diff --git a/.eslintrc.js b/.eslintrc.js index d247aa5..fd173ff 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,33 +1,34 @@ module.exports = { 'env': { 'es6': true, - 'browser': true, 'meteor': true, 'node': true }, 'extends': 'eslint:recommended', 'ecmaFeatures': { 'jsx': true, + 'modules': true, 'experimentalObjectRestSpread': true }, - 'plugins': [ - 'react' - ], + 'plugins': [], 'globals': { + 'Bert': true, 'BlazeLayout': true, 'Documents': true, - 'FlowRouter': true + 'FlowRouter': true, + 'Roles': true, + 'SimpleSchema': true }, 'rules': { - 'comma-dangle': [2, 'never'], - 'eqeqeq': [2, 'smart'], - 'indent': [2, 2], - 'linebreak-style': [2, 'unix'], - 'no-multi-spaces': [1, { 'exceptions': { 'VariableDeclarator': true } } ], - 'no-unneeded-ternary': [2], - 'quotes': [2, 'single'], - 'semi': [2, 'always'], - 'space-infix-ops': [2], - 'space-in-parens': [2, 'always', { 'exceptions': ['{}'] }] + 'comma-dangle': [ 2, 'never' ], + 'computed-property-spacing': [ 2, 'always' ], + 'eqeqeq': [ 2, 'smart' ], + 'indent': [ 2, 2, { 'VariableDeclarator': 2 } ], + 'linebreak-style': [ 2, 'unix' ], + 'no-unneeded-ternary': [ 2 ], + 'object-curly-spacing': [ 2, 'always' ], + 'quotes': [ 2, 'single' ], + 'semi': [ 2, 'always' ], + 'space-infix-ops': [ 2 ] } }; diff --git a/.gitignore b/.gitignore index 0f14a3d..1594de2 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ settings-development.json settings-production.json npm-debug.log + +node_modules diff --git a/.meteor/packages b/.meteor/packages index f27e710..980e050 100644 --- a/.meteor/packages +++ b/.meteor/packages @@ -25,7 +25,6 @@ meteor-base session templating fourseven:scss -stevezhu:lodash reactive-var reactive-dict aldeed:collection2 @@ -33,3 +32,4 @@ tracker twbs:bootstrap momentjs:moment alanning:roles +themeteorchef:seeder diff --git a/.meteor/release b/.meteor/release index 9503ef1..54dcbc8 100644 --- a/.meteor/release +++ b/.meteor/release @@ -1 +1 @@ -METEOR@1.3-modules-beta.6 +METEOR@1.3-modules-beta.8 diff --git a/.meteor/versions b/.meteor/versions index a2e1078..06201e6 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -1,100 +1,100 @@ -accounts-base@1.2.3-modules.6 -accounts-password@1.1.5-modules.6 +accounts-base@1.2.3-modules.8 +accounts-password@1.1.5-modules.8 alanning:roles@1.2.14 aldeed:collection2@2.6.1 aldeed:simple-schema@1.3.3 -allow-deny@1.0.1-modules.6 +allow-deny@1.0.1-modules.8 audit-argument-checks@1.0.4 -autoupdate@1.2.5-modules.6 -babel-compiler@6.4.0-modules.6 -babel-runtime@0.1.5-modules.6 -base64@1.0.5-modules.6 -binary-heap@1.0.5-modules.6 -blaze@2.1.4-modules.6 -blaze-tools@1.0.5-modules.6 -boilerplate-generator@1.0.5-modules.6 -browser-policy@1.0.6-modules.6 -browser-policy-common@1.0.5-modules.6 -browser-policy-content@1.0.7-modules.6 -browser-policy-framing@1.0.7-modules.6 -caching-compiler@1.0.1-modules.6 -caching-html-compiler@1.0.3-modules.6 -callback-hook@1.0.5-modules.6 -check@1.1.1-modules.6 +autoupdate@1.2.5-modules.8 +babel-compiler@6.4.0-modules.8 +babel-runtime@0.1.5-modules.8 +base64@1.0.5-modules.8 +binary-heap@1.0.5-modules.8 +blaze@2.1.4-modules.8 +blaze-tools@1.0.5-modules.8 +boilerplate-generator@1.0.5-modules.8 +browser-policy@1.0.6-modules.8 +browser-policy-common@1.0.5-modules.8 +browser-policy-content@1.0.7-modules.8 +browser-policy-framing@1.0.7-modules.8 +caching-compiler@1.0.1-modules.8 +caching-html-compiler@1.0.3-modules.8 +callback-hook@1.0.5-modules.8 +check@1.1.1-modules.8 chuangbo:cookie@1.1.0 -coffeescript@1.0.12-modules.6 +coffeescript@1.0.12-modules.8 cosmos:browserify@0.9.2 ddp@1.2.2 -ddp-client@1.2.2-modules.6 +ddp-client@1.2.2-modules.8 ddp-common@1.2.2 -ddp-rate-limiter@1.0.1-modules.6 -ddp-server@1.2.3-modules.6 +ddp-rate-limiter@1.0.1-modules.8 +ddp-server@1.2.3-modules.8 deps@1.0.9 -diff-sequence@1.0.2-modules.6 -ecmascript@0.4.0-modules.6 -ecmascript-runtime@0.2.7-modules.6 -ejson@1.0.8-modules.6 -email@1.0.9-modules.6 +diff-sequence@1.0.2-modules.8 +ecmascript@0.4.0-modules.8 +ecmascript-runtime@0.2.7-modules.8 +ejson@1.0.8-modules.8 +email@1.0.9-modules.8 fortawesome:fontawesome@4.4.0_1 fourseven:scss@3.4.1 -geojson-utils@1.0.5-modules.6 -hot-code-push@1.0.1-modules.6 -html-tools@1.0.6-modules.6 -htmljs@1.0.6-modules.6 -http@1.1.2-modules.6 +geojson-utils@1.0.5-modules.8 +hot-code-push@1.0.1-modules.8 +html-tools@1.0.6-modules.8 +htmljs@1.0.6-modules.8 +http@1.1.2-modules.8 id-map@1.0.4 -jquery@1.11.5-modules.6 +jquery@1.11.5-modules.8 kadira:blaze-layout@2.3.0 kadira:flow-router@2.10.0 livedata@1.0.15 -localstorage@1.0.6-modules.6 -logging@1.0.9-modules.6 -meteor@1.1.11-modules.6 +localstorage@1.0.6-modules.8 +logging@1.0.9-modules.8 +meteor@1.1.11-modules.8 meteor-base@1.0.1 -meteor-env-dev@0.0.1-modules.6 -meteor-env-prod@0.0.1-modules.6 +meteor-env-dev@0.0.1-modules.8 +meteor-env-prod@0.0.1-modules.8 meteorhacks:fast-render@2.11.0 meteorhacks:inject-data@1.4.1 meteorhacks:picker@1.0.3 meteorhacks:ssr@2.2.0 -minifiers-css@1.1.8-modules.6 -minifiers-js@1.1.8-modules.6 -minimongo@1.0.11-modules.6 -modules@0.5.0-modules.6 -modules-runtime@0.5.0-modules.6 +minifiers-css@1.1.8-modules.8 +minifiers-js@1.1.8-modules.8 +minimongo@1.0.11-modules.8 +modules@0.5.0-modules.8 +modules-runtime@0.5.0-modules.8 momentjs:moment@2.11.2 -mongo@1.1.4-modules.6 +mongo@1.1.4-modules.8 mongo-id@1.0.1 npm-bcrypt@0.7.8_2 -npm-mongo@1.4.40-modules.6 -observe-sequence@1.0.8-modules.6 +npm-mongo@1.4.40-modules.8 +observe-sequence@1.0.8-modules.8 ordered-dict@1.0.4 -promise@0.5.2-modules.6 -random@1.0.6-modules.6 -rate-limit@1.0.1-modules.6 -reactive-dict@1.1.4-modules.6 +promise@0.5.2-modules.8 +random@1.0.6-modules.8 +rate-limit@1.0.1-modules.8 +reactive-dict@1.1.4-modules.8 reactive-var@1.0.6 -reload@1.1.5-modules.6 +reload@1.1.5-modules.8 retry@1.0.4 -routepolicy@1.0.7-modules.6 -service-configuration@1.0.6-modules.6 -session@1.1.2-modules.6 +routepolicy@1.0.7-modules.8 +service-configuration@1.0.6-modules.8 +session@1.1.2-modules.8 sha@1.0.4 -spacebars@1.0.8-modules.6 -spacebars-compiler@1.0.8-modules.6 -srp@1.0.5-modules.6 -standard-minifiers@1.0.3-modules.6 -standard-minifiers-css@1.0.3-modules.6 -standard-minifiers-js@1.0.3-modules.6 -stevezhu:lodash@3.10.1 -templating@1.1.6-modules.6 -templating-tools@1.0.1-modules.6 -themeteorchef:bert@2.2.0 +spacebars@1.0.8-modules.8 +spacebars-compiler@1.0.8-modules.8 +srp@1.0.5-modules.8 +standard-minifiers@1.0.3-modules.8 +standard-minifiers-css@1.0.3-modules.8 +standard-minifiers-js@1.0.3-modules.8 +templating@1.1.6-modules.8 +templating-tools@1.0.1-modules.8 +themeteorchef:bert@2.1.0 themeteorchef:jquery-validation@1.14.0 -tracker@1.0.10-modules.6 +themeteorchef:seeder@0.1.0 +tracker@1.0.10-modules.8 twbs:bootstrap@3.3.6 ui@1.0.8 -underscore@1.0.5-modules.6 -url@1.0.6-modules.6 -webapp@1.2.4-modules.6 -webapp-hashing@1.0.6-modules.6 +underscore@1.0.5-modules.8 +url@1.0.6-modules.8 +webapp@1.2.4-modules.8 +webapp-hashing@1.0.6-modules.8 diff --git a/both/methods/remove/collection-name.js b/both/methods/remove/collection-name.js index 595de13..d114b77 100644 --- a/both/methods/remove/collection-name.js +++ b/both/methods/remove/collection-name.js @@ -1,5 +1,5 @@ Meteor.methods({ - remove( argument ) { + remove( documentId ) { check( documentId, String ); try { diff --git a/both/methods/update/collection-name.js b/both/methods/update/collection-name.js index 79d79b9..f0e4f8d 100644 --- a/both/methods/update/collection-name.js +++ b/both/methods/update/collection-name.js @@ -1,11 +1,9 @@ Meteor.methods({ update( update ) { - check( update, String ); + check( update, Object ); try { - return Documents.update( update._id, { - $set: update - }); + return Documents.update( update._id, { $set: update } ); } catch ( exception ) { throw new Meteor.Error( '500', `${ exception }` ); } diff --git a/both/modules/startup.js b/both/modules/startup.js deleted file mode 100644 index d6ccada..0000000 --- a/both/modules/startup.js +++ /dev/null @@ -1,3 +0,0 @@ -let startup = () => {}; - -export { startup }; diff --git a/both/routes/authenticated.js b/both/routes/authenticated.js index f565e4c..b19e7da 100644 --- a/both/routes/authenticated.js +++ b/both/routes/authenticated.js @@ -1,6 +1,4 @@ -const authenticatedRoutes = FlowRouter.group({ - name: 'authenticated' -}); +const authenticatedRoutes = FlowRouter.group( { name: 'authenticated' } ); authenticatedRoutes.route( '/', { name: 'index', @@ -12,6 +10,6 @@ authenticatedRoutes.route( '/', { authenticatedRoutes.route( '/dashboard', { name: 'dashboard', action() { - BlazeLayout.render( 'default', { yield: 'dashboard' }, hello ); + BlazeLayout.render( 'default', { yield: 'dashboard' } ); } }); diff --git a/both/routes/public.js b/both/routes/public.js index f2ca33a..db0241b 100644 --- a/both/routes/public.js +++ b/both/routes/public.js @@ -1,6 +1,4 @@ -const publicRoutes = FlowRouter.group({ - name: 'public' -}); +const publicRoutes = FlowRouter.group( { name: 'public' } ); publicRoutes.route( '/signup', { name: 'signup', diff --git a/both/startup.js b/both/startup.js index 2808e80..c0de2d9 100644 --- a/both/startup.js +++ b/both/startup.js @@ -1,3 +1,3 @@ -import { startup } from './modules/startup'; - -Meteor.startup( () => startup() ); +Meteor.startup( () => { + // Code to run on client *and* server startup. +}); diff --git a/client/modules/login.js b/client/modules/login.js index 0266d7f..02edf83 100644 --- a/client/modules/login.js +++ b/client/modules/login.js @@ -1,4 +1,6 @@ -let _handleLogin = ( template ) => { +let template; + +let _handleLogin = () => { let email = template.find( '[name="emailAddress"]' ).value, password = template.find( '[name="password"]' ).value; @@ -11,7 +13,7 @@ let _handleLogin = ( template ) => { }); }; -let validation = ( template ) => { +let validation = () => { return { rules: { emailAddress: { @@ -31,14 +33,15 @@ let validation = ( template ) => { required: 'Need a password here.' } }, - submitHandler() { _handleLogin( template ); } + submitHandler() { _handleLogin(); } }; }; -let _validate = ( form, template ) => { - $( form ).validate( validation( template ) ); +let _validate = ( form ) => { + $( form ).validate( validation() ); }; -export function login( options ) { - _validate( options.form, options.template ); +export default function( options ) { + template = options.template; + _validate( options.form ); } diff --git a/client/modules/recover-password.js b/client/modules/recover-password.js index 78f6b1e..20c7431 100644 --- a/client/modules/recover-password.js +++ b/client/modules/recover-password.js @@ -1,4 +1,6 @@ -let _handleRecovery = ( template ) => { +let template; + +let _handleRecovery = () => { let email = template.find( '[name="emailAddress"]' ).value; Accounts.forgotPassword( { email: email }, ( error ) => { @@ -10,7 +12,7 @@ let _handleRecovery = ( template ) => { }); }; -let validation = ( template ) => { +let validation = () => { return { rules: { emailAddress: { @@ -24,14 +26,15 @@ let validation = ( template ) => { email: 'Is this email address legit?' } }, - submitHandler() { _handleRecovery( template ); } + submitHandler() { _handleRecovery(); } }; }; -let _validate = ( form, template ) => { - $( form ).validate( validation( template ) ); +let _validate = ( form ) => { + $( form ).validate( validation() ); }; -export function recoverPassword( options ) { - _validate( options.form, options.template ); +export default function( options ) { + template = options.template; + _validate( options.form ); } diff --git a/client/modules/reset-password.js b/client/modules/reset-password.js index e3f11ee..29e19d8 100644 --- a/client/modules/reset-password.js +++ b/client/modules/reset-password.js @@ -1,5 +1,7 @@ -let _handleReset = ( template ) => { - var token = FlowRouter.current().params.token, +let template; + +let _handleReset = () => { + var token = FlowRouter.getParam( 'token' ), password = template.find( '[name="newPassword"]' ).value; Accounts.resetPassword( token, password, ( error ) => { @@ -11,7 +13,7 @@ let _handleReset = ( template ) => { }); }; -let validation = ( template ) => { +let validation = () => { return { rules: { newPassword: { @@ -26,22 +28,23 @@ let validation = ( template ) => { }, messages: { newPassword: { - required: "Enter a new password, please.", - minlength: "Use at least six characters, please." + required: 'Enter a new password, please.', + minlength: 'Use at least six characters, please.' }, repeatNewPassword: { - required: "Repeat your new password, please.", - equalTo: "Hmm, your passwords don't match. Try again?" + required: 'Repeat your new password, please.', + equalTo: 'Hmm, your passwords don\'t match. Try again?' } }, - submitHandler() { _handleReset( template ); } + submitHandler() { _handleReset(); } }; }; -let _validate = ( form, template ) => { - $( form ).validate( validation( template ) ); +let _validate = ( form ) => { + $( form ).validate( validation() ); }; -export function resetPassword( options ) { - _validate( options.form, options.template ); +export default function ( options ) { + template = options.template; + _validate( options.form ); } diff --git a/client/modules/signup.js b/client/modules/signup.js index 3cd4cd0..8984f01 100644 --- a/client/modules/signup.js +++ b/client/modules/signup.js @@ -1,4 +1,6 @@ -let _handleSignup = ( template ) => { +let template; + +let _handleSignup = () => { let user = { email: template.find( '[name="emailAddress"]' ).value, password: template.find( '[name="password"]' ).value @@ -13,7 +15,7 @@ let _handleSignup = ( template ) => { }); }; -let validation = ( template ) => { +let validation = () => { return { rules: { emailAddress: { @@ -35,14 +37,15 @@ let validation = ( template ) => { minlength: 'Use at least six characters, please.' } }, - submitHandler() { _handleSignup( template ); } + submitHandler() { _handleSignup(); } }; }; -let _validate = ( form, template ) => { - $( form ).validate( validation( template ) ); +let _validate = ( form ) => { + $( form ).validate( validation() ); }; -export function signup( options ) { - _validate( options.form, options.template ); +export default function( options ) { + template = options.template; + _validate( options.form ); } diff --git a/client/modules/startup.js b/client/modules/startup.js deleted file mode 100644 index 04eed13..0000000 --- a/client/modules/startup.js +++ /dev/null @@ -1,3 +0,0 @@ -export function startup() { - Bert.defaults.style = 'growl-top-right'; -} diff --git a/client/startup.js b/client/startup.js index 2808e80..f494e76 100644 --- a/client/startup.js +++ b/client/startup.js @@ -1,3 +1,3 @@ -import { startup } from './modules/startup'; - -Meteor.startup( () => startup() ); +Meteor.startup( () => { + Bert.defaults.style = 'growl-bottom-right'; +}); diff --git a/client/stylesheets/_extends.scss b/client/stylesheets/_extends.scss new file mode 100644 index 0000000..c136454 --- /dev/null +++ b/client/stylesheets/_extends.scss @@ -0,0 +1,13 @@ +%clearfix { + *zoom: 1; + + &:before, + &:after { + display: table; + content: ""; + } + + &:after { + clear: both; + } +} diff --git a/client/stylesheets/application.scss b/client/stylesheets/application.scss index 7d4dae8..fe60fe7 100644 --- a/client/stylesheets/application.scss +++ b/client/stylesheets/application.scss @@ -1,6 +1,7 @@ -@import "tools/extends"; +@import "extends"; -@import "objects/forms"; +@import "base/animations"; +@import "base/forms"; -@import "components/loading"; -@import "components/login"; +@import "module/loading"; +@import "module/login"; diff --git a/client/stylesheets/base/_animations.scss b/client/stylesheets/base/_animations.scss new file mode 100644 index 0000000..3dbc096 --- /dev/null +++ b/client/stylesheets/base/_animations.scss @@ -0,0 +1,9 @@ +@keyframes rotate { + from { transform: rotate( 0deg ); } + to { transform: rotate( 360deg ); } +} + +@-webkit-keyframes rotate { + from { -webkit-transform: rotate( 0deg ); } + to { -webkit-transform: rotate( 360deg ); } +} diff --git a/client/stylesheets/base/_forms.scss b/client/stylesheets/base/_forms.scss new file mode 100644 index 0000000..e41cc2d --- /dev/null +++ b/client/stylesheets/base/_forms.scss @@ -0,0 +1,6 @@ +form label.error { + display: block; + margin-top: 10px; + font-weight: normal; + color: lighten( red, 20% ); +} diff --git a/client/stylesheets/components/_loading.scss b/client/stylesheets/components/_loading.scss deleted file mode 100644 index 4f3d717..0000000 --- a/client/stylesheets/components/_loading.scss +++ /dev/null @@ -1,20 +0,0 @@ -@keyframes rotate { - from { transform: rotate( 0deg ); } - to { transform: rotate( 360deg ); } -} - -@-webkit-keyframes rotate { - from { -webkit-transform: rotate( 0deg ); } - to { -webkit-transform: rotate( 360deg ); } -} - -.loading { - -webkit-animation-name: rotate; - -webkit-animation-duration: 0.5s; - -webkit-animation-iteration-count: infinite; - -webkit-animation-timing-function: linear; - animation-name: rotate; - animation-duration: 0.5s; - animation-iteration-count: infinite; - animation-timing-function: linear; -} diff --git a/client/stylesheets/components/_login.scss b/client/stylesheets/components/_login.scss deleted file mode 100644 index e0744e8..0000000 --- a/client/stylesheets/components/_login.scss +++ /dev/null @@ -1,4 +0,0 @@ -.login label { - display: block; - @extend %clearfix; -} diff --git a/client/stylesheets/module/_loading.scss b/client/stylesheets/module/_loading.scss new file mode 100644 index 0000000..722a114 --- /dev/null +++ b/client/stylesheets/module/_loading.scss @@ -0,0 +1,10 @@ +.loading { + -webkit-animation-name: rotate; + -webkit-animation-duration: 0.5s; + -webkit-animation-iteration-count: infinite; + -webkit-animation-timing-function: linear; + animation-name: rotate; + animation-duration: 0.5s; + animation-iteration-count: infinite; + animation-timing-function: linear; +} diff --git a/client/stylesheets/module/_login.scss b/client/stylesheets/module/_login.scss new file mode 100644 index 0000000..e0744e8 --- /dev/null +++ b/client/stylesheets/module/_login.scss @@ -0,0 +1,4 @@ +.login label { + display: block; + @extend %clearfix; +} diff --git a/client/stylesheets/objects/_forms.scss b/client/stylesheets/objects/_forms.scss deleted file mode 100644 index 860f974..0000000 --- a/client/stylesheets/objects/_forms.scss +++ /dev/null @@ -1,6 +0,0 @@ -label.error { - display: block; - margin-top: 10px; - font-weight: normal; - color: lighten( red, 20% ); -} diff --git a/client/stylesheets/tools/_extends.scss b/client/stylesheets/tools/_extends.scss deleted file mode 100644 index f0ea750..0000000 --- a/client/stylesheets/tools/_extends.scss +++ /dev/null @@ -1,17 +0,0 @@ -/* - Clearfix - via http://nicolasgallagher.com/micro-clearfix-hack -*/ -%clearfix { - *zoom: 1; - - &:before, - &:after { - display: table; - content: ""; - } - - &:after { - clear: both; - } -} diff --git a/client/templates/authenticated/dashboard.html b/client/templates/authenticated/dashboard.html index c70b42e..4968b6f 100644 --- a/client/templates/authenticated/dashboard.html +++ b/client/templates/authenticated/dashboard.html @@ -1,3 +1,3 @@ diff --git a/client/templates/authenticated/index.js b/client/templates/authenticated/index.js index 059893c..93f0947 100644 --- a/client/templates/authenticated/index.js +++ b/client/templates/authenticated/index.js @@ -1,3 +1,3 @@ Template.index.onCreated( () => { - Template.instance().subscribe( 'template' ); + Template.instance().subscribe( 'index' ); }); diff --git a/client/templates/globals/header.js b/client/templates/globals/header.js index 752c7c2..baca695 100644 --- a/client/templates/globals/header.js +++ b/client/templates/globals/header.js @@ -7,7 +7,9 @@ Template.header.helpers({ }); Template.header.events({ - 'click .logout' () { + 'click .logout' ( event ) { + event.preventDefault(); + Meteor.logout( ( error ) => { if ( error ) { Bert.alert( error.reason, 'warning' ); diff --git a/client/templates/globals/not-found.html b/client/templates/globals/not-found.html index b8df76e..5398be1 100644 --- a/client/templates/globals/not-found.html +++ b/client/templates/globals/not-found.html @@ -1,3 +1,3 @@ diff --git a/client/templates/globals/not-found.js b/client/templates/globals/not-found.js new file mode 100644 index 0000000..23dc485 --- /dev/null +++ b/client/templates/globals/not-found.js @@ -0,0 +1,5 @@ +Template.notFound.helpers({ + currentPath() { + return FlowRouter.current().path; + } +}); diff --git a/client/templates/public/login.js b/client/templates/public/login.js index d49c1d1..95795db 100644 --- a/client/templates/public/login.js +++ b/client/templates/public/login.js @@ -1,7 +1,7 @@ -import { login } from '../../modules/login'; +import login from '../../modules/login'; Template.login.onRendered( () => { - login( { form: "#login", template: Template.instance() } ); + login( { form: '#login', template: Template.instance() } ); }); Template.login.events({ diff --git a/client/templates/public/recover-password.js b/client/templates/public/recover-password.js index f4a5fbf..16ace83 100644 --- a/client/templates/public/recover-password.js +++ b/client/templates/public/recover-password.js @@ -1,10 +1,7 @@ -import { recoverPassword } from '../../modules/recover-password'; +import recoverPassword from '../../modules/recover-password'; Template.recoverPassword.onRendered( () => { - recoverPassword({ - form: "#recover-password", - template: Template.instance() - }); + recoverPassword( { form: '#recover-password', template: Template.instance() } ); }); Template.recoverPassword.events({ diff --git a/client/templates/public/reset-password.js b/client/templates/public/reset-password.js index 05595fa..b1fb78e 100644 --- a/client/templates/public/reset-password.js +++ b/client/templates/public/reset-password.js @@ -1,10 +1,7 @@ -import { resetPassword } from '../../modules/login'; +import resetPassword from '../../modules/reset-password'; Template.resetPassword.onRendered( () => { - resetPassword({ - form: "#reset-password", - template: Template.instance() - }); + resetPassword( { form: '#reset-password', template: Template.instance() } ); }); Template.resetPassword.events({ diff --git a/client/templates/public/signup.js b/client/templates/public/signup.js index 70ed3b0..f82137a 100644 --- a/client/templates/public/signup.js +++ b/client/templates/public/signup.js @@ -1,7 +1,7 @@ -import { signup } from '../../modules/signup'; +import signup from '../../modules/signup'; Template.signup.onRendered( () => { - signup( { form: "#signup", template: Template.instance() } ); + signup({ form: '#signup', template: Template.instance() }); }); Template.signup.events({ diff --git a/collections/documents.js b/collections/documents.js index 7f0f8cb..db488fc 100644 --- a/collections/documents.js +++ b/collections/documents.js @@ -13,9 +13,9 @@ Documents.deny({ }); let DocumentsSchema = new SimpleSchema({ - "title": { + 'title': { type: String, - label: "The title of this document." + label: 'The title of this document.' } }); diff --git a/node_modules/.bin/eslint b/node_modules/.bin/eslint deleted file mode 120000 index 810e4bc..0000000 --- a/node_modules/.bin/eslint +++ /dev/null @@ -1 +0,0 @@ -../eslint/bin/eslint.js \ No newline at end of file diff --git a/node_modules/eslint-config-airbnb/.eslintrc b/node_modules/eslint-config-airbnb/.eslintrc deleted file mode 100644 index 4b3b1fa..0000000 --- a/node_modules/eslint-config-airbnb/.eslintrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "airbnb", - "rules": { - // disable requiring trailing commas because it might be nice to revert to - // being JSON at some point, and I don't want to make big changes now. - "comma-dangle": 0 - } -} diff --git a/node_modules/eslint-config-airbnb/CHANGELOG.md b/node_modules/eslint-config-airbnb/CHANGELOG.md deleted file mode 100644 index 75febdd..0000000 --- a/node_modules/eslint-config-airbnb/CHANGELOG.md +++ /dev/null @@ -1,102 +0,0 @@ -5.0.0 / 2016-02-03 -================== - - [breaking] disallow unneeded ternary expressions - - [breaking] Avoid lexical declarations in case/default clauses - - [dev deps] update `babel-tape-runner`, `eslint-plugin-react`, `react`, `tape` - -4.0.0 / 2016-01-22 -================== - - [breaking] require outer IIFE wrapping; flesh out guide section - - [minor] Add missing `arrow-body-style`, `prefer-template` rules (#678) - - [minor] Add `prefer-arrow-callback` to ES6 rules (to match the guide) (#677) - - [Tests] run `npm run lint` as part of tests; fix errors - - [Tests] use `parallelshell` to parallelize npm run-scripts - -3.1.0 / 2016-01-07 -================== - - [minor] Allow multiple stateless components in a single file - -3.0.2 / 2016-01-06 -================== - - [fix] Ignore URLs in `max-len` (#664) - -3.0.1 / 2016-01-06 -================== - - [fix] because we use babel, keywords should not be quoted - -3.0.0 / 2016-01-04 -================== - - [breaking] enable `quote-props` rule (#632) - - [breaking] Define a max line length of 100 characters (#639) - - [breaking] [react] Minor cleanup for the React styleguide, add `react/jsx-no-bind` (#619) - - [breaking] update best-practices config to prevent parameter object manipulation (#627) - - [minor] Enable react/no-is-mounted rule (#635, #633) - - [minor] Sort react/prefer-es6-class alphabetically (#634) - - [minor] enable react/prefer-es6-class rule - - Permit strict mode in "legacy" config - - [react] add missing rules from eslint-plugin-react (enforcing where necessary) (#581) - - [dev deps] update `eslint-plugin-react` - -2.1.1 / 2015-12-15 -================== - - [fix] Remove deprecated react/jsx-quotes (#622) - -2.1.0 / 2015-12-15 -================== - - [fix] use `require.resolve` to allow nested `extend`s (#582) - - [new] enable `object-shorthand` rule (#621) - - [new] enable `arrow-spacing` rule (#517) - - [docs] flesh out react rule defaults (#618) - -2.0.0 / 2015-12-03 -================== - - [breaking] `space-before-function-paren`: require function spacing: `function (` (#605) - - [breaking] `indent`: Fix switch statement indentation rule (#606) - - [breaking] `array-bracket-spacing`, `computed-property-spacing`: disallow spacing inside brackets (#594) - - [breaking] `object-curly-spacing`: require padding inside curly braces (#594) - - [breaking] `space-in-parens`: disallow spaces in parens (#594) - -1.0.2 / 2015-11-25 -================== - - [breaking] `no-multiple-empty-lines`: only allow 1 blank line at EOF (#578) - - [new] `restParams`: enable rest params (#592) - -1.0.1 / 2015-11-25 -================== - - *erroneous publish* - -1.0.0 / 2015-11-08 -================== - - require `eslint` `v1.0.0` or higher - - remove `babel-eslint` dependency - -0.1.1 / 2015-11-05 -================== - - remove id-length rule (#569) - - enable `no-mixed-spaces-and-tabs` (#539) - - enable `no-const-assign` (#560) - - enable `space-before-keywords` (#554) - -0.1.0 / 2015-11-05 -================== - - switch to modular rules files courtesy the [eslint-config-default][ecd] project and [@taion][taion]. [PR][pr-modular] - - export `eslint-config-airbnb/legacy` for ES5-only users. `eslint-config-airbnb/legacy` does not require the `babel-eslint` parser. [PR][pr-legacy] - -0.0.9 / 2015-09-24 -================== -- add rule `no-undef` -- add rule `id-length` - -0.0.8 / 2015-08-21 -================== - - now has a changelog - - now is modular (see instructions above for with react and without react versions) - -0.0.7 / 2015-07-30 -================== - - TODO: fill in - -[ecd]: https://github.com/walmartlabs/eslint-config-defaults -[taion]: https://github.com/taion -[pr-modular]: https://github.com/airbnb/javascript/pull/526 -[pr-legacy]: https://github.com/airbnb/javascript/pull/527 diff --git a/node_modules/eslint-config-airbnb/README.md b/node_modules/eslint-config-airbnb/README.md deleted file mode 100644 index 26c795f..0000000 --- a/node_modules/eslint-config-airbnb/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# eslint-config-airbnb - -[![npm version](https://badge.fury.io/js/eslint-config-airbnb.svg)](http://badge.fury.io/js/eslint-config-airbnb) - -This package provides Airbnb's .eslintrc as an extensible shared config. - -## Usage - -We export three ESLint configurations for your usage. - -### eslint-config-airbnb - -Our default export contains all of our ESLint rules, including EcmaScript 6+ -and React. It requires `eslint` and `eslint-plugin-react`. - -1. `npm install --save-dev eslint-config-airbnb eslint-plugin-react eslint` -2. add `"extends": "airbnb"` to your .eslintrc - -### eslint-config-airbnb/base - -Lints ES6+ but does not lint React. Requires `eslint`. - -1. `npm install --save-dev eslint-config-airbnb eslint` -2. add `"extends": "airbnb/base"` to your .eslintrc - -### eslint-config-airbnb/legacy - -Lints ES5 and below. Only requires `eslint`. - -1. `npm install --save-dev eslint-config-airbnb eslint` -2. add `"extends": "airbnb/legacy"` to your .eslintrc - -See [Airbnb's Javascript styleguide](https://github.com/airbnb/javascript) and -the [ESlint config docs](http://eslint.org/docs/user-guide/configuring#extending-configuration-files) -for more information. - -## Improving this config - -Consider adding test cases if you're making complicated rules changes, like -anything involving regexes. Perhaps in a distant future, we could use literate -programming to structure our README as test cases for our .eslintrc? - -You can run tests with `npm test`. - -You can make sure this module lints with itself using `npm run lint`. diff --git a/node_modules/eslint-config-airbnb/base.js b/node_modules/eslint-config-airbnb/base.js deleted file mode 100644 index 1cfea52..0000000 --- a/node_modules/eslint-config-airbnb/base.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: [ - 'eslint-config-airbnb/legacy', - 'eslint-config-airbnb/rules/es6', - ].map(require.resolve), - rules: {} -}; diff --git a/node_modules/eslint-config-airbnb/index.js b/node_modules/eslint-config-airbnb/index.js deleted file mode 100644 index e9ce995..0000000 --- a/node_modules/eslint-config-airbnb/index.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - extends: [ - 'eslint-config-airbnb/base', - 'eslint-config-airbnb/rules/strict', - 'eslint-config-airbnb/rules/react', - ].map(require.resolve), - rules: {} -}; diff --git a/node_modules/eslint-config-airbnb/legacy.js b/node_modules/eslint-config-airbnb/legacy.js deleted file mode 100644 index b404cf7..0000000 --- a/node_modules/eslint-config-airbnb/legacy.js +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = { - extends: [ - 'eslint-config-airbnb/rules/best-practices', - 'eslint-config-airbnb/rules/errors', - 'eslint-config-airbnb/rules/legacy', - 'eslint-config-airbnb/rules/node', - 'eslint-config-airbnb/rules/style', - 'eslint-config-airbnb/rules/variables' - ].map(require.resolve), - env: { - browser: true, - node: true, - amd: false, - mocha: false, - jasmine: false - }, - ecmaFeatures: {}, - globals: {}, - rules: {} -}; diff --git a/node_modules/eslint-config-airbnb/package.json b/node_modules/eslint-config-airbnb/package.json deleted file mode 100644 index 196bcbb..0000000 --- a/node_modules/eslint-config-airbnb/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "name": "eslint-config-airbnb", - "version": "5.0.0", - "description": "Airbnb's ESLint config, following our styleguide", - "main": "index.js", - "scripts": { - "lint": "eslint .", - "tests-only": "babel-tape-runner ./test/test-*.js", - "test": "parallelshell 'npm run lint' 'npm run tests-only'" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/airbnb/javascript.git" - }, - "keywords": [ - "eslint", - "eslintconfig", - "config", - "airbnb", - "javascript", - "styleguide" - ], - "author": { - "name": "Jake Teton-Landis", - "url": "https://twitter.com/@jitl" - }, - "contributors": [ - { - "name": "Jake Teton-Landis", - "url": "https://twitter.com/jitl" - }, - { - "name": "Jordan Harband", - "email": "ljharb@gmail.com", - "url": "http://ljharb.codes" - } - ], - "license": "MIT", - "bugs": { - "url": "https://github.com/airbnb/javascript/issues" - }, - "homepage": "https://github.com/airbnb/javascript", - "devDependencies": { - "babel-tape-runner": "1.2.0", - "eslint": "^1.10.3", - "eslint-plugin-react": "^3.16.1", - "react": "^0.14.7", - "tape": "^4.4.0", - "parallelshell": "^2.0.0" - }, - "peerDependencies": { - "eslint": ">=1.0.0" - }, - "_id": "eslint-config-airbnb@5.0.0", - "_shasum": "16886a3a613028f62213c6330e9b42554364ec3f", - "_from": "eslint-config-airbnb@*", - "_npmVersion": "3.3.12", - "_nodeVersion": "5.5.0", - "_npmUser": { - "name": "ljharb", - "email": "ljharb@gmail.com" - }, - "dist": { - "shasum": "16886a3a613028f62213c6330e9b42554364ec3f", - "tarball": "http://registry.npmjs.org/eslint-config-airbnb/-/eslint-config-airbnb-5.0.0.tgz" - }, - "maintainers": [ - { - "name": "airbnb", - "email": "jordan.harband+npm@airbnb.com" - }, - { - "name": "jitl", - "email": "just.1.jake@gmail.com" - }, - { - "name": "ljharb", - "email": "ljharb@gmail.com" - } - ], - "_npmOperationalInternal": { - "host": "packages-5-east.internal.npmjs.com", - "tmp": "tmp/eslint-config-airbnb-5.0.0.tgz_1454552979702_0.033046064199879766" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/eslint-config-airbnb/-/eslint-config-airbnb-5.0.0.tgz" -} diff --git a/node_modules/eslint-config-airbnb/rules/.eslintrc.json b/node_modules/eslint-config-airbnb/rules/.eslintrc.json deleted file mode 100644 index de68aa2..0000000 --- a/node_modules/eslint-config-airbnb/rules/.eslintrc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "rules": { - "quote-props": 0 - } -} diff --git a/node_modules/eslint-config-airbnb/rules/best-practices.js b/node_modules/eslint-config-airbnb/rules/best-practices.js deleted file mode 100644 index a221d4d..0000000 --- a/node_modules/eslint-config-airbnb/rules/best-practices.js +++ /dev/null @@ -1,119 +0,0 @@ -module.exports = { - 'rules': { - // enforces getter/setter pairs in objects - 'accessor-pairs': 0, - // treat var statements as if they were block scoped - 'block-scoped-var': 2, - // specify the maximum cyclomatic complexity allowed in a program - 'complexity': [0, 11], - // require return statements to either always or never specify values - 'consistent-return': 2, - // specify curly brace conventions for all control statements - 'curly': [2, 'multi-line'], - // require default case in switch statements - 'default-case': 2, - // encourages use of dot notation whenever possible - 'dot-notation': [2, { 'allowKeywords': true }], - // enforces consistent newlines before or after dots - 'dot-location': 0, - // require the use of === and !== - 'eqeqeq': 2, - // make sure for-in loops have an if statement - 'guard-for-in': 2, - // disallow the use of alert, confirm, and prompt - 'no-alert': 1, - // disallow use of arguments.caller or arguments.callee - 'no-caller': 2, - // disallow lexical declarations in case/default clauses - // http://eslint.org/docs/rules/no-case-declarations.html - 'no-case-declarations': 2, - // disallow division operators explicitly at beginning of regular expression - 'no-div-regex': 0, - // disallow else after a return in an if - 'no-else-return': 2, - // disallow use of labels for anything other then loops and switches - 'no-empty-label': 2, - // disallow comparisons to null without a type-checking operator - 'no-eq-null': 0, - // disallow use of eval() - 'no-eval': 2, - // disallow adding to native types - 'no-extend-native': 2, - // disallow unnecessary function binding - 'no-extra-bind': 2, - // disallow fallthrough of case statements - 'no-fallthrough': 2, - // disallow the use of leading or trailing decimal points in numeric literals - 'no-floating-decimal': 2, - // disallow the type conversions with shorter notations - 'no-implicit-coercion': 0, - // disallow use of eval()-like methods - 'no-implied-eval': 2, - // disallow this keywords outside of classes or class-like objects - 'no-invalid-this': 0, - // disallow usage of __iterator__ property - 'no-iterator': 2, - // disallow use of labeled statements - 'no-labels': 2, - // disallow unnecessary nested blocks - 'no-lone-blocks': 2, - // disallow creation of functions within loops - 'no-loop-func': 2, - // disallow use of multiple spaces - 'no-multi-spaces': 2, - // disallow use of multiline strings - 'no-multi-str': 2, - // disallow reassignments of native objects - 'no-native-reassign': 2, - // disallow use of new operator when not part of the assignment or comparison - 'no-new': 2, - // disallow use of new operator for Function object - 'no-new-func': 2, - // disallows creating new instances of String,Number, and Boolean - 'no-new-wrappers': 2, - // disallow use of (old style) octal literals - 'no-octal': 2, - // disallow use of octal escape sequences in string literals, such as - // var foo = 'Copyright \251'; - 'no-octal-escape': 2, - // disallow reassignment of function parameters - // disallow parameter object manipulation - // rule: http://eslint.org/docs/rules/no-param-reassign.html - 'no-param-reassign': [2, { 'props': true }], - // disallow use of process.env - 'no-process-env': 0, - // disallow usage of __proto__ property - 'no-proto': 2, - // disallow declaring the same variable more then once - 'no-redeclare': 2, - // disallow use of assignment in return statement - 'no-return-assign': 2, - // disallow use of `javascript:` urls. - 'no-script-url': 2, - // disallow comparisons where both sides are exactly the same - 'no-self-compare': 2, - // disallow use of comma operator - 'no-sequences': 2, - // restrict what can be thrown as an exception - 'no-throw-literal': 2, - // disallow usage of expressions in statement position - 'no-unused-expressions': 2, - // disallow unnecessary .call() and .apply() - 'no-useless-call': 0, - // disallow use of void operator - 'no-void': 0, - // disallow usage of configurable warning terms in comments: e.g. todo - 'no-warning-comments': [0, { 'terms': ['todo', 'fixme', 'xxx'], 'location': 'start' }], - // disallow use of the with statement - 'no-with': 2, - // require use of the second argument for parseInt() - 'radix': 2, - // requires to declare all vars on top of their containing scope - 'vars-on-top': 2, - // require immediate function invocation to be wrapped in parentheses - // http://eslint.org/docs/rules/wrap-iife.html - 'wrap-iife': [2, 'outside'], - // require or disallow Yoda conditions - 'yoda': 2 - } -}; diff --git a/node_modules/eslint-config-airbnb/rules/errors.js b/node_modules/eslint-config-airbnb/rules/errors.js deleted file mode 100644 index ec1b1aa..0000000 --- a/node_modules/eslint-config-airbnb/rules/errors.js +++ /dev/null @@ -1,60 +0,0 @@ -module.exports = { - 'rules': { - // disallow trailing commas in object literals - 'comma-dangle': [2, 'always-multiline'], - // disallow assignment in conditional expressions - 'no-cond-assign': [2, 'always'], - // disallow use of console - 'no-console': 1, - // disallow use of constant expressions in conditions - 'no-constant-condition': 1, - // disallow control characters in regular expressions - 'no-control-regex': 2, - // disallow use of debugger - 'no-debugger': 1, - // disallow duplicate arguments in functions - 'no-dupe-args': 2, - // disallow duplicate keys when creating object literals - 'no-dupe-keys': 2, - // disallow a duplicate case label. - 'no-duplicate-case': 2, - // disallow the use of empty character classes in regular expressions - 'no-empty-character-class': 2, - // disallow empty statements - 'no-empty': 2, - // disallow assigning to the exception in a catch block - 'no-ex-assign': 2, - // disallow double-negation boolean casts in a boolean context - 'no-extra-boolean-cast': 0, - // disallow unnecessary parentheses - 'no-extra-parens': [2, 'functions'], - // disallow unnecessary semicolons - 'no-extra-semi': 2, - // disallow overwriting functions written as function declarations - 'no-func-assign': 2, - // disallow function or variable declarations in nested blocks - 'no-inner-declarations': 2, - // disallow invalid regular expression strings in the RegExp constructor - 'no-invalid-regexp': 2, - // disallow irregular whitespace outside of strings and comments - 'no-irregular-whitespace': 2, - // disallow negation of the left operand of an in expression - 'no-negated-in-lhs': 2, - // disallow the use of object properties of the global object (Math and JSON) as functions - 'no-obj-calls': 2, - // disallow multiple spaces in a regular expression literal - 'no-regex-spaces': 2, - // disallow sparse arrays - 'no-sparse-arrays': 2, - // disallow unreachable statements after a return, throw, continue, or break statement - 'no-unreachable': 2, - // disallow comparisons with the value NaN - 'use-isnan': 2, - // ensure JSDoc comments are valid - 'valid-jsdoc': 0, - // ensure that the results of typeof are compared against a valid string - 'valid-typeof': 2, - // Avoid code that looks like two expressions but is actually one - 'no-unexpected-multiline': 0 - } -}; diff --git a/node_modules/eslint-config-airbnb/rules/es6.js b/node_modules/eslint-config-airbnb/rules/es6.js deleted file mode 100644 index e346843..0000000 --- a/node_modules/eslint-config-airbnb/rules/es6.js +++ /dev/null @@ -1,62 +0,0 @@ -module.exports = { - 'env': { - 'es6': false - }, - 'ecmaFeatures': { - 'arrowFunctions': true, - 'blockBindings': true, - 'classes': true, - 'defaultParams': true, - 'destructuring': true, - 'forOf': true, - 'generators': false, - 'modules': true, - 'objectLiteralComputedProperties': true, - 'objectLiteralDuplicateProperties': false, - 'objectLiteralShorthandMethods': true, - 'objectLiteralShorthandProperties': true, - 'restParams': true, - 'spread': true, - 'superInFunctions': true, - 'templateStrings': true, - 'jsx': true - }, - 'rules': { - // enforces no braces where they can be omitted - // http://eslint.org/docs/rules/arrow-body-style - 'arrow-body-style': [2, 'as-needed'], - // require parens in arrow function arguments - 'arrow-parens': 0, - // require space before/after arrow function's arrow - // https://github.com/eslint/eslint/blob/master/docs/rules/arrow-spacing.md - 'arrow-spacing': [2, { 'before': true, 'after': true }], - // verify super() callings in constructors - 'constructor-super': 0, - // enforce the spacing around the * in generator functions - 'generator-star-spacing': 0, - // disallow modifying variables of class declarations - 'no-class-assign': 0, - // disallow modifying variables that are declared using const - 'no-const-assign': 2, - // disallow to use this/super before super() calling in constructors. - 'no-this-before-super': 0, - // require let or const instead of var - 'no-var': 2, - // require method and property shorthand syntax for object literals - // https://github.com/eslint/eslint/blob/master/docs/rules/object-shorthand.md - 'object-shorthand': [2, 'always'], - // suggest using arrow functions as callbacks - 'prefer-arrow-callback': 2, - // suggest using of const declaration for variables that are never modified after declared - 'prefer-const': 2, - // suggest using the spread operator instead of .apply() - 'prefer-spread': 0, - // suggest using Reflect methods where applicable - 'prefer-reflect': 0, - // suggest using template literals instead of string concatenation - // http://eslint.org/docs/rules/prefer-template - 'prefer-template': 2, - // disallow generator functions that do not have yield - 'require-yield': 0 - } -}; diff --git a/node_modules/eslint-config-airbnb/rules/legacy.js b/node_modules/eslint-config-airbnb/rules/legacy.js deleted file mode 100644 index e94c774..0000000 --- a/node_modules/eslint-config-airbnb/rules/legacy.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = { - 'rules': { - // specify the maximum depth that blocks can be nested - 'max-depth': [0, 4], - // limits the number of parameters that can be used in the function declaration. - 'max-params': [0, 3], - // specify the maximum number of statement allowed in a function - 'max-statements': [0, 10], - // disallow use of bitwise operators - 'no-bitwise': 0, - // disallow use of unary operators, ++ and -- - 'no-plusplus': 0 - } -}; diff --git a/node_modules/eslint-config-airbnb/rules/node.js b/node_modules/eslint-config-airbnb/rules/node.js deleted file mode 100644 index 16b6f20..0000000 --- a/node_modules/eslint-config-airbnb/rules/node.js +++ /dev/null @@ -1,23 +0,0 @@ -module.exports = { - 'env': { - 'node': true - }, - 'rules': { - // enforce return after a callback - 'callback-return': 0, - // enforces error handling in callbacks (node environment) - 'handle-callback-err': 0, - // disallow mixing regular variable and require declarations - 'no-mixed-requires': [0, false], - // disallow use of new operator with the require function - 'no-new-require': 0, - // disallow string concatenation with __dirname and __filename - 'no-path-concat': 0, - // disallow process.exit() - 'no-process-exit': 0, - // restrict usage of specified node modules - 'no-restricted-modules': 0, - // disallow use of synchronous methods (off by default) - 'no-sync': 0 - } -}; diff --git a/node_modules/eslint-config-airbnb/rules/react.js b/node_modules/eslint-config-airbnb/rules/react.js deleted file mode 100644 index e1e1c25..0000000 --- a/node_modules/eslint-config-airbnb/rules/react.js +++ /dev/null @@ -1,139 +0,0 @@ -module.exports = { - 'plugins': [ - 'react' - ], - 'ecmaFeatures': { - 'jsx': true - }, - // View link below for react rules documentation - // https://github.com/yannickcr/eslint-plugin-react#list-of-supported-rules - 'rules': { - // Prevent missing displayName in a React component definition - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/display-name.md - 'react/display-name': [0, { 'acceptTranspilerName': false }], - // Forbid certain propTypes (any, array, object) - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-prop-types.md - 'react/forbid-prop-types': [0, { 'forbid': ['any', 'array', 'object'] }], - // Enforce boolean attributes notation in JSX - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md - 'react/jsx-boolean-value': [2, 'never'], - // Validate closing bracket location in JSX - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md - 'react/jsx-closing-bracket-location': [2, 'line-aligned'], - // Enforce or disallow spaces inside of curly braces in JSX attributes - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-spacing.md - 'react/jsx-curly-spacing': [0, 'never', { 'allowMultiline': true }], - // Enforce event handler naming conventions in JSX - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-handler-names.md - 'react/jsx-handler-names': [0, { - 'eventHandlerPrefix': 'handle', - 'eventHandlerPropPrefix': 'on', - }], - // Validate props indentation in JSX - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md - 'react/jsx-indent-props': [2, 2], - // Validate JSX has key prop when in array or iterator - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-key.md - 'react/jsx-key': 0, - // Limit maximum of props on a single line in JSX - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-max-props-per-line.md - 'react/jsx-max-props-per-line': [0, { 'maximum': 1 }], - // Prevent usage of .bind() and arrow functions in JSX props - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md - 'react/jsx-no-bind': 2, - // Prevent duplicate props in JSX - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md - 'react/jsx-no-duplicate-props': [0, { 'ignoreCase': false }], - // Prevent usage of unwrapped JSX strings - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-literals.md - 'react/jsx-no-literals': 0, - // Disallow undeclared variables in JSX - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md - 'react/jsx-no-undef': 2, - // Enforce PascalCase for user-defined JSX components - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md - 'react/jsx-pascal-case': 0, - // Enforce propTypes declarations alphabetical sorting - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-prop-types.md - 'react/jsx-sort-prop-types': [0, { - 'ignoreCase': false, - 'callbacksLast': false, - }], - // Enforce props alphabetical sorting - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md - 'react/jsx-sort-props': [0, { - 'ignoreCase': false, - 'callbacksLast': false, - }], - // Prevent React to be incorrectly marked as unused - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-react.md - 'react/jsx-uses-react': [2, { 'pragma': 'React' }], - // Prevent variables used in JSX to be incorrectly marked as unused - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md - 'react/jsx-uses-vars': 2, - // Prevent usage of dangerous JSX properties - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-danger.md - 'react/no-danger': 0, - // Prevent usage of deprecated methods - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-deprecated.md - 'react/no-deprecated': [1, { 'react': '0.14.0' }], - // Prevent usage of setState in componentDidMount - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-mount-set-state.md - 'react/no-did-mount-set-state': [2, 'allow-in-func'], - // Prevent usage of setState in componentDidUpdate - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-update-set-state.md - 'react/no-did-update-set-state': [2, 'allow-in-func'], - // Prevent direct mutation of this.state - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-direct-mutation-state.md - 'react/no-direct-mutation-state': 0, - // Prevent usage of isMounted - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-is-mounted.md - 'react/no-is-mounted': 2, - // Prevent multiple component definition per file - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md - 'react/no-multi-comp': [2, { 'ignoreStateless': true }], - // Prevent usage of setState - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-set-state.md - 'react/no-set-state': 0, - // Prevent using string references - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-string-refs.md - 'react/no-string-refs': 0, - // Prevent usage of unknown DOM property - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md - 'react/no-unknown-property': 2, - // Require ES6 class declarations over React.createClass - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-es6-class.md - 'react/prefer-es6-class': [2, 'always'], - // Prevent missing props validation in a React component definition - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md - 'react/prop-types': [2, { 'ignore': [], customValidators: [] }], - // Prevent missing React when using JSX - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md - 'react/react-in-jsx-scope': 2, - // Restrict file extensions that may be required - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-extension.md - 'react/require-extension': [0, { 'extensions': ['.jsx'] }], - // Prevent extra closing tags for components without children - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md - 'react/self-closing-comp': 2, - // Enforce component methods order - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-comp.md - 'react/sort-comp': [2, { - 'order': [ - 'lifecycle', - '/^on.+$/', - '/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/', - 'everything-else', - '/^render.+$/', - 'render' - ] - }], - // Prevent missing parentheses around multilines JSX - // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/wrap-multilines.md - 'react/wrap-multilines': [2, { - declaration: true, - assignment: true, - return: true - }], - } -}; diff --git a/node_modules/eslint-config-airbnb/rules/strict.js b/node_modules/eslint-config-airbnb/rules/strict.js deleted file mode 100644 index 6d32f8c..0000000 --- a/node_modules/eslint-config-airbnb/rules/strict.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - 'rules': { - // babel inserts `'use strict';` for us - 'strict': [2, 'never'] - } -}; diff --git a/node_modules/eslint-config-airbnb/rules/style.js b/node_modules/eslint-config-airbnb/rules/style.js deleted file mode 100644 index 25c5326..0000000 --- a/node_modules/eslint-config-airbnb/rules/style.js +++ /dev/null @@ -1,128 +0,0 @@ -module.exports = { - 'rules': { - // enforce spacing inside array brackets - 'array-bracket-spacing': [2, 'never'], - // enforce one true brace style - 'brace-style': [2, '1tbs', { 'allowSingleLine': true }], - // require camel case names - 'camelcase': [2, { 'properties': 'never' }], - // enforce spacing before and after comma - 'comma-spacing': [2, { 'before': false, 'after': true }], - // enforce one true comma style - 'comma-style': [2, 'last'], - // disallow padding inside computed properties - 'computed-property-spacing': [2, 'never'], - // enforces consistent naming when capturing the current execution context - 'consistent-this': 0, - // enforce newline at the end of file, with no multiple empty lines - 'eol-last': 2, - // require function expressions to have a name - 'func-names': 1, - // enforces use of function declarations or expressions - 'func-style': 0, - // this option enforces minimum and maximum identifier lengths - // (variable names, property names etc.) - 'id-length': 0, - // this option sets a specific tab width for your code - // https://github.com/eslint/eslint/blob/master/docs/rules/indent.md - 'indent': [2, 2, { 'SwitchCase': 1, 'VariableDeclarator': 1 }], - // specify whether double or single quotes should be used in JSX attributes - // http://eslint.org/docs/rules/jsx-quotes - 'jsx-quotes': [2, 'prefer-double'], - // enforces spacing between keys and values in object literal properties - 'key-spacing': [2, { 'beforeColon': false, 'afterColon': true }], - // enforces empty lines around comments - 'lines-around-comment': 0, - // disallow mixed 'LF' and 'CRLF' as linebreaks - 'linebreak-style': 0, - // specify the maximum length of a line in your program - // https://github.com/eslint/eslint/blob/master/docs/rules/max-len.md - 'max-len': [2, 100, 2, { - 'ignoreUrls': true, - 'ignoreComments': false - }], - // specify the maximum depth callbacks can be nested - 'max-nested-callbacks': 0, - // require a capital letter for constructors - 'new-cap': [2, { 'newIsCap': true }], - // disallow the omission of parentheses when invoking a constructor with no arguments - 'new-parens': 0, - // allow/disallow an empty newline after var statement - 'newline-after-var': 0, - // disallow use of the Array constructor - 'no-array-constructor': 0, - // disallow use of the continue statement - 'no-continue': 0, - // disallow comments inline after code - 'no-inline-comments': 0, - // disallow if as the only statement in an else block - 'no-lonely-if': 0, - // disallow mixed spaces and tabs for indentation - 'no-mixed-spaces-and-tabs': 2, - // disallow multiple empty lines and only one newline at the end - 'no-multiple-empty-lines': [2, { 'max': 2, 'maxEOF': 1 }], - // disallow nested ternary expressions - 'no-nested-ternary': 2, - // disallow use of the Object constructor - 'no-new-object': 2, - // disallow space between function identifier and application - 'no-spaced-func': 2, - // disallow the use of ternary operators - 'no-ternary': 0, - // disallow trailing whitespace at the end of lines - 'no-trailing-spaces': 2, - // disallow dangling underscores in identifiers - 'no-underscore-dangle': 0, - // disallow the use of Boolean literals in conditional expressions - // also, prefer `a || b` over `a ? a : b` - // http://eslint.org/docs/rules/no-unneeded-ternary - 'no-unneeded-ternary': [2, { 'defaultAssignment': false }], - // require padding inside curly braces - 'object-curly-spacing': [2, 'always'], - // allow just one var statement per function - 'one-var': [2, 'never'], - // require assignment operator shorthand where possible or prohibit it entirely - 'operator-assignment': 0, - // enforce operators to be placed before or after line breaks - 'operator-linebreak': 0, - // enforce padding within blocks - 'padded-blocks': [2, 'never'], - // require quotes around object literal property names - // http://eslint.org/docs/rules/quote-props.html - 'quote-props': [2, 'as-needed', { 'keywords': false, 'unnecessary': true, 'numbers': false }], - // specify whether double or single quotes should be used - 'quotes': [2, 'single', 'avoid-escape'], - // require identifiers to match the provided regular expression - 'id-match': 0, - // enforce spacing before and after semicolons - 'semi-spacing': [2, { 'before': false, 'after': true }], - // require or disallow use of semicolons instead of ASI - 'semi': [2, 'always'], - // sort variables within the same declaration block - 'sort-vars': 0, - // require a space before certain keywords - 'space-before-keywords': [2, 'always'], - // require a space after certain keywords - 'space-after-keywords': [2, 'always'], - // require or disallow space before blocks - 'space-before-blocks': 2, - // require or disallow space before function opening parenthesis - // https://github.com/eslint/eslint/blob/master/docs/rules/space-before-function-paren.md - 'space-before-function-paren': [2, { 'anonymous': 'always', 'named': 'never' }], - // require or disallow spaces inside parentheses - 'space-in-parens': [2, 'never'], - // require spaces around operators - 'space-infix-ops': 2, - // require a space after return, throw, and case - 'space-return-throw-case': 2, - // Require or disallow spaces before/after unary operators - 'space-unary-ops': 0, - // require or disallow a space immediately following the // or /* in a comment - 'spaced-comment': [2, 'always', { - 'exceptions': ['-', '+'], - 'markers': ['=', '!'] // space here to support sprockets directives - }], - // require regex literals to be wrapped in parentheses - 'wrap-regex': 0 - } -}; diff --git a/node_modules/eslint-config-airbnb/rules/variables.js b/node_modules/eslint-config-airbnb/rules/variables.js deleted file mode 100644 index 5991431..0000000 --- a/node_modules/eslint-config-airbnb/rules/variables.js +++ /dev/null @@ -1,26 +0,0 @@ -module.exports = { - 'rules': { - // enforce or disallow variable initializations at definition - 'init-declarations': 0, - // disallow the catch clause parameter name being the same as a variable in the outer scope - 'no-catch-shadow': 0, - // disallow deletion of variables - 'no-delete-var': 2, - // disallow labels that share a name with a variable - 'no-label-var': 0, - // disallow shadowing of names such as arguments - 'no-shadow-restricted-names': 2, - // disallow declaration of variables already declared in the outer scope - 'no-shadow': 2, - // disallow use of undefined when initializing variables - 'no-undef-init': 0, - // disallow use of undeclared variables unless mentioned in a /*global */ block - 'no-undef': 2, - // disallow use of undefined variable - 'no-undefined': 0, - // disallow declaration of variables that are not used in the code - 'no-unused-vars': [2, { 'vars': 'local', 'args': 'after-used' }], - // disallow use of variables before they are defined - 'no-use-before-define': 2 - } -}; diff --git a/node_modules/eslint-config-airbnb/test/.eslintrc b/node_modules/eslint-config-airbnb/test/.eslintrc deleted file mode 100644 index 7f79874..0000000 --- a/node_modules/eslint-config-airbnb/test/.eslintrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "rules": { - // disabled because I find it tedious to write tests while following this - // rule - "no-shadow": 0, - // tests uses `t` for tape - "id-length": [2, {"min": 2, "properties": "never", "exceptions": ["t"]}] - } -} diff --git a/node_modules/eslint-config-airbnb/test/test-base.js b/node_modules/eslint-config-airbnb/test/test-base.js deleted file mode 100644 index 24aa884..0000000 --- a/node_modules/eslint-config-airbnb/test/test-base.js +++ /dev/null @@ -1,30 +0,0 @@ -import fs from 'fs'; -import path from 'path'; -import test from 'tape'; - -const files = { - base: require('../base') -}; - -fs.readdirSync(path.join(__dirname, '../rules')).forEach(name => { - if (name === 'react.js') { - return; - } - - files[name] = require(`../rules/${name}`); -}); - -Object.keys(files).forEach(name => { - const config = files[name]; - - test(`${name}: does not reference react`, t => { - t.plan(2); - - t.notOk(config.plugins, 'plugins is unspecified'); - - // scan rules for react/ and fail if any exist - const reactRuleIds = Object.keys(config.rules) - .filter(ruleId => ruleId.indexOf('react/') === 0); - t.deepEquals(reactRuleIds, [], 'there are no react/ rules'); - }); -}); diff --git a/node_modules/eslint-config-airbnb/test/test-react-order.js b/node_modules/eslint-config-airbnb/test/test-react-order.js deleted file mode 100644 index 77448cf..0000000 --- a/node_modules/eslint-config-airbnb/test/test-react-order.js +++ /dev/null @@ -1,86 +0,0 @@ -import test from 'tape'; -import { CLIEngine } from 'eslint'; -import eslintrc from '../'; -import reactRules from '../rules/react'; - -const cli = new CLIEngine({ - useEslintrc: false, - baseConfig: eslintrc, - - // This rule fails when executing on text. - rules: { indent: 0 }, -}); - -function lint(text) { - // @see http://eslint.org/docs/developer-guide/nodejs-api.html#executeonfiles - // @see http://eslint.org/docs/developer-guide/nodejs-api.html#executeontext - return cli.executeOnText(text).results[0]; -} - -function wrapComponent(body) { - return ` -import React from 'react'; -export default class MyComponent extends React.Component { -${body} -} -`; -} - -test('validate react prop order', t => { - t.test('make sure our eslintrc has React linting dependencies', t => { - t.plan(1); - t.equal(reactRules.plugins[0], 'react', 'uses eslint-plugin-react'); - }); - - t.test('passes a good component', t => { - t.plan(3); - const result = lint(wrapComponent(` - componentWillMount() {} - componentDidMount() {} - setFoo() {} - getFoo() {} - setBar() {} - someMethod() {} - renderDogs() {} - render() { return
; } -`)); - - t.notOk(result.warningCount, 'no warnings'); - t.notOk(result.errorCount, 'no errors'); - t.deepEquals(result.messages, [], 'no messages in results'); - }); - - t.test('order: when random method is first', t => { - t.plan(2); - const result = lint(wrapComponent(` - someMethod() {} - componentWillMount() {} - componentDidMount() {} - setFoo() {} - getFoo() {} - setBar() {} - renderDogs() {} - render() { return
; } -`)); - - t.ok(result.errorCount, 'fails'); - t.equal(result.messages[0].ruleId, 'react/sort-comp', 'fails due to sort'); - }); - - t.test('order: when random method after lifecycle methods', t => { - t.plan(2); - const result = lint(wrapComponent(` - componentWillMount() {} - componentDidMount() {} - someMethod() {} - setFoo() {} - getFoo() {} - setBar() {} - renderDogs() {} - render() { return
; } -`)); - - t.ok(result.errorCount, 'fails'); - t.equal(result.messages[0].ruleId, 'react/sort-comp', 'fails due to sort'); - }); -}); diff --git a/node_modules/eslint-plugin-react/CHANGELOG.md b/node_modules/eslint-plugin-react/CHANGELOG.md deleted file mode 100644 index 49ffa6e..0000000 --- a/node_modules/eslint-plugin-react/CHANGELOG.md +++ /dev/null @@ -1,877 +0,0 @@ -# Change Log -All notable changes to this project will be documented in this file. -This project adheres to [Semantic Versioning](http://semver.org/). -This change log adheres to standards from [Keep a CHANGELOG](http://keepachangelog.com). - -## [3.16.1] - 2016-01-24 -### Fixed -* Fix `jsx-sort-prop-types` issue with custom propTypes ([#408][] @alitaheri) - -[3.16.1]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.16.0...v3.16.1 -[#408]: https://github.com/yannickcr/eslint-plugin-react/issues/408 - -## [3.16.0] - 2016-01-24 -### Added -* Add `jsx-equals-spacing` rule ([#394][] @ryym) -* Add auto fix for `wrap-multiline` -* Add auto fix for `jsx-boolean-value` -* Add auto fix for `no-unknown-property` -* Add auto fix for `jsx-curly-spacing` ([#407][] @ewendel) -* Add `requiredFirst` option to `jsx-sort-prop-types` ([#392][] @chrislaskey) -* Add `ignoreRefs` option to `jsx-no-bind` ([#330][] @silvenon) - -### Fixed -* Ignore `ref` in `jsx-handler-names` (again) ([#396][]) - -### Changed -* Update dependencies - -[3.16.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.15.0...v3.16.0 -[#394]: https://github.com/yannickcr/eslint-plugin-react/issues/394 -[#407]: https://github.com/yannickcr/eslint-plugin-react/pull/407 -[#392]: https://github.com/yannickcr/eslint-plugin-react/pull/392 -[#330]: https://github.com/yannickcr/eslint-plugin-react/issues/330 -[#396]: https://github.com/yannickcr/eslint-plugin-react/issues/396 - -## [3.15.0] - 2016-01-12 -### Added -* Add support for flow annotations to `prop-types` ([#382][] @phpnode) - -### Fixed -* Fix `prop-types` crash when initializing class variable with an empty object ([#383][]) -* Fix `prop-types` crash when propTypes are using the spread operator ([#389][]) - -### Changed -* Improve `sort-comp` error messages ([#372][] @SystemParadox) -* Update dependencies - -[3.15.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.14.0...v3.15.0 -[#382]: https://github.com/yannickcr/eslint-plugin-react/pull/382 -[#383]: https://github.com/yannickcr/eslint-plugin-react/issues/383 -[#389]: https://github.com/yannickcr/eslint-plugin-react/issues/389 -[#372]: https://github.com/yannickcr/eslint-plugin-react/pull/372 - -## [3.14.0] - 2016-01-05 -### Added -* Add `jsx-indent` rule ([#342][]) -* Add shared setting for pragma configuration ([#228][] @NickStefan) - -### Fixed -* Fix crash in `jsx-key` ([#380][] @nfcampos) -* Fix crash in `forbid-prop-types` ([#377][] @nfcampos) -* Ignore `ref` in `jsx-handler-names` ([#375][]) - -### Changed -* Add AppVeyor CI to run tests on a Windows platform -* Add `sort-comp` codemod to `sort-comp` documentation ([#381][] @turadg) - -[3.14.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.13.1...v3.14.0 -[#342]: https://github.com/yannickcr/eslint-plugin-react/issues/342 -[#228]: https://github.com/yannickcr/eslint-plugin-react/issues/228 -[#380]: https://github.com/yannickcr/eslint-plugin-react/pull/380 -[#377]: https://github.com/yannickcr/eslint-plugin-react/pull/377 -[#375]: https://github.com/yannickcr/eslint-plugin-react/issues/375 -[#381]: https://github.com/yannickcr/eslint-plugin-react/pull/381 - -## [3.13.1] - 2015-12-26 -### Fixed -* Fix crash in `jsx-key` ([#373][] @lukekarrys) - -[3.13.1]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.13.0...v3.13.1 -[#373]: https://github.com/yannickcr/eslint-plugin-react/issues/373 - -## [3.13.0] - 2015-12-24 -### Added -* Add `no-string-refs` rule ([#341][] @Intellicode) -* Add support for propTypes assigned via a variable in `prop-types` ([#355][]) - -### Fixed -* Fix `never` option in `prefer-es6-class` -* Fix `jsx-key` false-positives ([#320][] @silvenon) - -### Changed -* Documentation improvements ([#368][] @lencioni, [#370][] @tmcw, [#371][]) -* Update dependencies - -[3.13.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.12.0...v3.13.0 -[#341]: https://github.com/yannickcr/eslint-plugin-react/issues/341 -[#355]: https://github.com/yannickcr/eslint-plugin-react/issues/355 -[#320]: https://github.com/yannickcr/eslint-plugin-react/issues/320 - -[#368]: https://github.com/yannickcr/eslint-plugin-react/pull/368 -[#370]: https://github.com/yannickcr/eslint-plugin-react/pull/370 -[#371]: https://github.com/yannickcr/eslint-plugin-react/issues/371 - -## [3.12.0] - 2015-12-20 -### Added -* Add `no-deprecated` rule ([#356][] @graue) -* Add `no-is-mounted` rule ([#37][] @lencioni) -* Add `never` option to `prefer-es6-class` rule ([#359][] @pwmckenna) - -### Fixed -* Fix `jsx-pascal-case` to stop checking lower cased components ([#329][]) -* Fix crash in component detection class ([#364][]) - -### Changed -* Add link to [eslint-plugin-react-native](https://github.com/Intellicode/eslint-plugin-react-native) in Readme -* Update dependencies - -[3.12.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.11.3...v3.12.0 -[#356]: https://github.com/yannickcr/eslint-plugin-react/pull/356 -[#37]: https://github.com/yannickcr/eslint-plugin-react/issues/37 -[#359]: https://github.com/yannickcr/eslint-plugin-react/pull/359 -[#329]: https://github.com/yannickcr/eslint-plugin-react/issues/329 -[#364]: https://github.com/yannickcr/eslint-plugin-react/issues/364 - -## [3.11.3] - 2015-12-05 -### Fixed -* Fix crash in `prop-types` when reassigning props ([#345][]) -* Fix `jsx-handler-names` for stateless components ([#346][]) - -### Changed -* Update `jsx-handler-names` error messages to be less specific ([#348][] @jakemmarsh) - -[3.11.3]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.11.2...v3.11.3 -[#345]: https://github.com/yannickcr/eslint-plugin-react/issues/345 -[#346]: https://github.com/yannickcr/eslint-plugin-react/issues/346 -[#348]: https://github.com/yannickcr/eslint-plugin-react/pull/348 - -## [3.11.2] - 2015-12-01 -### Fixed -* Allow numbers in `jsx-pascal-case` ([#339][]) -* Fix `jsx-handler-names` crash with arrays ([#340][]) - -### Changed -* Add allow-in-func option to `no-did-update-set-state` documentation - -[3.11.2]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.11.1...v3.11.2 -[#339]: https://github.com/yannickcr/eslint-plugin-react/issues/339 -[#340]: https://github.com/yannickcr/eslint-plugin-react/issues/340 - -## [3.11.1] - 2015-11-29 -### Fixed -* Fix SVG attributes support for `no-unknown-property` ([#338][]) - -[3.11.1]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.11.0...v3.11.1 -[#338]: https://github.com/yannickcr/eslint-plugin-react/issues/338 - -## [3.11.0] - 2015-11-29 -### Added -* Add `jsx-handler-names` rule ([#315][] @jakemmarsh) -* Add SVG attributes support to `no-unknown-property` ([#318][]) -* Add shorthandFirst option to `jsx-sort-props` ([#336][] @lucasmotta) - -### Fixed -* Fix destructured props detection in stateless components ([#326][]) -* Fix props validation for nested stateless components ([#331][]) -* Fix `require-extension` to ignore extension if it's part of the package name ([#319][]) - -### Changed -* Allow consecutive uppercase letters in `jsx-pascal-case` ([#328][] @lencioni) -* Update dependencies - -[3.11.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.10.0...v3.11.0 -[#315]: https://github.com/yannickcr/eslint-plugin-react/pull/315 -[#318]: https://github.com/yannickcr/eslint-plugin-react/issues/318 -[#336]: https://github.com/yannickcr/eslint-plugin-react/pull/336 -[#326]: https://github.com/yannickcr/eslint-plugin-react/issues/326 -[#331]: https://github.com/yannickcr/eslint-plugin-react/issues/331 -[#319]: https://github.com/yannickcr/eslint-plugin-react/issues/319 -[#328]: https://github.com/yannickcr/eslint-plugin-react/issues/328 - -## [3.10.0] - 2015-11-21 -### Added -* Add `jsx-pascal-case` rule ([#306][] @jakemmarsh) - -### Fixed -* Fix crash on incomplete class property declaration ([#317][] @dapetcu21) -* Fix crash with ESLint 1.10.0 ([#323][] @lukekarrys) - -[3.10.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.9.0...v3.10.0 -[#306]: https://github.com/yannickcr/eslint-plugin-react/pull/306 -[#317]: https://github.com/yannickcr/eslint-plugin-react/issues/317 -[#323]: https://github.com/yannickcr/eslint-plugin-react/issues/323 - -## [3.9.0] - 2015-11-17 -### Added -* Add `jsx-key` rule ([#293][] @benmosher) -* Add `allow-in-func` option to `no-did-update-set-state` ([#300][]) -* Add option to only enforce `jsx-closing-bracket-location` rule to one type of tag (nonEmpty or selfClosing) ([#307][]) - -### Fixed -* Fix crash when destructuring with only the rest spread ([#269][]) -* Fix variables detection when searching for related components ([#303][]) -* Fix `no-unknown-property` to not check custom elements ([#308][] @zertosh) - -### Changed -* Improve `jsx-closing-bracket-location` error message ([#301][] @alopatin) -* Update dependencies - -[3.9.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.8.0...v3.9.0 -[#293]: https://github.com/yannickcr/eslint-plugin-react/pull/293 -[#300]: https://github.com/yannickcr/eslint-plugin-react/issues/300 -[#307]: https://github.com/yannickcr/eslint-plugin-react/issues/307 -[#269]: https://github.com/yannickcr/eslint-plugin-react/issues/269 -[#303]: https://github.com/yannickcr/eslint-plugin-react/issues/303 -[#308]: https://github.com/yannickcr/eslint-plugin-react/pull/308 -[#301]: https://github.com/yannickcr/eslint-plugin-react/pull/301 - -## [3.8.0] - 2015-11-07 -### Added -* Add ignoreStateless option to `no-multi-comp` ([#290][]) - -### Fixed -* Fix classes with properties to always be marked as components ([#291][]) -* Fix ES5 class detection when using `createClass` by itself ([#297][]) -* Fix direct props detection ([#298][]) -* Ignore functions containing the keyword `this` during component detection - -[3.8.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.7.1...v3.8.0 -[#290]: https://github.com/yannickcr/eslint-plugin-react/issues/290 -[#291]: https://github.com/yannickcr/eslint-plugin-react/issues/291 -[#297]: https://github.com/yannickcr/eslint-plugin-react/issues/297 -[#298]: https://github.com/yannickcr/eslint-plugin-react/issues/298 - -## [3.7.1] - 2015-11-05 -### Fixed -* Fix `sort-comp` crash on stateless components ([#285][]) -* Fix crash in ES5 components detection ([#286][]) -* Fix ES5 components detection from nested functions ([#287][]) - -[3.7.1]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.7.0...v3.7.1 -[#285]: https://github.com/yannickcr/eslint-plugin-react/issues/285 -[#286]: https://github.com/yannickcr/eslint-plugin-react/issues/286 -[#287]: https://github.com/yannickcr/eslint-plugin-react/issues/287 - -## [3.7.0] - 2015-11-05 -### Added -* Add `jsx-no-bind` rule ([#184][] @Daniel15) -* Add line-aligned option to `jsx-closing-bracket-location` ([#243][] @alopatin) - -### Fixed -* Fix a lot of issues about components detection, mostly related to stateless components ([#264][], [#267][], [#268][], [#276][], [#277][], [#280][]) - -### Changed -* Update dependencies - -[3.7.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.6.3...v3.7.0 -[#184]: https://github.com/yannickcr/eslint-plugin-react/issues/184 -[#243]: https://github.com/yannickcr/eslint-plugin-react/issues/243 -[#264]: https://github.com/yannickcr/eslint-plugin-react/issues/264 -[#267]: https://github.com/yannickcr/eslint-plugin-react/issues/267 -[#268]: https://github.com/yannickcr/eslint-plugin-react/issues/268 -[#276]: https://github.com/yannickcr/eslint-plugin-react/issues/276 -[#277]: https://github.com/yannickcr/eslint-plugin-react/issues/277 -[#280]: https://github.com/yannickcr/eslint-plugin-react/issues/280 - -## [3.6.3] - 2015-10-20 -### Fixed -* Fix `display-name` for stateless components ([#256][]) -* Fix `prop-types` props validation in constructor ([#259][]) -* Fix typo in README ([#261][] @chiedojohn) - -[3.6.3]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.6.2...v3.6.3 -[#256]: https://github.com/yannickcr/eslint-plugin-react/issues/256 -[#259]: https://github.com/yannickcr/eslint-plugin-react/issues/259 -[#261]: https://github.com/yannickcr/eslint-plugin-react/pull/261 - -## [3.6.2] - 2015-10-18 -### Fixed -* Fix wrong prop-types detection ([#255][]) - -[3.6.2]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.6.1...v3.6.2 -[#255]: https://github.com/yannickcr/eslint-plugin-react/issues/255 - -## [3.6.1] - 2015-10-18 -### Fixed -* Fix props validation in constructor ([#254][]) - -[3.6.1]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.6.0...v3.6.1 -[#254]: https://github.com/yannickcr/eslint-plugin-react/issues/254 - -## [3.6.0] - 2015-10-18 -### Added -* Add support for stateless function components to `display-name` and `prop-types` ([#237][]) -* Add callbacksLast option to `jsx-sort-props` and `jsx-sort-prop-types` ([#242][] @Daniel15) -* Add `prefer-es6-class` rule ([#247][] @hamiltondanielb) - -### Fixed -* Fix `forbid-prop-types` crash with destructured PropTypes ([#230][] @epmatsw) -* Fix `forbid-prop-types` to do not modify AST directly ([#249][] @rhysd) -* Fix `prop-types` crash with empty destructuring ([#251][]) -* Fix `prop-types` to not validate computed keys in destructuring ([#236][]) - -### Changed -* Update dependencies -* Improve components detection ([#233][]) -* Documentation improvements ([#248][] @dguo) - -[3.6.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.5.1...v3.6.0 -[#237]: https://github.com/yannickcr/eslint-plugin-react/issues/237 -[#242]: https://github.com/yannickcr/eslint-plugin-react/pull/242 -[#247]: https://github.com/yannickcr/eslint-plugin-react/issues/247 -[#230]: https://github.com/yannickcr/eslint-plugin-react/issues/230 -[#249]: https://github.com/yannickcr/eslint-plugin-react/issues/249 -[#251]: https://github.com/yannickcr/eslint-plugin-react/issues/251 -[#236]: https://github.com/yannickcr/eslint-plugin-react/issues/236 -[#233]: https://github.com/yannickcr/eslint-plugin-react/issues/233 -[#248]: https://github.com/yannickcr/eslint-plugin-react/pull/248 - -## [3.5.1] - 2015-10-01 -### Fixed -* Fix `no-direct-mutation-state` to report only in React components ([#229][]) -* Fix `forbid-prop-types` for arrayOf and instanceOf ([#230][]) - -### Changed -* Documentation improvements ([#232][] @edge) - -[3.5.1]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.5.0...v3.5.1 -[#229]: https://github.com/yannickcr/eslint-plugin-react/issues/229 -[#230]: https://github.com/yannickcr/eslint-plugin-react/issues/230 -[#232]: https://github.com/yannickcr/eslint-plugin-react/pull/232 - -## [3.5.0] - 2015-09-28 -### Added -* Add `no-direct-mutation-state` rule ([#133][], [#201][] @petersendidit) -* Add `forbid-prop-types` rule ([#215][] @pwmckenna) - -### Fixed -* Fix no-did-mount/update-set-state rules, these rules were not working on ES6 classes - -### Changed -* Update dependencies -* Documentation improvements ([#222][] @Andersos) - -[3.5.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.4.2...v3.5.0 -[#133]: https://github.com/yannickcr/eslint-plugin-react/issues/133 -[#201]: https://github.com/yannickcr/eslint-plugin-react/issues/201 -[#215]: https://github.com/yannickcr/eslint-plugin-react/issues/215 -[#222]: https://github.com/yannickcr/eslint-plugin-react/pull/222 - -## [3.4.2] - 2015-09-18 -### Fixed -* Only display the `jsx-quotes` deprecation warning with the default formatter ([#221][]) - -[3.4.2]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.4.1...v3.4.2 -[#221]: https://github.com/yannickcr/eslint-plugin-react/issues/221 - -## [3.4.1] - 2015-09-17 -### Fixed -* Fix `jsx-quotes` rule deprecation message ([#220][]) - -[3.4.1]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.4.0...v3.4.1 -[#220]: https://github.com/yannickcr/eslint-plugin-react/issues/220 - -## [3.4.0] - 2015-09-16 -### Added -* Add namespaced JSX support to `jsx-no-undef` ([#219][] @zertosh) -* Add option to `jsx-closing-bracket-location` to configure different styles for self-closing and non-empty tags ([#208][] @evocateur) - -### Deprecated -* Deprecate `jsx-quotes` rule, will now trigger a warning if used ([#217][]) - -[3.4.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.3.2...v3.4.0 -[#219]: https://github.com/yannickcr/eslint-plugin-react/pull/219 -[#208]: https://github.com/yannickcr/eslint-plugin-react/pull/208 -[#217]: https://github.com/yannickcr/eslint-plugin-react/issues/217 - -## [3.3.2] - 2015-09-10 -### Changed -* Add `state` in lifecycle methods for `sort-comp` rule ([#197][] @mathieudutour) -* Treat component with render which returns `createElement` as valid ([#206][] @epmatsw) - -### Fixed -* Fix allowed methods on arrayOf in `prop-types` ([#146][]) -* Fix default configuration for `jsx-boolean-value` ([#210][]) - -[3.3.2]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.3.1...v3.3.2 -[#146]: https://github.com/yannickcr/eslint-plugin-react/issues/146 -[#197]: https://github.com/yannickcr/eslint-plugin-react/pull/197 -[#206]: https://github.com/yannickcr/eslint-plugin-react/pull/206 -[#210]: https://github.com/yannickcr/eslint-plugin-react/issues/210 - -## [3.3.1] - 2015-09-01 -### Changed -* Update dependencies -* Update changelog to follow the Keep a CHANGELOG standards -* Documentation improvements ([#198][] @lencioni) - -### Fixed -* Fix `jsx-closing-bracket-location` for multiline props ([#199][]) - -[3.3.1]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.3.0...v3.3.1 -[#198]: https://github.com/yannickcr/eslint-plugin-react/pull/198 -[#199]: https://github.com/yannickcr/eslint-plugin-react/issues/199 - -## [3.3.0] - 2015-08-26 -### Added -* Add `jsx-indent-props` rule ([#15][], [#181][]) -* Add `no-set-state rule` ([#197][] @markdalgleish) -* Add `jsx-closing-bracket-location` rule ([#14][], [#64][]) - -### Changed -* Update dependencies - -### Fixed -* Fix crash on propTypes declarations with an empty body ([#193][] @mattyod) - -[3.3.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.2.3...v3.3.0 -[#15]: https://github.com/yannickcr/eslint-plugin-react/issues/15 -[#181]: https://github.com/yannickcr/eslint-plugin-react/issues/181 -[#197]: https://github.com/yannickcr/eslint-plugin-react/pull/197 -[#14]: https://github.com/yannickcr/eslint-plugin-react/issues/14 -[#64]: https://github.com/yannickcr/eslint-plugin-react/issues/64 -[#193]: https://github.com/yannickcr/eslint-plugin-react/pull/193 - -## [3.2.3] - 2015-08-16 -### Changed -* Update dependencies - -### Fixed -* Fix object rest/spread handling ([#187][] @xjamundx, [#189][] @Morantron) - -[3.2.3]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.2.2...v3.2.3 -[#187]: https://github.com/yannickcr/eslint-plugin-react/pull/187 -[#189]: https://github.com/yannickcr/eslint-plugin-react/pull/189 - -## [3.2.2] - 2015-08-11 -### Changed -* Remove peerDependencies ([#178][]) - -[3.2.2]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.2.1...v3.2.2 -[#178]: https://github.com/yannickcr/eslint-plugin-react/issues/178 - -## [3.2.1] - 2015-08-08 -### Fixed -* Fix crash when propTypes don't have any parent ([#182][]) -* Fix jsx-no-literals reporting errors outside JSX ([#183][] @CalebMorris) - -[3.2.1]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.2.0...v3.2.1 -[#182]: https://github.com/yannickcr/eslint-plugin-react/issues/182 -[#183]: https://github.com/yannickcr/eslint-plugin-react/pull/183 - -## [3.2.0] - 2015-08-04 -### Added -* Add `jsx-max-props-per-line` rule ([#13][]) -* Add `jsx-no-literals` rule ([#176][] @CalebMorris) - -### Changed -* Update dependencies - -### Fixed -* Fix object access in `jsx-no-undef` ([#172][]) - -[3.2.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.1.0...v3.2.0 -[#13]: https://github.com/yannickcr/eslint-plugin-react/issues/13 -[#176]: https://github.com/yannickcr/eslint-plugin-react/pull/176 -[#172]: https://github.com/yannickcr/eslint-plugin-react/issues/172 - -## [3.1.0] - 2015-07-28 -### Added -* Add event handlers to `no-unknown-property` ([#164][] @mkenyon) -* Add customValidators option to `prop-types` ([#145][] @CalebMorris) - -### Changed -* Update dependencies -* Documentation improvements ([#167][] @ngbrown) - -### Fixed -* Fix comment handling in `jsx-curly-spacing` ([#165][]) - -[3.1.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v3.0.0...v3.1.0 -[#164]: https://github.com/yannickcr/eslint-plugin-react/pull/164 -[#145]: https://github.com/yannickcr/eslint-plugin-react/issues/145 -[#165]: https://github.com/yannickcr/eslint-plugin-react/issues/165 -[#167]: https://github.com/yannickcr/eslint-plugin-react/pull/167 - -## [3.0.0] - 2015-07-21 -### Added -* Add jsx-no-duplicate-props rule ([#161][] @hummlas) -* Add allowMultiline option to the `jsx-curly-spacing` rule ([#156][] @mathieumg) - -## Breaking -* In `jsx-curly-spacing` braces spanning multiple lines are now allowed with `never` option ([#156][] @mathieumg) - -### Fixed -* Fix multiple var and destructuring handling in `props-types` ([#159][]) -* Fix crash when retrieving propType name ([#163][]) - -[3.0.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v2.7.1...v3.0.0 -[#161]: https://github.com/yannickcr/eslint-plugin-react/pull/161 -[#156]: https://github.com/yannickcr/eslint-plugin-react/pull/156 -[#159]: https://github.com/yannickcr/eslint-plugin-react/issues/159 -[#163]: https://github.com/yannickcr/eslint-plugin-react/issues/163 - -## [2.7.1] - 2015-07-16 -### Changed -* Update peerDependencies requirements ([#154][]) -* Update codebase for ESLint v1.0.0 -* Change oneOfType to actually keep the child types ([#148][] @CalebMorris) -* Documentation improvements ([#147][] @lencioni) - -[2.7.1]: https://github.com/yannickcr/eslint-plugin-react/compare/v2.7.0...v2.7.1 -[#154]: https://github.com/yannickcr/eslint-plugin-react/issues/154 -[#148]: https://github.com/yannickcr/eslint-plugin-react/issues/148 -[#147]: https://github.com/yannickcr/eslint-plugin-react/pull/147 - -## [2.7.0] - 2015-07-11 -### Added -* Add `no-danger` rule ([#138][] @scothis) -* Add `jsx-curly-spacing` rule ([#142][]) - -### Fixed -* Fix properties limitations on propTypes ([#139][]) -* Fix component detection ([#144][]) - -[2.7.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v2.6.4...v2.7.0 -[#138]: https://github.com/yannickcr/eslint-plugin-react/pull/138 -[#142]: https://github.com/yannickcr/eslint-plugin-react/issues/142 -[#139]: https://github.com/yannickcr/eslint-plugin-react/issues/139 -[#144]: https://github.com/yannickcr/eslint-plugin-react/issues/144 - -## [2.6.4] - 2015-07-02 -### Fixed -* Fix simple destructuring handling ([#137][]) - -[2.6.4]: https://github.com/yannickcr/eslint-plugin-react/compare/v2.6.3...v2.6.4 -[#137]: https://github.com/yannickcr/eslint-plugin-react/issues/137 - -## [2.6.3] - 2015-06-30 -### Fixed -* Fix ignore option for `prop-types` rule ([#135][]) -* Fix nested props destructuring ([#136][]) - -[2.6.3]: https://github.com/yannickcr/eslint-plugin-react/compare/v2.6.2...v2.6.3 -[#135]: https://github.com/yannickcr/eslint-plugin-react/issues/135 -[#136]: https://github.com/yannickcr/eslint-plugin-react/issues/136 - -## [2.6.2] - 2015-06-28 -### Fixed -* Fix props validation when using a prop as an object key ([#132][]) - -[2.6.2]: https://github.com/yannickcr/eslint-plugin-react/compare/v2.6.1...v2.6.2 -[#132]: https://github.com/yannickcr/eslint-plugin-react/issues/132 - -## [2.6.1] - 2015-06-28 -### Fixed -* Fix crash in `prop-types` when encountering an empty variable declaration ([#130][]) - -[2.6.1]: https://github.com/yannickcr/eslint-plugin-react/compare/v2.6.0...v2.6.1 -[#130]: https://github.com/yannickcr/eslint-plugin-react/issues/130 - -## [2.6.0] - 2015-06-28 -### Added -* Add support for nested propTypes ([#62][] [#105][] @Cellule) -* Add `require-extension` rule ([#117][] @scothis) -* Add support for computed string format in `prop-types` ([#127][] @Cellule) -* Add ES6 methods to `sort-comp` default configuration ([#97][] [#122][]) -* Add support for props destructuring directly on the this keyword -* Add `acceptTranspilerName` option to `display-name` rule ([#75][]) -* Add schema to validate rules options - -### Changed -* Update dependencies - -### Fixed -* Fix test command for Windows ([#114][] @Cellule) -* Fix detection of missing displayName and propTypes when `ecmaFeatures.jsx` is false ([#119][] @rpl) -* Fix propTypes destructuring with properties as string ([#118][] @Cellule) -* Fix `jsx-sort-prop-types` support for keys as string ([#123][] @Cellule) -* Fix crash if a ClassProperty has only one token ([#125][]) -* Fix invalid class property handling in `jsx-sort-prop-types` ([#129][]) - -[2.6.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v2.5.2...v2.6.0 -[#62]: https://github.com/yannickcr/eslint-plugin-react/issues/62 -[#105]: https://github.com/yannickcr/eslint-plugin-react/issues/105 -[#114]: https://github.com/yannickcr/eslint-plugin-react/pull/114 -[#117]: https://github.com/yannickcr/eslint-plugin-react/pull/117 -[#119]: https://github.com/yannickcr/eslint-plugin-react/pull/119 -[#118]: https://github.com/yannickcr/eslint-plugin-react/issues/118 -[#123]: https://github.com/yannickcr/eslint-plugin-react/pull/123 -[#125]: https://github.com/yannickcr/eslint-plugin-react/issues/125 -[#127]: https://github.com/yannickcr/eslint-plugin-react/pull/127 -[#97]: https://github.com/yannickcr/eslint-plugin-react/issues/97 -[#122]: https://github.com/yannickcr/eslint-plugin-react/issues/122 -[#129]: https://github.com/yannickcr/eslint-plugin-react/issues/129 -[#75]: https://github.com/yannickcr/eslint-plugin-react/issues/75 - -## [2.5.2] - 2015-06-14 -### Fixed -* Fix regression in `jsx-uses-vars` with `babel-eslint` ([#110][]) - -[2.5.2]: https://github.com/yannickcr/eslint-plugin-react/compare/v2.5.1...v2.5.2 -[#110]: https://github.com/yannickcr/eslint-plugin-react/issues/110 - -## [2.5.1] - 2015-06-14 -### Changed -* Update dependencies -* Documentation improvements ([#99][] @morenoh149) - -### Fixed -* Fix `prop-types` crash when propTypes definition is invalid ([#95][]) -* Fix `jsx-uses-vars` for ES6 classes ([#96][]) -* Fix hasOwnProperty that is taken for a prop ([#102][]) - -[2.5.1]: https://github.com/yannickcr/eslint-plugin-react/compare/v2.5.0...v2.5.1 -[#95]: https://github.com/yannickcr/eslint-plugin-react/issues/95 -[#96]: https://github.com/yannickcr/eslint-plugin-react/issues/96 -[#102]: https://github.com/yannickcr/eslint-plugin-react/issues/102 -[#99]: https://github.com/yannickcr/eslint-plugin-react/pull/99 - -## [2.5.0] - 2015-06-04 -### Added -* Add option to make `wrap-multilines` more granular ([#94][] @PiPeep) - -### Changed -* Update dependencies -* Documentation improvements ([#92][] [#93][] @lencioni) - -[2.5.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v2.4.0...v2.5.0 -[#94]: https://github.com/yannickcr/eslint-plugin-react/pull/94 -[#92]: https://github.com/yannickcr/eslint-plugin-react/pull/92 -[#93]: https://github.com/yannickcr/eslint-plugin-react/pull/93 - -## [2.4.0] - 2015-05-30 -### Added -* Add pragma option to `jsx-uses-react` ([#82][] @dominicbarnes) -* Add context props to `sort-comp` ([#89][] @zertosh) - -### Changed -* Update dependencies -* Documentation improvement ([#91][] @matthewwithanm) - -### Fixed -* Fix itemID in `no-unknown-property` rule ([#85][] @cody) -* Fix license field in package.json ([#90][] @zertosh) -* Fix usage of contructor in `sort-comp` options ([#88][]) - -[2.4.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v2.3.0...v2.4.0 -[#82]: https://github.com/yannickcr/eslint-plugin-react/pull/82 -[#89]: https://github.com/yannickcr/eslint-plugin-react/pull/89 -[#85]: https://github.com/yannickcr/eslint-plugin-react/pull/85 -[#90]: https://github.com/yannickcr/eslint-plugin-react/pull/90 -[#88]: https://github.com/yannickcr/eslint-plugin-react/issues/88 -[#91]: https://github.com/yannickcr/eslint-plugin-react/pull/91 - -## [2.3.0] - 2015-05-14 -### Added -* Add `sort-comp` rule ([#39][]) -* Add `allow-in-func` option to `no-did-mount-set-state` ([#56][]) - -### Changed -* Update dependencies -* Improve errors locations for `prop-types` - -### Fixed -* Fix quoted propTypes in ES6 ([#77][]) - -[2.3.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v2.2.0...v2.3.0 -[#39]: https://github.com/yannickcr/eslint-plugin-react/issues/39 -[#77]: https://github.com/yannickcr/eslint-plugin-react/issues/77 -[#56]: https://github.com/yannickcr/eslint-plugin-react/issues/56 - -## [2.2.0] - 2015-04-22 -### Added -* Add `jsx-sort-prop-types` rule ([#38][] @AlexKVal) - -### Changed -* Documentation improvements ([#71][] @AlexKVal) - -### Fixed -* Fix variables marked as used when a prop has the same name ([#69][] @burnnat) - -[2.2.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v2.1.1...v2.2.0 -[#38]: https://github.com/yannickcr/eslint-plugin-react/issues/38 -[#69]: https://github.com/yannickcr/eslint-plugin-react/pull/69 -[#71]: https://github.com/yannickcr/eslint-plugin-react/pull/71 - -## [2.1.1] - 2015-04-17 -### Added -* Add support for classes static properties ([#43][]) -* Add tests for the `babel-eslint` parser -* Add ESLint as peerDependency ([#63][] @AlexKVal) - -### Changed -* Documentation improvements ([#55][] @AlexKVal, [#60][] @chriscalo) - -[2.1.1]: https://github.com/yannickcr/eslint-plugin-react/compare/v2.1.0...v2.1.1 -[#43]: https://github.com/yannickcr/eslint-plugin-react/issues/43 -[#63]: https://github.com/yannickcr/eslint-plugin-react/pull/63 -[#55]: https://github.com/yannickcr/eslint-plugin-react/pull/55 -[#60]: https://github.com/yannickcr/eslint-plugin-react/pull/60 - -## [2.1.0] - 2015-04-06 -### Added -* Add `jsx-boolean-value` rule ([#11][]) -* Add support for static methods in `display-name` and `prop-types` ([#48][]) - -### Changed -* Update `jsx-sort-props` to reset the alphabetical verification on spread ([#47][] @zertosh) -* Update `jsx-uses-vars` to be enabled by default ([#49][] @banderson) - -### Fixed -* Fix describing comment for hasSpreadOperator() method ([#53][] @AlexKVal) - -[2.1.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v2.0.2...v2.1.0 -[#47]: https://github.com/yannickcr/eslint-plugin-react/pull/47 -[#49]: https://github.com/yannickcr/eslint-plugin-react/pull/49 -[#11]: https://github.com/yannickcr/eslint-plugin-react/issues/11 -[#48]: https://github.com/yannickcr/eslint-plugin-react/issues/48 -[#53]: https://github.com/yannickcr/eslint-plugin-react/pull/53 - -## [2.0.2] - 2015-03-31 -### Fixed -* Fix ignore rest spread when destructuring props ([#46][]) -* Fix component detection in `prop-types` and `display-name` ([#45][]) -* Fix spread handling in `jsx-sort-props` ([#42][] @zertosh) - -[2.0.2]: https://github.com/yannickcr/eslint-plugin-react/compare/v2.0.1...v2.0.2 -[#46]: https://github.com/yannickcr/eslint-plugin-react/issues/46 -[#45]: https://github.com/yannickcr/eslint-plugin-react/issues/45 -[#42]: https://github.com/yannickcr/eslint-plugin-react/pull/42 - -## [2.0.1] - 2015-03-30 -### Fixed -* Fix props detection when used in an object ([#41][]) - -[2.0.1]: https://github.com/yannickcr/eslint-plugin-react/compare/v2.0.0...v2.0.1 -[#41]: https://github.com/yannickcr/eslint-plugin-react/issues/41 - -## [2.0.0] - 2015-03-29 -### Added -* Add `jsx-sort-props` rule ([#16][]) -* Add `no-unknown-property` rule ([#28][]) -* Add ignore option to `prop-types` rule - -### Changed -* Update dependencies - -## Breaking -* In `prop-types` the children prop is no longer ignored - -### Fixed -* Fix components are now detected when using ES6 classes ([#24][]) -* Fix `prop-types` now return the right line/column ([#33][]) -* Fix props are now detected when destructuring ([#27][]) -* Fix only check for computed property names in `prop-types` ([#36][] @burnnat) - -[2.0.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v1.6.1...v2.0.0 -[#16]: https://github.com/yannickcr/eslint-plugin-react/issues/16 -[#28]: https://github.com/yannickcr/eslint-plugin-react/issues/28 -[#24]: https://github.com/yannickcr/eslint-plugin-react/issues/24 -[#33]: https://github.com/yannickcr/eslint-plugin-react/issues/33 -[#27]: https://github.com/yannickcr/eslint-plugin-react/issues/27 -[#36]: https://github.com/yannickcr/eslint-plugin-react/pull/36 - -## [1.6.1] - 2015-03-25 -### Changed -* Update `jsx-quotes` documentation - -### Fixed -* Fix `jsx-no-undef` with `babel-eslint` ([#30][]) -* Fix `jsx-quotes` on Literal childs ([#29][]) - -[1.6.1]: https://github.com/yannickcr/eslint-plugin-react/compare/v1.6.0...v1.6.1 -[#30]: https://github.com/yannickcr/eslint-plugin-react/issues/30 -[#29]: https://github.com/yannickcr/eslint-plugin-react/issues/29 - -## [1.6.0] - 2015-03-22 -### Added -* Add `jsx-no-undef` rule -* Add `jsx-quotes` rule ([#12][]) -* Add `@jsx` pragma support ([#23][]) - -### Changed -* Allow `this.getState` references (not calls) in lifecycle methods ([#22][] @benmosher) -* Update dependencies - -### Fixed -* Fix `react-in-jsx-scope` in Node.js env -* Fix usage of propTypes with an external object ([#9][]) - -[1.6.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v1.5.0...v1.6.0 -[#12]: https://github.com/yannickcr/eslint-plugin-react/issues/12 -[#23]: https://github.com/yannickcr/eslint-plugin-react/issues/23 -[#9]: https://github.com/yannickcr/eslint-plugin-react/issues/9 -[#22]: https://github.com/yannickcr/eslint-plugin-react/pull/22 - -## [1.5.0] - 2015-03-14 -### Added -* Add `jsx-uses-vars` rule - -### Fixed -* Fix `jsx-uses-react` for ESLint 0.17.0 - -[1.5.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v1.4.1...v1.5.0 - -## [1.4.1] - 2015-03-03 -### Fixed -* Fix `this.props.children` marked as missing in props validation ([#7][]) -* Fix usage of `this.props` without property ([#8][]) - -[1.4.1]: https://github.com/yannickcr/eslint-plugin-react/compare/v1.4.0...v1.4.1 -[#7]: https://github.com/yannickcr/eslint-plugin-react/issues/7 -[#8]: https://github.com/yannickcr/eslint-plugin-react/issues/8 - -## [1.4.0] - 2015-02-24 -### Added -* Add `react-in-jsx-scope` rule ([#5][] @glenjamin) -* Add `jsx-uses-react` rule ([#6][] @glenjamin) - -### Changed -* Update `prop-types` to check props usage insead of propTypes presence ([#4][]) - -[1.4.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v1.3.0...v1.4.0 -[#4]: https://github.com/yannickcr/eslint-plugin-react/issues/4 -[#5]: https://github.com/yannickcr/eslint-plugin-react/pull/5 -[#6]: https://github.com/yannickcr/eslint-plugin-react/pull/6 - -## [1.3.0] - 2015-02-24 -### Added -* Add `no-did-mount-set-state` rule -* Add `no-did-update-set-state` rule - -### Changed -* Update dependencies - -[1.3.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v1.2.2...v1.3.0 - -## [1.2.2] - 2015-02-09 -### Changed -* Update dependencies - -### Fixed -* Fix childs detection in `self-closing-comp` ([#3][]) - -[1.2.2]: https://github.com/yannickcr/eslint-plugin-react/compare/v1.2.1...v1.2.2 -[#3]: https://github.com/yannickcr/eslint-plugin-react/issues/3 - -## [1.2.1] - 2015-01-29 -### Changed -* Update Readme -* Update dependencies -* Update `wrap-multilines` and `self-closing-comp` rules for ESLint 0.13.0 - -[1.2.1]: https://github.com/yannickcr/eslint-plugin-react/compare/v1.2.0...v1.2.1 - -## [1.2.0] - 2014-12-29 -### Added -* Add `self-closing-comp` rule - -### Fixed -* Fix `display-name` and `prop-types` rules - -[1.2.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v1.1.0...v1.2.0 - -## [1.1.0] - 2014-12-28 -### Added - * Add `display-name` rule - * Add `wrap-multilines` rule - * Add rules documentation - * Add rules tests - -[1.1.0]: https://github.com/yannickcr/eslint-plugin-react/compare/v1.0.0...v1.1.0 - -## 1.0.0 - 2014-12-16 -### Added - * First revision diff --git a/node_modules/eslint-plugin-react/LICENSE b/node_modules/eslint-plugin-react/LICENSE deleted file mode 100644 index 6b5a43e..0000000 --- a/node_modules/eslint-plugin-react/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Yannick Croissant - -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. - diff --git a/node_modules/eslint-plugin-react/README.md b/node_modules/eslint-plugin-react/README.md deleted file mode 100644 index a9c82af..0000000 --- a/node_modules/eslint-plugin-react/README.md +++ /dev/null @@ -1,186 +0,0 @@ -ESLint-plugin-React -=================== - -[![Maintenance Status][status-image]][status-url] [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Build Status][appveyor-image]][appveyor-url] [![Dependency Status][deps-image]][deps-url] [![Coverage Status][coverage-image]][coverage-url] [![Code Climate][climate-image]][climate-url] - -React specific linting rules for ESLint - -# Installation - -Install [ESLint](https://www.github.com/eslint/eslint) either locally or globally. - -```sh -$ npm install eslint -``` - -If you installed `ESLint` globally, you have to install React plugin globally too. Otherwise, install it locally. - -```sh -$ npm install eslint-plugin-react -``` - -# Configuration - -Add `plugins` section and specify ESLint-plugin-React as a plugin. - -```json -{ - "plugins": [ - "react" - ] -} -``` - -You can also specify some settings that will be shared across all the plugin rules. - -```js -{ - "settings": { - "react": { - "pragma": "React" // Pragma to use, default to "React" - } - } -} -``` - -If it is not already the case you must also configure `ESLint` to support JSX. - -With ESLint 1.x.x: - -```json -{ - "ecmaFeatures": { - "jsx": true - } -} -``` - -With ESLint 2.x.x: - -```json -{ - "parserOptions": { - "ecmaFeatures": { - "jsx": true - } - } -} -``` - -Finally, enable all of the rules that you would like to use. - -```json -{ - "rules": { - "react/display-name": 1, - "react/forbid-prop-types": 1, - "react/jsx-boolean-value": 1, - "react/jsx-closing-bracket-location": 1, - "react/jsx-curly-spacing": 1, - "react/jsx-equals-spacing": 1, - "react/jsx-handler-names": 1, - "react/jsx-indent-props": 1, - "react/jsx-indent": 1, - "react/jsx-key": 1, - "react/jsx-max-props-per-line": 1, - "react/jsx-no-bind": 1, - "react/jsx-no-duplicate-props": 1, - "react/jsx-no-literals": 1, - "react/jsx-no-undef": 1, - "react/jsx-pascal-case": 1, - "react/jsx-quotes": 1, - "react/jsx-sort-prop-types": 1, - "react/jsx-sort-props": 1, - "react/jsx-uses-react": 1, - "react/jsx-uses-vars": 1, - "react/no-danger": 1, - "react/no-deprecated": 1, - "react/no-did-mount-set-state": 1, - "react/no-did-update-set-state": 1, - "react/no-direct-mutation-state": 1, - "react/no-is-mounted": 1, - "react/no-multi-comp": 1, - "react/no-set-state": 1, - "react/no-string-refs": 1, - "react/no-unknown-property": 1, - "react/prefer-es6-class": 1, - "react/prop-types": 1, - "react/react-in-jsx-scope": 1, - "react/require-extension": 1, - "react/self-closing-comp": 1, - "react/sort-comp": 1, - "react/wrap-multilines": 1 - } -} -``` - -# List of supported rules - -* [display-name](docs/rules/display-name.md): Prevent missing `displayName` in a React component definition -* [forbid-prop-types](docs/rules/forbid-prop-types.md): Forbid certain propTypes -* [jsx-boolean-value](docs/rules/jsx-boolean-value.md): Enforce boolean attributes notation in JSX (fixable) -* [jsx-closing-bracket-location](docs/rules/jsx-closing-bracket-location.md): Validate closing bracket location in JSX -* [jsx-curly-spacing](docs/rules/jsx-curly-spacing.md): Enforce or disallow spaces inside of curly braces in JSX attributes (fixable) -* [jsx-equals-spacing](docs/rules/jsx-equals-spacing.md): Enforce or disallow spaces around equal signs in JSX attributes -* [jsx-handler-names](docs/rules/jsx-handler-names.md): Enforce event handler naming conventions in JSX -* [jsx-indent-props](docs/rules/jsx-indent-props.md): Validate props indentation in JSX -* [jsx-indent](docs/rules/jsx-indent.md): Validate JSX indentation -* [jsx-key](docs/rules/jsx-key.md): Validate JSX has key prop when in array or iterator -* [jsx-max-props-per-line](docs/rules/jsx-max-props-per-line.md): Limit maximum of props on a single line in JSX -* [jsx-no-bind](docs/rules/jsx-no-bind.md): Prevent usage of `.bind()` and arrow functions in JSX props -* [jsx-no-duplicate-props](docs/rules/jsx-no-duplicate-props.md): Prevent duplicate props in JSX -* [jsx-no-literals](docs/rules/jsx-no-literals.md): Prevent usage of unwrapped JSX strings -* [jsx-no-undef](docs/rules/jsx-no-undef.md): Disallow undeclared variables in JSX -* [jsx-pascal-case](docs/rules/jsx-pascal-case.md): Enforce PascalCase for user-defined JSX components -* [jsx-quotes](docs/rules/jsx-quotes.md): Enforce quote style for JSX attributes -* [jsx-sort-prop-types](docs/rules/jsx-sort-prop-types.md): Enforce propTypes declarations alphabetical sorting -* [jsx-sort-props](docs/rules/jsx-sort-props.md): Enforce props alphabetical sorting -* [jsx-uses-react](docs/rules/jsx-uses-react.md): Prevent React to be incorrectly marked as unused -* [jsx-uses-vars](docs/rules/jsx-uses-vars.md): Prevent variables used in JSX to be incorrectly marked as unused -* [no-danger](docs/rules/no-danger.md): Prevent usage of dangerous JSX properties -* [no-deprecated](docs/rules/no-deprecated.md): Prevent usage of deprecated methods -* [no-did-mount-set-state](docs/rules/no-did-mount-set-state.md): Prevent usage of `setState` in `componentDidMount` -* [no-did-update-set-state](docs/rules/no-did-update-set-state.md): Prevent usage of `setState` in `componentDidUpdate` -* [no-direct-mutation-state](docs/rules/no-direct-mutation-state.md): Prevent direct mutation of `this.state` -* [no-is-mounted](docs/rules/no-is-mounted.md): Prevent usage of `isMounted` -* [no-multi-comp](docs/rules/no-multi-comp.md): Prevent multiple component definition per file -* [no-set-state](docs/rules/no-set-state.md): Prevent usage of `setState` -* [no-string-refs](docs/rules/no-string-refs.md): Prevent using string references in `ref` attribute. -* [no-unknown-property](docs/rules/no-unknown-property.md): Prevent usage of unknown DOM property (fixable) -* [prefer-es6-class](docs/rules/prefer-es6-class.md): Enforce ES5 or ES6 class for React Components -* [prop-types](docs/rules/prop-types.md): Prevent missing props validation in a React component definition -* [react-in-jsx-scope](docs/rules/react-in-jsx-scope.md): Prevent missing `React` when using JSX -* [require-extension](docs/rules/require-extension.md): Restrict file extensions that may be required -* [self-closing-comp](docs/rules/self-closing-comp.md): Prevent extra closing tags for components without children -* [sort-comp](docs/rules/sort-comp.md): Enforce component methods order -* [wrap-multilines](docs/rules/wrap-multilines.md): Prevent missing parentheses around multilines JSX (fixable) - -## React Native - -If you're searching for React Native specific linting rules, check out [eslint-plugin-react-native](https://github.com/Intellicode/eslint-plugin-react-native). - -# License - -ESLint-plugin-React is licensed under the [MIT License](http://www.opensource.org/licenses/mit-license.php). - - -[npm-url]: https://npmjs.org/package/eslint-plugin-react -[npm-image]: https://img.shields.io/npm/v/eslint-plugin-react.svg - -[travis-url]: https://travis-ci.org/yannickcr/eslint-plugin-react -[travis-image]: https://img.shields.io/travis/yannickcr/eslint-plugin-react/master.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSItMTQyLjUgLTE0Mi41IDI4NSAyODUiPjxjaXJjbGUgcj0iMTQxLjciIGZpbGw9IiNERDQ4MTQiLz48ZyBpZD0iYSIgZmlsbD0iI0ZGRiI%2BPGNpcmNsZSBjeD0iLTk2LjQiIHI9IjE4LjkiLz48cGF0aCBkPSJNLTQ1LjYgNjguNGMtMTYuNi0xMS0yOS0yOC0zNC00Ny44IDYtNSA5LjgtMTIuMyA5LjgtMjAuNnMtMy44LTE1LjctOS44LTIwLjZjNS0xOS44IDE3LjQtMzYuNyAzNC00Ny44bDEzLjggMjMuMkMtNDYtMzUuMi01NS4zLTE4LjctNTUuMyAwYzAgMTguNyA5LjMgMzUuMiAyMy41IDQ1LjJ6Ii8%2BPC9nPjx1c2UgeGxpbms6aHJlZj0iI2EiIHRyYW5zZm9ybT0icm90YXRlKDEyMCkiLz48dXNlIHhsaW5rOmhyZWY9IiNhIiB0cmFuc2Zvcm09InJvdGF0ZSgyNDApIi8%2BPC9zdmc%2B - -[appveyor-url]: https://ci.appveyor.com/project/yannickcr/eslint-plugin-react -[appveyor-image]: https://img.shields.io/appveyor/ci/yannickcr/eslint-plugin-react/master.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjEyOCIgaGVpZ2h0PSIxMjgiIHZpZXdCb3g9IjAgMCAxMjggMTI4Ij48ZyBmaWxsPSIjMUJBMUUyIiB0cmFuc2Zvcm09InNjYWxlKDgpIj48cGF0aCBkPSJNMCAyLjI2NWw2LjUzOS0uODg4LjAwMyA2LjI4OC02LjUzNi4wMzd6Ii8%2BPHBhdGggZD0iTTYuNTM2IDguMzlsLjAwNSA2LjI5My02LjUzNi0uODk2di01LjQ0eiIvPjxwYXRoIGQ9Ik03LjMyOCAxLjI2MWw4LjY3LTEuMjYxdjcuNTg1bC04LjY3LjA2OXoiLz48cGF0aCBkPSJNMTYgOC40NDlsLS4wMDIgNy41NTEtOC42Ny0xLjIyLS4wMTItNi4zNDV6Ii8%2BPC9nPjwvc3ZnPg== - -[deps-url]: https://david-dm.org/yannickcr/eslint-plugin-react -[deps-image]: https://img.shields.io/david/dev/yannickcr/eslint-plugin-react.svg - -[coverage-url]: https://coveralls.io/r/yannickcr/eslint-plugin-react?branch=master -[coverage-image]: https://img.shields.io/coveralls/yannickcr/eslint-plugin-react/master.svg - -[climate-url]: https://codeclimate.com/github/yannickcr/eslint-plugin-react -[climate-image]: https://img.shields.io/codeclimate/github/yannickcr/eslint-plugin-react.svg - -[status-url]: https://github.com/yannickcr/eslint-plugin-react/pulse -[status-image]: https://img.shields.io/badge/status-maintained-brightgreen.svg diff --git a/node_modules/eslint-plugin-react/index.js b/node_modules/eslint-plugin-react/index.js deleted file mode 100644 index ad33d96..0000000 --- a/node_modules/eslint-plugin-react/index.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict'; - -module.exports = { - rules: { - 'jsx-uses-react': require('./lib/rules/jsx-uses-react'), - 'no-multi-comp': require('./lib/rules/no-multi-comp'), - 'prop-types': require('./lib/rules/prop-types'), - 'display-name': require('./lib/rules/display-name'), - 'wrap-multilines': require('./lib/rules/wrap-multilines'), - 'self-closing-comp': require('./lib/rules/self-closing-comp'), - 'no-danger': require('./lib/rules/no-danger'), - 'no-set-state': require('./lib/rules/no-set-state'), - 'no-is-mounted': require('./lib/rules/no-is-mounted'), - 'no-deprecated': require('./lib/rules/no-deprecated'), - 'no-did-mount-set-state': require('./lib/rules/no-did-mount-set-state'), - 'no-did-update-set-state': require('./lib/rules/no-did-update-set-state'), - 'react-in-jsx-scope': require('./lib/rules/react-in-jsx-scope'), - 'jsx-uses-vars': require('./lib/rules/jsx-uses-vars'), - 'jsx-handler-names': require('./lib/rules/jsx-handler-names'), - 'jsx-pascal-case': require('./lib/rules/jsx-pascal-case'), - 'jsx-no-bind': require('./lib/rules/jsx-no-bind'), - 'jsx-no-undef': require('./lib/rules/jsx-no-undef'), - 'jsx-quotes': require('./lib/rules/jsx-quotes'), - 'no-unknown-property': require('./lib/rules/no-unknown-property'), - 'jsx-curly-spacing': require('./lib/rules/jsx-curly-spacing'), - 'jsx-equals-spacing': require('./lib/rules/jsx-equals-spacing'), - 'jsx-sort-props': require('./lib/rules/jsx-sort-props'), - 'jsx-sort-prop-types': require('./lib/rules/jsx-sort-prop-types'), - 'jsx-boolean-value': require('./lib/rules/jsx-boolean-value'), - 'sort-comp': require('./lib/rules/sort-comp'), - 'require-extension': require('./lib/rules/require-extension'), - 'jsx-no-duplicate-props': require('./lib/rules/jsx-no-duplicate-props'), - 'jsx-max-props-per-line': require('./lib/rules/jsx-max-props-per-line'), - 'jsx-no-literals': require('./lib/rules/jsx-no-literals'), - 'jsx-indent-props': require('./lib/rules/jsx-indent-props'), - 'jsx-indent': require('./lib/rules/jsx-indent'), - 'jsx-closing-bracket-location': require('./lib/rules/jsx-closing-bracket-location'), - 'no-direct-mutation-state': require('./lib/rules/no-direct-mutation-state'), - 'forbid-prop-types': require('./lib/rules/forbid-prop-types'), - 'prefer-es6-class': require('./lib/rules/prefer-es6-class'), - 'jsx-key': require('./lib/rules/jsx-key'), - 'no-string-refs': require('./lib/rules/no-string-refs') - }, - rulesConfig: { - 'jsx-uses-react': 0, - 'no-multi-comp': 0, - 'prop-types': 0, - 'display-name': 0, - 'wrap-multilines': 0, - 'self-closing-comp': 0, - 'no-deprecated': 0, - 'no-danger': 0, - 'no-set-state': 0, - 'no-is-mounted': 0, - 'no-did-mount-set-state': 0, - 'no-did-update-set-state': 0, - 'react-in-jsx-scope': 0, - 'jsx-uses-vars': 1, - 'jsx-handler-names': 0, - 'jsx-pascal-case': 0, - 'jsx-no-bind': 0, - 'jsx-no-undef': 0, - 'jsx-quotes': 0, - 'no-unknown-property': 0, - 'jsx-curly-spacing': 0, - 'jsx-equals-spacing': 0, - 'jsx-sort-props': 0, - 'jsx-sort-prop-types': 0, - 'jsx-boolean-value': 0, - 'sort-comp': 0, - 'require-extension': 0, - 'jsx-no-duplicate-props': 0, - 'jsx-max-props-per-line': 0, - 'jsx-no-literals': 0, - 'jsx-indent-props': 0, - 'jsx-indent': 0, - 'jsx-closing-bracket-location': 0, - 'no-direct-mutation-state': 0, - 'forbid-prop-types': 0, - 'prefer-es6-class': 0, - 'jsx-key': 0, - 'no-string-refs': 0 - } -}; diff --git a/node_modules/eslint-plugin-react/lib/rules/display-name.js b/node_modules/eslint-plugin-react/lib/rules/display-name.js deleted file mode 100644 index 728c843..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/display-name.js +++ /dev/null @@ -1,211 +0,0 @@ -/** - * @fileoverview Prevent missing displayName in a React component definition - * @author Yannick Croissant - */ -'use strict'; - -var Components = require('../util/Components'); - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = Components.detect(function(context, components, utils) { - - var config = context.options[0] || {}; - var acceptTranspilerName = config.acceptTranspilerName || false; - - var MISSING_MESSAGE = 'Component definition is missing display name'; - - /** - * Checks if we are declaring a display name - * @param {ASTNode} node The AST node being checked. - * @returns {Boolean} True if we are declaring a display name, false if not. - */ - function isDisplayNameDeclaration(node) { - // Special case for class properties - // (babel-eslint does not expose property name so we have to rely on tokens) - if (node.type === 'ClassProperty') { - var tokens = context.getFirstTokens(node, 2); - if ( - tokens[0].value === 'displayName' || - (tokens[1] && tokens[1].value === 'displayName') - ) { - return true; - } - return false; - } - - return Boolean( - node && - node.name === 'displayName' - ); - } - - /** - * Mark a prop type as declared - * @param {ASTNode} node The AST node being checked. - */ - function markDisplayNameAsDeclared(node) { - components.set(node, { - hasDisplayName: true - }); - } - - /** - * Reports missing display name for a given component - * @param {Object} component The component to process - */ - function reportMissingDisplayName(component) { - context.report( - component.node, - MISSING_MESSAGE, { - component: component.name - } - ); - } - - /** - * Checks if the component have a name set by the transpiler - * @param {ASTNode} node The AST node being checked. - * @returns {Boolean} True ifcomponent have a name, false if not. - */ - function hasTranspilerName(node) { - var namedObjectAssignment = ( - node.type === 'ObjectExpression' && - node.parent && - node.parent.parent && - node.parent.parent.type === 'AssignmentExpression' && ( - !node.parent.parent.left.object || - node.parent.parent.left.object.name !== 'module' || - node.parent.parent.left.property.name !== 'exports' - ) - ); - var namedObjectDeclaration = ( - node.type === 'ObjectExpression' && - node.parent && - node.parent.parent && - node.parent.parent.type === 'VariableDeclarator' - ); - var namedClass = ( - node.type === 'ClassDeclaration' && - node.id && node.id.name - ); - - var namedFunctionDeclaration = ( - (node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression') && - node.id && - node.id.name - ); - - var namedFunctionExpression = ( - (node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression') && - node.parent && - (node.parent.type === 'VariableDeclarator' || node.parent.method === true) - ); - - if ( - namedObjectAssignment || namedObjectDeclaration || - namedClass || - namedFunctionDeclaration || namedFunctionExpression - ) { - return true; - } - return false; - } - - // -------------------------------------------------------------------------- - // Public - // -------------------------------------------------------------------------- - - return { - - ClassProperty: function(node) { - if (!isDisplayNameDeclaration(node)) { - return; - } - markDisplayNameAsDeclared(node); - }, - - MemberExpression: function(node) { - if (!isDisplayNameDeclaration(node.property)) { - return; - } - var component = utils.getRelatedComponent(node); - if (!component) { - return; - } - markDisplayNameAsDeclared(component.node); - }, - - FunctionExpression: function(node) { - if (!acceptTranspilerName || !hasTranspilerName(node)) { - return; - } - markDisplayNameAsDeclared(node); - }, - - FunctionDeclaration: function(node) { - if (!acceptTranspilerName || !hasTranspilerName(node)) { - return; - } - markDisplayNameAsDeclared(node); - }, - - ArrowFunctionExpression: function(node) { - if (!acceptTranspilerName || !hasTranspilerName(node)) { - return; - } - markDisplayNameAsDeclared(node); - }, - - MethodDefinition: function(node) { - if (!isDisplayNameDeclaration(node.key)) { - return; - } - markDisplayNameAsDeclared(node); - }, - - ClassDeclaration: function(node) { - if (!acceptTranspilerName || !hasTranspilerName(node)) { - return; - } - markDisplayNameAsDeclared(node); - }, - - ObjectExpression: function(node) { - if (!acceptTranspilerName || !hasTranspilerName(node)) { - // Search for the displayName declaration - node.properties.forEach(function(property) { - if (!property.key || !isDisplayNameDeclaration(property.key)) { - return; - } - markDisplayNameAsDeclared(node); - }); - return; - } - markDisplayNameAsDeclared(node); - }, - - 'Program:exit': function() { - var list = components.list(); - // Report missing display name for all components - for (var component in list) { - if (!list.hasOwnProperty(component) || list[component].hasDisplayName) { - continue; - } - reportMissingDisplayName(list[component]); - } - } - }; -}); - -module.exports.schema = [{ - type: 'object', - properties: { - acceptTranspilerName: { - type: 'boolean' - } - }, - additionalProperties: false -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/forbid-prop-types.js b/node_modules/eslint-plugin-react/lib/rules/forbid-prop-types.js deleted file mode 100644 index bebce09..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/forbid-prop-types.js +++ /dev/null @@ -1,128 +0,0 @@ -/** - * @fileoverview Forbid certain propTypes - */ -'use strict'; - -// ------------------------------------------------------------------------------ -// Constants -// ------------------------------------------------------------------------------ - -var DEFAULTS = ['any', 'array', 'object']; - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function(context) { - - function isForbidden(type) { - var configuration = context.options[0] || {}; - - var forbid = configuration.forbid || DEFAULTS; - return forbid.indexOf(type) >= 0; - } - - /** - * Checks if node is `propTypes` declaration - * @param {ASTNode} node The AST node being checked. - * @returns {Boolean} True if node is `propTypes` declaration, false if not. - */ - function isPropTypesDeclaration(node) { - - // Special case for class properties - // (babel-eslint does not expose property name so we have to rely on tokens) - if (node.type === 'ClassProperty') { - var tokens = context.getFirstTokens(node, 2); - if (tokens[0].value === 'propTypes' || (tokens[1] && tokens[1].value === 'propTypes')) { - return true; - } - return false; - } - - return Boolean( - node && - node.name === 'propTypes' - ); - } - - - /** - * Checks if propTypes declarations are forbidden - * @param {Array} declarations The array of AST nodes being checked. - * @returns {void} - */ - function checkForbidden(declarations) { - declarations.forEach(function(declaration) { - var target; - var value = declaration.value; - if ( - value.type === 'MemberExpression' && - value.property && - value.property.name && - value.property.name === 'isRequired' - ) { - value = value.object; - } - if ( - value.type === 'CallExpression' && - value.callee.type === 'MemberExpression' - ) { - value = value.callee; - } - if (value.property) { - target = value.property.name; - } else if (value.type === 'Identifier') { - target = value.name; - } - if (isForbidden(target)) { - context.report(declaration, 'Prop type `' + target + '` is forbidden'); - } - }); - } - - return { - ClassProperty: function(node) { - if (isPropTypesDeclaration(node) && node.value && node.value.type === 'ObjectExpression') { - checkForbidden(node.value.properties); - } - }, - - MemberExpression: function(node) { - if (isPropTypesDeclaration(node.property)) { - var right = node.parent.right; - if (right && right.type === 'ObjectExpression') { - checkForbidden(right.properties); - } - } - }, - - ObjectExpression: function(node) { - node.properties.forEach(function(property) { - if (!property.key) { - return; - } - - if (!isPropTypesDeclaration(property.key)) { - return; - } - if (property.value.type === 'ObjectExpression') { - checkForbidden(property.value.properties); - } - }); - } - - }; -}; - -module.exports.schema = [{ - type: 'object', - properties: { - forbid: { - type: 'array', - items: { - type: 'string' - } - } - }, - additionalProperties: true -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-boolean-value.js b/node_modules/eslint-plugin-react/lib/rules/jsx-boolean-value.js deleted file mode 100644 index e4169e0..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/jsx-boolean-value.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @fileoverview Enforce boolean attributes notation in JSX - * @author Yannick Croissant - */ -'use strict'; - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function(context) { - - var configuration = context.options[0] || 'never'; - - var NEVER_MESSAGE = 'Value must be omitted for boolean attributes'; - var ALWAYS_MESSAGE = 'Value must be set for boolean attributes'; - - return { - JSXAttribute: function(node) { - switch (configuration) { - case 'always': - if (node.value === null) { - context.report({ - node: node, - message: ALWAYS_MESSAGE, - fix: function(fixer) { - return fixer.insertTextAfter(node, '={true}'); - } - }); - } - break; - case 'never': - if (node.value && node.value.type === 'JSXExpressionContainer' && node.value.expression.value === true) { - context.report({ - node: node, - message: NEVER_MESSAGE, - fix: function(fixer) { - return fixer.removeRange([node.name.range[1], node.value.range[1]]); - } - }); - } - break; - default: - break; - } - } - }; -}; - -module.exports.schema = [{ - enum: ['always', 'never'] -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-closing-bracket-location.js b/node_modules/eslint-plugin-react/lib/rules/jsx-closing-bracket-location.js deleted file mode 100644 index f6202af..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/jsx-closing-bracket-location.js +++ /dev/null @@ -1,199 +0,0 @@ -/** - * @fileoverview Validate closing bracket location in JSX - * @author Yannick Croissant - */ -'use strict'; - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ -module.exports = function(context) { - - var MESSAGE = 'The closing bracket must be {{location}}{{details}}'; - var MESSAGE_LOCATION = { - 'after-props': 'placed after the last prop', - 'after-tag': 'placed after the opening tag', - 'props-aligned': 'aligned with the last prop', - 'tag-aligned': 'aligned with the opening tag', - 'line-aligned': 'aligned with the line containing the opening tag' - }; - var DEFAULT_LOCATION = 'tag-aligned'; - - var config = context.options[0]; - var options = { - nonEmpty: DEFAULT_LOCATION, - selfClosing: DEFAULT_LOCATION - }; - - if (typeof config === 'string') { - // simple shorthand [1, 'something'] - options.nonEmpty = config; - options.selfClosing = config; - } else if (typeof config === 'object') { - // [1, {location: 'something'}] (back-compat) - if (config.hasOwnProperty('location')) { - options.nonEmpty = config.location; - options.selfClosing = config.location; - } - // [1, {nonEmpty: 'something'}] - if (config.hasOwnProperty('nonEmpty')) { - options.nonEmpty = config.nonEmpty; - } - // [1, {selfClosing: 'something'}] - if (config.hasOwnProperty('selfClosing')) { - options.selfClosing = config.selfClosing; - } - } - - /** - * Get expected location for the closing bracket - * @param {Object} tokens Locations of the opening bracket, closing bracket and last prop - * @return {String} Expected location for the closing bracket - */ - function getExpectedLocation(tokens) { - var location; - // Is always after the opening tag if there is no props - if (typeof tokens.lastProp === 'undefined') { - location = 'after-tag'; - // Is always after the last prop if this one is on the same line as the opening bracket - } else if (tokens.opening.line === tokens.lastProp.line) { - location = 'after-props'; - // Else use configuration dependent on selfClosing property - } else { - location = tokens.selfClosing ? options.selfClosing : options.nonEmpty; - } - return location; - } - - /** - * Get the correct 0-indexed column for the closing bracket, given the - * expected location. - * @param {Object} tokens Locations of the opening bracket, closing bracket and last prop - * @param {String} expectedLocation Expected location for the closing bracket - * @return {?Number} The correct column for the closing bracket, or null - */ - function getCorrectColumn(tokens, expectedLocation) { - switch (expectedLocation) { - case 'props-aligned': - return tokens.lastProp.column; - case 'tag-aligned': - return tokens.opening.column; - case 'line-aligned': - return tokens.openingStartOfLine.column; - default: - return null; - } - } - - /** - * Check if the closing bracket is correctly located - * @param {Object} tokens Locations of the opening bracket, closing bracket and last prop - * @param {String} expectedLocation Expected location for the closing bracket - * @return {Boolean} True if the closing bracket is correctly located, false if not - */ - function hasCorrectLocation(tokens, expectedLocation) { - switch (expectedLocation) { - case 'after-tag': - return tokens.tag.line === tokens.closing.line; - case 'after-props': - return tokens.lastProp.line === tokens.closing.line; - case 'props-aligned': - case 'tag-aligned': - case 'line-aligned': - var correctColumn = getCorrectColumn(tokens, expectedLocation); - return correctColumn === tokens.closing.column; - default: - return true; - } - } - - /** - * Get the locations of the opening bracket, closing bracket, last prop, and - * start of opening line. - * @param {ASTNode} node The node to check - * @return {Object} Locations of the opening bracket, closing bracket, last - * prop and start of opening line. - */ - function getTokensLocations(node) { - var opening = context.getFirstToken(node).loc.start; - var closing = context.getLastTokens(node, node.selfClosing ? 2 : 1)[0].loc.start; - var tag = context.getFirstToken(node.name).loc.start; - var lastProp; - if (node.attributes.length) { - lastProp = node.attributes[node.attributes.length - 1]; - lastProp = { - column: context.getFirstToken(lastProp).loc.start.column, - line: context.getLastToken(lastProp).loc.end.line - }; - } - var openingLine = context.getSourceCode().lines[opening.line - 1]; - var openingStartOfLine = { - column: /^\s*/.exec(openingLine)[0].length, - line: opening.line - }; - return { - tag: tag, - opening: opening, - closing: closing, - lastProp: lastProp, - selfClosing: node.selfClosing, - openingStartOfLine: openingStartOfLine - }; - } - - return { - JSXOpeningElement: function(node) { - var tokens = getTokensLocations(node); - var expectedLocation = getExpectedLocation(tokens); - if (hasCorrectLocation(tokens, expectedLocation)) { - return; - } - - var data = {location: MESSAGE_LOCATION[expectedLocation], details: ''}; - var correctColumn = getCorrectColumn(tokens, expectedLocation); - - if (correctColumn !== null) { - var expectedNextLine = tokens.lastProp && - (tokens.lastProp.line === tokens.closing.line); - data.details = ' (expected column ' + (correctColumn + 1) + - (expectedNextLine ? ' on the next line)' : ')'); - } - - context.report({ - node: node, - loc: tokens.closing, - message: MESSAGE, - data: data - }); - } - }; - -}; - -module.exports.schema = [{ - oneOf: [ - { - enum: ['after-props', 'props-aligned', 'tag-aligned', 'line-aligned'] - }, - { - type: 'object', - properties: { - location: { - enum: ['after-props', 'props-aligned', 'tag-aligned', 'line-aligned'] - } - }, - additionalProperties: false - }, { - type: 'object', - properties: { - nonEmpty: { - enum: ['after-props', 'props-aligned', 'tag-aligned', 'line-aligned', false] - }, - selfClosing: { - enum: ['after-props', 'props-aligned', 'tag-aligned', 'line-aligned', false] - } - }, - additionalProperties: false - } - ] -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-curly-spacing.js b/node_modules/eslint-plugin-react/lib/rules/jsx-curly-spacing.js deleted file mode 100644 index 8dbc78d..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/jsx-curly-spacing.js +++ /dev/null @@ -1,217 +0,0 @@ -/** - * @fileoverview Enforce or disallow spaces inside of curly braces in JSX attributes. - * @author Jamund Ferguson - * @author Brandyn Bennett - * @author Michael Ficarra - * @author Vignesh Anand - * @author Jamund Ferguson - * @author Yannick Croissant - * @author Erik Wendel - */ -'use strict'; - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function(context) { - var spaced = context.options[0] === 'always'; - var multiline = context.options[1] ? context.options[1].allowMultiline : true; - - // -------------------------------------------------------------------------- - // Helpers - // -------------------------------------------------------------------------- - - /** - * Determines whether two adjacent tokens have a newline between them. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {boolean} Whether or not there is a newline between the tokens. - */ - function isMultiline(left, right) { - return left.loc.start.line !== right.loc.start.line; - } - - /** - * Determines whether two adjacent tokens have whitespace between them. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {boolean} Whether or not there is space between the tokens. - */ - function isSpaced(left, right) { - return left.range[1] < right.range[0]; - } - - /** - * Reports that there shouldn't be a newline after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportNoBeginningNewline(node, token) { - context.report({ - node: node, - loc: token.loc.start, - message: 'There should be no newline after \'' + token.value + '\'', - fix: function(fixer) { - var nextToken = context.getSourceCode().getTokenAfter(token); - return fixer.replaceTextRange([token.range[1], nextToken.range[0]], spaced ? ' ' : ''); - } - }); - } - - /** - * Reports that there shouldn't be a newline before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportNoEndingNewline(node, token) { - context.report({ - node: node, - loc: token.loc.start, - message: 'There should be no newline before \'' + token.value + '\'', - fix: function(fixer) { - var previousToken = context.getSourceCode().getTokenBefore(token); - return fixer.replaceTextRange([previousToken.range[1], token.range[0]], spaced ? ' ' : ''); - } - }); - } - - /** - * Reports that there shouldn't be a space after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportNoBeginningSpace(node, token) { - context.report({ - node: node, - loc: token.loc.start, - message: 'There should be no space after \'' + token.value + '\'', - fix: function(fixer) { - var nextToken = context.getSourceCode().getTokenAfter(token); - return fixer.removeRange([token.range[1], nextToken.range[0]]); - } - }); - } - - /** - * Reports that there shouldn't be a space before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportNoEndingSpace(node, token) { - context.report({ - node: node, - loc: token.loc.start, - message: 'There should be no space before \'' + token.value + '\'', - fix: function(fixer) { - var previousToken = context.getSourceCode().getTokenBefore(token); - return fixer.removeRange([previousToken.range[1], token.range[0]]); - } - }); - } - - /** - * Reports that there should be a space after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportRequiredBeginningSpace(node, token) { - context.report({ - node: node, - loc: token.loc.start, - message: 'A space is required after \'' + token.value + '\'', - fix: function(fixer) { - return fixer.insertTextAfter(token, ' '); - } - }); - } - - /** - * Reports that there should be a space before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportRequiredEndingSpace(node, token) { - context.report({ - node: node, - loc: token.loc.start, - message: 'A space is required before \'' + token.value + '\'', - fix: function(fixer) { - return fixer.insertTextBefore(token, ' '); - } - }); - } - - /** - * Determines if spacing in curly braces is valid. - * @param {ASTNode} node The AST node to check. - * @param {Token} first The first token to check (should be the opening brace) - * @param {Token} second The second token to check (should be first after the opening brace) - * @param {Token} penultimate The penultimate token to check (should be last before closing brace) - * @param {Token} last The last token to check (should be closing brace) - * @returns {void} - */ - function validateBraceSpacing(node, first, second, penultimate, last) { - if (spaced) { - if (!isSpaced(first, second)) { - reportRequiredBeginningSpace(node, first); - } else if (!multiline && isMultiline(first, second)) { - reportNoBeginningNewline(node, first); - } - - if (!isSpaced(penultimate, last)) { - reportRequiredEndingSpace(node, last); - } else if (!multiline && isMultiline(penultimate, last)) { - reportNoEndingNewline(node, last); - } - - return; - } - - // "never" setting if we get here. - if (isSpaced(first, second) && !(multiline && isMultiline(first, second))) { - reportNoBeginningSpace(node, first); - } - - if (isSpaced(penultimate, last) && !(multiline && isMultiline(penultimate, last))) { - reportNoEndingSpace(node, last); - } - } - - // -------------------------------------------------------------------------- - // Public - // -------------------------------------------------------------------------- - - return { - JSXExpressionContainer: function(node) { - var first = context.getFirstToken(node); - var second = context.getFirstToken(node, 1); - var penultimate = context.getLastToken(node, 1); - var last = context.getLastToken(node); - - if (first === penultimate && second === last) { - return; - } - - validateBraceSpacing(node, first, second, penultimate, last); - } - }; -}; - -module.exports.schema = [{ - enum: ['always', 'never'] -}, { - type: 'object', - properties: { - allowMultiline: { - type: 'boolean' - } - }, - additionalProperties: false -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-equals-spacing.js b/node_modules/eslint-plugin-react/lib/rules/jsx-equals-spacing.js deleted file mode 100644 index 7773c10..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/jsx-equals-spacing.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @fileoverview Disallow or enforce spaces around equal signs in JSX attributes. - * @author ryym - */ -'use strict'; - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function(context) { - var config = context.options[0]; - var sourceCode = context.getSourceCode(); - - /** - * Determines a given attribute node has an equal sign. - * @param {ASTNode} attrNode - The attribute node. - * @returns {boolean} Whether or not the attriute node has an equal sign. - */ - function hasEqual(attrNode) { - return attrNode.type !== 'JSXSpreadAttribute' && attrNode.value !== null; - } - - // -------------------------------------------------------------------------- - // Public - // -------------------------------------------------------------------------- - - return { - JSXOpeningElement: function(node) { - node.attributes.forEach(function(attrNode) { - if (!hasEqual(attrNode)) { - return; - } - - var equalToken = sourceCode.getTokenAfter(attrNode.name); - var spacedBefore = sourceCode.isSpaceBetweenTokens(attrNode.name, equalToken); - var spacedAfter = sourceCode.isSpaceBetweenTokens(equalToken, attrNode.value); - - switch (config) { - default: - case 'never': - if (spacedBefore) { - context.report(attrNode, equalToken.loc.start, - 'There should be no space before \'=\''); - } - if (spacedAfter) { - context.report(attrNode, equalToken.loc.start, - 'There should be no space after \'=\''); - } - break; - case 'always': - if (!spacedBefore) { - context.report(attrNode, equalToken.loc.start, - 'A space is required before \'=\''); - } - if (!spacedAfter) { - context.report(attrNode, equalToken.loc.start, - 'A space is required after \'=\''); - } - break; - } - }); - } - }; -}; - -module.exports.schema = [{ - enum: ['always', 'never'] -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-handler-names.js b/node_modules/eslint-plugin-react/lib/rules/jsx-handler-names.js deleted file mode 100644 index 2d2861e..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/jsx-handler-names.js +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @fileoverview Enforce event handler naming conventions in JSX - * @author Jake Marsh - */ -'use strict'; - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function(context) { - - var configuration = context.options[0] || {}; - var eventHandlerPrefix = configuration.eventHandlerPrefix || 'handle'; - var eventHandlerPropPrefix = configuration.eventHandlerPropPrefix || 'on'; - - var EVENT_HANDLER_REGEX = new RegExp('^((props\.' + eventHandlerPropPrefix + ')' - + '|((.*\.)?' + eventHandlerPrefix + ')).+$'); - var PROP_EVENT_HANDLER_REGEX = new RegExp('^(' + eventHandlerPropPrefix + '.+|ref)$'); - - return { - JSXAttribute: function(node) { - if (!node.value || !node.value.expression || !node.value.expression.object) { - return; - } - - var propKey = typeof node.name === 'object' ? node.name.name : node.name; - var propValue = context.getSource(node.value.expression).replace(/^this\./, ''); - - if (propKey === 'ref') { - return; - } - - var propIsEventHandler = PROP_EVENT_HANDLER_REGEX.test(propKey); - var propFnIsNamedCorrectly = EVENT_HANDLER_REGEX.test(propValue); - - if (propIsEventHandler && !propFnIsNamedCorrectly) { - context.report( - node, - 'Handler function for ' + propKey + ' prop key must begin with \'' + eventHandlerPrefix + '\'' - ); - } else if (propFnIsNamedCorrectly && !propIsEventHandler) { - context.report( - node, - 'Prop key for ' + propValue + ' must begin with \'' + eventHandlerPropPrefix + '\'' - ); - } - } - }; - -}; - -module.exports.schema = [{ - type: 'object', - properties: { - eventHandlerPrefix: { - type: 'string' - }, - eventHandlerPropPrefix: { - type: 'string' - } - }, - additionalProperties: false -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-indent-props.js b/node_modules/eslint-plugin-react/lib/rules/jsx-indent-props.js deleted file mode 100644 index 4ea259f..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/jsx-indent-props.js +++ /dev/null @@ -1,154 +0,0 @@ -/** - * @fileoverview Validate props indentation in JSX - * @author Yannick Croissant - - * This rule has been ported and modified from eslint and nodeca. - * @author Vitaly Puzrin - * @author Gyandeep Singh - * @copyright 2015 Vitaly Puzrin. All rights reserved. - * @copyright 2015 Gyandeep Singh. All rights reserved. - Copyright (C) 2014 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. - */ -'use strict'; - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ -module.exports = function(context) { - - var MESSAGE = 'Expected indentation of {{needed}} {{type}} {{characters}} but found {{gotten}}.'; - - var extraColumnStart = 0; - var indentType = 'space'; - var indentSize = 4; - - if (context.options.length) { - if (context.options[0] === 'tab') { - indentSize = 1; - indentType = 'tab'; - } else if (typeof context.options[0] === 'number') { - indentSize = context.options[0]; - indentType = 'space'; - } - } - - /** - * Reports a given indent violation and properly pluralizes the message - * @param {ASTNode} node Node violating the indent rule - * @param {Number} needed Expected indentation character count - * @param {Number} gotten Indentation character count in the actual node/code - * @param {Object=} loc Error line and column location - */ - function report(node, needed, gotten, loc) { - var msgContext = { - needed: needed, - type: indentType, - characters: needed === 1 ? 'character' : 'characters', - gotten: gotten - }; - - if (loc) { - context.report(node, loc, MESSAGE, msgContext); - } else { - context.report(node, MESSAGE, msgContext); - } - } - - /** - * Get node indent - * @param {ASTNode} node Node to examine - * @param {Boolean} byLastLine get indent of node's last line - * @param {Boolean} excludeCommas skip comma on start of line - * @return {Number} Indent - */ - function getNodeIndent(node, byLastLine, excludeCommas) { - byLastLine = byLastLine || false; - excludeCommas = excludeCommas || false; - - var src = context.getSource(node, node.loc.start.column + extraColumnStart); - var lines = src.split('\n'); - if (byLastLine) { - src = lines[lines.length - 1]; - } else { - src = lines[0]; - } - - var skip = excludeCommas ? ',' : ''; - - var regExp; - if (indentType === 'space') { - regExp = new RegExp('^[ ' + skip + ']+'); - } else { - regExp = new RegExp('^[\t' + skip + ']+'); - } - - var indent = regExp.exec(src); - return indent ? indent[0].length : 0; - } - - /** - * Checks node is the first in its own start line. By default it looks by start line. - * @param {ASTNode} node The node to check - * @param {Boolean} [byEndLocation] Lookup based on start position or end - * @return {Boolean} true if its the first in the its start line - */ - function isNodeFirstInLine(node, byEndLocation) { - var firstToken = byEndLocation === true ? context.getLastToken(node, 1) : context.getTokenBefore(node); - var startLine = byEndLocation === true ? node.loc.end.line : node.loc.start.line; - var endLine = firstToken ? firstToken.loc.end.line : -1; - - return startLine !== endLine; - } - - /** - * Check indent for nodes list - * @param {ASTNode[]} nodes list of node objects - * @param {Number} indent needed indent - * @param {Boolean} excludeCommas skip comma on start of line - */ - function checkNodesIndent(nodes, indent, excludeCommas) { - nodes.forEach(function(node) { - var nodeIndent = getNodeIndent(node, false, excludeCommas); - if ( - node.type !== 'ArrayExpression' && node.type !== 'ObjectExpression' && - nodeIndent !== indent && isNodeFirstInLine(node) - ) { - report(node, indent, nodeIndent); - } - }); - } - - return { - JSXOpeningElement: function(node) { - var elementIndent = getNodeIndent(node); - checkNodesIndent(node.attributes, elementIndent + indentSize); - } - }; - -}; - -module.exports.schema = [{ - oneOf: [{ - enum: ['tab'] - }, { - type: 'integer' - }] -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-indent.js b/node_modules/eslint-plugin-react/lib/rules/jsx-indent.js deleted file mode 100644 index 4e8adb3..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/jsx-indent.js +++ /dev/null @@ -1,162 +0,0 @@ -/** - * @fileoverview Validate props indentation in JSX - * @author Yannick Croissant - - * This rule has been ported and modified from eslint and nodeca. - * @author Vitaly Puzrin - * @author Gyandeep Singh - * @copyright 2015 Vitaly Puzrin. All rights reserved. - * @copyright 2015 Gyandeep Singh. All rights reserved. - Copyright (C) 2014 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. - */ -'use strict'; - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ -module.exports = function(context) { - - var MESSAGE = 'Expected indentation of {{needed}} {{type}} {{characters}} but found {{gotten}}.'; - - var extraColumnStart = 0; - var indentType = 'space'; - var indentSize = 4; - - if (context.options.length) { - if (context.options[0] === 'tab') { - indentSize = 1; - indentType = 'tab'; - } else if (typeof context.options[0] === 'number') { - indentSize = context.options[0]; - indentType = 'space'; - } - } - - /** - * Reports a given indent violation and properly pluralizes the message - * @param {ASTNode} node Node violating the indent rule - * @param {Number} needed Expected indentation character count - * @param {Number} gotten Indentation character count in the actual node/code - * @param {Object=} loc Error line and column location - */ - function report(node, needed, gotten, loc) { - var msgContext = { - needed: needed, - type: indentType, - characters: needed === 1 ? 'character' : 'characters', - gotten: gotten - }; - - if (loc) { - context.report(node, loc, MESSAGE, msgContext); - } else { - context.report(node, MESSAGE, msgContext); - } - } - - /** - * Get node indent - * @param {ASTNode} node Node to examine - * @param {Boolean} byLastLine get indent of node's last line - * @param {Boolean} excludeCommas skip comma on start of line - * @return {Number} Indent - */ - function getNodeIndent(node, byLastLine, excludeCommas) { - byLastLine = byLastLine || false; - excludeCommas = excludeCommas || false; - - var src = context.getSource(node, node.loc.start.column + extraColumnStart); - var lines = src.split('\n'); - if (byLastLine) { - src = lines[lines.length - 1]; - } else { - src = lines[0]; - } - - var skip = excludeCommas ? ',' : ''; - - var regExp; - if (indentType === 'space') { - regExp = new RegExp('^[ ' + skip + ']+'); - } else { - regExp = new RegExp('^[\t' + skip + ']+'); - } - - var indent = regExp.exec(src); - return indent ? indent[0].length : 0; - } - - /** - * Checks node is the first in its own start line. By default it looks by start line. - * @param {ASTNode} node The node to check - * @return {Boolean} true if its the first in the its start line - */ - function isNodeFirstInLine(node) { - var token = node; - do { - token = context.getTokenBefore(token); - } while (token.type === 'JSXText'); - var startLine = node.loc.start.line; - var endLine = token ? token.loc.end.line : -1; - - return startLine !== endLine; - } - - /** - * Check indent for nodes list - * @param {ASTNode[]} nodes list of node objects - * @param {Number} indent needed indent - * @param {Boolean} excludeCommas skip comma on start of line - */ - function checkNodesIndent(node, indent, excludeCommas) { - var nodeIndent = getNodeIndent(node, false, excludeCommas); - if (nodeIndent !== indent && isNodeFirstInLine(node)) { - report(node, indent, nodeIndent); - } - } - - return { - JSXOpeningElement: function(node) { - if (!node.parent || !node.parent.parent) { - return; - } - var parentElementIndent = getNodeIndent(node.parent.parent); - var indent = node.parent.parent.loc.start.line === node.loc.start.line ? 0 : indentSize; - checkNodesIndent(node, parentElementIndent + indent); - }, - JSXClosingElement: function(node) { - if (!node.parent) { - return; - } - var peerElementIndent = getNodeIndent(node.parent.openingElement); - checkNodesIndent(node, peerElementIndent); - } - }; - -}; - -module.exports.schema = [{ - oneOf: [{ - enum: ['tab'] - }, { - type: 'integer' - }] -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-key.js b/node_modules/eslint-plugin-react/lib/rules/jsx-key.js deleted file mode 100644 index 11f4cd2..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/jsx-key.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * @fileoverview Report missing `key` props in iterators/collection literals. - * @author Ben Mosher - */ -'use strict'; - -// var Components = require('../util/Components'); - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function(context) { - - function hasKeyProp(node) { - return node.openingElement.attributes.some(function(decl) { - if (decl.type === 'JSXSpreadAttribute') { - return false; - } - return (decl.name.name === 'key'); - }); - } - - function checkIteratorElement(node) { - if (node.type === 'JSXElement' && !hasKeyProp(node)) { - context.report(node, 'Missing "key" prop for element in iterator'); - } - } - - function getReturnStatement(body) { - return body.filter(function(item) { - return item.type === 'ReturnStatement'; - })[0]; - } - - return { - JSXElement: function(node) { - if (hasKeyProp(node)) { - return; - } - - if (node.parent.type === 'ArrayExpression') { - context.report(node, 'Missing "key" prop for element in array'); - } - }, - - // Array.prototype.map - CallExpression: function (node) { - if (node.callee && node.callee.property && node.callee.property.name !== 'map') { - return; - } - - var fn = node.arguments[0]; - var isFn = fn && fn.type === 'FunctionExpression'; - var isArrFn = fn && fn.type === 'ArrowFunctionExpression'; - - if (isArrFn && fn.body.type === 'JSXElement') { - checkIteratorElement(fn.body); - } - - if (isFn || isArrFn) { - if (fn.body.type === 'BlockStatement') { - var returnStatement = getReturnStatement(fn.body.body); - if (returnStatement && returnStatement.argument) { - checkIteratorElement(returnStatement.argument); - } - } - } - } - }; -}; - -module.exports.schema = []; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-max-props-per-line.js b/node_modules/eslint-plugin-react/lib/rules/jsx-max-props-per-line.js deleted file mode 100644 index 817974f..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/jsx-max-props-per-line.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @fileoverview Limit maximum of props on a single line in JSX - * @author Yannick Croissant - */ - -'use strict'; - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function (context) { - - var configuration = context.options[0] || {}; - var maximum = configuration.maximum || 1; - - function getPropName(propNode) { - if (propNode.type === 'JSXSpreadAttribute') { - return context.getSource(propNode.argument); - } - return propNode.name.name; - } - - return { - JSXOpeningElement: function (node) { - var props = {}; - - node.attributes.forEach(function(decl) { - var line = decl.loc.start.line; - if (props[line]) { - props[line].push(decl); - } else { - props[line] = [decl]; - } - }); - - for (var line in props) { - if (!props.hasOwnProperty(line)) { - continue; - } - if (props[line].length > maximum) { - var name = getPropName(props[line][maximum]); - context.report(props[line][maximum], 'Prop `' + name + '` must be placed on a new line'); - break; - } - } - } - }; -}; - -module.exports.schema = [{ - type: 'object', - properties: { - maximum: { - type: 'integer', - minimum: 1 - } - } -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-no-bind.js b/node_modules/eslint-plugin-react/lib/rules/jsx-no-bind.js deleted file mode 100644 index 349741c..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/jsx-no-bind.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @fileoverview Prevents usage of Function.prototype.bind and arrow functions - * in React component definition. - * @author Daniel Lo Nigro - */ -'use strict'; - -// ----------------------------------------------------------------------------- -// Rule Definition -// ----------------------------------------------------------------------------- - -module.exports = function(context) { - var configuration = context.options[0] || {}; - - return { - JSXAttribute: function(node) { - var isRef = configuration.ignoreRefs && node.name.name === 'ref'; - if (isRef || !node.value || !node.value.expression) { - return; - } - var valueNode = node.value.expression; - if ( - !configuration.allowBind && - valueNode.type === 'CallExpression' && - valueNode.callee.type === 'MemberExpression' && - valueNode.callee.property.name === 'bind' - ) { - context.report(node, 'JSX props should not use .bind()'); - } else if ( - !configuration.allowArrowFunctions && - valueNode.type === 'ArrowFunctionExpression' - ) { - context.report(node, 'JSX props should not use arrow functions'); - } - } - }; -}; - -module.exports.schema = [{ - type: 'object', - properties: { - allowArrowFunctions: { - default: false, - type: 'boolean' - }, - allowBind: { - default: false, - type: 'boolean' - }, - ignoreRefs: { - default: false, - type: 'boolean' - } - }, - additionalProperties: false -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-no-duplicate-props.js b/node_modules/eslint-plugin-react/lib/rules/jsx-no-duplicate-props.js deleted file mode 100644 index 0bdb84b..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/jsx-no-duplicate-props.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @fileoverview Enforce no duplicate props - * @author Markus Ånöstam - */ - -'use strict'; - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function (context) { - - var configuration = context.options[0] || {}; - var ignoreCase = configuration.ignoreCase || false; - - return { - JSXOpeningElement: function (node) { - var props = {}; - - node.attributes.forEach(function(decl) { - if (decl.type === 'JSXSpreadAttribute') { - return; - } - - var name = decl.name.name; - - if (ignoreCase) { - name = name.toLowerCase(); - } - - if (props.hasOwnProperty(name)) { - context.report(decl, 'No duplicate props allowed'); - } else { - props[name] = 1; - } - }); - } - }; -}; - -module.exports.schema = [{ - type: 'object', - properties: { - ignoreCase: { - type: 'boolean' - } - }, - additionalProperties: false -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-no-literals.js b/node_modules/eslint-plugin-react/lib/rules/jsx-no-literals.js deleted file mode 100644 index eaf29bf..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/jsx-no-literals.js +++ /dev/null @@ -1,43 +0,0 @@ -/* -* @fileoverview Prevent using string literals in React component definition -* @author Caleb Morris -*/ -'use strict'; - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function(context) { - - function reportLiteralNode(node) { - context.report(node, 'Missing JSX expression container around literal string'); - } - - // -------------------------------------------------------------------------- - // Public - // -------------------------------------------------------------------------- - - return { - - Literal: function(node) { - if ( - !/^[\s]+$/.test(node.value) && - node.parent && - node.parent.type !== 'JSXExpressionContainer' && - node.parent.type !== 'JSXAttribute' && - node.parent.type.indexOf('JSX') !== -1 - ) { - reportLiteralNode(node); - } - } - - }; - -}; - -module.exports.schema = [{ - type: 'object', - properties: {}, - additionalProperties: false -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-no-undef.js b/node_modules/eslint-plugin-react/lib/rules/jsx-no-undef.js deleted file mode 100644 index baeb751..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/jsx-no-undef.js +++ /dev/null @@ -1,80 +0,0 @@ -/** - * @fileoverview Disallow undeclared variables in JSX - * @author Yannick Croissant - */ - -'use strict'; - -/** - * Checks if a node name match the JSX tag convention. - * @param {String} name - Name of the node to check. - * @returns {boolean} Whether or not the node name match the JSX tag convention. - */ -var tagConvention = /^[a-z]|\-/; -function isTagName(name) { - return tagConvention.test(name); -} - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Compare an identifier with the variables declared in the scope - * @param {ASTNode} node - Identifier or JSXIdentifier node - * @returns {void} - */ - function checkIdentifierInJSX(node) { - var scope = context.getScope(); - var variables = scope.variables; - var i; - var len; - - while (scope.type !== 'global') { - scope = scope.upper; - variables = scope.variables.concat(variables); - } - if (scope.childScopes.length) { - variables = scope.childScopes[0].variables.concat(variables); - // Temporary fix for babel-eslint - if (scope.childScopes[0].childScopes.length) { - variables = scope.childScopes[0].childScopes[0].variables.concat(variables); - } - } - - for (i = 0, len = variables.length; i < len; i++) { - if (variables[i].name === node.name) { - return; - } - } - - context.report(node, '\'' + node.name + '\' is not defined.'); - } - - return { - JSXOpeningElement: function(node) { - switch (node.name.type) { - case 'JSXIdentifier': - node = node.name; - break; - case 'JSXMemberExpression': - node = node.name.object; - break; - case 'JSXNamespacedName': - node = node.name.namespace; - break; - default: - break; - } - if (isTagName(node.name)) { - return; - } - checkIdentifierInJSX(node); - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-pascal-case.js b/node_modules/eslint-plugin-react/lib/rules/jsx-pascal-case.js deleted file mode 100644 index 918df86..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/jsx-pascal-case.js +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @fileoverview Enforce PasalCase for user-defined JSX components - * @author Jake Marsh - */ - -'use strict'; - -// ------------------------------------------------------------------------------ -// Constants -// ------------------------------------------------------------------------------ - -var PASCAL_CASE_REGEX = /^[A-Z0-9]+[a-z0-9]+(?:[A-Z0-9]+[a-z0-9]*)*$/; -var COMPAT_TAG_REGEX = /^[a-z]|\-/; - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - JSXOpeningElement: function(node) { - switch (node.name.type) { - case 'JSXIdentifier': - node = node.name; - break; - case 'JSXMemberExpression': - node = node.name.object; - break; - case 'JSXNamespacedName': - node = node.name.namespace; - break; - default: - break; - } - - var isPascalCase = PASCAL_CASE_REGEX.test(node.name); - var isCompatTag = COMPAT_TAG_REGEX.test(node.name); - - if (!isPascalCase && !isCompatTag) { - context.report(node, 'Imported JSX component ' + node.name + ' must be in PascalCase'); - } - } - }; - -}; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-quotes.js b/node_modules/eslint-plugin-react/lib/rules/jsx-quotes.js deleted file mode 100644 index ca97b02..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/jsx-quotes.js +++ /dev/null @@ -1,89 +0,0 @@ -/** - * @fileoverview Enforce props quotes style - * @author Matt DuVall , Brandon Payton, Yannick Croissant - */ -'use strict'; - -// ------------------------------------------------------------------------------ -// Constants -// ------------------------------------------------------------------------------ - -var QUOTE_SETTINGS = { - double: { - quote: '"', - alternateQuote: '\'', - description: 'doublequote' - }, - single: { - quote: '\'', - alternateQuote: '"', - description: 'singlequote' - } -}; - -var AVOID_ESCAPE = 'avoid-escape'; - -var isWarnedForDeprecation = false; - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Validate that a string passed in is surrounded by the specified character - * @param {string} val The text to check. - * @param {string} character The character to see if it's surrounded by. - * @returns {boolean} True if the text is surrounded by the character, false if not. - * @private - */ - function isSurroundedBy(val, character) { - return val[0] === character && val[val.length - 1] === character; - } - - return { - - Program: function() { - if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { - return; - } - /* eslint-disable no-console */ - console.log('The react/jsx-quotes rule is deprecated. Please use the jsx-quotes rule instead.'); - /* eslint-enable no-console */ - isWarnedForDeprecation = true; - }, - - Literal: function(node) { - - if (node.parent.type !== 'JSXAttribute') { - return; - } - var val = node.value; - var rawVal = node.raw; - var quoteOption = context.options[0]; - var settings = QUOTE_SETTINGS[quoteOption]; - var avoidEscape = context.options[1] === AVOID_ESCAPE; - var isValid; - - if (settings && typeof val === 'string') { - isValid = isSurroundedBy(rawVal, settings.quote); - - if (!isValid && avoidEscape) { - isValid = isSurroundedBy(rawVal, settings.alternateQuote) && rawVal.indexOf(settings.quote) >= 0; - } - - if (!isValid) { - context.report(node, 'JSX attributes must use ' + settings.description + '.'); - } - } - } - }; - -}; - -module.exports.schema = [{ - enum: ['single', 'double'] -}, { - enum: ['avoid-escape'] -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-sort-prop-types.js b/node_modules/eslint-plugin-react/lib/rules/jsx-sort-prop-types.js deleted file mode 100644 index 8dd0758..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/jsx-sort-prop-types.js +++ /dev/null @@ -1,154 +0,0 @@ -/** - * @fileoverview Enforce propTypes declarations alphabetical sorting - */ -'use strict'; - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function(context) { - - var configuration = context.options[0] || {}; - var requiredFirst = configuration.requiredFirst || false; - var callbacksLast = configuration.callbacksLast || false; - var ignoreCase = configuration.ignoreCase || false; - - /** - * Checks if node is `propTypes` declaration - * @param {ASTNode} node The AST node being checked. - * @returns {Boolean} True if node is `propTypes` declaration, false if not. - */ - function isPropTypesDeclaration(node) { - - // Special case for class properties - // (babel-eslint does not expose property name so we have to rely on tokens) - if (node.type === 'ClassProperty') { - var tokens = context.getFirstTokens(node, 2); - return (tokens[0] && tokens[0].value === 'propTypes') || - (tokens[1] && tokens[1].value === 'propTypes'); - } - - return Boolean( - node && - node.name === 'propTypes' - ); - } - - function getKey(node) { - return node.key.type === 'Identifier' ? node.key.name : node.key.value; - } - - function getValueName(node) { - return node.value.property && node.value.property.name; - } - - function isCallbackPropName(propName) { - return /^on[A-Z]/.test(propName); - } - - function isRequiredProp(node) { - return getValueName(node) === 'isRequired'; - } - - /** - * Checks if propTypes declarations are sorted - * @param {Array} declarations The array of AST nodes being checked. - * @returns {void} - */ - function checkSorted(declarations) { - declarations.reduce(function(prev, curr) { - var prevPropName = getKey(prev); - var currentPropName = getKey(curr); - var previousIsRequired = isRequiredProp(prev); - var currentIsRequired = isRequiredProp(curr); - var previousIsCallback = isCallbackPropName(prevPropName); - var currentIsCallback = isCallbackPropName(currentPropName); - - if (ignoreCase) { - prevPropName = prevPropName.toLowerCase(); - currentPropName = currentPropName.toLowerCase(); - } - - if (requiredFirst) { - if (previousIsRequired && !currentIsRequired) { - // Transition between required and non-required. Don't compare for alphabetical. - return curr; - } - if (!previousIsRequired && currentIsRequired) { - // Encountered a non-required prop after a required prop - context.report(curr, 'Required prop types must be listed before all other prop types'); - return curr; - } - } - - if (callbacksLast) { - if (!previousIsCallback && currentIsCallback) { - // Entering the callback prop section - return curr; - } - if (previousIsCallback && !currentIsCallback) { - // Encountered a non-callback prop after a callback prop - context.report(prev, 'Callback prop types must be listed after all other prop types'); - return prev; - } - } - - if (currentPropName < prevPropName) { - context.report(curr, 'Prop types declarations should be sorted alphabetically'); - return prev; - } - - return curr; - }, declarations[0]); - } - - return { - ClassProperty: function(node) { - if (isPropTypesDeclaration(node) && node.value && node.value.type === 'ObjectExpression') { - checkSorted(node.value.properties); - } - }, - - MemberExpression: function(node) { - if (isPropTypesDeclaration(node.property)) { - var right = node.parent.right; - if (right && right.type === 'ObjectExpression') { - checkSorted(right.properties); - } - } - }, - - ObjectExpression: function(node) { - node.properties.forEach(function(property) { - if (!property.key) { - return; - } - - if (!isPropTypesDeclaration(property.key)) { - return; - } - if (property.value.type === 'ObjectExpression') { - checkSorted(property.value.properties); - } - }); - } - - }; -}; - -module.exports.schema = [{ - type: 'object', - properties: { - requiredFirst: { - type: 'boolean' - }, - callbacksLast: { - type: 'boolean' - }, - ignoreCase: { - type: 'boolean' - } - }, - additionalProperties: false -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-sort-props.js b/node_modules/eslint-plugin-react/lib/rules/jsx-sort-props.js deleted file mode 100644 index 5e345b3..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/jsx-sort-props.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @fileoverview Enforce props alphabetical sorting - * @author Ilya Volodin, Yannick Croissant - */ -'use strict'; - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -function isCallbackPropName(propName) { - return /^on[A-Z]/.test(propName); -} - -module.exports = function(context) { - - var configuration = context.options[0] || {}; - var ignoreCase = configuration.ignoreCase || false; - var callbacksLast = configuration.callbacksLast || false; - var shorthandFirst = configuration.shorthandFirst || false; - - return { - JSXOpeningElement: function(node) { - node.attributes.reduce(function(memo, decl, idx, attrs) { - if (decl.type === 'JSXSpreadAttribute') { - return attrs[idx + 1]; - } - - var previousPropName = memo.name.name; - var currentPropName = decl.name.name; - var previousValue = memo.value; - var currentValue = decl.value; - var previousIsCallback = isCallbackPropName(previousPropName); - var currentIsCallback = isCallbackPropName(currentPropName); - - if (ignoreCase) { - previousPropName = previousPropName.toLowerCase(); - currentPropName = currentPropName.toLowerCase(); - } - - if (callbacksLast) { - if (!previousIsCallback && currentIsCallback) { - // Entering the callback prop section - return decl; - } - if (previousIsCallback && !currentIsCallback) { - // Encountered a non-callback prop after a callback prop - context.report(memo, 'Callbacks must be listed after all other props'); - return memo; - } - } - - if (shorthandFirst) { - if (currentValue && !previousValue) { - return decl; - } - if (!currentValue && previousValue) { - context.report(memo, 'Shorthand props must be listed before all other props'); - return memo; - } - } - - if (currentPropName < previousPropName) { - context.report(decl, 'Props should be sorted alphabetically'); - return memo; - } - - return decl; - }, node.attributes[0]); - } - }; -}; - -module.exports.schema = [{ - type: 'object', - properties: { - // Whether callbacks (prefixed with "on") should be listed at the very end, - // after all other props. - callbacksLast: { - type: 'boolean' - }, - // Whether shorthand properties (without a value) should be listed first - shorthandFirst: { - type: 'boolean' - }, - ignoreCase: { - type: 'boolean' - } - }, - additionalProperties: false -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-uses-react.js b/node_modules/eslint-plugin-react/lib/rules/jsx-uses-react.js deleted file mode 100644 index c5fd742..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/jsx-uses-react.js +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @fileoverview Prevent React to be marked as unused - * @author Glen Mailer - */ -'use strict'; - -var variableUtil = require('../util/variable'); -var pragmaUtil = require('../util/pragma'); - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function(context) { - - var pragma = pragmaUtil.getFromContext(context); - - // -------------------------------------------------------------------------- - // Public - // -------------------------------------------------------------------------- - - return { - - JSXOpeningElement: function() { - variableUtil.markVariableAsUsed(context, pragma); - }, - - BlockComment: function(node) { - pragma = pragmaUtil.getFromNode(node) || pragma; - } - - }; - -}; - -module.exports.schema = [{ - type: 'object', - properties: { - pragma: { - type: 'string' - } - }, - additionalProperties: false -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/jsx-uses-vars.js b/node_modules/eslint-plugin-react/lib/rules/jsx-uses-vars.js deleted file mode 100644 index 9eaf8a0..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/jsx-uses-vars.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @fileoverview Prevent variables used in JSX to be marked as unused - * @author Yannick Croissant - */ -'use strict'; - -var variableUtil = require('../util/variable'); - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - JSXExpressionContainer: function(node) { - if (node.expression.type !== 'Identifier') { - return; - } - variableUtil.markVariableAsUsed(context, node.expression.name); - }, - - JSXIdentifier: function(node) { - if (node.parent.type === 'JSXAttribute') { - return; - } - variableUtil.markVariableAsUsed(context, node.name); - } - - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-danger.js b/node_modules/eslint-plugin-react/lib/rules/no-danger.js deleted file mode 100644 index 2f60dd8..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/no-danger.js +++ /dev/null @@ -1,65 +0,0 @@ -/** - * @fileoverview Prevent usage of dangerous JSX props - * @author Scott Andrews - */ -'use strict'; - -// ------------------------------------------------------------------------------ -// Constants -// ------------------------------------------------------------------------------ - -var DANGEROUS_MESSAGE = 'Dangerous property \'{{name}}\' found'; - -var DANGEROUS_PROPERTY_NAMES = [ - 'dangerouslySetInnerHTML' -]; - -var DANGEROUS_PROPERTIES = DANGEROUS_PROPERTY_NAMES.reduce(function (props, prop) { - props[prop] = prop; - return props; -}, Object.create(null)); - -// ------------------------------------------------------------------------------ -// Helpers -// ------------------------------------------------------------------------------ - -/** - * Checks if a node name match the JSX tag convention. - * @param {String} name - Name of the node to check. - * @returns {boolean} Whether or not the node name match the JSX tag convention. - */ -var tagConvention = /^[a-z]|\-/; -function isTagName(name) { - return tagConvention.test(name); -} - -/** - * Checks if a JSX attribute is dangerous. - * @param {String} name - Name of the attribute to check. - * @returns {boolean} Whether or not the attribute is dnagerous. - */ -function isDangerous(name) { - return name in DANGEROUS_PROPERTIES; -} - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - JSXAttribute: function(node) { - if (isTagName(node.parent.name.name) && isDangerous(node.name.name)) { - context.report(node, DANGEROUS_MESSAGE, { - name: node.name.name - }); - } - } - - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-deprecated.js b/node_modules/eslint-plugin-react/lib/rules/no-deprecated.js deleted file mode 100644 index 294fc57..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/no-deprecated.js +++ /dev/null @@ -1,118 +0,0 @@ -/** - * @fileoverview Prevent usage of deprecated methods - * @author Yannick Croissant - * @author Scott Feeney - */ -'use strict'; - -var pragmaUtil = require('../util/pragma'); - -// ------------------------------------------------------------------------------ -// Constants -// ------------------------------------------------------------------------------ - -var DEPRECATED_MESSAGE = '{{oldMethod}} is deprecated since React {{version}}{{newMethod}}'; - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function(context) { - - // Validate React version passed in options - // (append the patch version if missing, allowing shorthands like 0.12 for React 0.12.0) - var optVer = context.options[0] ? context.options[0].react : '999.999.999'; - optVer = /^[0-9]+\.[0-9]+$/.test(optVer) ? optVer + '.0' : optVer; - optVer = optVer.split('.').map(function(part) { - return Number(part); - }); - - var pragma = pragmaUtil.getFromContext(context); - - function getDeprecated() { - var deprecated = { - MemberExpression: {} - }; - // 0.12.0 - deprecated.MemberExpression[pragma + '.renderComponent'] = ['0.12.0', pragma + '.render']; - deprecated.MemberExpression[pragma + '.renderComponentToString'] = ['0.12.0', pragma + '.renderToString']; - deprecated.MemberExpression[pragma + '.renderComponentToStaticMarkup'] = [ - '0.12.0', - pragma + '.renderToStaticMarkup' - ]; - deprecated.MemberExpression[pragma + '.isValidComponent'] = ['0.12.0', pragma + '.isValidElement']; - deprecated.MemberExpression[pragma + '.PropTypes.component'] = ['0.12.0', pragma + '.PropTypes.element']; - deprecated.MemberExpression[pragma + '.PropTypes.renderable'] = ['0.12.0', pragma + '.PropTypes.node']; - deprecated.MemberExpression[pragma + '.isValidClass'] = ['0.12.0']; - deprecated.MemberExpression['this.transferPropsTo'] = ['0.12.0', 'spread operator ({...})']; - // 0.13.0 - deprecated.MemberExpression[pragma + '.addons.classSet'] = ['0.13.0', 'the npm module classnames']; - deprecated.MemberExpression[pragma + '.addons.cloneWithProps'] = ['0.13.0', pragma + '.cloneElement']; - // 0.14.0 - deprecated.MemberExpression[pragma + '.render'] = ['0.14.0', 'ReactDOM.render']; - deprecated.MemberExpression[pragma + '.unmountComponentAtNode'] = ['0.14.0', 'ReactDOM.unmountComponentAtNode']; - deprecated.MemberExpression[pragma + '.findDOMNode'] = ['0.14.0', 'ReactDOM.findDOMNode']; - deprecated.MemberExpression[pragma + '.renderToString'] = ['0.14.0', 'ReactDOMServer.renderToString']; - deprecated.MemberExpression[pragma + '.renderToStaticMarkup'] = ['0.14.0', 'ReactDOMServer.renderToStaticMarkup']; - - return deprecated; - } - - function checkVersion(methodVer) { - methodVer = methodVer.split('.').map(function(part) { - return Number(part); - }); - var higherMajor = methodVer[0] < optVer[0]; - var higherMinor = methodVer[0] === optVer[0] && methodVer[1] < optVer[1]; - var higherOrEqualPatch = methodVer[0] === optVer[0] && methodVer[1] === optVer[1] && methodVer[2] <= optVer[2]; - - return higherMajor || higherMinor || higherOrEqualPatch; - } - - function isDeprecated(type, method) { - var deprecated = getDeprecated(); - - return ( - deprecated[type] && - deprecated[type][method] && - checkVersion(deprecated[type][method][0]) - ); - } - - // -------------------------------------------------------------------------- - // Public - // -------------------------------------------------------------------------- - - return { - - MemberExpression: function(node) { - var method = context.getSource(node); - if (!isDeprecated(node.type, method)) { - return; - } - var deprecated = getDeprecated(); - context.report(node, DEPRECATED_MESSAGE, { - oldMethod: method, - version: deprecated[node.type][method][0], - newMethod: deprecated[node.type][method][1] ? ', use ' + deprecated[node.type][method][1] + ' instead' : '' - }); - }, - - BlockComment: function(node) { - pragma = pragmaUtil.getFromNode(node) || pragma; - } - - }; - -}; - -module.exports.schema = [{ - type: 'object', - properties: { - react: { - type: 'string', - pattern: '^[0-9]+\.[0-9]+(\.[0-9]+)?$' - } - }, - additionalProperties: false -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-did-mount-set-state.js b/node_modules/eslint-plugin-react/lib/rules/no-did-mount-set-state.js deleted file mode 100644 index 6869eac..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/no-did-mount-set-state.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @fileoverview Prevent usage of setState in componentDidMount - * @author Yannick Croissant - */ -'use strict'; - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function(context) { - - var mode = context.options[0] || 'never'; - - // -------------------------------------------------------------------------- - // Public - // -------------------------------------------------------------------------- - - return { - - CallExpression: function(node) { - var callee = node.callee; - if ( - callee.type !== 'MemberExpression' || - callee.object.type !== 'ThisExpression' || - callee.property.name !== 'setState' - ) { - return; - } - var ancestors = context.getAncestors(callee).reverse(); - var depth = 0; - for (var i = 0, j = ancestors.length; i < j; i++) { - if (/Function(Expression|Declaration)$/.test(ancestors[i].type)) { - depth++; - } - if ( - (ancestors[i].type !== 'Property' && ancestors[i].type !== 'MethodDefinition') || - ancestors[i].key.name !== 'componentDidMount' || - (mode === 'allow-in-func' && depth > 1) - ) { - continue; - } - context.report(callee, 'Do not use setState in componentDidMount'); - break; - } - } - }; - -}; - -module.exports.schema = [{ - enum: ['allow-in-func'] -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-did-update-set-state.js b/node_modules/eslint-plugin-react/lib/rules/no-did-update-set-state.js deleted file mode 100644 index c26f273..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/no-did-update-set-state.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @fileoverview Prevent usage of setState in componentDidUpdate - * @author Yannick Croissant - */ -'use strict'; - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function(context) { - - var mode = context.options[0] || 'never'; - - // -------------------------------------------------------------------------- - // Public - // -------------------------------------------------------------------------- - - return { - - CallExpression: function(node) { - var callee = node.callee; - if ( - callee.type !== 'MemberExpression' || - callee.object.type !== 'ThisExpression' || - callee.property.name !== 'setState' - ) { - return; - } - var ancestors = context.getAncestors(callee).reverse(); - var depth = 0; - for (var i = 0, j = ancestors.length; i < j; i++) { - if (/Function(Expression|Declaration)$/.test(ancestors[i].type)) { - depth++; - } - if ( - (ancestors[i].type !== 'Property' && ancestors[i].type !== 'MethodDefinition') || - ancestors[i].key.name !== 'componentDidUpdate' || - (mode === 'allow-in-func' && depth > 1) - ) { - continue; - } - context.report(callee, 'Do not use setState in componentDidUpdate'); - break; - } - } - }; - -}; - -module.exports.schema = [{ - enum: ['allow-in-func'] -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-direct-mutation-state.js b/node_modules/eslint-plugin-react/lib/rules/no-direct-mutation-state.js deleted file mode 100644 index 5fd9620..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/no-direct-mutation-state.js +++ /dev/null @@ -1,75 +0,0 @@ -/** - * @fileoverview Prevent usage of setState in componentDidMount - * @author David Petersen - */ -'use strict'; - -var Components = require('../util/Components'); - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = Components.detect(function(context, components, utils) { - - /** - * Checks if the component is valid - * @param {Object} component The component to process - * @returns {Boolean} True if the component is valid, false if not. - */ - function isValid(component) { - return Boolean(component && !component.mutateSetState); - } - - /** - * Reports undeclared proptypes for a given component - * @param {Object} component The component to process - */ - function reportMutations(component) { - var mutation; - for (var i = 0, j = component.mutations.length; i < j; i++) { - mutation = component.mutations[i]; - context.report(mutation, 'Do not mutate state directly. Use setState().'); - } - } - - // -------------------------------------------------------------------------- - // Public - // -------------------------------------------------------------------------- - - return { - AssignmentExpression: function(node) { - var item; - if (!node.left || !node.left.object || !node.left.object.object) { - return; - } - item = node.left.object; - while (item.object.property) { - item = item.object; - } - if ( - item.object.type === 'ThisExpression' && - item.property.name === 'state' - ) { - var component = components.get(utils.getParentComponent()); - var mutations = component && component.mutations || []; - mutations.push(node.left.object); - components.set(node, { - mutateSetState: true, - mutations: mutations - }); - } - }, - - 'Program:exit': function() { - var list = components.list(); - for (var component in list) { - if (!list.hasOwnProperty(component) || isValid(list[component])) { - continue; - } - reportMutations(list[component]); - } - } - }; - -}); diff --git a/node_modules/eslint-plugin-react/lib/rules/no-is-mounted.js b/node_modules/eslint-plugin-react/lib/rules/no-is-mounted.js deleted file mode 100644 index bfd8c1d..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/no-is-mounted.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @fileoverview Prevent usage of isMounted - * @author Joe Lencioni - */ -'use strict'; - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function(context) { - - // -------------------------------------------------------------------------- - // Public - // -------------------------------------------------------------------------- - - return { - - CallExpression: function(node) { - var callee = node.callee; - if (callee.type !== 'MemberExpression') { - return; - } - if (callee.object.type !== 'ThisExpression' || callee.property.name !== 'isMounted') { - return; - } - var ancestors = context.getAncestors(callee); - for (var i = 0, j = ancestors.length; i < j; i++) { - if (ancestors[i].type === 'Property' || ancestors[i].type === 'MethodDefinition') { - context.report(callee, 'Do not use isMounted'); - break; - } - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-multi-comp.js b/node_modules/eslint-plugin-react/lib/rules/no-multi-comp.js deleted file mode 100644 index 179cdc9..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/no-multi-comp.js +++ /dev/null @@ -1,61 +0,0 @@ -/** - * @fileoverview Prevent multiple component definition per file - * @author Yannick Croissant - */ -'use strict'; - -var Components = require('../util/Components'); - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = Components.detect(function(context, components) { - - var configuration = context.options[0] || {}; - var ignoreStateless = configuration.ignoreStateless || false; - - var MULTI_COMP_MESSAGE = 'Declare only one React component per file'; - - /** - * Checks if the component is ignored - * @param {Object} component The component being checked. - * @returns {Boolean} True if the component is ignored, false if not. - */ - function isIgnored(component) { - return ignoreStateless === true && /Function/.test(component.node.type); - } - - // -------------------------------------------------------------------------- - // Public - // -------------------------------------------------------------------------- - - return { - 'Program:exit': function() { - if (components.length() <= 1) { - return; - } - - var list = components.list(); - var i = 0; - - for (var component in list) { - if (!list.hasOwnProperty(component) || isIgnored(list[component]) || ++i === 1) { - continue; - } - context.report(list[component].node, MULTI_COMP_MESSAGE); - } - } - }; -}); - -module.exports.schema = [{ - type: 'object', - properties: { - ignoreStateless: { - default: false, - type: 'boolean' - } - }, - additionalProperties: false -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-set-state.js b/node_modules/eslint-plugin-react/lib/rules/no-set-state.js deleted file mode 100644 index 94f2217..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/no-set-state.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @fileoverview Prevent usage of setState - * @author Mark Dalgleish - */ -'use strict'; - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function(context) { - - // -------------------------------------------------------------------------- - // Public - // -------------------------------------------------------------------------- - - return { - - CallExpression: function(node) { - var callee = node.callee; - if (callee.type !== 'MemberExpression') { - return; - } - if (callee.object.type !== 'ThisExpression' || callee.property.name !== 'setState') { - return; - } - var ancestors = context.getAncestors(callee); - for (var i = 0, j = ancestors.length; i < j; i++) { - if (ancestors[i].type === 'Property' || ancestors[i].type === 'MethodDefinition') { - context.report(callee, 'Do not use setState'); - break; - } - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-string-refs.js b/node_modules/eslint-plugin-react/lib/rules/no-string-refs.js deleted file mode 100644 index e6cd65d..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/no-string-refs.js +++ /dev/null @@ -1,88 +0,0 @@ -/** - * @fileoverview Prevent string definitions for references and prevent referencing this.refs - * @author Tom Hastjarjanto - */ -'use strict'; - -var Components = require('../util/Components'); - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = Components.detect(function(context, components, utils) { - /** - * Checks if we are using refs - * @param {ASTNode} node The AST node being checked. - * @returns {Boolean} True if we are using refs, false if not. - */ - function isRefsUsage(node) { - return Boolean( - ( - utils.getParentES6Component() || - utils.getParentES5Component() - ) && - node.object.type === 'ThisExpression' && - node.property.name === 'refs' - ); - } - - /** - * Checks if we are using a ref attribute - * @param {ASTNode} node The AST node being checked. - * @returns {Boolean} True if we are using a ref attribute, false if not. - */ - function isRefAttribute(node) { - return Boolean( - node.type === 'JSXAttribute' && - node.name && - node.name.name === 'ref' - ); - } - - /** - * Checks if a node contains a string value - * @param {ASTNode} node The AST node being checked. - * @returns {Boolean} True if the node contains a string value, false if not. - */ - function containsStringLiteral(node) { - return Boolean( - node.value && - node.value.type === 'Literal' && - typeof node.value.value === 'string' - ); - } - - /** - * Checks if a node contains a string value within a jsx expression - * @param {ASTNode} node The AST node being checked. - * @returns {Boolean} True if the node contains a string value within a jsx expression, false if not. - */ - function containsStringExpressionContainer(node) { - return Boolean( - node.value && - node.value.type === 'JSXExpressionContainer' && - node.value.expression && - node.value.expression.type === 'Literal' && - typeof node.value.expression.value === 'string' - ); - } - - return { - MemberExpression: function(node) { - if (isRefsUsage(node)) { - context.report(node, 'Using this.refs is deprecated.'); - } - }, - JSXAttribute: function(node) { - if ( - isRefAttribute(node) && - (containsStringLiteral(node) || containsStringExpressionContainer(node)) - ) { - context.report(node, 'Using string literals in ref attributes is deprecated.'); - } - } - }; -}); - -module.exports.schema = []; diff --git a/node_modules/eslint-plugin-react/lib/rules/no-unknown-property.js b/node_modules/eslint-plugin-react/lib/rules/no-unknown-property.js deleted file mode 100644 index 7e9147d..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/no-unknown-property.js +++ /dev/null @@ -1,135 +0,0 @@ -/** - * @fileoverview Prevent usage of unknown DOM property - * @author Yannick Croissant - */ -'use strict'; - -// ------------------------------------------------------------------------------ -// Constants -// ------------------------------------------------------------------------------ - -var UNKNOWN_MESSAGE = 'Unknown property \'{{name}}\' found, use \'{{standardName}}\' instead'; - -var DOM_ATTRIBUTE_NAMES = { - // Standard - 'accept-charset': 'acceptCharset', - class: 'className', - for: 'htmlFor', - 'http-equiv': 'httpEquiv', - // SVG - 'clip-path': 'clipPath', - 'fill-opacity': 'fillOpacity', - 'font-family': 'fontFamily', - 'font-size': 'fontSize', - 'marker-end': 'markerEnd', - 'marker-mid': 'markerMid', - 'marker-start': 'markerStart', - 'stop-color': 'stopColor', - 'stop-opacity': 'stopOpacity', - 'stroke-dasharray': 'strokeDasharray', - 'stroke-linecap': 'strokeLinecap', - 'stroke-opacity': 'strokeOpacity', - 'stroke-width': 'strokeWidth', - 'text-anchor': 'textAnchor', - 'xlink:actuate': 'xlinkActuate', - 'xlink:arcrole': 'xlinkArcrole', - 'xlink:href': 'xlinkHref', - 'xlink:role': 'xlinkRole', - 'xlink:show': 'xlinkShow', - 'xlink:title': 'xlinkTitle', - 'xlink:type': 'xlinkType', - 'xml:base': 'xmlBase', - 'xml:lang': 'xmlLang', - 'xml:space': 'xmlSpace' -}; - -var DOM_PROPERTY_NAMES = [ - // Standard - 'acceptCharset', 'accessKey', 'allowFullScreen', 'allowTransparency', 'autoComplete', 'autoFocus', 'autoPlay', - 'cellPadding', 'cellSpacing', 'charSet', 'classID', 'className', 'colSpan', 'contentEditable', 'contextMenu', - 'crossOrigin', 'dateTime', 'encType', 'formAction', 'formEncType', 'formMethod', 'formNoValidate', 'formTarget', - 'frameBorder', 'hrefLang', 'htmlFor', 'httpEquiv', 'marginHeight', 'marginWidth', 'maxLength', 'mediaGroup', - 'noValidate', 'onBlur', 'onChange', 'onClick', 'onContextMenu', 'onCopy', 'onCut', 'onDoubleClick', - 'onDrag', 'onDragEnd', 'onDragEnter', 'onDragExit', 'onDragLeave', 'onDragOver', 'onDragStart', 'onDrop', - 'onFocus', 'onInput', 'onKeyDown', 'onKeyPress', 'onKeyUp', 'onMouseDown', 'onMouseEnter', 'onMouseLeave', - 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp', 'onPaste', 'onScroll', 'onSubmit', 'onTouchCancel', - 'onTouchEnd', 'onTouchMove', 'onTouchStart', 'onWheel', - 'radioGroup', 'readOnly', 'rowSpan', 'spellCheck', 'srcDoc', 'srcSet', 'tabIndex', 'useMap', - // Non standard - 'autoCapitalize', 'autoCorrect', - 'autoSave', - 'itemProp', 'itemScope', 'itemType', 'itemRef', 'itemID' -]; - -// ------------------------------------------------------------------------------ -// Helpers -// ------------------------------------------------------------------------------ - -/** - * Checks if a node matches the JSX tag convention. - * @param {Object} node - JSX element being tested. - * @returns {boolean} Whether or not the node name match the JSX tag convention. - */ -var tagConvention = /^[a-z][^-]*$/; -function isTagName(node) { - if (tagConvention.test(node.parent.name.name)) { - // http://www.w3.org/TR/custom-elements/#type-extension-semantics - return !node.parent.attributes.some(function(attrNode) { - return ( - attrNode.type === 'JSXAttribute' && - attrNode.name.type === 'JSXIdentifier' && - attrNode.name.name === 'is' - ); - }); - } - return false; -} - -/** - * Get the standard name of the attribute. - * @param {String} name - Name of the attribute. - * @returns {String} The standard name of the attribute. - */ -function getStandardName(name) { - if (DOM_ATTRIBUTE_NAMES[name]) { - return DOM_ATTRIBUTE_NAMES[name]; - } - var i; - var found = DOM_PROPERTY_NAMES.some(function(element, index) { - i = index; - return element.toLowerCase() === name; - }); - return found ? DOM_PROPERTY_NAMES[i] : null; -} - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - JSXAttribute: function(node) { - var name = context.getSource(node.name); - var standardName = getStandardName(name); - if (!isTagName(node) || !standardName) { - return; - } - context.report({ - node: node, - message: UNKNOWN_MESSAGE, - data: { - name: name, - standardName: standardName - }, - fix: function(fixer) { - return fixer.replaceText(node.name, standardName); - } - }); - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint-plugin-react/lib/rules/prefer-es6-class.js b/node_modules/eslint-plugin-react/lib/rules/prefer-es6-class.js deleted file mode 100644 index 618b295..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/prefer-es6-class.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @fileoverview Enforce ES5 or ES6 class for React Components - * @author Dan Hamilton - */ -'use strict'; - -var Components = require('../util/Components'); - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = Components.detect(function(context, components, utils) { - var configuration = context.options[0] || 'always'; - - return { - ObjectExpression: function(node) { - if (utils.isES5Component(node) && configuration === 'always') { - context.report(node, 'Component should use es6 class instead of createClass'); - } - }, - ClassDeclaration: function(node) { - if (utils.isES6Component(node) && configuration === 'never') { - context.report(node, 'Component should use createClass instead of es6 class'); - } - } - }; -}); - -module.exports.schema = [{ - enum: ['always', 'never'] -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/prop-types.js b/node_modules/eslint-plugin-react/lib/rules/prop-types.js deleted file mode 100644 index b339823..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/prop-types.js +++ /dev/null @@ -1,829 +0,0 @@ -/** - * @fileoverview Prevent missing props validation in a React component definition - * @author Yannick Croissant - */ -'use strict'; - -// As for exceptions for props.children or props.className (and alike) look at -// https://github.com/yannickcr/eslint-plugin-react/issues/7 - -var Components = require('../util/Components'); -var variable = require('../util/variable'); - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = Components.detect(function(context, components, utils) { - - var configuration = context.options[0] || {}; - var ignored = configuration.ignore || []; - var customValidators = configuration.customValidators || []; - // Used to track the type annotations in scope. - // Necessary because babel's scopes do not track type annotations. - var stack = null; - - var MISSING_MESSAGE = '\'{{name}}\' is missing in props validation'; - - /** - * Helper for accessing the current scope in the stack. - * @param {string} key The name of the identifier to access. If omitted, returns the full scope. - * @param {ASTNode} value If provided sets the new value for the identifier. - * @returns {Object|ASTNode} Either the whole scope or the ASTNode associated with the given identifier. - */ - function typeScope(key, value) { - if (arguments.length === 0) { - return stack[stack.length - 1]; - } else if (arguments.length === 1) { - return stack[stack.length - 1][key]; - } - stack[stack.length - 1][key] = value; - return value; - } - - /** - * Checks if we are using a prop - * @param {ASTNode} node The AST node being checked. - * @returns {Boolean} True if we are using a prop, false if not. - */ - function isPropTypesUsage(node) { - var isClassUsage = ( - (utils.getParentES6Component() || utils.getParentES5Component()) && - node.object.type === 'ThisExpression' && node.property.name === 'props' - ); - var isStatelessFunctionUsage = node.object.name === 'props'; - return isClassUsage || isStatelessFunctionUsage; - } - - /** - * Checks if we are declaring a `props` class property with a flow type annotation. - * @param {ASTNode} node The AST node being checked. - * @returns {Boolean} True if the node is a type annotated props declaration, false if not. - */ - function isAnnotatedPropsDeclaration(node) { - if (node && node.type === 'ClassProperty') { - var tokens = context.getFirstTokens(node, 2); - if ( - node.typeAnnotation && ( - tokens[0].value === 'props' || - (tokens[1] && tokens[1].value === 'props') - ) - ) { - return true; - } - } - return false; - } - - /** - * Checks if we are declaring a prop - * @param {ASTNode} node The AST node being checked. - * @returns {Boolean} True if we are declaring a prop, false if not. - */ - function isPropTypesDeclaration(node) { - - // Special case for class properties - // (babel-eslint does not expose property name so we have to rely on tokens) - if (node && node.type === 'ClassProperty') { - var tokens = context.getFirstTokens(node, 2); - if ( - tokens[0].value === 'propTypes' || - (tokens[1] && tokens[1].value === 'propTypes') - ) { - return true; - } - return false; - } - - return Boolean( - node && - node.name === 'propTypes' - ); - - } - - /** - * Checks if the prop is ignored - * @param {String} name Name of the prop to check. - * @returns {Boolean} True if the prop is ignored, false if not. - */ - function isIgnored(name) { - return ignored.indexOf(name) !== -1; - } - - /** - * Checks if prop should be validated by plugin-react-proptypes - * @param {String} validator Name of validator to check. - * @returns {Boolean} True if validator should be checked by custom validator. - */ - function hasCustomValidator(validator) { - return customValidators.indexOf(validator) !== -1; - } - - /** - * Checks if the component must be validated - * @param {Object} component The component to process - * @returns {Boolean} True if the component must be validated, false if not. - */ - function mustBeValidated(component) { - return Boolean( - component && - component.usedPropTypes && - !component.ignorePropsValidation - ); - } - - /** - * Internal: Checks if the prop is declared - * @param {Object} declaredPropTypes Description of propTypes declared in the current component - * @param {String[]} keyList Dot separated name of the prop to check. - * @returns {Boolean} True if the prop is declared, false if not. - */ - function _isDeclaredInComponent(declaredPropTypes, keyList) { - for (var i = 0, j = keyList.length; i < j; i++) { - var key = keyList[i]; - var propType = ( - // Check if this key is declared - declaredPropTypes[key] || - // If not, check if this type accepts any key - declaredPropTypes.__ANY_KEY__ - ); - - if (!propType) { - // If it's a computed property, we can't make any further analysis, but is valid - return key === '__COMPUTED_PROP__'; - } - if (propType === true) { - return true; - } - // Consider every children as declared - if (propType.children === true) { - return true; - } - if (propType.acceptedProperties) { - return key in propType.acceptedProperties; - } - if (propType.type === 'union') { - // If we fall in this case, we know there is at least one complex type in the union - if (i + 1 >= j) { - // this is the last key, accept everything - return true; - } - // non trivial, check all of them - var unionTypes = propType.children; - var unionPropType = {}; - for (var k = 0, z = unionTypes.length; k < z; k++) { - unionPropType[key] = unionTypes[k]; - var isValid = _isDeclaredInComponent( - unionPropType, - keyList.slice(i) - ); - if (isValid) { - return true; - } - } - - // every possible union were invalid - return false; - } - declaredPropTypes = propType.children; - } - return true; - } - - /** - * Checks if the prop is declared - * @param {ASTNode} node The AST node being checked. - * @param {String[]} names List of names of the prop to check. - * @returns {Boolean} True if the prop is declared, false if not. - */ - function isDeclaredInComponent(node, names) { - while (node) { - var component = components.get(node); - var isDeclared = - component && component.confidence === 2 && - _isDeclaredInComponent(component.declaredPropTypes || {}, names) - ; - if (isDeclared) { - return true; - } - node = node.parent; - } - return false; - } - - /** - * Checks if the prop has spread operator. - * @param {ASTNode} node The AST node being marked. - * @returns {Boolean} True if the prop has spread operator, false if not. - */ - function hasSpreadOperator(node) { - var tokens = context.getTokens(node); - return tokens.length && tokens[0].value === '...'; - } - - /** - * Retrieve the name of a key node - * @param {ASTNode} node The AST node with the key. - * @return {string} the name of the key - */ - function getKeyValue(node) { - if (node.type === 'ObjectTypeProperty') { - var tokens = context.getFirstTokens(node, 1); - return tokens[0].value; - } - var key = node.key || node.argument; - return key.type === 'Identifier' ? key.name : key.value; - } - - /** - * Iterates through a properties node, like a customized forEach. - * @param {Object[]} properties Array of properties to iterate. - * @param {Function} fn Function to call on each property, receives property key - and property value. (key, value) => void - */ - function iterateProperties(properties, fn) { - if (properties.length && typeof fn === 'function') { - for (var i = 0, j = properties.length; i < j; i++) { - var node = properties[i]; - var key = getKeyValue(node); - - var value = node.value; - fn(key, value); - } - } - } - - /** - * Creates the representation of the React propTypes for the component. - * The representation is used to verify nested used properties. - * @param {ASTNode} value Node of the React.PropTypes for the desired property - * @return {Object|Boolean} The representation of the declaration, true means - * the property is declared without the need for further analysis. - */ - function buildReactDeclarationTypes(value) { - if ( - value && - value.callee && - value.callee.object && - hasCustomValidator(value.callee.object.name) - ) { - return true; - } - - if ( - value && - value.type === 'MemberExpression' && - value.property && - value.property.name && - value.property.name === 'isRequired' - ) { - value = value.object; - } - - // Verify React.PropTypes that are functions - if ( - value && - value.type === 'CallExpression' && - value.callee && - value.callee.property && - value.callee.property.name && - value.arguments && - value.arguments.length > 0 - ) { - var callName = value.callee.property.name; - var argument = value.arguments[0]; - switch (callName) { - case 'shape': - if (argument.type !== 'ObjectExpression') { - // Invalid proptype or cannot analyse statically - return true; - } - var shapeTypeDefinition = { - type: 'shape', - children: {} - }; - iterateProperties(argument.properties, function(childKey, childValue) { - shapeTypeDefinition.children[childKey] = buildReactDeclarationTypes(childValue); - }); - return shapeTypeDefinition; - case 'arrayOf': - case 'objectOf': - return { - type: 'object', - children: { - __ANY_KEY__: buildReactDeclarationTypes(argument) - } - }; - case 'oneOfType': - if ( - !argument.elements || - !argument.elements.length - ) { - // Invalid proptype or cannot analyse statically - return true; - } - var unionTypeDefinition = { - type: 'union', - children: [] - }; - for (var i = 0, j = argument.elements.length; i < j; i++) { - var type = buildReactDeclarationTypes(argument.elements[i]); - // keep only complex type - if (type !== true) { - if (type.children === true) { - // every child is accepted for one type, abort type analysis - unionTypeDefinition.children = true; - return unionTypeDefinition; - } - } - - unionTypeDefinition.children.push(type); - } - if (unionTypeDefinition.length === 0) { - // no complex type found, simply accept everything - return true; - } - return unionTypeDefinition; - case 'instanceOf': - return { - type: 'instance', - // Accept all children because we can't know what type they are - children: true - }; - case 'oneOf': - default: - return true; - } - } - // Unknown property or accepts everything (any, object, ...) - return true; - } - - /** - * Creates the representation of the React props type annotation for the component. - * The representation is used to verify nested used properties. - * @param {ASTNode} annotation Type annotation for the props class property. - * @return {Object|Boolean} The representation of the declaration, true means - * the property is declared without the need for further analysis. - */ - function buildTypeAnnotationDeclarationTypes(annotation) { - switch (annotation.type) { - case 'GenericTypeAnnotation': - if (typeScope(annotation.id.name)) { - return buildTypeAnnotationDeclarationTypes(typeScope(annotation.id.name)); - } - return true; - case 'ObjectTypeAnnotation': - var shapeTypeDefinition = { - type: 'shape', - children: {} - }; - iterateProperties(annotation.properties, function(childKey, childValue) { - shapeTypeDefinition.children[childKey] = buildTypeAnnotationDeclarationTypes(childValue); - }); - return shapeTypeDefinition; - case 'UnionTypeAnnotation': - var unionTypeDefinition = { - type: 'union', - children: [] - }; - for (var i = 0, j = annotation.types.length; i < j; i++) { - var type = buildTypeAnnotationDeclarationTypes(annotation.types[i]); - // keep only complex type - if (type !== true) { - if (type.children === true) { - // every child is accepted for one type, abort type analysis - unionTypeDefinition.children = true; - return unionTypeDefinition; - } - } - - unionTypeDefinition.children.push(type); - } - if (unionTypeDefinition.children.length === 0) { - // no complex type found, simply accept everything - return true; - } - return unionTypeDefinition; - case 'ArrayTypeAnnotation': - return { - type: 'object', - children: { - __ANY_KEY__: buildTypeAnnotationDeclarationTypes(annotation.elementType) - } - }; - default: - // Unknown or accepts everything. - return true; - } - } - - /** - * Check if we are in a class constructor - * @return {boolean} true if we are in a class constructor, false if not - */ - function inConstructor() { - var scope = context.getScope(); - while (scope) { - if (scope.block && scope.block.parent && scope.block.parent.kind === 'constructor') { - return true; - } - scope = scope.upper; - } - return false; - } - - /** - * Retrieve the name of a property node - * @param {ASTNode} node The AST node with the property. - * @return {string} the name of the property or undefined if not found - */ - function getPropertyName(node) { - var isDirectProp = /^props(\.|\[)/.test(context.getSource(node)); - var isInClassComponent = utils.getParentES6Component() || utils.getParentES5Component(); - var isNotInConstructor = !inConstructor(node); - if (isDirectProp && isInClassComponent && isNotInConstructor) { - return void 0; - } - if (!isDirectProp) { - node = node.parent; - } - var property = node.property; - if (property) { - switch (property.type) { - case 'Identifier': - if (node.computed) { - return '__COMPUTED_PROP__'; - } - return property.name; - case 'MemberExpression': - return void 0; - case 'Literal': - // Accept computed properties that are literal strings - if (typeof property.value === 'string') { - return property.value; - } - // falls through - default: - if (node.computed) { - return '__COMPUTED_PROP__'; - } - break; - } - } - return void 0; - } - - /** - * Mark a prop type as used - * @param {ASTNode} node The AST node being marked. - */ - function markPropTypesAsUsed(node, parentNames) { - parentNames = parentNames || []; - var type; - var name; - var allNames; - var properties; - switch (node.type) { - case 'MemberExpression': - name = getPropertyName(node); - if (name) { - allNames = parentNames.concat(name); - if (node.parent.type === 'MemberExpression') { - markPropTypesAsUsed(node.parent, allNames); - } - // Do not mark computed props as used. - type = name !== '__COMPUTED_PROP__' ? 'direct' : null; - } else if ( - node.parent.id && - node.parent.id.properties && - node.parent.id.properties.length && - getKeyValue(node.parent.id.properties[0]) - ) { - type = 'destructuring'; - properties = node.parent.id.properties; - } - break; - case 'VariableDeclarator': - for (var i = 0, j = node.id.properties.length; i < j; i++) { - // let {props: {firstname}} = this - var thisDestructuring = ( - (node.id.properties[i].key.name === 'props' || node.id.properties[i].key.value === 'props') && - node.id.properties[i].value.type === 'ObjectPattern' - ); - // let {firstname} = props - var statelessDestructuring = node.init.name === 'props' && utils.getParentStatelessComponent(); - - if (thisDestructuring) { - properties = node.id.properties[i].value.properties; - } else if (statelessDestructuring) { - properties = node.id.properties; - } else { - continue; - } - type = 'destructuring'; - break; - } - break; - default: - throw new Error(node.type + ' ASTNodes are not handled by markPropTypesAsUsed'); - } - - var component = components.get(utils.getParentComponent()); - var usedPropTypes = component && component.usedPropTypes || []; - - switch (type) { - case 'direct': - // Ignore Object methods - if (Object.prototype[name]) { - break; - } - - var isDirectProp = /^props(\.|\[)/.test(context.getSource(node)); - - usedPropTypes.push({ - name: name, - allNames: allNames, - node: !isDirectProp && !inConstructor(node) ? node.parent.property : node.property - }); - break; - case 'destructuring': - for (var k = 0, l = properties.length; k < l; k++) { - if (hasSpreadOperator(properties[k]) || properties[k].computed) { - continue; - } - var propName = getKeyValue(properties[k]); - - var currentNode = node; - allNames = []; - while (currentNode.property && currentNode.property.name !== 'props') { - allNames.unshift(currentNode.property.name); - currentNode = currentNode.object; - } - allNames.push(propName); - - if (propName) { - usedPropTypes.push({ - name: propName, - allNames: allNames, - node: properties[k] - }); - } - } - break; - default: - break; - } - - components.set(node, { - usedPropTypes: usedPropTypes - }); - } - - /** - * Mark a prop type as declared - * @param {ASTNode} node The AST node being checked. - * @param {propTypes} node The AST node containing the proptypes - */ - function markPropTypesAsDeclared(node, propTypes) { - var component = components.get(node); - var declaredPropTypes = component && component.declaredPropTypes || {}; - var ignorePropsValidation = false; - - switch (propTypes && propTypes.type) { - case 'ObjectTypeAnnotation': - iterateProperties(propTypes.properties, function(key, value) { - declaredPropTypes[key] = buildTypeAnnotationDeclarationTypes(value); - }); - break; - case 'ObjectExpression': - iterateProperties(propTypes.properties, function(key, value) { - if (!value) { - ignorePropsValidation = true; - return; - } - declaredPropTypes[key] = buildReactDeclarationTypes(value); - }); - break; - case 'MemberExpression': - var curDeclaredPropTypes = declaredPropTypes; - // Walk the list of properties, until we reach the assignment - // ie: ClassX.propTypes.a.b.c = ... - while ( - propTypes && - propTypes.parent && - propTypes.parent.type !== 'AssignmentExpression' && - propTypes.property && - curDeclaredPropTypes - ) { - var propName = propTypes.property.name; - if (propName in curDeclaredPropTypes) { - curDeclaredPropTypes = curDeclaredPropTypes[propName].children; - propTypes = propTypes.parent; - } else { - // This will crash at runtime because we haven't seen this key before - // stop this and do not declare it - propTypes = null; - } - } - if (propTypes && propTypes.parent && propTypes.property) { - curDeclaredPropTypes[propTypes.property.name] = - buildReactDeclarationTypes(propTypes.parent.right); - } - break; - case 'Identifier': - var variablesInScope = variable.variablesInScope(context); - for (var i = 0, j = variablesInScope.length; i < j; i++) { - if (variablesInScope[i].name !== propTypes.name) { - continue; - } - var defInScope = variablesInScope[i].defs[variablesInScope[i].defs.length - 1]; - markPropTypesAsDeclared(node, defInScope.node && defInScope.node.init); - return; - } - ignorePropsValidation = true; - break; - case null: - break; - default: - ignorePropsValidation = true; - break; - } - - components.set(node, { - declaredPropTypes: declaredPropTypes, - ignorePropsValidation: ignorePropsValidation - }); - } - - /** - * Reports undeclared proptypes for a given component - * @param {Object} component The component to process - */ - function reportUndeclaredPropTypes(component) { - var allNames; - for (var i = 0, j = component.usedPropTypes.length; i < j; i++) { - allNames = component.usedPropTypes[i].allNames; - if ( - isIgnored(allNames[0]) || - isDeclaredInComponent(component.node, allNames) - ) { - continue; - } - context.report( - component.usedPropTypes[i].node, - MISSING_MESSAGE, { - name: allNames.join('.').replace(/\.__COMPUTED_PROP__/g, '[]') - } - ); - } - } - - /** - * Resolve the type annotation for a given node. - * Flow annotations are sometimes wrapped in outer `TypeAnnotation` - * and `NullableTypeAnnotation` nodes which obscure the annotation we're - * interested in. - * This method also resolves type aliases where possible. - * - * @param {ASTNode} node The annotation or a node containing the type annotation. - * @returns {ASTNode} The resolved type annotation for the node. - */ - function resolveTypeAnnotation(node) { - var annotation = node.typeAnnotation || node; - while (annotation && (annotation.type === 'TypeAnnotation' || annotation.type === 'NullableTypeAnnotation')) { - annotation = annotation.typeAnnotation; - } - if (annotation.type === 'GenericTypeAnnotation' && typeScope(annotation.id.name)) { - return typeScope(annotation.id.name); - } - return annotation; - } - - // -------------------------------------------------------------------------- - // Public - // -------------------------------------------------------------------------- - - return { - ClassProperty: function(node) { - if (isAnnotatedPropsDeclaration(node)) { - markPropTypesAsDeclared(node, resolveTypeAnnotation(node)); - } else if (isPropTypesDeclaration(node)) { - markPropTypesAsDeclared(node, node.value); - } - }, - - VariableDeclarator: function(node) { - var destructuring = node.init && node.id && node.id.type === 'ObjectPattern'; - // let {props: {firstname}} = this - var thisDestructuring = destructuring && node.init.type === 'ThisExpression'; - // let {firstname} = props - var statelessDestructuring = destructuring && node.init.name === 'props' && utils.getParentStatelessComponent(); - - if (!thisDestructuring && !statelessDestructuring) { - return; - } - markPropTypesAsUsed(node); - }, - - MemberExpression: function(node) { - var type; - if (isPropTypesUsage(node)) { - type = 'usage'; - } else if (isPropTypesDeclaration(node.property)) { - type = 'declaration'; - } - - switch (type) { - case 'usage': - markPropTypesAsUsed(node); - break; - case 'declaration': - var component = utils.getRelatedComponent(node); - if (!component) { - return; - } - markPropTypesAsDeclared(component.node, node.parent.right || node.parent); - break; - default: - break; - } - }, - - MethodDefinition: function(node) { - if (!isPropTypesDeclaration(node.key)) { - return; - } - - var i = node.value.body.body.length - 1; - for (; i >= 0; i--) { - if (node.value.body.body[i].type === 'ReturnStatement') { - break; - } - } - - if (i >= 0) { - markPropTypesAsDeclared(node, node.value.body.body[i].argument); - } - }, - - ObjectExpression: function(node) { - // Search for the proptypes declaration - node.properties.forEach(function(property) { - if (!isPropTypesDeclaration(property.key)) { - return; - } - markPropTypesAsDeclared(node, property.value); - }); - }, - - TypeAlias: function(node) { - typeScope(node.id.name, node.right); - }, - - Program: function() { - stack = [{}]; - }, - - BlockStatement: function () { - stack.push(Object.create(typeScope())); - }, - - 'BlockStatement:exit': function () { - stack.pop(); - }, - - 'Program:exit': function() { - stack = null; - var list = components.list(); - // Report undeclared proptypes for all classes - for (var component in list) { - if (!list.hasOwnProperty(component) || !mustBeValidated(list[component])) { - continue; - } - reportUndeclaredPropTypes(list[component]); - } - } - }; - -}); - -module.exports.schema = [{ - type: 'object', - properties: { - ignore: { - type: 'array', - items: { - type: 'string' - } - }, - customValidators: { - type: 'array', - items: { - type: 'string' - } - } - }, - additionalProperties: false -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/react-in-jsx-scope.js b/node_modules/eslint-plugin-react/lib/rules/react-in-jsx-scope.js deleted file mode 100644 index 550fddc..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/react-in-jsx-scope.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @fileoverview Prevent missing React when using JSX - * @author Glen Mailer - */ -'use strict'; - -var variableUtil = require('../util/variable'); -var pragmaUtil = require('../util/pragma'); - -// ----------------------------------------------------------------------------- -// Rule Definition -// ----------------------------------------------------------------------------- - -module.exports = function(context) { - - var pragma = pragmaUtil.getFromContext(context); - var NOT_DEFINED_MESSAGE = '\'{{name}}\' must be in scope when using JSX'; - - return { - - JSXOpeningElement: function(node) { - var variables = variableUtil.variablesInScope(context); - if (variableUtil.findVariable(variables, pragma)) { - return; - } - context.report(node, NOT_DEFINED_MESSAGE, { - name: pragma - }); - }, - - BlockComment: function(node) { - pragma = pragmaUtil.getFromNode(node) || pragma; - } - - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint-plugin-react/lib/rules/require-extension.js b/node_modules/eslint-plugin-react/lib/rules/require-extension.js deleted file mode 100644 index 3edbf12..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/require-extension.js +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @fileoverview Restrict file extensions that may be required - * @author Scott Andrews - */ -'use strict'; - -var path = require('path'); - -// ------------------------------------------------------------------------------ -// Constants -// ------------------------------------------------------------------------------ - -var DEFAULTS = { - extentions: ['.jsx'] -}; - -var PKG_REGEX = /^[^\.]((?!\/).)*$/; - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function(context) { - - function isPackage(id) { - return PKG_REGEX.test(id); - } - - function isRequire(expression) { - return expression.callee.name === 'require'; - } - - function getId(expression) { - return expression.arguments[0] && expression.arguments[0].value; - } - - function getExtension(id) { - return path.extname(id || ''); - } - - function getExtentionsConfig() { - return context.options[0] && context.options[0].extensions || DEFAULTS.extentions; - } - - var forbiddenExtensions = getExtentionsConfig().reduce(function (extensions, extension) { - extensions[extension] = true; - return extensions; - }, Object.create(null)); - - function isForbiddenExtension(ext) { - return ext in forbiddenExtensions; - } - - // -------------------------------------------------------------------------- - // Public - // -------------------------------------------------------------------------- - - return { - - CallExpression: function(node) { - if (isRequire(node)) { - var id = getId(node); - var ext = getExtension(id); - if (!isPackage(id) && isForbiddenExtension(ext)) { - context.report(node, 'Unable to require module with extension \'' + ext + '\''); - } - } - } - - }; - -}; - -module.exports.schema = [{ - type: 'object', - properties: { - extensions: { - type: 'array', - items: { - type: 'string' - } - } - }, - additionalProperties: false -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/self-closing-comp.js b/node_modules/eslint-plugin-react/lib/rules/self-closing-comp.js deleted file mode 100644 index 37adfc1..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/self-closing-comp.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @fileoverview Prevent extra closing tags for components without children - * @author Yannick Croissant - */ -'use strict'; - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function(context) { - - var tagConvention = /^[a-z]|\-/; - function isTagName(name) { - return tagConvention.test(name); - } - - function isComponent(node) { - return node.name && node.name.type === 'JSXIdentifier' && !isTagName(node.name.name); - } - - function hasChildren(node) { - var childrens = node.parent.children; - if ( - !childrens.length || - (childrens.length === 1 && childrens[0].type === 'Literal' && !childrens[0].value.trim()) - ) { - return false; - } - return true; - } - - // -------------------------------------------------------------------------- - // Public - // -------------------------------------------------------------------------- - - return { - - JSXOpeningElement: function(node) { - if (!isComponent(node) || node.selfClosing || hasChildren(node)) { - return; - } - context.report(node, 'Empty components are self-closing'); - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint-plugin-react/lib/rules/sort-comp.js b/node_modules/eslint-plugin-react/lib/rules/sort-comp.js deleted file mode 100644 index 93d6cff..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/sort-comp.js +++ /dev/null @@ -1,376 +0,0 @@ -/** - * @fileoverview Enforce component methods order - * @author Yannick Croissant - */ -'use strict'; - -var util = require('util'); - -var Components = require('../util/Components'); - -/** - * Get the methods order from the default config and the user config - * @param {Object} defaultConfig The default configuration. - * @param {Object} userConfig The user configuration. - * @returns {Array} Methods order - */ -function getMethodsOrder(defaultConfig, userConfig) { - userConfig = userConfig || {}; - - var groups = util._extend(defaultConfig.groups, userConfig.groups); - var order = userConfig.order || defaultConfig.order; - - var config = []; - var entry; - for (var i = 0, j = order.length; i < j; i++) { - entry = order[i]; - if (groups.hasOwnProperty(entry)) { - config = config.concat(groups[entry]); - } else { - config.push(entry); - } - } - - return config; -} - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = Components.detect(function(context, components) { - - var errors = {}; - - var MISPOSITION_MESSAGE = '{{propA}} should be placed {{position}} {{propB}}'; - - var methodsOrder = getMethodsOrder({ - order: [ - 'lifecycle', - 'everything-else', - 'render' - ], - groups: { - lifecycle: [ - 'displayName', - 'propTypes', - 'contextTypes', - 'childContextTypes', - 'mixins', - 'statics', - 'defaultProps', - 'constructor', - 'getDefaultProps', - 'state', - 'getInitialState', - 'getChildContext', - 'componentWillMount', - 'componentDidMount', - 'componentWillReceiveProps', - 'shouldComponentUpdate', - 'componentWillUpdate', - 'componentDidUpdate', - 'componentWillUnmount' - ] - } - }, context.options[0]); - - // -------------------------------------------------------------------------- - // Public - // -------------------------------------------------------------------------- - - var regExpRegExp = /\/(.*)\/([g|y|i|m]*)/; - - /** - * Get indexes of the matching patterns in methods order configuration - * @param {String} method - Method name. - * @returns {Array} The matching patterns indexes. Return [Infinity] if there is no match. - */ - function getRefPropIndexes(method) { - var isRegExp; - var matching; - var i; - var j; - var indexes = []; - for (i = 0, j = methodsOrder.length; i < j; i++) { - isRegExp = methodsOrder[i].match(regExpRegExp); - if (isRegExp) { - matching = new RegExp(isRegExp[1], isRegExp[2]).test(method); - } else { - matching = methodsOrder[i] === method; - } - if (matching) { - indexes.push(i); - } - } - - // No matching pattern, return 'everything-else' index - if (indexes.length === 0) { - for (i = 0, j = methodsOrder.length; i < j; i++) { - if (methodsOrder[i] === 'everything-else') { - indexes.push(i); - } - } - } - - // No matching pattern and no 'everything-else' group - if (indexes.length === 0) { - indexes.push(Infinity); - } - - return indexes; - } - - /** - * Get properties name - * @param {Object} node - Property. - * @returns {String} Property name. - */ - function getPropertyName(node) { - - // Special case for class properties - // (babel-eslint does not expose property name so we have to rely on tokens) - if (node.type === 'ClassProperty') { - var tokens = context.getFirstTokens(node, 2); - return tokens[1] && tokens[1].type === 'Identifier' ? tokens[1].value : tokens[0].value; - } - - return node.key.name; - } - - /** - * Store a new error in the error list - * @param {Object} propA - Mispositioned property. - * @param {Object} propB - Reference property. - */ - function storeError(propA, propB) { - // Initialize the error object if needed - if (!errors[propA.index]) { - errors[propA.index] = { - node: propA.node, - score: 0, - closest: { - distance: Infinity, - ref: { - node: null, - index: 0 - } - } - }; - } - // Increment the prop score - errors[propA.index].score++; - // Stop here if we already have a closer reference - if (Math.abs(propA.index - propB.index) > errors[propA.index].closest.distance) { - return; - } - // Update the closest reference - errors[propA.index].closest.distance = Math.abs(propA.index - propB.index); - errors[propA.index].closest.ref.node = propB.node; - errors[propA.index].closest.ref.index = propB.index; - } - - /** - * Dedupe errors, only keep the ones with the highest score and delete the others - */ - function dedupeErrors() { - for (var i in errors) { - if (!errors.hasOwnProperty(i)) { - continue; - } - var index = errors[i].closest.ref.index; - if (!errors[index]) { - continue; - } - if (errors[i].score > errors[index].score) { - delete errors[index]; - } else { - delete errors[i]; - } - } - } - - /** - * Report errors - */ - function reportErrors() { - dedupeErrors(); - - var nodeA; - var nodeB; - var indexA; - var indexB; - for (var i in errors) { - if (!errors.hasOwnProperty(i)) { - continue; - } - - nodeA = errors[i].node; - nodeB = errors[i].closest.ref.node; - indexA = i; - indexB = errors[i].closest.ref.index; - - context.report(nodeA, MISPOSITION_MESSAGE, { - propA: getPropertyName(nodeA), - propB: getPropertyName(nodeB), - position: indexA < indexB ? 'before' : 'after' - }); - } - } - - /** - * Get properties for a given AST node - * @param {ASTNode} node The AST node being checked. - * @returns {Array} Properties array. - */ - function getComponentProperties(node) { - switch (node.type) { - case 'ClassDeclaration': - return node.body.body; - case 'ObjectExpression': - return node.properties; - default: - return []; - } - } - - /** - * Compare two properties and find out if they are in the right order - * @param {Array} propertiesNames Array containing all the properties names. - * @param {String} propA First property name. - * @param {String} propB Second property name. - * @returns {Object} Object containing a correct true/false flag and the correct indexes for the two properties. - */ - function comparePropsOrder(propertiesNames, propA, propB) { - var i; - var j; - var k; - var l; - var refIndexA; - var refIndexB; - - // Get references indexes (the correct position) for given properties - var refIndexesA = getRefPropIndexes(propA); - var refIndexesB = getRefPropIndexes(propB); - - // Get current indexes for given properties - var classIndexA = propertiesNames.indexOf(propA); - var classIndexB = propertiesNames.indexOf(propB); - - // Loop around the references indexes for the 1st property - for (i = 0, j = refIndexesA.length; i < j; i++) { - refIndexA = refIndexesA[i]; - - // Loop around the properties for the 2nd property (for comparison) - for (k = 0, l = refIndexesB.length; k < l; k++) { - refIndexB = refIndexesB[k]; - - if ( - // Comparing the same properties - refIndexA === refIndexB || - // 1st property is placed before the 2nd one in reference and in current component - refIndexA < refIndexB && classIndexA < classIndexB || - // 1st property is placed after the 2nd one in reference and in current component - refIndexA > refIndexB && classIndexA > classIndexB - ) { - return { - correct: true, - indexA: classIndexA, - indexB: classIndexB - }; - } - - } - } - - // We did not find any correct match between reference and current component - return { - correct: false, - indexA: refIndexA, - indexB: refIndexB - }; - } - - /** - * Check properties order from a properties list and store the eventual errors - * @param {Array} properties Array containing all the properties. - */ - function checkPropsOrder(properties) { - var propertiesNames = properties.map(getPropertyName); - var i; - var j; - var k; - var l; - var propA; - var propB; - var order; - - // Loop around the properties - for (i = 0, j = propertiesNames.length; i < j; i++) { - propA = propertiesNames[i]; - - // Loop around the properties a second time (for comparison) - for (k = 0, l = propertiesNames.length; k < l; k++) { - propB = propertiesNames[k]; - - // Compare the properties order - order = comparePropsOrder(propertiesNames, propA, propB); - - // Continue to next comparison is order is correct - if (order.correct === true) { - continue; - } - - // Store an error if the order is incorrect - storeError({ - node: properties[i], - index: order.indexA - }, { - node: properties[k], - index: order.indexB - }); - } - } - - } - - return { - 'Program:exit': function() { - var list = components.list(); - for (var component in list) { - if (!list.hasOwnProperty(component)) { - continue; - } - var properties = getComponentProperties(list[component].node); - checkPropsOrder(properties); - } - - reportErrors(); - } - }; - -}); - -module.exports.schema = [{ - type: 'object', - properties: { - order: { - type: 'array', - items: { - type: 'string' - } - }, - groups: { - type: 'object', - patternProperties: { - '^.*$': { - type: 'array', - items: { - type: 'string' - } - } - } - } - }, - additionalProperties: false -}]; diff --git a/node_modules/eslint-plugin-react/lib/rules/wrap-multilines.js b/node_modules/eslint-plugin-react/lib/rules/wrap-multilines.js deleted file mode 100644 index 0fc0a73..0000000 --- a/node_modules/eslint-plugin-react/lib/rules/wrap-multilines.js +++ /dev/null @@ -1,103 +0,0 @@ -/** - * @fileoverview Prevent missing parentheses around multilines JSX - * @author Yannick Croissant - */ -'use strict'; - -// ------------------------------------------------------------------------------ -// Constants -// ------------------------------------------------------------------------------ - -var DEFAULTS = { - declaration: true, - assignment: true, - return: true -}; - -// ------------------------------------------------------------------------------ -// Rule Definition -// ------------------------------------------------------------------------------ - -module.exports = function(context) { - - var sourceCode = context.getSourceCode(); - - function isParenthesised(node) { - var previousToken = context.getTokenBefore(node); - var nextToken = context.getTokenAfter(node); - - return previousToken && nextToken && - previousToken.value === '(' && previousToken.range[1] <= node.range[0] && - nextToken.value === ')' && nextToken.range[0] >= node.range[1]; - } - - function isMultilines(node) { - return node.loc.start.line !== node.loc.end.line; - } - - function check(node) { - if (!node || node.type !== 'JSXElement') { - return; - } - - if (!isParenthesised(node) && isMultilines(node)) { - context.report({ - node: node, - message: 'Missing parentheses around multilines JSX', - fix: function(fixer) { - return fixer.replaceText(node, '(' + sourceCode.getText(node) + ')'); - } - }); - } - } - - function isEnabled(type) { - var userOptions = context.options[0] || {}; - if (({}).hasOwnProperty.call(userOptions, type)) { - return userOptions[type]; - } - return DEFAULTS[type]; - } - - // -------------------------------------------------------------------------- - // Public - // -------------------------------------------------------------------------- - - return { - - VariableDeclarator: function(node) { - if (isEnabled('declaration')) { - check(node.init); - } - }, - - AssignmentExpression: function(node) { - if (isEnabled('assignment')) { - check(node.right); - } - }, - - ReturnStatement: function(node) { - if (isEnabled('return')) { - check(node.argument); - } - } - }; - -}; - -module.exports.schema = [{ - type: 'object', - properties: { - declaration: { - type: 'boolean' - }, - assignment: { - type: 'boolean' - }, - return: { - type: 'boolean' - } - }, - additionalProperties: false -}]; diff --git a/node_modules/eslint-plugin-react/lib/util/Components.js b/node_modules/eslint-plugin-react/lib/util/Components.js deleted file mode 100644 index b0e190a..0000000 --- a/node_modules/eslint-plugin-react/lib/util/Components.js +++ /dev/null @@ -1,412 +0,0 @@ -/** - * @fileoverview Utility class and functions for React components detection - * @author Yannick Croissant - */ -'use strict'; - -var util = require('util'); -var variableUtil = require('./variable'); -var pragmaUtil = require('./pragma'); - -/** - * Components - * @class - */ -function Components() { - this._list = {}; - this._getId = function(node) { - return node && node.range.join(':'); - }; -} - -/** - * Add a node to the components list, or update it if it's already in the list - * - * @param {ASTNode} node The AST node being added. - * @param {Number} confidence Confidence in the component detection (0=banned, 1=maybe, 2=yes) - */ -Components.prototype.add = function(node, confidence) { - var id = this._getId(node); - if (this._list[id]) { - if (confidence === 0 || this._list[id].confidence === 0) { - this._list[id].confidence = 0; - } else { - this._list[id].confidence = Math.max(this._list[id].confidence, confidence); - } - return; - } - this._list[id] = { - node: node, - confidence: confidence - }; -}; - -/** - * Find a component in the list using its node - * - * @param {ASTNode} node The AST node being searched. - * @returns {Object} Component object, undefined if the component is not found - */ -Components.prototype.get = function(node) { - var id = this._getId(node); - return this._list[id]; -}; - -/** - * Update a component in the list - * - * @param {ASTNode} node The AST node being updated. - * @param {Object} props Additional properties to add to the component. - */ -Components.prototype.set = function(node, props) { - while (node && !this._list[this._getId(node)]) { - node = node.parent; - } - if (!node) { - return; - } - var id = this._getId(node); - this._list[id] = util._extend(this._list[id], props); -}; - -/** - * Return the components list - * Components for which we are not confident are not returned - * - * @returns {Object} Components list - */ -Components.prototype.list = function() { - var list = {}; - for (var i in this._list) { - if (!this._list.hasOwnProperty(i) || this._list[i].confidence < 2) { - continue; - } - list[i] = this._list[i]; - } - return list; -}; - -/** - * Return the length of the components list - * Components for which we are not confident are not counted - * - * @returns {Number} Components list length - */ -Components.prototype.length = function() { - var length = 0; - for (var i in this._list) { - if (!this._list.hasOwnProperty(i) || this._list[i].confidence < 2) { - continue; - } - length++; - } - return length; -}; - -function componentRule(rule, context) { - - var pragma = pragmaUtil.getFromContext(context); - var sourceCode = context.getSourceCode(); - var components = new Components(); - - // Utilities for component detection - var utils = { - - /** - * Check if the node is a React ES5 component - * - * @param {ASTNode} node The AST node being checked. - * @returns {Boolean} True if the node is a React ES5 component, false if not - */ - isES5Component: function(node) { - if (!node.parent) { - return false; - } - return new RegExp('^(' + pragma + '\\.)?createClass$').test(sourceCode.getText(node.parent.callee)); - }, - - /** - * Check if the node is a React ES6 component - * - * @param {ASTNode} node The AST node being checked. - * @returns {Boolean} True if the node is a React ES6 component, false if not - */ - isES6Component: function(node) { - if (!node.superClass) { - return false; - } - return new RegExp('^(' + pragma + '\\.)?Component$').test(sourceCode.getText(node.superClass)); - }, - - /** - * Check if the node is returning JSX - * - * @param {ASTNode} node The AST node being checked (must be a ReturnStatement). - * @returns {Boolean} True if the node is returning JSX, false if not - */ - isReturningJSX: function(node) { - var property; - switch (node.type) { - case 'ReturnStatement': - property = 'argument'; - break; - case 'ArrowFunctionExpression': - property = 'body'; - break; - default: - return false; - } - - var returnsJSX = - node[property] && - node[property].type === 'JSXElement' - ; - var returnsReactCreateElement = - node[property] && - node[property].callee && - node[property].callee.property && - node[property].callee.property.name === 'createElement' - ; - - return Boolean(returnsJSX || returnsReactCreateElement); - }, - - /** - * Get the parent component node from the current scope - * - * @returns {ASTNode} component node, null if we are not in a component - */ - getParentComponent: function() { - return ( - utils.getParentES6Component() || - utils.getParentES5Component() || - utils.getParentStatelessComponent() - ); - }, - - /** - * Get the parent ES5 component node from the current scope - * - * @returns {ASTNode} component node, null if we are not in a component - */ - getParentES5Component: function() { - var scope = context.getScope(); - while (scope) { - var node = scope.block && scope.block.parent && scope.block.parent.parent; - if (node && utils.isES5Component(node)) { - return node; - } - scope = scope.upper; - } - return null; - }, - - /** - * Get the parent ES6 component node from the current scope - * - * @returns {ASTNode} component node, null if we are not in a component - */ - getParentES6Component: function() { - var scope = context.getScope(); - while (scope && scope.type !== 'class') { - scope = scope.upper; - } - var node = scope && scope.block; - if (!node || !utils.isES6Component(node)) { - return null; - } - return node; - }, - - /** - * Get the parent stateless component node from the current scope - * - * @returns {ASTNode} component node, null if we are not in a component - */ - getParentStatelessComponent: function() { - var scope = context.getScope(); - while (scope) { - var node = scope.block; - var isFunction = /Function/.test(node.type); // Ignore non functions - var isNotMethod = !node.parent || node.parent.type !== 'MethodDefinition'; // Ignore classes methods - var isNotArgument = !node.parent || node.parent.type !== 'CallExpression'; // Ignore arguments (callback, etc.) - if (isFunction && isNotMethod && isNotArgument) { - return node; - } - scope = scope.upper; - } - return null; - }, - - /** - * Get the related component from a node - * - * @param {ASTNode} node The AST node being checked (must be a MemberExpression). - * @returns {ASTNode} component node, null if we cannot find the component - */ - getRelatedComponent: function(node) { - var i; - var j; - var k; - var l; - // Get the component path - var componentPath = []; - while (node) { - if (node.property && node.property.type === 'Identifier') { - componentPath.push(node.property.name); - } - if (node.object && node.object.type === 'Identifier') { - componentPath.push(node.object.name); - } - node = node.object; - } - componentPath.reverse(); - - // Find the variable in the current scope - var variableName = componentPath.shift(); - if (!variableName) { - return null; - } - var variableInScope; - var variables = variableUtil.variablesInScope(context); - for (i = 0, j = variables.length; i < j; i++) { - if (variables[i].name === variableName) { - variableInScope = variables[i]; - break; - } - } - if (!variableInScope) { - return null; - } - - // Find the variable declaration - var defInScope; - var defs = variableInScope.defs; - for (i = 0, j = defs.length; i < j; i++) { - if (defs[i].type === 'ClassName' || defs[i].type === 'FunctionName' || defs[i].type === 'Variable') { - defInScope = defs[i]; - break; - } - } - if (!defInScope || !defInScope.node) { - return null; - } - node = defInScope.node.init || defInScope.node; - - // Traverse the node properties to the component declaration - for (i = 0, j = componentPath.length; i < j; i++) { - if (!node.properties) { - continue; - } - for (k = 0, l = node.properties.length; k < l; k++) { - if (node.properties[k].key.name === componentPath[i]) { - node = node.properties[k]; - break; - } - } - if (!node || !node.value) { - return null; - } - node = node.value; - } - - // Return the component - return components.get(node); - } - }; - - // Component detection instructions - var detectionInstructions = { - ClassDeclaration: function(node) { - if (!utils.isES6Component(node)) { - return; - } - components.add(node, 2); - }, - - ClassProperty: function(node) { - node = utils.getParentComponent(); - if (!node) { - return; - } - components.add(node, 2); - }, - - ObjectExpression: function(node) { - if (!utils.isES5Component(node)) { - return; - } - components.add(node, 2); - }, - - FunctionExpression: function(node) { - node = utils.getParentComponent(); - if (!node) { - return; - } - components.add(node, 1); - }, - - FunctionDeclaration: function(node) { - node = utils.getParentComponent(); - if (!node) { - return; - } - components.add(node, 1); - }, - - ArrowFunctionExpression: function(node) { - node = utils.getParentComponent(); - if (!node) { - return; - } - if (node.expression && utils.isReturningJSX(node)) { - components.add(node, 2); - } else { - components.add(node, 1); - } - }, - - ThisExpression: function(node) { - node = utils.getParentComponent(); - if (!node || !/Function/.test(node.type)) { - return; - } - // Ban functions with a ThisExpression - components.add(node, 0); - }, - - BlockComment: function(node) { - pragma = pragmaUtil.getFromNode(node) || pragma; - }, - - ReturnStatement: function(node) { - if (!utils.isReturningJSX(node)) { - return; - } - node = utils.getParentComponent(); - if (!node) { - return; - } - components.add(node, 2); - } - }; - - // Update the provided rule instructions to add the component detection - var ruleInstructions = rule(context, components, utils); - var updatedRuleInstructions = util._extend({}, ruleInstructions); - Object.keys(detectionInstructions).forEach(function(instruction) { - updatedRuleInstructions[instruction] = function(node) { - detectionInstructions[instruction](node); - return ruleInstructions[instruction] ? ruleInstructions[instruction](node) : void 0; - }; - }); - // Return the updated rule instructions - return updatedRuleInstructions; -} - -Components.detect = function(rule) { - return componentRule.bind(this, rule); -}; - -module.exports = Components; diff --git a/node_modules/eslint-plugin-react/lib/util/pragma.js b/node_modules/eslint-plugin-react/lib/util/pragma.js deleted file mode 100644 index 479257f..0000000 --- a/node_modules/eslint-plugin-react/lib/util/pragma.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @fileoverview Utility functions for React pragma configuration - * @author Yannick Croissant - */ -'use strict'; - -var JSX_ANNOTATION_REGEX = /^\*\s*@jsx\s+([^\s]+)/; - -function getFromContext(context) { - var pragma = 'React'; - // .eslintrc shared settings (http://eslint.org/docs/user-guide/configuring#adding-shared-settings) - if (context.settings.react && context.settings.react.pragma) { - pragma = context.settings.react.pragma; - // Deprecated pragma option, here for backward compatibility - } else if (context.options[0] && context.options[0].pragma) { - pragma = context.options[0].pragma; - } - return pragma.split('.')[0]; -} - -function getFromNode(node) { - var matches = JSX_ANNOTATION_REGEX.exec(node.value); - if (!matches) { - return false; - } - return matches[1].split('.')[0]; -} - -module.exports = { - getFromContext: getFromContext, - getFromNode: getFromNode -}; diff --git a/node_modules/eslint-plugin-react/lib/util/variable.js b/node_modules/eslint-plugin-react/lib/util/variable.js deleted file mode 100644 index 5ba2f62..0000000 --- a/node_modules/eslint-plugin-react/lib/util/variable.js +++ /dev/null @@ -1,92 +0,0 @@ -/** - * @fileoverview Utility functions for React components detection - * @author Yannick Croissant - */ -'use strict'; - -/** - * Record that a particular variable has been used in code - * - * @param {Object} context The current rule context. - * @param {String} name The name of the variable to mark as used. - * @returns {Boolean} True if the variable was found and marked as used, false if not. - */ -function markVariableAsUsed(context, name) { - var scope = context.getScope(); - var variables; - var i; - var len; - var found = false; - - // Special Node.js scope means we need to start one level deeper - if (scope.type === 'global') { - while (scope.childScopes.length) { - scope = scope.childScopes[0]; - } - } - - do { - variables = scope.variables; - for (i = 0, len = variables.length; i < len; i++) { - if (variables[i].name === name) { - variables[i].eslintUsed = true; - found = true; - } - } - scope = scope.upper; - } while (scope); - - return found; -} - -/** - * Search a particular variable in a list - * @param {Array} variables The variables list. - * @param {Array} name The name of the variable to search. - * @returns {Boolean} True if the variable was found, false if not. - */ -function findVariable(variables, name) { - var i; - var len; - - for (i = 0, len = variables.length; i < len; i++) { - if (variables[i].name === name) { - return true; - } - } - - return false; -} - -/** - * List all variable in a given scope - * - * Contain a patch for babel-eslint to avoid https://github.com/babel/babel-eslint/issues/21 - * - * @param {Object} context The current rule context. - * @param {Array} name The name of the variable to search. - * @returns {Boolean} True if the variable was found, false if not. - */ -function variablesInScope(context) { - var scope = context.getScope(); - var variables = scope.variables; - - while (scope.type !== 'global') { - scope = scope.upper; - variables = scope.variables.concat(variables); - } - if (scope.childScopes.length) { - variables = scope.childScopes[0].variables.concat(variables); - if (scope.childScopes[0].childScopes.length) { - variables = scope.childScopes[0].childScopes[0].variables.concat(variables); - } - } - - return variables; -} - -module.exports = { - findVariable: findVariable, - variablesInScope: variablesInScope, - markVariableAsUsed: markVariableAsUsed -}; diff --git a/node_modules/eslint-plugin-react/package.json b/node_modules/eslint-plugin-react/package.json deleted file mode 100644 index 3cb4a57..0000000 --- a/node_modules/eslint-plugin-react/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "eslint-plugin-react", - "version": "3.16.1", - "author": { - "name": "Yannick Croissant", - "email": "yannick.croissant+npm@gmail.com" - }, - "description": "React specific linting rules for ESLint", - "main": "index.js", - "scripts": { - "coveralls": "cat ./reports/coverage/lcov.info | coveralls", - "lint": "eslint ./", - "test": "npm run lint && npm run unit-test", - "unit-test": "istanbul cover --dir reports/coverage node_modules/mocha/bin/_mocha tests/**/*.js -- --reporter dot" - }, - "files": [ - "LICENSE", - "README.md", - "index.js", - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/yannickcr/eslint-plugin-react.git" - }, - "homepage": "https://github.com/yannickcr/eslint-plugin-react", - "bugs": { - "url": "https://github.com/yannickcr/eslint-plugin-react/issues" - }, - "devDependencies": { - "babel-eslint": "5.0.0-beta6", - "coveralls": "2.11.6", - "eslint": "2.0.0-beta.2", - "istanbul": "0.4.2", - "mocha": "2.3.4" - }, - "keywords": [ - "eslint", - "eslint-plugin", - "eslintplugin", - "react" - ], - "license": "MIT", - "gitHead": "c06ebd84bd5e5655a687d0fd7a150b3c10bf8c93", - "_id": "eslint-plugin-react@3.16.1", - "_shasum": "262d96b77d7c4a42af809a73c0e527a58612293c", - "_from": "eslint-plugin-react@*", - "_npmVersion": "3.2.2", - "_nodeVersion": "4.0.0", - "_npmUser": { - "name": "yannickcr", - "email": "yannick.croissant+npm@gmail.com" - }, - "dist": { - "shasum": "262d96b77d7c4a42af809a73c0e527a58612293c", - "tarball": "http://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-3.16.1.tgz" - }, - "maintainers": [ - { - "name": "yannickcr", - "email": "yannick.croissant+npm@gmail.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-3.16.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/LICENSE b/node_modules/eslint/LICENSE deleted file mode 100644 index 3f7b4ba..0000000 --- a/node_modules/eslint/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -ESLint -Copyright (c) 2013 Nicholas C. Zakas. 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. diff --git a/node_modules/eslint/README.md b/node_modules/eslint/README.md deleted file mode 100644 index 099a0df..0000000 --- a/node_modules/eslint/README.md +++ /dev/null @@ -1,126 +0,0 @@ -[![NPM version][npm-image]][npm-url] -[![build status][travis-image]][travis-url] -[![Test coverage][coveralls-image]][coveralls-url] -[![Downloads][downloads-image]][downloads-url] -[![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=282608)](https://www.bountysource.com/trackers/282608-eslint?utm_source=282608&utm_medium=shield&utm_campaign=TRACKER_BADGE) -[![Join the chat at https://gitter.im/eslint/eslint](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/eslint/eslint?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - -# ESLint - -[Website](http://eslint.org) | [Configuring](http://eslint.org/docs/user-guide/configuring) | [Rules](http://eslint.org/docs/rules/) | [Contributing](http://eslint.org/docs/developer-guide/contributing) | [Twitter](https://twitter.com/geteslint) | [Mailing List](https://groups.google.com/group/eslint) - -ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. In many ways, it is similar to JSLint and JSHint with a few exceptions: - -* ESLint uses [Espree](https://github.com/eslint/espree) for JavaScript parsing. -* ESLint uses an AST to evaluate patterns in code. -* ESLint is completely pluggable, every single rule is a plugin and you can add more at runtime. - -## Installation - -You can install ESLint using npm: - - npm install -g eslint - -## Usage - -If it's your first time using ESLint, you should set up a config file using `--init`: - - eslint --init - -After that, you can run ESLint on any JavaScript file: - - eslint test.js test2.js - -## Configuration - -After running `eslint --init`, you'll have a `.eslintrc` file in your directory. In it, you'll see some rules configured like this: - -```json -{ - "rules": { - "semi": [2, "always"], - "quotes": [2, "double"] - } -} -``` - -The names `"semi"` and `"quotes"` are the names of [rules](http://eslint.org/docs/rules) in ESLint. The number is the error level of the rule and can be one of the three values: - -* `0` - turn the rule off -* `1` - turn the rule on as a warning (doesn't affect exit code) -* `2` - turn the rule on as an error (exit code will be 1) - -The three error levels allow you fine-grained control over how ESLint applies rules (for more configuration options and details, see the [configuration docs](http://eslint.org/docs/user-guide/configuring)). - -## Sponsors - -* Development is sponsored by [Box](https://box.com) - -## Team - -These folks keep the project moving and are resources for help: - -* Nicholas C. Zakas ([@nzakas](https://github.com/nzakas)) - project lead -* Ilya Volodin ([@ilyavolodin](https://github.com/ilyavolodin)) - reviewer -* Brandon Mills ([@btmills](https://github.com/btmills)) - reviewer -* Gyandeep Singh ([@gyandeeps](https://github.com/gyandeeps)) - reviewer -* Mathias Schreck ([@lo1tuma](https://github.com/lo1tuma)) - committer -* Jamund Ferguson ([@xjamundx](https://github.com/xjamundx)) - committer -* Ian VanSchooten ([@ianvs](https://github.com/ianvs)) - committer -* Toru Nagashima ([@mysticatea](https://github.com/mysticatea)) - committer -* Burak Yiğit Kaya ([@byk](https://github.com/byk)) - committer -* Alberto Rodríguez ([@alberto](https://github.com/alberto)) - committer - -## Releases - -We have scheduled releases every two weeks on Friday or Saturday. - -## Frequently Asked Questions - -### Why don't you like JSHint??? - -I do like JSHint. And I like Anton and Rick. Neither of those were deciding factors in creating this tool. The fact is that I've had a dire need for a JavaScript tool with pluggable linting rules. I had hoped JSHint would be able to do this, however after chatting with Anton, I found that the planned plugin infrastructure wasn't going to suit my purpose. - -### I'm not giving up JSHint for this! - -That's not really a question, but I got it. I'm not trying to convince you that ESLint is better than JSHint. The only thing I know is that ESLint is better than JSHint for what I'm doing. In the off chance you're doing something similar, it might be better for you. Otherwise, keep using JSHint, I'm certainly not going to tell you to stop using it. - -### How does ESLint performance compare to JSHint and JSCS? - -ESLint is slower than JSHint, usually 2-3x slower on a single file. This is because ESLint uses Espree to construct an AST before it can evaluate your code whereas JSHint evaluates your code as it's being parsed. The speed is also based on the number of rules you enable; the more rules you enable, the slower the process. - -Despite being slower, we believe that ESLint is fast enough to replace JSHint without causing significant pain. - -ESLint is faster than JSCS, as ESLint uses a single-pass traversal for analysis whereas JSCS using a querying model. - -If you are using both JSHint and JSCS on your files, then using just ESLint will be faster. - -### Is ESLint just linting or does it also check style? - -ESLint does both traditional linting (looking for problematic patterns) and style checking (enforcement of conventions). You can use it for both. - -### What about ECMAScript 6 support? - -ESLint has full support for ECMAScript 6. By default, this support is off. You can enable ECMAScript 6 support through [configuration](http://eslint.org/docs/user-guide/configuring). - -### Does ESLint support JSX? - -Yes, ESLint natively supports parsing JSX syntax (this must be enabled in [configuration](http://eslint.org/docs/user-guide/configuring).). Please note that supporting JSX syntax *is not* the same as supporting React. React applies specific semantics to JSX syntax that ESLint doesn't recognize. We recommend using [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react) if you are using React and want React semantics. - -### What about ECMAScript 7/2016 and experimental features? - -ESLint doesn't natively support experimental ECMAScript language features. You can use [babel-eslint](https://github.com/babel/babel-eslint) to use any option available in Babel. - -### Where to ask for help? - -Join our [Mailing List](https://groups.google.com/group/eslint) or [Chatroom](https://gitter.im/eslint/eslint) - - -[npm-image]: https://img.shields.io/npm/v/eslint.svg?style=flat-square -[npm-url]: https://www.npmjs.com/package/eslint -[travis-image]: https://img.shields.io/travis/eslint/eslint/master.svg?style=flat-square -[travis-url]: https://travis-ci.org/eslint/eslint -[coveralls-image]: https://img.shields.io/coveralls/eslint/eslint/master.svg?style=flat-square -[coveralls-url]: https://coveralls.io/r/eslint/eslint?branch=master -[downloads-image]: https://img.shields.io/npm/dm/eslint.svg?style=flat-square -[downloads-url]: https://www.npmjs.com/package/eslint diff --git a/node_modules/eslint/bin/eslint.js b/node_modules/eslint/bin/eslint.js deleted file mode 100755 index 8c7bce9..0000000 --- a/node_modules/eslint/bin/eslint.js +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env node - -/** - * @fileoverview Main CLI that is run via the eslint command. - * @author Nicholas C. Zakas - * @copyright 2013 Nicholas C. Zakas. All rights reserved. - * See LICENSE file in root directory for full license. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -var exitCode = 0, - useStdIn = (process.argv.indexOf("--stdin") > -1), - init = (process.argv.indexOf("--init") > -1), - debug = (process.argv.indexOf("--debug") > -1); - -// must do this initialization *before* other requires in order to work -if (debug) { - require("debug").enable("eslint:*"); -} - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -// now we can safely include the other modules that use debug -var concat = require("concat-stream"), - cli = require("../lib/cli"); - -//------------------------------------------------------------------------------ -// Execution -//------------------------------------------------------------------------------ - -if (useStdIn) { - process.stdin.pipe(concat({ encoding: "string" }, function(text) { - try { - exitCode = cli.execute(process.argv, text); - } catch (ex) { - console.error(ex.message); - console.error(ex.stack); - exitCode = 1; - } - })); -} else if (init) { - var configInit = require("../lib/config/config-initializer"); - configInit.initializeConfig(function(err) { - if (err) { - exitCode = 1; - console.error(err.message); - console.error(err.stack); - } else { - exitCode = 0; - } - }); -} else { - exitCode = cli.execute(process.argv); -} - -/* - * Wait for the stdout buffer to drain. - * See https://github.com/eslint/eslint/issues/317 - */ -process.on("exit", function() { - process.exit(exitCode); -}); diff --git a/node_modules/eslint/conf/blank-script.json b/node_modules/eslint/conf/blank-script.json deleted file mode 100644 index d7d7d37..0000000 --- a/node_modules/eslint/conf/blank-script.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "type": "Program", - "body": [], - "sourceType": "script", - "range": [ - 0, - 0 - ], - "loc": { - "start": { - "line": 0, - "column": 0 - }, - "end": { - "line": 0, - "column": 0 - } - }, - "comments": [], - "tokens": [] -} diff --git a/node_modules/eslint/conf/environments.js b/node_modules/eslint/conf/environments.js deleted file mode 100644 index f66aebc..0000000 --- a/node_modules/eslint/conf/environments.js +++ /dev/null @@ -1,114 +0,0 @@ -/** - * @fileoverview Defines environment settings and globals. - * @author Elan Shanker - * @copyright 2014 Elan Shanker. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var globals = require("globals"); - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -module.exports = { - builtin: globals.builtin, - browser: { - globals: globals.browser - }, - node: { - globals: globals.node, - ecmaFeatures: { - globalReturn: true - } - }, - commonjs: { - globals: globals.commonjs, - ecmaFeatures: { - globalReturn: true - } - }, - worker: { - globals: globals.worker - }, - amd: { - globals: globals.amd - }, - mocha: { - globals: globals.mocha - }, - jasmine: { - globals: globals.jasmine - }, - jest: { - globals: globals.jest - }, - phantomjs: { - globals: globals.phantomjs - }, - jquery: { - globals: globals.jquery - }, - qunit: { - globals: globals.qunit - }, - prototypejs: { - globals: globals.prototypejs - }, - shelljs: { - globals: globals.shelljs - }, - meteor: { - globals: globals.meteor - }, - mongo: { - globals: globals.mongo - }, - protractor: { - globals: globals.protractor - }, - applescript: { - globals: globals.applescript - }, - nashorn: { - globals: globals.nashorn - }, - serviceworker: { - globals: globals.serviceworker - }, - embertest: { - globals: globals.embertest - }, - webextensions: { - globals: globals.webextensions - }, - es6: { - ecmaFeatures: { - arrowFunctions: true, - blockBindings: true, - regexUFlag: true, - regexYFlag: true, - templateStrings: true, - binaryLiterals: true, - octalLiterals: true, - unicodeCodePointEscapes: true, - superInFunctions: true, - defaultParams: true, - restParams: true, - forOf: true, - objectLiteralComputedProperties: true, - objectLiteralShorthandMethods: true, - objectLiteralShorthandProperties: true, - objectLiteralDuplicateProperties: true, - generators: true, - destructuring: true, - classes: true, - spread: true, - newTarget: true - } - } -}; diff --git a/node_modules/eslint/conf/eslint.json b/node_modules/eslint/conf/eslint.json deleted file mode 100644 index 4984ba8..0000000 --- a/node_modules/eslint/conf/eslint.json +++ /dev/null @@ -1,196 +0,0 @@ -{ - "parser": "espree", - "ecmaFeatures": {}, - "rules": { - "no-alert": 0, - "no-array-constructor": 0, - "no-arrow-condition": 0, - "no-bitwise": 0, - "no-caller": 0, - "no-case-declarations": 0, - "no-catch-shadow": 0, - "no-class-assign": 0, - "no-cond-assign": 2, - "no-console": 2, - "no-const-assign": 0, - "no-constant-condition": 2, - "no-continue": 0, - "no-control-regex": 2, - "no-debugger": 2, - "no-delete-var": 2, - "no-div-regex": 0, - "no-dupe-class-members": 0, - "no-dupe-keys": 2, - "no-dupe-args": 2, - "no-duplicate-case": 2, - "no-else-return": 0, - "no-empty": 2, - "no-empty-character-class": 2, - "no-empty-label": 0, - "no-empty-pattern": 0, - "no-eq-null": 0, - "no-eval": 0, - "no-ex-assign": 2, - "no-extend-native": 0, - "no-extra-bind": 0, - "no-extra-boolean-cast": 2, - "no-extra-parens": 0, - "no-extra-semi": 2, - "no-fallthrough": 2, - "no-floating-decimal": 0, - "no-func-assign": 2, - "no-implicit-coercion": 0, - "no-implied-eval": 0, - "no-inline-comments": 0, - "no-inner-declarations": [2, "functions"], - "no-invalid-regexp": 2, - "no-invalid-this": 0, - "no-irregular-whitespace": 2, - "no-iterator": 0, - "no-label-var": 0, - "no-labels": 0, - "no-lone-blocks": 0, - "no-lonely-if": 0, - "no-loop-func": 0, - "no-mixed-requires": [0, false], - "no-mixed-spaces-and-tabs": [2, false], - "linebreak-style": [0, "unix"], - "no-multi-spaces": 0, - "no-multi-str": 0, - "no-multiple-empty-lines": [0, {"max": 2}], - "no-native-reassign": 0, - "no-negated-condition": 0, - "no-negated-in-lhs": 2, - "no-nested-ternary": 0, - "no-new": 0, - "no-new-func": 0, - "no-new-object": 0, - "no-new-require": 0, - "no-new-wrappers": 0, - "no-obj-calls": 2, - "no-octal": 2, - "no-octal-escape": 0, - "no-param-reassign": 0, - "no-path-concat": 0, - "no-plusplus": 0, - "no-process-env": 0, - "no-process-exit": 0, - "no-proto": 0, - "no-redeclare": 2, - "no-regex-spaces": 2, - "no-restricted-modules": 0, - "no-restricted-syntax": 0, - "no-return-assign": 0, - "no-script-url": 0, - "no-self-compare": 0, - "no-sequences": 0, - "no-shadow": 0, - "no-shadow-restricted-names": 0, - "no-spaced-func": 0, - "no-sparse-arrays": 2, - "no-sync": 0, - "no-ternary": 0, - "no-trailing-spaces": 0, - "no-this-before-super": 0, - "no-throw-literal": 0, - "no-undef": 2, - "no-undef-init": 0, - "no-undefined": 0, - "no-unexpected-multiline": 0, - "no-underscore-dangle": 0, - "no-unneeded-ternary": 0, - "no-unreachable": 2, - "no-unused-expressions": 0, - "no-unused-vars": [2, {"vars": "all", "args": "after-used"}], - "no-use-before-define": 0, - "no-useless-call": 0, - "no-useless-concat": 0, - "no-void": 0, - "no-var": 0, - "no-warning-comments": [0, { "terms": ["todo", "fixme", "xxx"], "location": "start" }], - "no-with": 0, - "no-magic-numbers": 0, - - "array-bracket-spacing": [0, "never"], - "arrow-body-style": [0, "as-needed"], - "arrow-parens": 0, - "arrow-spacing": 0, - "accessor-pairs": 0, - "block-scoped-var": 0, - "block-spacing": 0, - "brace-style": [0, "1tbs"], - "callback-return": 0, - "camelcase": 0, - "comma-dangle": [2, "never"], - "comma-spacing": 0, - "comma-style": 0, - "complexity": [0, 11], - "computed-property-spacing": [0, "never"], - "consistent-return": 0, - "consistent-this": [0, "that"], - "constructor-super": 0, - "curly": [0, "all"], - "default-case": 0, - "dot-location": 0, - "dot-notation": [0, { "allowKeywords": true }], - "eol-last": 0, - "eqeqeq": 0, - "func-names": 0, - "func-style": [0, "declaration"], - "generator-star-spacing": 0, - "global-require": 0, - "guard-for-in": 0, - "handle-callback-err": 0, - "id-length": 0, - "indent": 0, - "init-declarations": 0, - "jsx-quotes": [0, "prefer-double"], - "key-spacing": [0, { "beforeColon": false, "afterColon": true }], - "lines-around-comment": 0, - "max-depth": [0, 4], - "max-len": [0, 80, 4], - "max-nested-callbacks": [0, 2], - "max-params": [0, 3], - "max-statements": [0, 10], - "new-cap": 0, - "new-parens": 0, - "newline-after-var": 0, - "object-curly-spacing": [0, "never"], - "object-shorthand": 0, - "one-var": [0, "always"], - "operator-assignment": [0, "always"], - "operator-linebreak": 0, - "padded-blocks": 0, - "prefer-arrow-callback": 0, - "prefer-const": 0, - "prefer-spread": 0, - "prefer-reflect": 0, - "prefer-template": 0, - "quote-props": 0, - "quotes": [0, "double"], - "radix": 0, - "id-match": 0, - "require-jsdoc": 0, - "require-yield": 0, - "semi": 0, - "semi-spacing": [0, {"before": false, "after": true}], - "sort-vars": 0, - "space-after-keywords": [0, "always"], - "space-before-keywords": [0, "always"], - "space-before-blocks": [0, "always"], - "space-before-function-paren": [0, "always"], - "space-in-parens": [0, "never"], - "space-infix-ops": 0, - "space-return-throw-case": 0, - "space-unary-ops": [0, { "words": true, "nonwords": false }], - "spaced-comment": 0, - "strict": 0, - "use-isnan": 2, - "valid-jsdoc": 0, - "valid-typeof": 2, - "vars-on-top": 0, - "wrap-iife": 0, - "wrap-regex": 0, - "yoda": [0, "never"] - } -} diff --git a/node_modules/eslint/conf/json-schema-schema.json b/node_modules/eslint/conf/json-schema-schema.json deleted file mode 100644 index 85eb502..0000000 --- a/node_modules/eslint/conf/json-schema-schema.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "id": "http://json-schema.org/draft-04/schema#", - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "Core schema meta-schema", - "definitions": { - "schemaArray": { - "type": "array", - "minItems": 1, - "items": { "$ref": "#" } - }, - "positiveInteger": { - "type": "integer", - "minimum": 0 - }, - "positiveIntegerDefault0": { - "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ] - }, - "simpleTypes": { - "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ] - }, - "stringArray": { - "type": "array", - "items": { "type": "string" }, - "minItems": 1, - "uniqueItems": true - } - }, - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uri" - }, - "$schema": { - "type": "string", - "format": "uri" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "default": {}, - "multipleOf": { - "type": "number", - "minimum": 0, - "exclusiveMinimum": true - }, - "maximum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "boolean", - "default": false - }, - "minimum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "boolean", - "default": false - }, - "maxLength": { "$ref": "#/definitions/positiveInteger" }, - "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" }, - "pattern": { - "type": "string", - "format": "regex" - }, - "additionalItems": { - "anyOf": [ - { "type": "boolean" }, - { "$ref": "#" } - ], - "default": {} - }, - "items": { - "anyOf": [ - { "$ref": "#" }, - { "$ref": "#/definitions/schemaArray" } - ], - "default": {} - }, - "maxItems": { "$ref": "#/definitions/positiveInteger" }, - "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" }, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "maxProperties": { "$ref": "#/definitions/positiveInteger" }, - "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" }, - "required": { "$ref": "#/definitions/stringArray" }, - "additionalProperties": { - "anyOf": [ - { "type": "boolean" }, - { "$ref": "#" } - ], - "default": {} - }, - "definitions": { - "type": "object", - "additionalProperties": { "$ref": "#" }, - "default": {} - }, - "properties": { - "type": "object", - "additionalProperties": { "$ref": "#" }, - "default": {} - }, - "patternProperties": { - "type": "object", - "additionalProperties": { "$ref": "#" }, - "default": {} - }, - "dependencies": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { "$ref": "#" }, - { "$ref": "#/definitions/stringArray" } - ] - } - }, - "enum": { - "type": "array", - "minItems": 1, - "uniqueItems": true - }, - "type": { - "anyOf": [ - { "$ref": "#/definitions/simpleTypes" }, - { - "type": "array", - "items": { "$ref": "#/definitions/simpleTypes" }, - "minItems": 1, - "uniqueItems": true - } - ] - }, - "allOf": { "$ref": "#/definitions/schemaArray" }, - "anyOf": { "$ref": "#/definitions/schemaArray" }, - "oneOf": { "$ref": "#/definitions/schemaArray" }, - "not": { "$ref": "#" } - }, - "dependencies": { - "exclusiveMaximum": [ "maximum" ], - "exclusiveMinimum": [ "minimum" ] - }, - "default": {} -} diff --git a/node_modules/eslint/conf/replacements.json b/node_modules/eslint/conf/replacements.json deleted file mode 100644 index 34a09d5..0000000 --- a/node_modules/eslint/conf/replacements.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "rules": { - "generator-star": ["generator-star-spacing"], - "global-strict": ["strict"], - "no-comma-dangle": ["comma-dangle"], - "no-empty-class": ["no-empty-character-class"], - "no-extra-strict": ["strict"], - "no-reserved-keys": ["quote-props"], - "no-space-before-semi": ["semi-spacing"], - "no-wrap-func": ["no-extra-parens"], - "space-after-function-name": ["space-before-function-paren"], - "space-before-function-parentheses": ["space-before-function-paren"], - "space-in-brackets": ["object-curly-spacing", "array-bracket-spacing", "computed-property-spacing"], - "space-unary-word-ops": ["space-unary-ops"], - "spaced-line-comment": ["spaced-comment"] - } -} diff --git a/node_modules/eslint/lib/api.js b/node_modules/eslint/lib/api.js deleted file mode 100644 index 664e9a5..0000000 --- a/node_modules/eslint/lib/api.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @fileoverview Expose out ESLint and CLI to require. - * @author Ian Christian Myers - */ - -"use strict"; - -module.exports = { - linter: require("./eslint"), - CLIEngine: require("./cli-engine"), - RuleTester: require("./testers/rule-tester"), - SourceCode: require("./util/source-code") -}; diff --git a/node_modules/eslint/lib/ast-utils.js b/node_modules/eslint/lib/ast-utils.js deleted file mode 100644 index 397d8da..0000000 --- a/node_modules/eslint/lib/ast-utils.js +++ /dev/null @@ -1,154 +0,0 @@ -/** - * @fileoverview Common utils for AST. - * @author Gyandeep Singh - * @copyright 2015 Gyandeep Singh. All rights reserved. - * See LICENSE file in root directory for full license. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var esutils = require("esutils"); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Checks reference if is non initializer and writable. - * @param {Reference} reference - A reference to check. - * @param {int} index - The index of the reference in the references. - * @param {Reference[]} references - The array that the reference belongs to. - * @returns {boolean} Success/Failure - * @private - */ -function isModifyingReference(reference, index, references) { - var identifier = reference.identifier; - - return (identifier && - reference.init === false && - reference.isWrite() && - // Destructuring assignments can have multiple default value, - // so possibly there are multiple writeable references for the same identifier. - (index === 0 || references[index - 1].identifier !== identifier) - ); -} - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -module.exports = { - - /** - * Determines whether two adjacent tokens are on the same line. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {boolean} Whether or not the tokens are on the same line. - * @public - */ - isTokenOnSameLine: function(left, right) { - return left.loc.end.line === right.loc.start.line; - }, - - /** - * Checks whether or not a node is `null` or `undefined`. - * @param {ASTNode} node - A node to check. - * @returns {boolean} Whether or not the node is a `null` or `undefined`. - * @public - */ - isNullOrUndefined: function(node) { - return ( - (node.type === "Literal" && node.value === null) || - (node.type === "Identifier" && node.name === "undefined") || - (node.type === "UnaryExpression" && node.operator === "void") - ); - }, - - /** - * Checks whether or not a given node is a string literal. - * @param {ASTNode} node - A node to check. - * @returns {boolean} `true` if the node is a string literal. - */ - isStringLiteral: function(node) { - return ( - (node.type === "Literal" && typeof node.value === "string") || - node.type === "TemplateLiteral" - ); - }, - - /** - * Gets references which are non initializer and writable. - * @param {Reference[]} references - An array of references. - * @returns {Reference[]} An array of only references which are non initializer and writable. - * @public - */ - getModifyingReferences: function(references) { - return references.filter(isModifyingReference); - }, - - /** - * Validate that a string passed in is surrounded by the specified character - * @param {string} val The text to check. - * @param {string} character The character to see if it's surrounded by. - * @returns {boolean} True if the text is surrounded by the character, false if not. - * @private - */ - isSurroundedBy: function(val, character) { - return val[0] === character && val[val.length - 1] === character; - }, - - /** - * Returns whether the provided node is an ESLint directive comment or not - * @param {LineComment|BlockComment} node The node to be checked - * @returns {boolean} `true` if the node is an ESLint directive comment - */ - isDirectiveComment: function(node) { - var comment = node.value.trim(); - return ( - node.type === "Line" && comment.indexOf("eslint-") === 0 || - node.type === "Block" && ( - comment.indexOf("global ") === 0 || - comment.indexOf("eslint ") === 0 || - comment.indexOf("eslint-") === 0 - ) - ); - }, - - /** - * Gets the trailing statement of a given node. - * - * if (code) - * consequent; - * - * When taking this `IfStatement`, returns `consequent;` statement. - * - * @param {ASTNode} A node to get. - * @returns {ASTNode|null} The trailing statement's node. - */ - getTrailingStatement: esutils.ast.trailingStatement, - - /** - * Finds the variable by a given name in a given scope and its upper scopes. - * - * @param {escope.Scope} initScope - A scope to start find. - * @param {string} name - A variable name to find. - * @returns {escope.Variable|null} A found variable or `null`. - */ - getVariableByName: function(initScope, name) { - var scope = initScope; - while (scope) { - var variable = scope.set.get(name); - if (variable) { - return variable; - } - - scope = scope.upper; - } - - return null; - } -}; diff --git a/node_modules/eslint/lib/cli-engine.js b/node_modules/eslint/lib/cli-engine.js deleted file mode 100644 index 3fff395..0000000 --- a/node_modules/eslint/lib/cli-engine.js +++ /dev/null @@ -1,730 +0,0 @@ -/** - * @fileoverview Main CLI object. - * @author Nicholas C. Zakas - * @copyright 2014 Nicholas C. Zakas. All rights reserved. - * See LICENSE in root directory for full license. - */ - -"use strict"; - -/* - * The CLI object should *not* call process.exit() directly. It should only return - * exit codes. This allows other programs to use the CLI object and still control - * when the program exits. - */ - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var fs = require("fs"), - path = require("path"), - - assign = require("object-assign"), - debug = require("debug"), - shell = require("shelljs"), - - rules = require("./rules"), - eslint = require("./eslint"), - IgnoredPaths = require("./ignored-paths"), - Config = require("./config"), - util = require("./util"), - fileEntryCache = require("file-entry-cache"), - globUtil = require("./util/glob-util"), - SourceCodeFixer = require("./util/source-code-fixer"), - validator = require("./config/config-validator"), - stringify = require("json-stable-stringify"), - - crypto = require( "crypto" ), - pkg = require("../package.json"); - -var DEFAULT_PARSER = require("../conf/eslint.json").parser; - -//------------------------------------------------------------------------------ -// Typedefs -//------------------------------------------------------------------------------ - -/** - * The options to configure a CLI engine with. - * @typedef {Object} CLIEngineOptions - * @property {string} configFile The configuration file to use. - * @property {boolean|object} baseConfig Base config object. True enables recommend rules and environments. - * @property {boolean} ignore False disables use of .eslintignore. - * @property {string[]} rulePaths An array of directories to load custom rules from. - * @property {boolean} useEslintrc False disables looking for .eslintrc - * @property {string[]} envs An array of environments to load. - * @property {string[]} globals An array of global variables to declare. - * @property {string[]} extensions An array of file extensions to check. - * @property {Object} rules An object of rules to use. - * @property {string} ignorePath The ignore file to use instead of .eslintignore. - */ - -/** - * A linting warning or error. - * @typedef {Object} LintMessage - * @property {string} message The message to display to the user. - */ - -/** - * A linting result. - * @typedef {Object} LintResult - * @property {string} filePath The path to the file that was linted. - * @property {LintMessage[]} messages All of the messages for the result. - */ - -//------------------------------------------------------------------------------ -// Private -//------------------------------------------------------------------------------ - - -var defaultOptions = { - configFile: null, - baseConfig: false, - rulePaths: [], - useEslintrc: true, - envs: [], - globals: [], - rules: {}, - extensions: [".js"], - ignore: true, - ignorePath: null, - parser: DEFAULT_PARSER, - cache: false, - // in order to honor the cacheFile option if specified - // this option should not have a default value otherwise - // it will always be used - cacheLocation: "", - cacheFile: ".eslintcache", - fix: false, - allowInlineConfig: true - }, - loadedPlugins = Object.create(null); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -debug = debug("eslint:cli-engine"); - -/** - * Load the given plugins if they are not loaded already. - * @param {string[]} pluginNames An array of plugin names which should be loaded. - * @returns {void} - */ -function loadPlugins(pluginNames) { - if (pluginNames) { - pluginNames.forEach(function(pluginName) { - var pluginNamespace = util.getNamespace(pluginName), - pluginNameWithoutNamespace = util.removeNameSpace(pluginName), - pluginNameWithoutPrefix = util.removePluginPrefix(pluginNameWithoutNamespace), - plugin; - - if (!loadedPlugins[pluginNameWithoutPrefix]) { - debug("Load plugin " + pluginNameWithoutPrefix); - - plugin = require(pluginNamespace + util.PLUGIN_NAME_PREFIX + pluginNameWithoutPrefix); - // if this plugin has rules, import them - if (plugin.rules) { - rules.import(plugin.rules, pluginNameWithoutPrefix); - } - - loadedPlugins[pluginNameWithoutPrefix] = plugin; - } - }); - } -} - -/** - * It will calculate the error and warning count for collection of messages per file - * @param {Object[]} messages - Collection of messages - * @returns {Object} Contains the stats - * @private - */ -function calculateStatsPerFile(messages) { - return messages.reduce(function(stat, message) { - if (message.fatal || message.severity === 2) { - stat.errorCount++; - } else { - stat.warningCount++; - } - return stat; - }, { - errorCount: 0, - warningCount: 0 - }); -} - -/** - * It will calculate the error and warning count for collection of results from all files - * @param {Object[]} results - Collection of messages from all the files - * @returns {Object} Contains the stats - * @private - */ -function calculateStatsPerRun(results) { - return results.reduce(function(stat, result) { - stat.errorCount += result.errorCount; - stat.warningCount += result.warningCount; - return stat; - }, { - errorCount: 0, - warningCount: 0 - }); -} - -/** - * Processes an source code using ESLint. - * @param {string} text The source code to check. - * @param {Object} configHelper The configuration options for ESLint. - * @param {string} filename An optional string representing the texts filename. - * @param {boolean} fix Indicates if fixes should be processed. - * @param {boolean} allowInlineConfig Allow/ignore comments that change config. - * @returns {Result} The results for linting on this text. - * @private - */ -function processText(text, configHelper, filename, fix, allowInlineConfig) { - - // clear all existing settings for a new file - eslint.reset(); - - var filePath, - config, - messages, - stats, - fileExtension = path.extname(filename), - processor, - fixedResult; - - if (filename) { - filePath = path.resolve(filename); - } - - filename = filename || ""; - debug("Linting " + filename); - config = configHelper.getConfig(filePath); - loadPlugins(config.plugins); - - for (var plugin in loadedPlugins) { - if (loadedPlugins[plugin].processors && Object.keys(loadedPlugins[plugin].processors).indexOf(fileExtension) >= 0) { - processor = loadedPlugins[plugin].processors[fileExtension]; - break; - } - } - - if (processor) { - debug("Using processor"); - var parsedBlocks = processor.preprocess(text, filename); - var unprocessedMessages = []; - parsedBlocks.forEach(function(block) { - unprocessedMessages.push(eslint.verify(block, config, { - filename: filename, - allowInlineConfig: allowInlineConfig - })); - }); - - // TODO(nzakas): Figure out how fixes might work for processors - - messages = processor.postprocess(unprocessedMessages, filename); - - } else { - - messages = eslint.verify(text, config, { - filename: filename, - allowInlineConfig: allowInlineConfig - }); - - if (fix) { - debug("Generating fixed text for " + filename); - fixedResult = SourceCodeFixer.applyFixes(eslint.getSourceCode(), messages); - messages = fixedResult.messages; - } - } - - stats = calculateStatsPerFile(messages); - - var result = { - filePath: filename, - messages: messages, - errorCount: stats.errorCount, - warningCount: stats.warningCount - }; - - if (fixedResult && fixedResult.fixed) { - result.output = fixedResult.output; - } - - return result; -} - -/** - * Processes an individual file using ESLint. Files used here are known to - * exist, so no need to check that here. - * @param {string} filename The filename of the file being checked. - * @param {Object} configHelper The configuration options for ESLint. - * @param {Object} options The CLIEngine options object. - * @returns {Result} The results for linting on this file. - * @private - */ -function processFile(filename, configHelper, options) { - - var text = fs.readFileSync(path.resolve(filename), "utf8"), - result = processText(text, configHelper, filename, options.fix, options.allowInlineConfig); - - return result; - -} - -/** - * Returns result with warning by ignore settings - * @param {string} filePath File path of checked code - * @returns {Result} Result with single warning - * @private - */ -function createIgnoreResult(filePath) { - return { - filePath: path.resolve(filePath), - messages: [ - { - fatal: false, - severity: 1, - message: "File ignored because of your .eslintignore file. Use --no-ignore to override." - } - ], - errorCount: 0, - warningCount: 1 - }; -} - - -/** - * Checks if the given message is an error message. - * @param {object} message The message to check. - * @returns {boolean} Whether or not the message is an error message. - * @private - */ -function isErrorMessage(message) { - return message.severity === 2; -} - -/** - * create a md5Hash of a given string - * @param {string} str the string to calculate the hash for - * @returns {string} the calculated hash - */ -function md5Hash(str) { - return crypto - .createHash("md5") - .update(str, "utf8") - .digest("hex"); -} - -/** - * return the cacheFile to be used by eslint, based on whether the provided parameter is - * a directory or looks like a directory (ends in `path.sep`), in which case the file - * name will be the `cacheFile/.cache_hashOfCWD` - * - * if cacheFile points to a file or looks like a file then in will just use that file - * - * @param {string} cacheFile The name of file to be used to store the cache - * @returns {string} the resolved path to the cache file - */ -function getCacheFile(cacheFile) { - // make sure the path separators are normalized for the environment/os - // keeping the trailing path separator if present - cacheFile = path.normalize(cacheFile); - - var resolvedCacheFile = path.resolve(cacheFile); - var looksLikeADirectory = cacheFile[cacheFile.length - 1 ] === path.sep; - - /** - * return the name for the cache file in case the provided parameter is a directory - * @returns {string} the resolved path to the cacheFile - */ - function getCacheFileForDirectory() { - return path.join(resolvedCacheFile, ".cache_" + md5Hash(process.cwd())); - } - - var fileStats; - - try { - fileStats = fs.lstatSync(resolvedCacheFile); - } catch (ex) { - fileStats = null; - } - - - // in case the file exists we need to verify if the provided path - // is a directory or a file. If it is a directory we want to create a file - // inside that directory - if (fileStats) { - // is a directory or is a file, but the original file the user provided - // looks like a directory but `path.resolve` removed the `last path.sep` - // so we need to still treat this like a directory - if (fileStats.isDirectory() || looksLikeADirectory) { - return getCacheFileForDirectory(); - } - // is file so just use that file - return resolvedCacheFile; - } - - // here we known the file or directory doesn't exist, - // so we will try to infer if its a directory if it looks like a directory - // for the current operating system. - - // if the last character passed is a path separator we assume is a directory - if (looksLikeADirectory) { - return getCacheFileForDirectory(); - } - - return resolvedCacheFile; -} - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -/** - * Creates a new instance of the core CLI engine. - * @param {CLIEngineOptions} options The options for this instance. - * @constructor - */ -function CLIEngine(options) { - - /** - * Stored options for this instance - * @type {Object} - */ - this.options = assign(Object.create(defaultOptions), options || {}); - - - var cacheFile = getCacheFile(this.options.cacheLocation || this.options.cacheFile); - - /** - * cache used to not operate on files that haven't changed since last successful - * execution (e.g. file passed with no errors and no warnings - * @type {Object} - */ - this._fileCache = fileEntryCache.create(cacheFile); // eslint-disable-line no-underscore-dangle - - if (!this.options.cache) { - this._fileCache.destroy(); // eslint-disable-line no-underscore-dangle - } - - // load in additional rules - if (this.options.rulePaths) { - this.options.rulePaths.forEach(function(rulesdir) { - debug("Loading rules from " + rulesdir); - rules.load(rulesdir); - }); - } - - Object.keys(this.options.rules || {}).forEach(function(name) { - validator.validateRuleOptions(name, this.options.rules[name], "CLI"); - }.bind(this)); -} - -/** - * Returns the formatter representing the given format or null if no formatter - * with the given name can be found. - * @param {string} [format] The name of the format to load or the path to a - * custom formatter. - * @returns {Function} The formatter function or null if not found. - */ -CLIEngine.getFormatter = function(format) { - - var formatterPath; - - // default is stylish - format = format || "stylish"; - - // only strings are valid formatters - if (typeof format === "string") { - - // replace \ with / for Windows compatibility - format = format.replace(/\\/g, "/"); - - // if there's a slash, then it's a file - if (format.indexOf("/") > -1) { - formatterPath = path.resolve(process.cwd(), format); - } else { - formatterPath = "./formatters/" + format; - } - - try { - return require(formatterPath); - } catch (ex) { - return null; - } - - } else { - return null; - } -}; - -/** - * Returns results that only contains errors. - * @param {LintResult[]} results The results to filter. - * @returns {LintResult[]} The filtered results. - */ -CLIEngine.getErrorResults = function(results) { - var filtered = []; - - results.forEach(function(result) { - var filteredMessages = result.messages.filter(isErrorMessage); - - if (filteredMessages.length > 0) { - filtered.push({ - filePath: result.filePath, - messages: filteredMessages - }); - } - }); - - return filtered; -}; - -/** - * Outputs fixes from the given results to files. - * @param {Object} report The report object created by CLIEngine. - * @returns {void} - */ -CLIEngine.outputFixes = function(report) { - report.results.filter(function(result) { - return result.hasOwnProperty("output"); - }).forEach(function(result) { - fs.writeFileSync(result.filePath, result.output); - }); -}; - -CLIEngine.prototype = { - - constructor: CLIEngine, - - /** - * Add a plugin by passing it's configuration - * @param {string} name Name of the plugin. - * @param {Object} pluginobject Plugin configuration object. - * @returns {void} - */ - addPlugin: function(name, pluginobject) { - var pluginNameWithoutPrefix = util.removePluginPrefix(util.removeNameSpace(name)); - if (pluginobject.rules) { - rules.import(pluginobject.rules, pluginNameWithoutPrefix); - } - loadedPlugins[pluginNameWithoutPrefix] = pluginobject; - }, - - /** - * Resolves the patterns passed into executeOnFiles() into glob-based patterns - * for easier handling. - * @param {string[]} patterns The file patterns passed on the command line. - * @returns {string[]} The equivalent glob patterns. - */ - resolveFileGlobPatterns: function(patterns) { - return globUtil.resolveFileGlobPatterns(patterns, this.options.extensions); - }, - - /** - * Executes the current configuration on an array of file and directory names. - * @param {string[]} patterns An array of file and directory names. - * @returns {Object} The results for all files that were linted. - */ - executeOnFiles: function(patterns) { - var results = [], - processed = {}, - options = this.options, - fileCache = this._fileCache, // eslint-disable-line no-underscore-dangle - configHelper = new Config(options), - stats, - startTime, - prevConfig; // the previous configuration used - - startTime = Date.now(); - - patterns = this.resolveFileGlobPatterns(patterns); - - /** - * Calculates the hash of the config file used to validate a given file - * @param {string} filename The path of the file to retrieve a config object for to calculate the hash - * @returns {string} the hash of the config - */ - function hashOfConfigFor(filename) { - var config = configHelper.getConfig(filename); - - if (!prevConfig) { - prevConfig = {}; - } - - // reuse the previously hashed config if the config hasn't changed - if (prevConfig.config !== config) { - // config changed so we need to calculate the hash of the config - // and the hash of the plugins being used - prevConfig.config = config; - - var eslintVersion = pkg.version; - - prevConfig.hash = md5Hash(eslintVersion + "_" + stringify(config)); - } - - return prevConfig.hash; - } - - /** - * Executes the linter on a file defined by the `filename`. Skips - * unsupported file extensions and any files that are already linted. - * @param {string} filename The resolved filename of the file to be linted - * @returns {void} - */ - function executeOnFile(filename) { - var hashOfConfig; - - if (processed[filename]) { - return; - } - - if (options.cache) { - // get the descriptor for this file - // with the metadata and the flag that determines if - // the file has changed - var descriptor = fileCache.getFileDescriptor(filename); - var meta = descriptor.meta || {}; - - hashOfConfig = hashOfConfigFor(filename); - - var changed = descriptor.changed || meta.hashOfConfig !== hashOfConfig; - if (!changed) { - debug("Skipping file since hasn't changed: " + filename); - - // Adding the filename to the processed hashmap - // so the reporting is not affected (showing a warning about .eslintignore being used - // when it is not really used) - - processed[filename] = true; - - // Add the the cached results (always will be 0 error and 0 warnings) - // cause we don't save to cache files that failed - // to guarantee that next execution will process those files as well - results.push(descriptor.meta.results); - - // move to the next file - return; - } - } - - debug("Processing " + filename); - - processed[filename] = true; - - var res = processFile(filename, configHelper, options); - - if (options.cache) { - // if a file contains errors or warnings we don't want to - // store the file in the cache so we can guarantee that - // next execution will also operate on this file - if ( res.errorCount > 0 || res.warningCount > 0 ) { - debug("File has problems, skipping it: " + filename); - // remove the entry from the cache - fileCache.removeEntry( filename ); - } else { - // since the file passed we store the result here - // TODO: check this as we might not need to store the - // successful runs as it will always should be 0 error 0 warnings - descriptor.meta.hashOfConfig = hashOfConfig; - descriptor.meta.results = res; - } - } - - results.push(res); - } - - // Lint each desired file - globUtil.listFilesToProcess(patterns, options).forEach(executeOnFile); - - // only warn for files explicitly passed on the command line - if (options.ignore) { - patterns.forEach(function(file) { - var fullPath = path.resolve(file); - if (shell.test("-f", fullPath) && !processed[fullPath]) { - results.push(createIgnoreResult(file)); - } - }); - } - - stats = calculateStatsPerRun(results); - - if (options.cache) { - // persist the cache to disk - fileCache.reconcile(); - } - - debug("Linting complete in: " + (Date.now() - startTime) + "ms"); - - return { - results: results, - errorCount: stats.errorCount, - warningCount: stats.warningCount - }; - }, - - /** - * Executes the current configuration on text. - * @param {string} text A string of JavaScript code to lint. - * @param {string} filename An optional string representing the texts filename. - * @returns {Object} The results for the linting. - */ - executeOnText: function(text, filename) { - - var results = [], - stats, - options = this.options, - configHelper = new Config(options), - ignoredPaths = IgnoredPaths.load(options), - exclude = ignoredPaths.contains.bind(ignoredPaths); - - if (filename && options.ignore && exclude(filename)) { - results.push(createIgnoreResult(filename)); - } else { - results.push(processText(text, configHelper, filename, options.fix, options.allowInlineConfig)); - } - - stats = calculateStatsPerRun(results); - - return { - results: results, - errorCount: stats.errorCount, - warningCount: stats.warningCount - }; - }, - - /** - * Returns a configuration object for the given file based on the CLI options. - * This is the same logic used by the ESLint CLI executable to determine - * configuration for each file it processes. - * @param {string} filePath The path of the file to retrieve a config object for. - * @returns {Object} A configuration object for the file. - */ - getConfigForFile: function(filePath) { - var configHelper = new Config(this.options); - return configHelper.getConfig(filePath); - }, - - /** - * Checks if a given path is ignored by ESLint. - * @param {string} filePath The path of the file to check. - * @returns {boolean} Whether or not the given path is ignored. - */ - isPathIgnored: function(filePath) { - var ignoredPaths; - - if (this.options.ignore) { - ignoredPaths = IgnoredPaths.load(this.options); - return ignoredPaths.contains(filePath); - } - - return false; - }, - - getFormatter: CLIEngine.getFormatter - -}; - -module.exports = CLIEngine; diff --git a/node_modules/eslint/lib/cli.js b/node_modules/eslint/lib/cli.js deleted file mode 100644 index 2201367..0000000 --- a/node_modules/eslint/lib/cli.js +++ /dev/null @@ -1,191 +0,0 @@ -/** - * @fileoverview Main CLI object. - * @author Nicholas C. Zakas - */ - -"use strict"; - -/* - * The CLI object should *not* call process.exit() directly. It should only return - * exit codes. This allows other programs to use the CLI object and still control - * when the program exits. - */ - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var fs = require("fs"), - path = require("path"), - - debug = require("debug"), - - options = require("./options"), - CLIEngine = require("./cli-engine"), - mkdirp = require("mkdirp"), - log = require("./logging"); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -debug = debug("eslint:cli"); - -/** - * Translates the CLI options into the options expected by the CLIEngine. - * @param {Object} cliOptions The CLI options to translate. - * @returns {CLIEngineOptions} The options object for the CLIEngine. - * @private - */ -function translateOptions(cliOptions) { - return { - envs: cliOptions.env, - extensions: cliOptions.ext, - rules: cliOptions.rule, - plugins: cliOptions.plugin, - globals: cliOptions.global, - ignore: cliOptions.ignore, - ignorePath: cliOptions.ignorePath, - ignorePattern: cliOptions.ignorePattern, - configFile: cliOptions.config, - rulePaths: cliOptions.rulesdir, - useEslintrc: cliOptions.eslintrc, - parser: cliOptions.parser, - cache: cliOptions.cache, - cacheFile: cliOptions.cacheFile, - cacheLocation: cliOptions.cacheLocation, - fix: cliOptions.fix, - allowInlineConfig: cliOptions.inlineConfig - }; -} - -/** - * Outputs the results of the linting. - * @param {CLIEngine} engine The CLIEngine to use. - * @param {LintResult[]} results The results to print. - * @param {string} format The name of the formatter to use or the path to the formatter. - * @param {string} outputFile The path for the output file. - * @returns {boolean} True if the printing succeeds, false if not. - * @private - */ -function printResults(engine, results, format, outputFile) { - var formatter, - output, - filePath; - - formatter = engine.getFormatter(format); - if (!formatter) { - log.error("Could not find formatter '%s'.", format); - return false; - } - - output = formatter(results); - - if (output) { - if (outputFile) { - filePath = path.resolve(process.cwd(), outputFile); - - if (fs.existsSync(filePath) && fs.statSync(filePath).isDirectory()) { - log.error("Cannot write to output file path, it is a directory: %s", outputFile); - return false; - } - - try { - mkdirp.sync(path.dirname(filePath)); - fs.writeFileSync(filePath, output); - } catch (ex) { - log.error("There was a problem writing the output file:\n%s", ex); - return false; - } - } else { - log.info(output); - } - } - - return true; - -} - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -/** - * Encapsulates all CLI behavior for eslint. Makes it easier to test as well as - * for other Node.js programs to effectively run the CLI. - */ -var cli = { - - /** - * Executes the CLI based on an array of arguments that is passed in. - * @param {string|Array|Object} args The arguments to process. - * @param {string} [text] The text to lint (used for TTY). - * @returns {int} The exit code for the operation. - */ - execute: function(args, text) { - - var currentOptions, - files, - report, - engine, - tooManyWarnings; - - try { - currentOptions = options.parse(args); - } catch (error) { - log.error(error.message); - return 1; - } - - files = currentOptions._; - - if (currentOptions.version) { // version from package.json - - log.info("v" + require("../package.json").version); - - } else if (currentOptions.help || (!files.length && !text)) { - - log.info(options.generateHelp()); - - } else { - - debug("Running on " + (text ? "text" : "files")); - - // disable --fix for piped-in code until we know how to do it correctly - if (text && currentOptions.fix) { - log.error("The --fix option is not available for piped-in code."); - return 1; - } - - engine = new CLIEngine(translateOptions(currentOptions)); - - report = text ? engine.executeOnText(text, currentOptions.stdinFilename) : engine.executeOnFiles(files); - if (currentOptions.fix) { - debug("Fix mode enabled - applying fixes"); - CLIEngine.outputFixes(report); - } - - if (currentOptions.quiet) { - debug("Quiet mode enabled - filtering out warnings"); - report.results = CLIEngine.getErrorResults(report.results); - } - - if (printResults(engine, report.results, currentOptions.format, currentOptions.outputFile)) { - tooManyWarnings = currentOptions.maxWarnings >= 0 && report.warningCount > currentOptions.maxWarnings; - - if (!report.errorCount && tooManyWarnings) { - log.error("ESLint found too many warnings (maximum: %s).", currentOptions.maxWarnings); - } - - return (report.errorCount || tooManyWarnings) ? 1 : 0; - } else { - return 1; - } - - } - - return 0; - } -}; - -module.exports = cli; diff --git a/node_modules/eslint/lib/config.js b/node_modules/eslint/lib/config.js deleted file mode 100644 index 3eb174e..0000000 --- a/node_modules/eslint/lib/config.js +++ /dev/null @@ -1,336 +0,0 @@ -/** - * @fileoverview Responsible for loading config files - * @author Seth McLaughlin - * @copyright 2014 Nicholas C. Zakas. All rights reserved. - * @copyright 2014 Michael McLaughlin. All rights reserved. - * @copyright 2013 Seth McLaughlin. All rights reserved. - * See LICENSE in root directory for full license. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var path = require("path"), - ConfigOps = require("./config/config-ops"), - ConfigFile = require("./config/config-file"), - util = require("./util"), - FileFinder = require("./file-finder"), - debug = require("debug"), - userHome = require("user-home"), - isResolvable = require("is-resolvable"), - pathIsInside = require("path-is-inside"); - -//------------------------------------------------------------------------------ -// Constants -//------------------------------------------------------------------------------ - -var PACKAGE_CONFIG_FILENAME = "package.json", - PERSONAL_CONFIG_DIR = userHome || null; - -//------------------------------------------------------------------------------ -// Private -//------------------------------------------------------------------------------ - -var loadedPlugins = Object.create(null); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -debug = debug("eslint:config"); - -/** - * Check if item is an javascript object - * @param {*} item object to check for - * @returns {boolean} True if its an object - * @private - */ -function isObject(item) { - return typeof item === "object" && !Array.isArray(item) && item !== null; -} - -/** - * Load and parse a JSON config object from a file. - * @param {string|Object} configToLoad the path to the JSON config file or the config object itself. - * @returns {Object} the parsed config object (empty object if there was a parse error) - * @private - */ -function loadConfig(configToLoad) { - var config = {}, - filePath = ""; - - if (configToLoad) { - - if (isObject(configToLoad)) { - config = configToLoad; - - if (config.extends) { - config = ConfigFile.applyExtends(config, filePath); - } - } else { - filePath = configToLoad; - config = ConfigFile.load(filePath); - } - - } - - return config; -} - -/** - * Load configuration for all plugins provided. - * @param {string[]} pluginNames An array of plugin names which should be loaded. - * @returns {Object} all plugin configurations merged together - */ -function getPluginsConfig(pluginNames) { - var pluginConfig = {}; - - pluginNames.forEach(function(pluginName) { - var pluginNamespace = util.getNamespace(pluginName), - pluginNameWithoutNamespace = util.removeNameSpace(pluginName), - pluginNameWithoutPrefix = util.removePluginPrefix(pluginNameWithoutNamespace), - plugin = {}, - rules = {}; - - if (!loadedPlugins[pluginNameWithoutPrefix]) { - try { - plugin = require(pluginNamespace + util.PLUGIN_NAME_PREFIX + pluginNameWithoutPrefix); - loadedPlugins[pluginNameWithoutPrefix] = plugin; - } catch (err) { - debug("Failed to load plugin configuration for " + pluginNameWithoutPrefix + ". Proceeding without it."); - plugin = { rulesConfig: {}}; - } - } else { - plugin = loadedPlugins[pluginNameWithoutPrefix]; - } - - if (!plugin.rulesConfig) { - plugin.rulesConfig = {}; - } - - Object.keys(plugin.rulesConfig).forEach(function(item) { - rules[pluginNameWithoutPrefix + "/" + item] = plugin.rulesConfig[item]; - }); - - pluginConfig = ConfigOps.merge(pluginConfig, rules); - }); - - return {rules: pluginConfig}; -} - -/** - * Get personal config object from ~/.eslintrc. - * @returns {Object} the personal config object (empty object if there is no personal config) - * @private - */ -function getPersonalConfig() { - var config = {}, - filename; - - if (PERSONAL_CONFIG_DIR) { - filename = ConfigFile.getFilenameForDirectory(PERSONAL_CONFIG_DIR); - - if (filename) { - debug("Using personal config"); - config = loadConfig(filename); - } - } - - return config; -} - -/** - * Get a local config object. - * @param {Object} thisConfig A Config object. - * @param {string} directory The directory to start looking in for a local config file. - * @returns {Object} The local config object, or an empty object if there is no local config. - */ -function getLocalConfig(thisConfig, directory) { - var found, - i, - localConfig, - localConfigFile, - config = {}, - localConfigFiles = thisConfig.findLocalConfigFiles(directory), - numFiles = localConfigFiles.length, - rootPath, - projectConfigPath = ConfigFile.getFilenameForDirectory(process.cwd()); - - for (i = 0; i < numFiles; i++) { - - localConfigFile = localConfigFiles[i]; - - // Don't consider the personal config file in the home directory, - // except if the home directory is the same as the current working directory - if (path.dirname(localConfigFile) === PERSONAL_CONFIG_DIR && localConfigFile !== projectConfigPath) { - continue; - } - - // If root flag is set, don't consider file if it is above root - if (rootPath && !pathIsInside(path.dirname(localConfigFile), rootPath)) { - continue; - } - - debug("Loading " + localConfigFile); - localConfig = loadConfig(localConfigFile); - - // Don't consider a local config file found if the config is null - if (!localConfig) { - continue; - } - - // Check for root flag - if (localConfig.root === true) { - rootPath = path.dirname(localConfigFile); - } - - found = true; - debug("Using " + localConfigFile); - config = ConfigOps.merge(localConfig, config); - } - - // Use the personal config file if there are no other local config files found. - return found ? config : ConfigOps.merge(config, getPersonalConfig()); -} - -//------------------------------------------------------------------------------ -// API -//------------------------------------------------------------------------------ - -/** - * Config - * @constructor - * @class Config - * @param {Object} options Options to be passed in - * @param {string} [cwd] current working directory. Defaults to process.cwd() - */ -function Config(options) { - var useConfig; - - options = options || {}; - - this.ignore = options.ignore; - this.ignorePath = options.ignorePath; - this.cache = {}; - this.parser = options.parser; - - this.baseConfig = options.baseConfig ? loadConfig(options.baseConfig) : { rules: {} }; - - this.useEslintrc = (options.useEslintrc !== false); - - this.env = (options.envs || []).reduce(function(envs, name) { - envs[name] = true; - return envs; - }, {}); - - this.globals = (options.globals || []).reduce(function(globals, def) { - // Default "foo" to false and handle "foo:false" and "foo:true" - var parts = def.split(":"); - globals[parts[0]] = (parts.length > 1 && parts[1] === "true"); - return globals; - }, {}); - - useConfig = options.configFile; - this.options = options; - - if (useConfig) { - debug("Using command line config " + useConfig); - if (isResolvable(useConfig) || isResolvable("eslint-config-" + useConfig) || useConfig.charAt(0) === "@") { - this.useSpecificConfig = loadConfig(useConfig); - } else { - this.useSpecificConfig = loadConfig(path.resolve(process.cwd(), useConfig)); - } - } -} - -/** - * Build a config object merging the base config (conf/eslint.json), the - * environments config (conf/environments.js) and eventually the user config. - * @param {string} filePath a file in whose directory we start looking for a local config - * @returns {Object} config object - */ -Config.prototype.getConfig = function(filePath) { - var config, - userConfig, - directory = filePath ? path.dirname(filePath) : process.cwd(), - pluginConfig; - - debug("Constructing config for " + (filePath ? filePath : "text")); - - config = this.cache[directory]; - - if (config) { - debug("Using config from cache"); - return config; - } - - // Step 1: Determine user-specified config from .eslintrc and package.json files - if (this.useEslintrc) { - debug("Using .eslintrc and package.json files"); - userConfig = getLocalConfig(this, directory); - } else { - debug("Not using .eslintrc or package.json files"); - userConfig = {}; - } - - // Step 2: Create a copy of the baseConfig - config = ConfigOps.merge({parser: this.parser}, this.baseConfig); - - // Step 3: Merge in the user-specified configuration from .eslintrc and package.json - config = ConfigOps.merge(config, userConfig); - - // Step 4: Merge in command line config file - if (this.useSpecificConfig) { - debug("Merging command line config file"); - - config = ConfigOps.merge(config, this.useSpecificConfig); - } - - // Step 5: Merge in command line environments - debug("Merging command line environment settings"); - config = ConfigOps.merge(config, ConfigOps.createEnvironmentConfig(this.env)); - - // Step 6: Merge in command line rules - if (this.options.rules) { - debug("Merging command line rules"); - config = ConfigOps.merge(config, { rules: this.options.rules }); - } - - // Step 7: Merge in command line globals - config = ConfigOps.merge(config, { globals: this.globals }); - - // Step 8: Merge in command line plugins - if (this.options.plugins) { - debug("Merging command line plugins"); - pluginConfig = getPluginsConfig(this.options.plugins); - config = ConfigOps.merge(config, { plugins: this.options.plugins }); - } - - // Step 9: Merge in plugin specific rules in reverse - if (config.plugins) { - pluginConfig = getPluginsConfig(config.plugins); - config = ConfigOps.merge(pluginConfig, config); - } - - this.cache[directory] = config; - - return config; -}; - -/** - * Find local config files from directory and parent directories. - * @param {string} directory The directory to start searching from. - * @returns {string[]} The paths of local config files found. - */ -Config.prototype.findLocalConfigFiles = function(directory) { - - if (!this.localConfigFinder) { - this.localConfigFinder = new FileFinder(ConfigFile.CONFIG_FILES, PACKAGE_CONFIG_FILENAME); - } - - return this.localConfigFinder.findAllInDirectoryAndParents(directory); -}; - -module.exports = Config; diff --git a/node_modules/eslint/lib/config/config-file.js b/node_modules/eslint/lib/config/config-file.js deleted file mode 100644 index aaffb6f..0000000 --- a/node_modules/eslint/lib/config/config-file.js +++ /dev/null @@ -1,440 +0,0 @@ -/** - * @fileoverview Helper to locate and load configuration files. - * @author Nicholas C. Zakas - * @copyright 2015 Nicholas C. Zakas. All rights reserved. - * See LICENSE file in root directory for full license. - */ -/* eslint no-use-before-define: 0 */ -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var debug = require("debug"), - fs = require("fs"), - path = require("path"), - ConfigOps = require("./config-ops"), - validator = require("./config-validator"), - stripComments = require("strip-json-comments"), - isAbsolutePath = require("path-is-absolute"); - -//------------------------------------------------------------------------------ -// Private -//------------------------------------------------------------------------------ - -var CONFIG_FILES = [ - ".eslintrc.js", - ".eslintrc.yaml", - ".eslintrc.yml", - ".eslintrc.json", - ".eslintrc" -]; - -debug = debug("eslint:config-file"); - -/** - * Convenience wrapper for synchronously reading file contents. - * @param {string} filePath The filename to read. - * @returns {string} The file contents. - * @private - */ -function readFile(filePath) { - return fs.readFileSync(filePath, "utf8"); -} - -/** - * Determines if a given string represents a filepath or not using the same - * conventions as require(), meaning that the first character must be nonalphanumeric - * and not the @ sign which is used for scoped packages to be considered a file path. - * @param {string} filePath The string to check. - * @returns {boolean} True if it's a filepath, false if not. - * @private - */ -function isFilePath(filePath) { - return isAbsolutePath(filePath) || !/\w|@/.test(filePath.charAt(0)); -} - -/** - * Loads a YAML configuration from a file. - * @param {string} filePath The filename to load. - * @returns {Object} The configuration object from the file. - * @throws {Error} If the file cannot be read. - * @private - */ -function loadYAMLConfigFile(filePath) { - debug("Loading YAML config file: " + filePath); - - // lazy load YAML to improve performance when not used - var yaml = require("js-yaml"); - - try { - // empty YAML file can be null, so always use - return yaml.safeLoad(readFile(filePath)) || {}; - } catch (e) { - debug("Error reading YAML file: " + filePath); - e.message = "Cannot read config file: " + filePath + "\nError: " + e.message; - throw e; - } -} - -/** - * Loads a JSON configuration from a file. - * @param {string} filePath The filename to load. - * @returns {Object} The configuration object from the file. - * @throws {Error} If the file cannot be read. - * @private - */ -function loadJSONConfigFile(filePath) { - debug("Loading JSON config file: " + filePath); - - try { - return JSON.parse(stripComments(readFile(filePath))); - } catch (e) { - debug("Error reading JSON file: " + filePath); - e.message = "Cannot read config file: " + filePath + "\nError: " + e.message; - throw e; - } -} - -/** - * Loads a legacy (.eslintrc) configuration from a file. - * @param {string} filePath The filename to load. - * @returns {Object} The configuration object from the file. - * @throws {Error} If the file cannot be read. - * @private - */ -function loadLegacyConfigFile(filePath) { - debug("Loading config file: " + filePath); - - // lazy load YAML to improve performance when not used - var yaml = require("js-yaml"); - - try { - return yaml.safeLoad(stripComments(readFile(filePath))) || {}; - } catch (e) { - debug("Error reading YAML file: " + filePath); - e.message = "Cannot read config file: " + filePath + "\nError: " + e.message; - throw e; - } -} - -/** - * Loads a JavaScript configuration from a file. - * @param {string} filePath The filename to load. - * @returns {Object} The configuration object from the file. - * @throws {Error} If the file cannot be read. - * @private - */ -function loadJSConfigFile(filePath) { - debug("Loading JS config file: " + filePath); - try { - return require(filePath); - } catch (e) { - debug("Error reading JavaScript file: " + filePath); - e.message = "Cannot read config file: " + filePath + "\nError: " + e.message; - throw e; - } -} - -/** - * Loads a configuration from a package.json file. - * @param {string} filePath The filename to load. - * @returns {Object} The configuration object from the file. - * @throws {Error} If the file cannot be read. - * @private - */ -function loadPackageJSONConfigFile(filePath) { - debug("Loading package.json config file: " + filePath); - try { - return require(filePath).eslintConfig || null; - } catch (e) { - debug("Error reading package.json file: " + filePath); - e.message = "Cannot read config file: " + filePath + "\nError: " + e.message; - throw e; - } -} - -/** - * Loads a JavaScript configuration from a package. - * @param {string} filePath The package name to load. - * @returns {Object} The configuration object from the package. - * @throws {Error} If the package cannot be read. - * @private - */ -function loadPackage(filePath) { - debug("Loading config package: " + filePath); - try { - return require(filePath); - } catch (e) { - debug("Error reading package: " + filePath); - e.message = "Cannot read config package: " + filePath + "\nError: " + e.message; - throw e; - } -} - -/** - * Loads a configuration file regardless of the source. Inspects the file path - * to determine the correctly way to load the config file. - * @param {string} filePath The path to the configuration. - * @returns {Object} The configuration information. - * @private - */ -function loadConfigFile(filePath) { - var config; - - if (isFilePath(filePath)) { - switch (path.extname(filePath)) { - case ".js": - config = loadJSConfigFile(filePath); - break; - - case ".json": - if (path.basename(filePath) === "package.json") { - config = loadPackageJSONConfigFile(filePath); - if (config === null) { - return null; - } - } else { - config = loadJSONConfigFile(filePath); - } - break; - - case ".yaml": - case ".yml": - config = loadYAMLConfigFile(filePath); - break; - - default: - config = loadLegacyConfigFile(filePath); - } - } else { - config = loadPackage(filePath); - } - - return ConfigOps.merge(ConfigOps.createEmptyConfig(), config); -} - -/** - * Writes a configuration file in JSON format. - * @param {Object} config The configuration object to write. - * @param {string} filePath The filename to write to. - * @returns {void} - * @private - */ -function writeJSONConfigFile(config, filePath) { - debug("Writing JSON config file: " + filePath); - - var content = JSON.stringify(config, null, 4); - fs.writeFileSync(filePath, content, "utf8"); -} - -/** - * Writes a configuration file in YAML format. - * @param {Object} config The configuration object to write. - * @param {string} filePath The filename to write to. - * @returns {void} - * @private - */ -function writeYAMLConfigFile(config, filePath) { - debug("Writing YAML config file: " + filePath); - - // lazy load YAML to improve performance when not used - var yaml = require("js-yaml"); - - var content = yaml.safeDump(config); - fs.writeFileSync(filePath, content, "utf8"); -} - -/** - * Writes a configuration file in JavaScript format. - * @param {Object} config The configuration object to write. - * @param {string} filePath The filename to write to. - * @returns {void} - * @private - */ -function writeJSConfigFile(config, filePath) { - debug("Writing JS config file: " + filePath); - - var content = "module.exports = " + JSON.stringify(config, null, 4) + ";"; - fs.writeFileSync(filePath, content, "utf8"); -} - -/** - * Writes a configuration file. - * @param {Object} config The configuration object to write. - * @param {string} filePath The filename to write to. - * @returns {void} - * @throws {Error} When an unknown file type is specified. - * @private - */ -function write(config, filePath) { - switch (path.extname(filePath)) { - case ".js": - writeJSConfigFile(config, filePath); - break; - - case ".json": - writeJSONConfigFile(config, filePath); - break; - - case ".yaml": - case ".yml": - writeYAMLConfigFile(config, filePath); - break; - - default: - throw new Error("Can't write to unknown file type."); - } -} - -/** - * Applies values from the "extends" field in a configuration file. - * @param {Object} config The configuration information. - * @param {string} filePath The file path from which the configuration information - * was loaded. - * @returns {Object} A new configuration object with all of the "extends" fields - * loaded and merged. - * @private - */ -function applyExtends(config, filePath) { - var configExtends = config.extends; - - // normalize into an array for easier handling - if (!Array.isArray(config.extends)) { - configExtends = [config.extends]; - } - - // Make the last element in an array take the highest precedence - config = configExtends.reduceRight(function(previousValue, parentPath) { - - if (parentPath === "eslint:recommended") { - // Add an explicit substitution for eslint:recommended to conf/eslint.json - // this lets us use the eslint.json file as the recommended rules - parentPath = path.resolve(__dirname, "../../conf/eslint.json"); - } else if (isFilePath(parentPath)) { - // If the `extends` path is relative, use the directory of the current configuration - // file as the reference point. Otherwise, use as-is. - parentPath = (!isAbsolutePath(parentPath) ? - path.join(path.dirname(filePath), parentPath) : - parentPath - ); - } - - try { - debug("Loading " + parentPath); - return ConfigOps.merge(load(parentPath), previousValue); - } catch (e) { - // If the file referenced by `extends` failed to load, add the path to the - // configuration file that referenced it to the error message so the user is - // able to see where it was referenced from, then re-throw - e.message += "\nReferenced from: " + filePath; - throw e; - } - - }, config); - - return config; -} - -/** - * Resolves a configuration file path into the fully-formed path, whether filename - * or package name. - * @param {string} filePath The filepath to resolve. - * @returns {string} A path that can be used directly to load the configuration. - * @private - */ -function resolve(filePath) { - - if (isFilePath(filePath)) { - return path.resolve(filePath); - } else { - - // it's a package - - if (filePath.charAt(0) === "@") { - // it's a scoped package - - // package name is "eslint-config", or just a username - var scopedPackageShortcutRegex = /^(@[^\/]+)(?:\/(?:eslint-config)?)?$/; - if (scopedPackageShortcutRegex.test(filePath)) { - filePath = filePath.replace(scopedPackageShortcutRegex, "$1/eslint-config"); - } else if (filePath.split("/")[1].indexOf("eslint-config-") !== 0) { - // for scoped packages, insert the eslint-config after the first / - filePath = filePath.replace(/^@([^\/]+)\/(.*)$/, "@$1/eslint-config-$2"); - } - } else if (filePath.indexOf("eslint-config-") !== 0) { - filePath = "eslint-config-" + filePath; - } - - return filePath; - } - -} - -/** - * Loads a configuration file from the given file path. - * @param {string} filePath The filename or package name to load the configuration - * information from. - * @returns {Object} The configuration information. - * @private - */ -function load(filePath) { - - var resolvedPath = resolve(filePath), - config = loadConfigFile(resolvedPath); - - if (config) { - - // validate the configuration before continuing - validator.validate(config, filePath); - - // If an `extends` property is defined, it represents a configuration file to use as - // a "parent". Load the referenced file and merge the configuration recursively. - if (config.extends) { - config = applyExtends(config, filePath); - } - - if (config.env) { - // Merge in environment-specific globals and ecmaFeatures. - config = ConfigOps.applyEnvironments(config); - } - - } - - return config; -} - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -module.exports = { - - load: load, - resolve: resolve, - write: write, - applyExtends: applyExtends, - CONFIG_FILES: CONFIG_FILES, - - /** - * Retrieves the configuration filename for a given directory. It loops over all - * of the valid configuration filenames in order to find the first one that exists. - * @param {string} directory The directory to check for a config file. - * @returns {?string} The filename of the configuration file for the directory - * or null if there is no configuration file in the directory. - */ - getFilenameForDirectory: function(directory) { - - var filename; - - for (var i = 0, len = CONFIG_FILES.length; i < len; i++) { - filename = path.join(directory, CONFIG_FILES[i]); - if (fs.existsSync(filename)) { - return filename; - } - } - - return null; - } -}; diff --git a/node_modules/eslint/lib/config/config-initializer.js b/node_modules/eslint/lib/config/config-initializer.js deleted file mode 100644 index 526c56d..0000000 --- a/node_modules/eslint/lib/config/config-initializer.js +++ /dev/null @@ -1,241 +0,0 @@ -/** - * @fileoverview Config initialization wizard. - * @author Ilya Volodin - * @copyright 2015 Ilya Volodin. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var exec = require("child_process").exec, - inquirer = require("inquirer"), - ConfigFile = require("./config-file"); - -//------------------------------------------------------------------------------ -// Private -//------------------------------------------------------------------------------ - -/* istanbul ignore next: hard to test fs function */ -/** - * Create .eslintrc file in the current working directory - * @param {object} config object that contains user's answers - * @param {string} format The file format to write to. - * @param {function} callback function to call once the file is written. - * @returns {void} - */ -function writeFile(config, format, callback) { - - // default is .js - var extname = ".js"; - if (format === "YAML") { - extname = ".yml"; - } else if (format === "JSON") { - extname = ".json"; - } - - - try { - ConfigFile.write(config, "./.eslintrc" + extname); - console.log("Successfully created .eslintrc" + extname + " file in " + process.cwd()); - } catch (e) { - callback(e); - return; - } - - // install any external configs as well as any included plugins - if (config.extends && config.extends.indexOf("eslint") === -1) { - console.log("Installing additional dependencies"); - exec("npm i eslint-config-" + config.extends + " --save-dev", function(err) { - - if (err) { - return callback(err); - } - - // TODO: consider supporting more than 1 plugin though it's required yet. - exec("npm i eslint-plugin-" + config.plugins[0] + " --save-dev", callback); - }); - return; - } - - // install the react plugin if it was explictly chosen - if (config.plugins && config.plugins.indexOf("react") >= 0) { - console.log("Installing React plugin"); - exec("npm i eslint-plugin-react --save-dev", callback); - return; - } - callback(); -} - -/** - * process user's answers and create config object - * @param {object} answers answers received from inquirer - * @returns {object} config object - */ -function processAnswers(answers) { - var config = {rules: {}, env: {}, extends: "eslint:recommended"}; - config.rules.indent = [2, answers.indent]; - config.rules.quotes = [2, answers.quotes]; - config.rules["linebreak-style"] = [2, answers.linebreak]; - config.rules.semi = [2, answers.semi ? "always" : "never"]; - if (answers.es6) { - config.env.es6 = true; - } - answers.env.forEach(function(env) { - config.env[env] = true; - }); - if (answers.jsx) { - config.ecmaFeatures = {jsx: true}; - if (answers.react) { - config.plugins = ["react"]; - config.ecmaFeatures.experimentalObjectRestSpread = true; - } - } - return config; -} - -/** - * process user's style guide of choice and return an appropriate config object. - * @param {string} guide name of the chosen style guide - * @returns {object} config object - */ -function getConfigForStyleGuide(guide) { - var guides = { - google: {extends: "google"}, - airbnb: {extends: "airbnb", plugins: ["react"]}, - standard: {extends: "standard", plugins: ["standard"]} - }; - if (!guides[guide]) { - throw new Error("You referenced an unsupported guide."); - } - return guides[guide]; -} - -/* istanbul ignore next: no need to test inquirer*/ -/** - * Ask use a few questions on command prompt - * @param {function} callback callback function when file has been written - * @returns {void} - */ -function promptUser(callback) { - inquirer.prompt([ - { - type: "list", - name: "source", - message: "How would you like to configure ESLint?", - default: "prompt", - choices: [{name: "Answer questions about your style", value: "prompt"}, {name: "Use a popular style guide", value: "guide"}] - }, - { - type: "list", - name: "styleguide", - message: "Which style guide do you want to follow?", - choices: [{name: "Google", value: "google"}, {name: "AirBnB", value: "airbnb"}, {name: "Standard", value: "standard"}], - when: function(answers) { - return answers.source === "guide"; - } - }, - { - type: "list", - name: "format", - message: "What format do you want your config file to be in?", - default: "JavaScript", - choices: ["JavaScript", "YAML", "JSON"], - when: function(answers) { - return answers.source === "guide"; - } - } - ], function(earlyAnswers) { - - // early exit if you are using a style guide - if (earlyAnswers.source === "guide") { - writeFile(getConfigForStyleGuide(earlyAnswers.styleguide), earlyAnswers.format, callback); - return; - } - - // continue with the style questions otherwise... - inquirer.prompt([ - { - type: "list", - name: "indent", - message: "What style of indentation do you use?", - default: "tabs", - choices: [{name: "Tabs", value: "tab"}, {name: "Spaces", value: 4}] - }, - { - type: "list", - name: "quotes", - message: "What quotes do you use for strings?", - default: "double", - choices: [{name: "Double", value: "double"}, {name: "Single", value: "single"}] - }, - { - type: "list", - name: "linebreak", - message: "What line endings do you use?", - default: "unix", - choices: [{name: "Unix", value: "unix"}, {name: "Windows", value: "windows"}] - }, - { - type: "confirm", - name: "semi", - message: "Do you require semicolons?", - default: true - }, - { - type: "confirm", - name: "es6", - message: "Are you using ECMAScript 6 features?", - default: false - }, - { - type: "checkbox", - name: "env", - message: "Where will your code run?", - default: ["browser"], - choices: [{name: "Node", value: "node"}, {name: "Browser", value: "browser"}] - }, - { - type: "confirm", - name: "jsx", - message: "Do you use JSX?", - default: false - }, - { - type: "confirm", - name: "react", - message: "Do you use React", - default: false, - when: function(answers) { - return answers.jsx; - } - }, - { - type: "list", - name: "format", - message: "What format do you want your config file to be in?", - default: "JavaScript", - choices: ["JavaScript", "YAML", "JSON"] - } - ], function(answers) { - var config = processAnswers(answers); - writeFile(config, answers.format, callback); - }); - }); -} - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -var init = { - getConfigForStyleGuide: getConfigForStyleGuide, - processAnswers: processAnswers, - initializeConfig: /* istanbul ignore next */ function(callback) { - promptUser(callback); - } -}; - -module.exports = init; diff --git a/node_modules/eslint/lib/config/config-ops.js b/node_modules/eslint/lib/config/config-ops.js deleted file mode 100644 index fa9436b..0000000 --- a/node_modules/eslint/lib/config/config-ops.js +++ /dev/null @@ -1,186 +0,0 @@ -/** - * @fileoverview Config file operations. This file must be usable in the browser, - * so no Node-specific code can be here. - * @author Nicholas C. Zakas - * @copyright 2015 Nicholas C. Zakas. All rights reserved. - * See LICENSE file in root directory for full license. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var debug = require("debug"), - environments = require("../../conf/environments"), - assign = require("object-assign"); - -//------------------------------------------------------------------------------ -// Private -//------------------------------------------------------------------------------ - -debug = debug("eslint:config-ops"); - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -module.exports = { - - /** - * Creates an empty configuration object suitable for merging as a base. - * @returns {Object} A configuration object. - */ - createEmptyConfig: function() { - return { - globals: {}, - env: {}, - rules: {}, - ecmaFeatures: {} - }; - }, - - /** - * Creates an environment config based on the specified environments. - * @param {Object} env The environment settings. - * @returns {Object} A configuration object with the appropriate rules and globals - * set. - */ - createEnvironmentConfig: function(env) { - - var envConfig = this.createEmptyConfig(); - - if (env) { - - envConfig.env = env; - - Object.keys(env).filter(function(name) { - return env[name]; - }).forEach(function(name) { - var environment = environments[name]; - - if (environment) { - debug("Creating config for environment " + name); - if (environment.globals) { - assign(envConfig.globals, environment.globals); - } - - if (environment.ecmaFeatures) { - assign(envConfig.ecmaFeatures, environment.ecmaFeatures); - } - } - }); - } - - return envConfig; - }, - - /** - * Given a config with environment settings, applies the globals and - * ecmaFeatures to the configuration and returns the result. - * @param {Object} config The configuration information. - * @returns {Object} The updated configuration information. - */ - applyEnvironments: function(config) { - if (config.env && typeof config.env === "object") { - debug("Apply environment settings to config"); - return this.merge(this.createEnvironmentConfig(config.env), config); - } - - return config; - }, - - /** - * Merges two config objects. This will not only add missing keys, but will also modify values to match. - * @param {Object} target config object - * @param {Object} src config object. Overrides in this config object will take priority over base. - * @param {boolean} [combine] Whether to combine arrays or not - * @param {boolean} [isRule] Whether its a rule - * @returns {Object} merged config object. - */ - merge: function deepmerge(target, src, combine, isRule) { - /* - The MIT License (MIT) - - Copyright (c) 2012 Nicholas Fisher - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - */ - // This code is taken from deepmerge repo (https://github.com/KyleAMathews/deepmerge) and modified to meet our needs. - var array = Array.isArray(src) || Array.isArray(target); - var dst = array && [] || {}; - - combine = !!combine; - isRule = !!isRule; - if (array) { - target = target || []; - if (isRule && src.length > 1) { - dst = dst.concat(src); - } else { - dst = dst.concat(target); - } - if (typeof src !== "object" && !Array.isArray(src)) { - src = [src]; - } - Object.keys(src).forEach(function(e, i) { - e = src[i]; - if (typeof dst[i] === "undefined") { - dst[i] = e; - } else if (typeof e === "object") { - if (isRule) { - dst[i] = e; - } else { - dst[i] = deepmerge(target[i], e, combine, isRule); - } - } else { - if (!combine) { - dst[i] = e; - } else { - if (dst.indexOf(e) === -1) { - dst.push(e); - } - } - } - }); - } else { - if (target && typeof target === "object") { - Object.keys(target).forEach(function(key) { - dst[key] = target[key]; - }); - } - Object.keys(src).forEach(function(key) { - if (Array.isArray(src[key]) || Array.isArray(target[key])) { - dst[key] = deepmerge(target[key], src[key], key === "plugins", isRule); - } else if (typeof src[key] !== "object" || !src[key]) { - dst[key] = src[key]; - } else { - if (!target[key]) { - dst[key] = src[key]; - } else { - dst[key] = deepmerge(target[key], src[key], combine, key === "rules"); - } - } - }); - } - - return dst; - } - - -}; diff --git a/node_modules/eslint/lib/config/config-validator.js b/node_modules/eslint/lib/config/config-validator.js deleted file mode 100644 index 89e9a70..0000000 --- a/node_modules/eslint/lib/config/config-validator.js +++ /dev/null @@ -1,163 +0,0 @@ -/** - * @fileoverview Validates configs. - * @author Brandon Mills - * @copyright 2015 Brandon Mills - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var rules = require("../rules"), - environments = require("../../conf/environments"), - schemaValidator = require("is-my-json-valid"); - -var validators = { - rules: Object.create(null) -}; - -//------------------------------------------------------------------------------ -// Private -//------------------------------------------------------------------------------ - -/** - * Gets a complete options schema for a rule. - * @param {string} id The rule's unique name. - * @returns {object} JSON Schema for the rule's options. - */ -function getRuleOptionsSchema(id) { - var rule = rules.get(id), - schema = rule && rule.schema; - - if (!schema) { - return { - "type": "array", - "items": [ - { - "enum": [0, 1, 2] - } - ], - "minItems": 1 - }; - } - - // Given a tuple of schemas, insert warning level at the beginning - if (Array.isArray(schema)) { - return { - "type": "array", - "items": [ - { - "enum": [0, 1, 2] - } - ].concat(schema), - "minItems": 1, - "maxItems": schema.length + 1 - }; - } - - // Given a full schema, leave it alone - return schema; -} - -/** - * Validates a rule's options against its schema. - * @param {string} id The rule's unique name. - * @param {array|number} options The given options for the rule. - * @param {string} source The name of the configuration source. - * @returns {void} - */ -function validateRuleOptions(id, options, source) { - var validateRule = validators.rules[id], - message; - - if (!validateRule) { - validateRule = schemaValidator(getRuleOptionsSchema(id), { verbose: true }); - validators.rules[id] = validateRule; - } - - if (typeof options === "number") { - options = [options]; - } - - validateRule(options); - - if (validateRule.errors) { - message = [ - source, ":\n", - "\tConfiguration for rule \"", id, "\" is invalid:\n" - ]; - validateRule.errors.forEach(function(error) { - if (error.field === "data[\"0\"]") { // better error for severity - message.push( - "\tSeverity should be one of the following: 0 = off, 1 = warning, 2 = error (you passed \"", error.value, "\").\n"); - } else { - message.push( - "\tValue \"", error.value, "\" ", error.message, ".\n" - ); - } - }); - - throw new Error(message.join("")); - } -} - -/** - * Validates an environment object - * @param {object} environment The environment config object to validate. - * @param {string} source The location to report with any errors. - * @returns {void} - */ -function validateEnvironment(environment, source) { - - // not having an environment is ok - if (!environment) { - return; - } - - if (Array.isArray(environment)) { - throw new Error("Environment must not be an array"); - } - - if (typeof environment === "object") { - Object.keys(environment).forEach(function(env) { - if (!environments[env]) { - var message = [ - source, ":\n", - "\tEnvironment key \"", env, "\" is unknown\n" - ]; - throw new Error(message.join("")); - } - }); - } else { - throw new Error("Environment must be an object"); - } -} - -/** - * Validates an entire config object. - * @param {object} config The config object to validate. - * @param {string} source The location to report with any errors. - * @returns {void} - */ -function validate(config, source) { - - if (typeof config.rules === "object") { - Object.keys(config.rules).forEach(function(id) { - validateRuleOptions(id, config.rules[id], source); - }); - } - - validateEnvironment(config.env, source); -} - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -module.exports = { - getRuleOptionsSchema: getRuleOptionsSchema, - validate: validate, - validateRuleOptions: validateRuleOptions -}; diff --git a/node_modules/eslint/lib/eslint.js b/node_modules/eslint/lib/eslint.js deleted file mode 100644 index 12f8c3e..0000000 --- a/node_modules/eslint/lib/eslint.js +++ /dev/null @@ -1,1043 +0,0 @@ -/** - * @fileoverview Main ESLint object. - * @author Nicholas C. Zakas - * @copyright 2013 Nicholas C. Zakas. All rights reserved. - * See LICENSE file in root directory for full license. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var estraverse = require("./util/estraverse"), - escope = require("escope"), - environments = require("../conf/environments"), - blankScriptAST = require("../conf/blank-script.json"), - assign = require("object-assign"), - rules = require("./rules"), - RuleContext = require("./rule-context"), - timing = require("./timing"), - SourceCode = require("./util/source-code"), - NodeEventGenerator = require("./util/node-event-generator"), - CommentEventGenerator = require("./util/comment-event-generator"), - EventEmitter = require("events").EventEmitter, - ConfigOps = require("./config/config-ops"), - validator = require("./config/config-validator"), - replacements = require("../conf/replacements.json"), - assert = require("assert"); - -var DEFAULT_PARSER = require("../conf/eslint.json").parser; - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Parses a list of "name:boolean_value" or/and "name" options divided by comma or - * whitespace. - * @param {string} string The string to parse. - * @param {Comment} comment The comment node which has the string. - * @returns {Object} Result map object of names and boolean values - */ -function parseBooleanConfig(string, comment) { - var items = {}; - // Collapse whitespace around : to make parsing easier - string = string.replace(/\s*:\s*/g, ":"); - // Collapse whitespace around , - string = string.replace(/\s*,\s*/g, ","); - string.split(/\s|,+/).forEach(function(name) { - if (!name) { - return; - } - var pos = name.indexOf(":"), - value; - if (pos !== -1) { - value = name.substring(pos + 1, name.length); - name = name.substring(0, pos); - } - - items[name] = { - value: (value === "true"), - comment: comment - }; - - }); - return items; -} - -/** - * Parses a JSON-like config. - * @param {string} string The string to parse. - * @param {Object} location Start line and column of comments for potential error message. - * @param {Object[]} messages The messages queue for potential error message. - * @returns {Object} Result map object - */ -function parseJsonConfig(string, location, messages) { - var items = {}; - string = string.replace(/([a-zA-Z0-9\-\/]+):/g, "\"$1\":").replace(/(\]|[0-9])\s+(?=")/, "$1,"); - try { - items = JSON.parse("{" + string + "}"); - } catch (ex) { - - messages.push({ - fatal: true, - severity: 2, - message: "Failed to parse JSON from '" + string + "': " + ex.message, - line: location.start.line, - column: location.start.column + 1 - }); - - } - - return items; -} - -/** - * Parses a config of values separated by comma. - * @param {string} string The string to parse. - * @returns {Object} Result map of values and true values - */ -function parseListConfig(string) { - var items = {}; - // Collapse whitespace around , - string = string.replace(/\s*,\s*/g, ","); - string.split(/,+/).forEach(function(name) { - name = name.trim(); - if (!name) { - return; - } - items[name] = true; - }); - return items; -} - -/** - * Ensures that variables representing built-in properties of the Global Object, - * and any globals declared by special block comments, are present in the global - * scope. - * @param {ASTNode} program The top node of the AST. - * @param {Scope} globalScope The global scope. - * @param {Object} config The existing configuration data. - * @returns {void} - */ -function addDeclaredGlobals(program, globalScope, config) { - var declaredGlobals = {}, - exportedGlobals = {}, - explicitGlobals = {}, - builtin = environments.builtin; - - assign(declaredGlobals, builtin); - - Object.keys(config.env).forEach(function(name) { - if (config.env[name]) { - var environmentGlobals = environments[name] && environments[name].globals; - if (environmentGlobals) { - assign(declaredGlobals, environmentGlobals); - } - } - }); - - assign(exportedGlobals, config.exported); - assign(declaredGlobals, config.globals); - assign(explicitGlobals, config.astGlobals); - - Object.keys(declaredGlobals).forEach(function(name) { - var variable = globalScope.set.get(name); - if (!variable) { - variable = new escope.Variable(name, globalScope); - variable.eslintExplicitGlobal = false; - globalScope.variables.push(variable); - globalScope.set.set(name, variable); - } - variable.writeable = declaredGlobals[name]; - }); - - Object.keys(explicitGlobals).forEach(function(name) { - var variable = globalScope.set.get(name); - if (!variable) { - variable = new escope.Variable(name, globalScope); - variable.eslintExplicitGlobal = true; - variable.eslintExplicitGlobalComment = explicitGlobals[name].comment; - globalScope.variables.push(variable); - globalScope.set.set(name, variable); - } - variable.writeable = explicitGlobals[name].value; - }); - - // mark all exported variables as such - Object.keys(exportedGlobals).forEach(function(name) { - var variable = globalScope.set.get(name); - if (variable) { - variable.eslintUsed = true; - } - }); -} - -/** - * Add data to reporting configuration to disable reporting for list of rules - * starting from start location - * @param {Object[]} reportingConfig Current reporting configuration - * @param {Object} start Position to start - * @param {string[]} rulesToDisable List of rules - * @returns {void} - */ -function disableReporting(reportingConfig, start, rulesToDisable) { - - if (rulesToDisable.length) { - rulesToDisable.forEach(function(rule) { - reportingConfig.push({ - start: start, - end: null, - rule: rule - }); - }); - } else { - reportingConfig.push({ - start: start, - end: null, - rule: null - }); - } -} - -/** - * Add data to reporting configuration to enable reporting for list of rules - * starting from start location - * @param {Object[]} reportingConfig Current reporting configuration - * @param {Object} start Position to start - * @param {string[]} rulesToEnable List of rules - * @returns {void} - */ -function enableReporting(reportingConfig, start, rulesToEnable) { - var i; - - if (rulesToEnable.length) { - rulesToEnable.forEach(function(rule) { - for (i = reportingConfig.length - 1; i >= 0; i--) { - if (!reportingConfig[i].end && reportingConfig[i].rule === rule ) { - reportingConfig[i].end = start; - break; - } - } - }); - } else { - // find all previous disabled locations if they was started as list of rules - var prevStart; - for (i = reportingConfig.length - 1; i >= 0; i--) { - if (prevStart && prevStart !== reportingConfig[i].start) { - break; - } - - if (!reportingConfig[i].end) { - reportingConfig[i].end = start; - prevStart = reportingConfig[i].start; - } - } - } -} - -/** - * Parses comments in file to extract file-specific config of rules, globals - * and environments and merges them with global config; also code blocks - * where reporting is disabled or enabled and merges them with reporting config. - * @param {string} filename The file being checked. - * @param {ASTNode} ast The top node of the AST. - * @param {Object} config The existing configuration data. - * @param {Object[]} reportingConfig The existing reporting configuration data. - * @param {Object[]} messages The messages queue. - * @returns {object} Modified config object - */ -function modifyConfigsFromComments(filename, ast, config, reportingConfig, messages) { - - var commentConfig = { - exported: {}, - astGlobals: {}, - rules: {}, - env: {} - }; - var commentRules = {}; - - ast.comments.forEach(function(comment) { - - var value = comment.value.trim(); - var match = /^(eslint-\w+|eslint-\w+-\w+|eslint|exported|globals?)(\s|$)/.exec(value); - - if (match) { - value = value.substring(match.index + match[1].length); - - if (comment.type === "Block") { - switch (match[1]) { - case "exported": - assign(commentConfig.exported, parseBooleanConfig(value, comment)); - break; - - case "globals": - case "global": - assign(commentConfig.astGlobals, parseBooleanConfig(value, comment)); - break; - - case "eslint-env": - assign(commentConfig.env, parseListConfig(value)); - break; - - case "eslint-disable": - disableReporting(reportingConfig, comment.loc.start, Object.keys(parseListConfig(value))); - break; - - case "eslint-enable": - enableReporting(reportingConfig, comment.loc.start, Object.keys(parseListConfig(value))); - break; - - case "eslint": - var items = parseJsonConfig(value, comment.loc, messages); - Object.keys(items).forEach(function(name) { - var ruleValue = items[name]; - validator.validateRuleOptions(name, ruleValue, filename + " line " + comment.loc.start.line); - commentRules[name] = ruleValue; - }); - break; - - // no default - } - } else { - // comment.type === "Line" - if (match[1] === "eslint-disable-line") { - disableReporting(reportingConfig, { "line": comment.loc.start.line, "column": 0 }, Object.keys(parseListConfig(value))); - enableReporting(reportingConfig, comment.loc.end, Object.keys(parseListConfig(value))); - } - } - } - }); - - // apply environment configs - Object.keys(commentConfig.env).forEach(function(name) { - if (environments[name]) { - commentConfig = ConfigOps.merge(commentConfig, environments[name]); - } - }); - assign(commentConfig.rules, commentRules); - - return ConfigOps.merge(config, commentConfig); -} - -/** - * Check if message of rule with ruleId should be ignored in location - * @param {Object[]} reportingConfig Collection of ignore records - * @param {string} ruleId Id of rule - * @param {Object} location Location of message - * @returns {boolean} True if message should be ignored, false otherwise - */ -function isDisabledByReportingConfig(reportingConfig, ruleId, location) { - - for (var i = 0, c = reportingConfig.length; i < c; i++) { - - var ignore = reportingConfig[i]; - if ((!ignore.rule || ignore.rule === ruleId) && - (location.line > ignore.start.line || (location.line === ignore.start.line && location.column >= ignore.start.column)) && - (!ignore.end || (location.line < ignore.end.line || (location.line === ignore.end.line && location.column <= ignore.end.column)))) { - return true; - } - } - - return false; -} - -/** - * Process initial config to make it safe to extend by file comment config - * @param {Object} config Initial config - * @returns {Object} Processed config - */ -function prepareConfig(config) { - - config.globals = config.globals || config.global || {}; - delete config.global; - - var copiedRules = {}, - ecmaFeatures = {}, - preparedConfig; - - if (typeof config.rules === "object") { - Object.keys(config.rules).forEach(function(k) { - var rule = config.rules[k]; - if (rule === null) { - throw new Error("Invalid config for rule '" + k + "'\."); - } - if (Array.isArray(rule)) { - copiedRules[k] = rule.slice(); - } else { - copiedRules[k] = rule; - } - }); - } - - // merge in environment ecmaFeatures - if (typeof config.env === "object") { - Object.keys(config.env).forEach(function(env) { - if (config.env[env] && environments[env] && environments[env].ecmaFeatures) { - assign(ecmaFeatures, environments[env].ecmaFeatures); - } - }); - } - - preparedConfig = { - rules: copiedRules, - parser: config.parser || DEFAULT_PARSER, - globals: ConfigOps.merge({}, config.globals), - env: ConfigOps.merge({}, config.env || {}), - settings: ConfigOps.merge({}, config.settings || {}), - ecmaFeatures: ConfigOps.merge(ecmaFeatures, config.ecmaFeatures || {}) - }; - - // can't have global return inside of modules - if (preparedConfig.ecmaFeatures.modules) { - preparedConfig.ecmaFeatures.globalReturn = false; - } - - return preparedConfig; -} - -/** - * Provide a stub rule with a given message - * @param {string} message The message to be displayed for the rule - * @returns {Function} Stub rule function - */ -function createStubRule(message) { - - /** - * Creates a fake rule object - * @param {object} context context object for each rule - * @returns {object} collection of node to listen on - */ - function createRuleModule(context) { - return { - Program: function(node) { - context.report(node, message); - } - }; - } - - if (message) { - return createRuleModule; - } else { - throw new Error("No message passed to stub rule"); - } -} - -/** - * Provide a rule replacement message - * @param {string} ruleId Name of the rule - * @returns {string} Message detailing rule replacement - */ -function getRuleReplacementMessage(ruleId) { - if (ruleId in replacements.rules) { - var newRules = replacements.rules[ruleId]; - return "Rule \'" + ruleId + "\' was removed and replaced by: " + newRules.join(", "); - } -} - -var eslintEnvPattern = /\/\*\s*eslint-env\s(.+?)\*\//g; - -/** - * Checks whether or not there is a comment which has "eslint-env *" in a given text. - * @param {string} text - A source code text to check. - * @returns {object|null} A result of parseListConfig() with "eslint-env *" comment. - */ -function findEslintEnv(text) { - var match, retv; - - eslintEnvPattern.lastIndex = 0; - while ((match = eslintEnvPattern.exec(text))) { - retv = assign(retv || {}, parseListConfig(match[1])); - } - - return retv; -} - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -/** - * Object that is responsible for verifying JavaScript text - * @name eslint - */ -module.exports = (function() { - - var api = Object.create(new EventEmitter()), - messages = [], - currentConfig = null, - currentScopes = null, - scopeMap = null, - scopeManager = null, - currentFilename = null, - controller = null, - reportingConfig = [], - sourceCode = null; - - /** - * Parses text into an AST. Moved out here because the try-catch prevents - * optimization of functions, so it's best to keep the try-catch as isolated - * as possible - * @param {string} text The text to parse. - * @param {Object} config The ESLint configuration object. - * @returns {ASTNode} The AST if successful or null if not. - * @private - */ - function parse(text, config) { - - var parser; - - try { - parser = require(config.parser); - } catch (ex) { - messages.push({ - fatal: true, - severity: 2, - message: ex.message, - line: 0, - column: 0 - }); - - return null; - } - - /* - * Check for parsing errors first. If there's a parsing error, nothing - * else can happen. However, a parsing error does not throw an error - * from this method - it's just considered a fatal error message, a - * problem that ESLint identified just like any other. - */ - try { - return parser.parse(text, { - loc: true, - range: true, - raw: true, - tokens: true, - comment: true, - attachComment: true, - ecmaFeatures: config.ecmaFeatures - }); - } catch (ex) { - - // If the message includes a leading line number, strip it: - var message = ex.message.replace(/^line \d+:/i, "").trim(); - - messages.push({ - fatal: true, - severity: 2, - - message: "Parsing error: " + message, - - line: ex.lineNumber, - column: ex.column + 1 - }); - - return null; - } - } - - /** - * Get the severity level of a rule (0 - none, 1 - warning, 2 - error) - * Returns 0 if the rule config is not valid (an Array or a number) - * @param {Array|number} ruleConfig rule configuration - * @returns {number} 0, 1, or 2, indicating rule severity - */ - function getRuleSeverity(ruleConfig) { - if (typeof ruleConfig === "number") { - return ruleConfig; - } else if (Array.isArray(ruleConfig)) { - return ruleConfig[0]; - } else { - return 0; - } - } - - /** - * Get the options for a rule (not including severity), if any - * @param {Array|number} ruleConfig rule configuration - * @returns {Array} of rule options, empty Array if none - */ - function getRuleOptions(ruleConfig) { - if (Array.isArray(ruleConfig)) { - return ruleConfig.slice(1); - } else { - return []; - } - } - - // set unlimited listeners (see https://github.com/eslint/eslint/issues/524) - api.setMaxListeners(0); - - /** - * Resets the internal state of the object. - * @returns {void} - */ - api.reset = function() { - this.removeAllListeners(); - messages = []; - currentConfig = null; - currentScopes = null; - scopeMap = null; - scopeManager = null; - controller = null; - reportingConfig = []; - sourceCode = null; - }; - - /** - * Verifies the text against the rules specified by the second argument. - * @param {string|SourceCode} textOrSourceCode The text to parse or a SourceCode object. - * @param {Object} config An object whose keys specify the rules to use. - * @param {(string|Object)} [filenameOrOptions] The optional filename of the file being checked. - * If this is not set, the filename will default to '' in the rule context. If - * an object, then it has "filename", "saveState", and "allowInlineConfig" properties. - * @param {boolean} [saveState] Indicates if the state from the last run should be saved. - * Mostly useful for testing purposes. - * @param {boolean} [filenameOrOptions.allowInlineConfig] Allow/disallow inline comments' ability to change config once it is set. Defaults to true if not supplied. - * Useful if you want to validate JS without comments overriding rules. - * @returns {Object[]} The results as an array of messages or null if no messages. - */ - api.verify = function(textOrSourceCode, config, filenameOrOptions, saveState) { - - var ast, - shebang, - ecmaFeatures, - ecmaVersion, - allowInlineConfig, - text = (typeof textOrSourceCode === "string") ? textOrSourceCode : null; - - // evaluate arguments - if (typeof filenameOrOptions === "object") { - currentFilename = filenameOrOptions.filename; - allowInlineConfig = filenameOrOptions.allowInlineConfig; - saveState = filenameOrOptions.saveState; - } else { - currentFilename = filenameOrOptions; - } - - if (!saveState) { - this.reset(); - } - - // search and apply "eslint-env *". - var envInFile = findEslintEnv(text || textOrSourceCode.text); - if (envInFile) { - if (!config || !config.env) { - config = assign({}, config || {}, {env: envInFile}); - } else { - config = assign({}, config); - config.env = assign({}, config.env, envInFile); - } - } - - // process initial config to make it safe to extend - config = prepareConfig(config || {}); - - // only do this for text - if (text !== null) { - - // there's no input, just exit here - if (text.trim().length === 0) { - sourceCode = new SourceCode(text, blankScriptAST); - return messages; - } - - ast = parse(text.replace(/^#!([^\r\n]+)/, function(match, captured) { - shebang = captured; - return "//" + captured; - }), config); - - if (ast) { - sourceCode = new SourceCode(text, ast); - } - - } else { - sourceCode = textOrSourceCode; - ast = sourceCode.ast; - } - - // if espree failed to parse the file, there's no sense in setting up rules - if (ast) { - - // parse global comments and modify config - if (allowInlineConfig !== false) { - config = modifyConfigsFromComments(currentFilename, ast, config, reportingConfig, messages); - } - - // enable appropriate rules - Object.keys(config.rules).filter(function(key) { - return getRuleSeverity(config.rules[key]) > 0; - }).forEach(function(key) { - var ruleCreator, - severity, - options, - rule; - - ruleCreator = rules.get(key); - if (!ruleCreator) { - var replacementMsg = getRuleReplacementMessage(key); - if (replacementMsg) { - ruleCreator = createStubRule(replacementMsg); - } else { - ruleCreator = createStubRule("Definition for rule '" + key + "' was not found"); - } - rules.define(key, ruleCreator); - } - - severity = getRuleSeverity(config.rules[key]); - options = getRuleOptions(config.rules[key]); - - try { - rule = ruleCreator(new RuleContext( - key, api, severity, options, - config.settings, config.ecmaFeatures - )); - - // add all the node types as listeners - Object.keys(rule).forEach(function(nodeType) { - api.on(nodeType, timing.enabled - ? timing.time(key, rule[nodeType]) - : rule[nodeType] - ); - }); - } catch (ex) { - ex.message = "Error while loading rule '" + key + "': " + ex.message; - throw ex; - } - }); - - // save config so rules can access as necessary - currentConfig = config; - controller = new estraverse.Controller(); - - ecmaFeatures = currentConfig.ecmaFeatures; - ecmaVersion = (ecmaFeatures.blockBindings || ecmaFeatures.classes || - ecmaFeatures.modules || ecmaFeatures.defaultParams || - ecmaFeatures.destructuring) ? 6 : 5; - - - // gather data that may be needed by the rules - scopeManager = escope.analyze(ast, { - ignoreEval: true, - nodejsScope: ecmaFeatures.globalReturn, - ecmaVersion: ecmaVersion, - sourceType: ecmaFeatures.modules ? "module" : "script" - }); - currentScopes = scopeManager.scopes; - - /* - * Index the scopes by the start range of their block for efficient - * lookup in getScope. - */ - scopeMap = []; - currentScopes.forEach(function(scope, index) { - var range = scope.block.range[0]; - - // Sometimes two scopes are returned for a given node. This is - // handled later in a known way, so just don't overwrite here. - if (!scopeMap[range]) { - scopeMap[range] = index; - } - }); - - // augment global scope with declared global variables - addDeclaredGlobals(ast, currentScopes[0], currentConfig); - - // remove shebang comments - if (shebang && ast.comments.length && ast.comments[0].value === shebang) { - ast.comments.splice(0, 1); - - if (ast.body.length && ast.body[0].leadingComments && ast.body[0].leadingComments[0].value === shebang) { - ast.body[0].leadingComments.splice(0, 1); - } - } - - var eventGenerator = new NodeEventGenerator(api); - eventGenerator = new CommentEventGenerator(eventGenerator, sourceCode); - - /* - * Each node has a type property. Whenever a particular type of node is found, - * an event is fired. This allows any listeners to automatically be informed - * that this type of node has been found and react accordingly. - */ - controller.traverse(ast, { - enter: function(node, parent) { - node.parent = parent; - eventGenerator.enterNode(node); - }, - leave: function(node) { - eventGenerator.leaveNode(node); - } - }); - - } - - // sort by line and column - messages.sort(function(a, b) { - var lineDiff = a.line - b.line; - - if (lineDiff === 0) { - return a.column - b.column; - } else { - return lineDiff; - } - }); - - return messages; - }; - - /** - * Reports a message from one of the rules. - * @param {string} ruleId The ID of the rule causing the message. - * @param {number} severity The severity level of the rule as configured. - * @param {ASTNode} node The AST node that the message relates to. - * @param {Object=} location An object containing the error line and column - * numbers. If location is not provided the node's start location will - * be used. - * @param {string} message The actual message. - * @param {Object} opts Optional template data which produces a formatted message - * with symbols being replaced by this object's values. - * @param {Object} fix A fix command description. - * @returns {void} - */ - api.report = function(ruleId, severity, node, location, message, opts, fix) { - if (node) { - assert.strictEqual(typeof node, "object", "Node must be an object"); - } - - if (typeof location === "string") { - assert.ok(node, "Node must be provided when reporting error if location is not provided"); - - fix = opts; - opts = message; - message = location; - location = node.loc.start; - } - // else, assume location was provided, so node may be omitted - - if (isDisabledByReportingConfig(reportingConfig, ruleId, location)) { - return; - } - - if (opts) { - message = message.replace(/\{\{\s*(.+?)\s*\}\}/g, function(fullMatch, term) { - if (term in opts) { - return opts[term]; - } - - // Preserve old behavior: If parameter name not provided, don't replace it. - return fullMatch; - }); - } - - var problem = { - ruleId: ruleId, - severity: severity, - message: message, - line: location.line, - column: location.column + 1, // switch to 1-base instead of 0-base - nodeType: node && node.type, - source: sourceCode.lines[location.line - 1] || "" - }; - - // ensure there's range and text properties, otherwise it's not a valid fix - if (fix && Array.isArray(fix.range) && (typeof fix.text === "string")) { - problem.fix = fix; - } - - messages.push(problem); - }; - - /** - * Gets the SourceCode object representing the parsed source. - * @returns {SourceCode} The SourceCode object. - */ - api.getSourceCode = function() { - return sourceCode; - }; - - // methods that exist on SourceCode object - var externalMethods = { - getSource: "getText", - getSourceLines: "getLines", - getAllComments: "getAllComments", - getNodeByRangeIndex: "getNodeByRangeIndex", - getComments: "getComments", - getJSDocComment: "getJSDocComment", - getFirstToken: "getFirstToken", - getFirstTokens: "getFirstTokens", - getLastToken: "getLastToken", - getLastTokens: "getLastTokens", - getTokenAfter: "getTokenAfter", - getTokenBefore: "getTokenBefore", - getTokenByRangeStart: "getTokenByRangeStart", - getTokens: "getTokens", - getTokensAfter: "getTokensAfter", - getTokensBefore: "getTokensBefore", - getTokensBetween: "getTokensBetween" - }; - - // copy over methods - Object.keys(externalMethods).forEach(function(methodName) { - var exMethodName = externalMethods[methodName]; - - // All functions expected to have less arguments than 5. - api[methodName] = function(a, b, c, d, e) { - if (sourceCode) { - return sourceCode[exMethodName](a, b, c, d, e); - } - return null; - }; - }); - - /** - * Gets nodes that are ancestors of current node. - * @returns {ASTNode[]} Array of objects representing ancestors. - */ - api.getAncestors = function() { - return controller.parents(); - }; - - /** - * Gets the scope for the current node. - * @returns {Object} An object representing the current node's scope. - */ - api.getScope = function() { - var parents = controller.parents(), - scope = currentScopes[0]; - - // Don't do this for Program nodes - they have no parents - if (parents.length) { - - // if current node introduces a scope, add it to the list - var current = controller.current(); - if (currentConfig.ecmaFeatures.blockBindings) { - if (["BlockStatement", "SwitchStatement", "CatchClause", "FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression"].indexOf(current.type) >= 0) { - parents.push(current); - } - } else { - if (["FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression"].indexOf(current.type) >= 0) { - parents.push(current); - } - } - - // Ascend the current node's parents - for (var i = parents.length - 1; i >= 0; --i) { - - // Get the innermost scope - scope = scopeManager.acquire(parents[i], true); - if (scope) { - if (scope.type === "function-expression-name") { - return scope.childScopes[0]; - } else { - return scope; - } - } - - } - - } - - return currentScopes[0]; - }; - - /** - * Record that a particular variable has been used in code - * @param {string} name The name of the variable to mark as used - * @returns {boolean} True if the variable was found and marked as used, - * false if not. - */ - api.markVariableAsUsed = function(name) { - var scope = this.getScope(), - specialScope = currentConfig.ecmaFeatures.globalReturn || currentConfig.ecmaFeatures.modules, - variables, - i, - len; - - // Special Node.js scope means we need to start one level deeper - if (scope.type === "global" && specialScope) { - scope = scope.childScopes[0]; - } - - do { - variables = scope.variables; - for (i = 0, len = variables.length; i < len; i++) { - if (variables[i].name === name) { - variables[i].eslintUsed = true; - return true; - } - } - } while ( (scope = scope.upper) ); - - return false; - }; - - /** - * Gets the filename for the currently parsed source. - * @returns {string} The filename associated with the source being parsed. - * Defaults to "" if no filename info is present. - */ - api.getFilename = function() { - if (typeof currentFilename === "string") { - return currentFilename; - } else { - return ""; - } - }; - - /** - * Defines a new linting rule. - * @param {string} ruleId A unique rule identifier - * @param {Function} ruleModule Function from context to object mapping AST node types to event handlers - * @returns {void} - */ - var defineRule = api.defineRule = function(ruleId, ruleModule) { - rules.define(ruleId, ruleModule); - }; - - /** - * Defines many new linting rules. - * @param {object} rulesToDefine map from unique rule identifier to rule - * @returns {void} - */ - api.defineRules = function(rulesToDefine) { - Object.getOwnPropertyNames(rulesToDefine).forEach(function(ruleId) { - defineRule(ruleId, rulesToDefine[ruleId]); - }); - }; - - /** - * Gets the default eslint configuration. - * @returns {Object} Object mapping rule IDs to their default configurations - */ - api.defaults = function() { - return require("../conf/eslint.json"); - }; - - /** - * Gets variables that are declared by a specified node. - * - * The variables are its `defs[].node` or `defs[].parent` is same as the specified node. - * Specifically, below: - * - * - `VariableDeclaration` - variables of its all declarators. - * - `VariableDeclarator` - variables. - * - `FunctionDeclaration`/`FunctionExpression` - its function name and parameters. - * - `ArrowFunctionExpression` - its parameters. - * - `ClassDeclaration`/`ClassExpression` - its class name. - * - `CatchClause` - variables of its exception. - * - `ImportDeclaration` - variables of its all specifiers. - * - `ImportSpecifier`/`ImportDefaultSpecifier`/`ImportNamespaceSpecifier` - a variable. - * - others - always an empty array. - * - * @param {ASTNode} node A node to get. - * @returns {escope.Variable[]} Variables that are declared by the node. - */ - api.getDeclaredVariables = function(node) { - return (scopeManager && scopeManager.getDeclaredVariables(node)) || []; - }; - - return api; - -}()); diff --git a/node_modules/eslint/lib/file-finder.js b/node_modules/eslint/lib/file-finder.js deleted file mode 100644 index 4f64a3f..0000000 --- a/node_modules/eslint/lib/file-finder.js +++ /dev/null @@ -1,186 +0,0 @@ -/** - * @fileoverview Util class to find config files. - * @author Aliaksei Shytkin - * @copyright 2014 Michael McLaughlin. All rights reserved. - * @copyright 2014 Aliaksei Shytkin. All rights reserved. - * See LICENSE in root directory for full license. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var fs = require("fs"), - path = require("path"); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Get the entries for a directory. Including a try-catch may be detrimental to - * function performance, so move it out here a separate function. - * @param {string} directory The directory to search in. - * @returns {string[]} The entries in the directory or an empty array on error. - * @private - */ -function getDirectoryEntries(directory) { - try { - return fs.readdirSync(directory); - } catch (ex) { - return []; - } -} - -//------------------------------------------------------------------------------ -// API -//------------------------------------------------------------------------------ - -/** - * FileFinder - * @constructor - * @param {...string} arguments The basename(s) of the file(s) to find. - */ -function FileFinder() { - this.fileNames = Array.prototype.slice.call(arguments); - this.cache = {}; -} - -/** - * Find one instance of a specified file name in directory or in a parent directory. - * Cache the results. - * Does not check if a matching directory entry is a file, and intentionally - * only searches for the first file name in this.fileNames. - * Is currently used by lib/ignored_paths.js to find an .eslintignore file. - * @param {string} directory The directory to start the search from. - * @returns {string} Path of the file found, or an empty string if not found. - */ -FileFinder.prototype.findInDirectoryOrParents = function(directory) { - var cache = this.cache, - child, - dirs, - filePath, - i, - name, - names, - searched; - - if (!directory) { - directory = process.cwd(); - } - - if (cache.hasOwnProperty(directory)) { - return cache[directory]; - } - - dirs = []; - searched = 0; - name = this.fileNames[0]; - names = Array.isArray(name) ? name : [name]; - - (function() { - while (directory !== child) { - dirs[searched++] = directory; - - for (var k = 0, found = false; k < names.length && !found; k++) { - - if (getDirectoryEntries(directory).indexOf(names[k]) !== -1 && fs.statSync(path.resolve(directory, names[k])).isFile()) { - filePath = path.resolve(directory, names[k]); - return; - } - } - - child = directory; - - // Assign parent directory to directory. - directory = path.dirname(directory); - } - }()); - - for (i = 0; i < searched; i++) { - cache[dirs[i]] = filePath; - } - - return filePath || String(); -}; - -/** - * Find all instances of files with the specified file names, in directory and - * parent directories. Cache the results. - * Does not check if a matching directory entry is a file. - * Searches for all the file names in this.fileNames. - * Is currently used by lib/config.js to find .eslintrc and package.json files. - * @param {string} directory The directory to start the search from. - * @returns {string[]} The file paths found. - */ -FileFinder.prototype.findAllInDirectoryAndParents = function(directory) { - var cache = this.cache, - child, - dirs, - name, - fileNames, - fileNamesCount, - filePath, - i, - j, - searched; - - if (!directory) { - directory = process.cwd(); - } - - if (cache.hasOwnProperty(directory)) { - return cache[directory]; - } - - dirs = []; - searched = 0; - fileNames = this.fileNames; - fileNamesCount = fileNames.length; - - do { - dirs[searched++] = directory; - cache[directory] = []; - - for (i = 0; i < fileNamesCount; i++) { - name = fileNames[i]; - - // convert to an array for easier handling - if (!Array.isArray(name)) { - name = [name]; - } - - for (var k = 0, found = false; k < name.length && !found; k++) { - - if (getDirectoryEntries(directory).indexOf(name[k]) !== -1 && fs.statSync(path.resolve(directory, name[k])).isFile()) { - filePath = path.resolve(directory, name[k]); - found = true; - - // Add the file path to the cache of each directory searched. - for (j = 0; j < searched; j++) { - cache[dirs[j]].push(filePath); - } - } - } - - } - child = directory; - - // Assign parent directory to directory. - directory = path.dirname(directory); - - if (directory === child) { - return cache[dirs[0]]; - } - } while (!cache.hasOwnProperty(directory)); - - // Add what has been cached previously to the cache of each directory searched. - for (i = 0; i < searched; i++) { - dirs.push.apply(cache[dirs[i]], cache[directory]); - } - - return cache[dirs[0]]; -}; - -module.exports = FileFinder; diff --git a/node_modules/eslint/lib/formatters/checkstyle.js b/node_modules/eslint/lib/formatters/checkstyle.js deleted file mode 100644 index dc40a2a..0000000 --- a/node_modules/eslint/lib/formatters/checkstyle.js +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @fileoverview CheckStyle XML reporter - * @author Ian Christian Myers - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Helper Functions -//------------------------------------------------------------------------------ - -/** - * Returns the severity of warning or error - * @param {object} message message object to examine - * @returns {string} severity level - * @private - */ -function getMessageType(message) { - if (message.fatal || message.severity === 2) { - return "error"; - } else { - return "warning"; - } -} - -/** - * Returns the escaped value for a character - * @param {string} s string to examine - * @returns {string} severity level - * @private - */ -function xmlEscape(s) { - return ("" + s).replace(/[<>&"']/g, function(c) { - switch (c) { - case "<": - return "<"; - case ">": - return ">"; - case "&": - return "&"; - case "\"": - return """; - case "'": - return "'"; - // no default - } - }); -} - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -module.exports = function(results) { - - var output = ""; - - output += ""; - output += ""; - - results.forEach(function(result) { - var messages = result.messages; - - output += ""; - - messages.forEach(function(message) { - output += ""; - }); - - output += ""; - - }); - - output += ""; - - return output; -}; diff --git a/node_modules/eslint/lib/formatters/compact.js b/node_modules/eslint/lib/formatters/compact.js deleted file mode 100644 index f1eb83a..0000000 --- a/node_modules/eslint/lib/formatters/compact.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @fileoverview Compact reporter - * @author Nicholas C. Zakas - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Helper Functions -//------------------------------------------------------------------------------ - -/** - * Returns the severity of warning or error - * @param {object} message message object to examine - * @returns {string} severity level - * @private - */ -function getMessageType(message) { - if (message.fatal || message.severity === 2) { - return "Error"; - } else { - return "Warning"; - } -} - - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -module.exports = function(results) { - - var output = "", - total = 0; - - results.forEach(function(result) { - - var messages = result.messages; - total += messages.length; - - messages.forEach(function(message) { - - output += result.filePath + ": "; - output += "line " + (message.line || 0); - output += ", col " + (message.column || 0); - output += ", " + getMessageType(message); - output += " - " + message.message; - output += message.ruleId ? " (" + message.ruleId + ")" : ""; - output += "\n"; - - }); - - }); - - if (total > 0) { - output += "\n" + total + " problem" + (total !== 1 ? "s" : ""); - } - - return output; -}; diff --git a/node_modules/eslint/lib/formatters/html-template.html b/node_modules/eslint/lib/formatters/html-template.html deleted file mode 100644 index f63a0a8..0000000 --- a/node_modules/eslint/lib/formatters/html-template.html +++ /dev/null @@ -1,130 +0,0 @@ - - - ESLint Report - - - -
-

ESLint Report

-
- {{renderText totalErrors totalWarnings}} - Generated on {{date}} -
-
- - - {{#each results}} - - - - {{#each this.messages}} - - - {{getSeverity this.severity}} - - - - {{/each}} - {{/each}} - -
- [+] {{this.filePath}} - {{renderText this.errorCount this.warningCount}} -
- - - \ No newline at end of file diff --git a/node_modules/eslint/lib/formatters/html.js b/node_modules/eslint/lib/formatters/html.js deleted file mode 100644 index 435894d..0000000 --- a/node_modules/eslint/lib/formatters/html.js +++ /dev/null @@ -1,88 +0,0 @@ -/** - * @fileoverview HTML reporter - * @author Julian Laval - * @copyright 2015 Julian Laval. All rights reserved. - */ -"use strict"; - -var handlebars = require("handlebars").create(); -var fs = require("fs"); -var path = require("path"); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Given a word and a count, append an s if count is not one. - * @param {string} word A word in its singular form. - * @param {int} count A number controlling whether word should be pluralized. - * @returns {string} The original word with an s on the end if count is not one. - */ -function pluralize(word, count) { - return (count === 1 ? word : word + "s"); -} - -/** - * Renders text along the template of x problems (x errors, x warnings) - * @param {string} totalErrors Total errors - * @param {string} totalWarnings Total warnings - * @returns {string} The formatted string, pluralized where necessary - */ -handlebars.registerHelper("renderText", function(totalErrors, totalWarnings) { - var totalProblems = totalErrors + totalWarnings; - var renderedText = totalProblems + " " + pluralize("problem", totalProblems); - if (totalProblems !== 0) { - renderedText += " (" + totalErrors + " " + pluralize("error", totalErrors) + ", " + totalWarnings + " " + pluralize("warning", totalWarnings) + ")"; - } - return renderedText; -}); - -/** - * Get the color based on whether there are errors/warnings... - * @param {string} totalErrors Total errors - * @param {string} totalWarnings Total warnings - * @returns {int} The color code (0 = green, 1 = yellow, 2 = red) - */ -handlebars.registerHelper("getColor", function(totalErrors, totalWarnings) { - if (totalErrors !== 0) { - return 2; - } else if (totalWarnings !== 0) { - return 1; - } - return 0; -}); - -/** - * Get the HTML row content based on the severity of the message - * @param {int} severity Severity of the message - * @returns {string} The generated HTML row - */ -handlebars.registerHelper("getSeverity", function(severity) { - // Return warning else error - return new handlebars.SafeString((severity === 1) ? "Warning" : "Error"); -}); - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -module.exports = function(results) { - - var template = fs.readFileSync(path.join(__dirname, "html-template.html"), "utf-8"); - - var data = { - date: new Date(), - totalErrors: 0, - totalWarnings: 0, - results: results - }; - - // Iterate over results to get totals - results.forEach(function(result) { - data.totalErrors += result.errorCount; - data.totalWarnings += result.warningCount; - }); - - return handlebars.compile(template)(data); -}; diff --git a/node_modules/eslint/lib/formatters/jslint-xml.js b/node_modules/eslint/lib/formatters/jslint-xml.js deleted file mode 100644 index 26aa2de..0000000 --- a/node_modules/eslint/lib/formatters/jslint-xml.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @fileoverview JSLint XML reporter - * @author Ian Christian Myers - */ -"use strict"; - -var xmlescape = require("xml-escape"); - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -module.exports = function(results) { - - var output = ""; - - output += ""; - output += ""; - - results.forEach(function(result) { - var messages = result.messages; - - output += ""; - - messages.forEach(function(message) { - output += ""; - }); - - output += ""; - - }); - - output += ""; - - return output; -}; diff --git a/node_modules/eslint/lib/formatters/json.js b/node_modules/eslint/lib/formatters/json.js deleted file mode 100644 index c110197..0000000 --- a/node_modules/eslint/lib/formatters/json.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * @fileoverview JSON reporter - * @author Burak Yigit Kaya aka BYK - * @copyright 2015 Burak Yigit Kaya. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -module.exports = function(results) { - return JSON.stringify(results); -}; diff --git a/node_modules/eslint/lib/formatters/junit.js b/node_modules/eslint/lib/formatters/junit.js deleted file mode 100644 index 3d4a1db..0000000 --- a/node_modules/eslint/lib/formatters/junit.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @fileoverview jUnit Reporter - * @author Jamund Ferguson - */ -"use strict"; - -var xmlescape = require("xml-escape"); - -//------------------------------------------------------------------------------ -// Helper Functions -//------------------------------------------------------------------------------ - -/** - * Returns the severity of warning or error - * @param {object} message message object to examine - * @returns {string} severity level - * @private - */ -function getMessageType(message) { - if (message.fatal || message.severity === 2) { - return "Error"; - } else { - return "Warning"; - } -} - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -module.exports = function(results) { - - var output = ""; - - output += "\n"; - output += "\n"; - - results.forEach(function(result) { - - var messages = result.messages; - - if (messages.length) { - output += "\n"; - } - - messages.forEach(function(message) { - var type = message.fatal ? "error" : "failure"; - output += ""; - output += "<" + type + " message=\"" + xmlescape(message.message || "") + "\">"; - output += ""; - output += ""; - output += "\n"; - }); - - if (messages.length) { - output += "\n"; - } - - }); - - output += "\n"; - - return output; -}; diff --git a/node_modules/eslint/lib/formatters/stylish.js b/node_modules/eslint/lib/formatters/stylish.js deleted file mode 100644 index 59e01d0..0000000 --- a/node_modules/eslint/lib/formatters/stylish.js +++ /dev/null @@ -1,90 +0,0 @@ -/** - * @fileoverview Stylish reporter - * @author Sindre Sorhus - */ -"use strict"; - -var chalk = require("chalk"), - table = require("text-table"); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Given a word and a count, append an s if count is not one. - * @param {string} word A word in its singular form. - * @param {int} count A number controlling whether word should be pluralized. - * @returns {string} The original word with an s on the end if count is not one. - */ -function pluralize(word, count) { - return (count === 1 ? word : word + "s"); -} - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -module.exports = function(results) { - - var output = "\n", - total = 0, - errors = 0, - warnings = 0, - summaryColor = "yellow"; - - results.forEach(function(result) { - var messages = result.messages; - - if (messages.length === 0) { - return; - } - - total += messages.length; - output += chalk.underline(result.filePath) + "\n"; - - output += table( - messages.map(function(message) { - var messageType; - - if (message.fatal || message.severity === 2) { - messageType = chalk.red("error"); - summaryColor = "red"; - errors++; - } else { - messageType = chalk.yellow("warning"); - warnings++; - } - - return [ - "", - message.line || 0, - message.column || 0, - messageType, - message.message.replace(/\.$/, ""), - chalk.gray(message.ruleId || "") - ]; - }), - { - align: ["", "r", "l"], - stringLength: function(str) { - return chalk.stripColor(str).length; - } - } - ).split("\n").map(function(el) { - return el.replace(/(\d+)\s+(\d+)/, function(m, p1, p2) { - return chalk.gray(p1 + ":" + p2); - }); - }).join("\n") + "\n\n"; - }); - - if (total > 0) { - output += chalk[summaryColor].bold([ - "\u2716 ", total, pluralize(" problem", total), - " (", errors, pluralize(" error", errors), ", ", - warnings, pluralize(" warning", warnings), ")\n" - ].join("")); - } - - return total > 0 ? output : ""; -}; diff --git a/node_modules/eslint/lib/formatters/tap.js b/node_modules/eslint/lib/formatters/tap.js deleted file mode 100644 index ecb6960..0000000 --- a/node_modules/eslint/lib/formatters/tap.js +++ /dev/null @@ -1,86 +0,0 @@ -/** - * @fileoverview TAP reporter - * @author Jonathan Kingston - */ -"use strict"; - -var yaml = require("js-yaml"); - -//------------------------------------------------------------------------------ -// Helper Functions -//------------------------------------------------------------------------------ - -/** - * Returns a canonical error level string based upon the error message passed in. - * @param {object} message Individual error message provided by eslint - * @returns {String} Error level string - */ -function getMessageType(message) { - if (message.fatal || message.severity === 2) { - return "error"; - } else { - return "warning"; - } -} - -/** - * Takes in a JavaScript object and outputs a TAP diagnostics string - * @param {object} diagnostic JavaScript object to be embedded as YAML into output. - * @returns {string} diagnostics string with YAML embedded - TAP version 13 compliant - */ -function outputDiagnostics(diagnostic) { - var prefix = " "; - var output = prefix + "---\n"; - output += prefix + yaml.safeDump(diagnostic).split("\n").join("\n" + prefix); - output += "...\n"; - return output; -} - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -module.exports = function(results) { - var output = "TAP version 13\n1.." + results.length + "\n"; - - results.forEach(function(result, id) { - var messages = result.messages; - var testResult = "ok"; - var diagnostics = {}; - - if (messages.length > 0) { - testResult = "not ok"; - - messages.forEach(function(message) { - var diagnostic = { - message: message.message, - severity: getMessageType(message), - data: { - line: message.line || 0, - column: message.column || 0, - ruleId: message.ruleId || "" - } - }; - - // If we have multiple messages place them under a messages key - // The first error will be logged as message key - // This is to adhere to TAP 13 loosely defined specification of having a message key - if ("message" in diagnostics) { - diagnostics.messages = [diagnostic]; - } else { - diagnostics = diagnostic; - } - }); - } - - output += testResult + " " + (id + 1) + " - " + result.filePath + "\n"; - - // If we have an error include diagnostics - if (messages.length > 0) { - output += outputDiagnostics(diagnostics); - } - - }); - - return output; -}; diff --git a/node_modules/eslint/lib/formatters/unix.js b/node_modules/eslint/lib/formatters/unix.js deleted file mode 100644 index 2782b0c..0000000 --- a/node_modules/eslint/lib/formatters/unix.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @fileoverview unix-style formatter. - * @author oshi-shinobu - * @copyright 2015 oshi-shinobu. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Helper Functions -//------------------------------------------------------------------------------ - -/** - * Returns a canonical error level string based upon the error message passed in. - * @param {object} message Individual error message provided by eslint - * @returns {String} Error level string - */ -function getMessageType(message) { - if (message.fatal || message.severity === 2) { - return "Error"; - } else { - return "Warning"; - } -} - - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -module.exports = function(results) { - - var output = "", - total = 0; - - results.forEach(function(result) { - - var messages = result.messages; - total += messages.length; - - messages.forEach(function(message) { - - output += result.filePath + ":"; - output += (message.line || 0) + ":"; - output += (message.column || 0) + ":"; - output += " " + message.message + " "; - output += "[" + getMessageType(message) + - (message.ruleId ? "/" + message.ruleId : "") + "]"; - output += "\n"; - - }); - - }); - - if (total > 0) { - output += "\n" + total + " problem" + (total !== 1 ? "s" : ""); - } - - return output; -}; diff --git a/node_modules/eslint/lib/ignored-paths.js b/node_modules/eslint/lib/ignored-paths.js deleted file mode 100644 index cbf6748..0000000 --- a/node_modules/eslint/lib/ignored-paths.js +++ /dev/null @@ -1,143 +0,0 @@ -/** - * @fileoverview Responsible for loading ignore config files and managing ignore patterns - * @author Jonathan Rajavuori - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var fs = require("fs"), - debug = require("debug"), - minimatch = require("minimatch"), - FileFinder = require("./file-finder"); - -debug = debug("eslint:ignored-paths"); - - -//------------------------------------------------------------------------------ -// Constants -//------------------------------------------------------------------------------ - -var ESLINT_IGNORE_FILENAME = ".eslintignore"; - - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Load and parse ignore patterns from the file at the given path - * @param {string} filepath Path to the ignore file. - * @returns {string[]} An array of ignore patterns or an empty array if no ignore file. - */ -function loadIgnoreFile(filepath) { - var ignorePatterns = []; - - /** - * Check if string is not empty - * @param {string} line string to examine - * @returns {boolean} True is its not empty - * @private - */ - function nonEmpty(line) { - return line.trim() !== "" && line[0] !== "#"; - } - - if (filepath) { - try { - ignorePatterns = fs.readFileSync(filepath, "utf8").split(/\r?\n/).filter(nonEmpty); - } catch (e) { - e.message = "Cannot read ignore file: " + filepath + "\nError: " + e.message; - throw e; - } - } - - return ["node_modules/**"].concat(ignorePatterns); -} - -var ignoreFileFinder; - -/** - * Find an ignore file in the current directory or a parent directory. - * @returns {string} Path of ignore file or an empty string. - */ -function findIgnoreFile() { - if (!ignoreFileFinder) { - ignoreFileFinder = new FileFinder(ESLINT_IGNORE_FILENAME); - } - - return ignoreFileFinder.findInDirectoryOrParents(); -} - - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -/** - * IgnoredPaths - * @constructor - * @class IgnoredPaths - * @param {Array} patterns to be matched against file paths - */ -function IgnoredPaths(patterns) { - this.patterns = patterns; -} - -/** - * IgnoredPaths initializer - * @param {Object} options object containing 'ignore' and 'ignorePath' properties - * @returns {IgnoredPaths} object, with patterns loaded from the ignore file - */ -IgnoredPaths.load = function(options) { - var patterns; - - options = options || {}; - - if (options.ignore) { - patterns = loadIgnoreFile(options.ignorePath || findIgnoreFile()); - } else { - patterns = []; - } - - if (options.ignorePattern) { - patterns = patterns.concat(options.ignorePattern); - } - - return new IgnoredPaths(patterns); -}; - -/** - * Determine whether a file path is included in the configured ignore patterns - * @param {string} filepath Path to check - * @returns {boolean} true if the file path matches one or more patterns, false otherwise - */ -IgnoredPaths.prototype.contains = function(filepath) { - if (this.patterns === null) { - throw new Error("No ignore patterns loaded, call 'load' first"); - } - - filepath = filepath.replace("\\", "/"); - filepath = filepath.replace(/^\.\//, ""); - return this.patterns.reduce(function(ignored, pattern) { - var negated = pattern[0] === "!", - matches; - - if (negated) { - pattern = pattern.slice(1); - } - - // Remove leading "current folder" prefix - if (pattern.indexOf("./") === 0) { - pattern = pattern.slice(2); - } - - matches = minimatch(filepath, pattern) || minimatch(filepath, pattern + "/**"); - - return matches ? !negated : ignored; - }, false); -}; - -module.exports = IgnoredPaths; diff --git a/node_modules/eslint/lib/load-rules.js b/node_modules/eslint/lib/load-rules.js deleted file mode 100644 index 68bf144..0000000 --- a/node_modules/eslint/lib/load-rules.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @fileoverview Module for loading rules from files and directories. - * @author Michael Ficarra - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var fs = require("fs"), - path = require("path"); - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -/** - * Load all rule modules from specified directory. - * @param {String} [rulesDir] Path to rules directory, may be relative. Defaults to `lib/rules`. - * @returns {Object} Loaded rule modules by rule ids (file names). - */ -module.exports = function(rulesDir) { - if (!rulesDir) { - rulesDir = path.join(__dirname, "rules"); - } else { - rulesDir = path.resolve(process.cwd(), rulesDir); - } - - var rules = Object.create(null); - fs.readdirSync(rulesDir).forEach(function(file) { - if (path.extname(file) !== ".js") { - return; - } - rules[file.slice(0, -3)] = path.join(rulesDir, file); - }); - return rules; -}; diff --git a/node_modules/eslint/lib/logging.js b/node_modules/eslint/lib/logging.js deleted file mode 100644 index b5e7260..0000000 --- a/node_modules/eslint/lib/logging.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @fileoverview Handle logging for Eslint - * @author Gyandeep Singh - * @copyright 2015 Gyandeep Singh. All rights reserved. - */ -"use strict"; - -/* istanbul ignore next */ -module.exports = { - /** - * Cover for console.log - * @returns {void} - */ - info: function() { - console.log.apply(console, Array.prototype.slice.call(arguments)); - }, - - /** - * Cover for console.error - * @returns {void} - */ - error: function() { - console.error.apply(console, Array.prototype.slice.call(arguments)); - } -}; diff --git a/node_modules/eslint/lib/options.js b/node_modules/eslint/lib/options.js deleted file mode 100644 index 3fee385..0000000 --- a/node_modules/eslint/lib/options.js +++ /dev/null @@ -1,209 +0,0 @@ -/** - * @fileoverview Options configuration for optionator. - * @author George Zahariev - * See LICENSE in root directory for full license. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var optionator = require("optionator"); - -//------------------------------------------------------------------------------ -// Initialization and Public Interface -//------------------------------------------------------------------------------ - -// exports "parse(args)", "generateHelp()", and "generateHelpForOption(optionName)" -module.exports = optionator({ - prepend: "eslint [options] file.js [file.js] [dir]", - concatRepeatedArrays: true, - mergeRepeatedObjects: true, - options: [ - { - heading: "Basic configuration" - }, - { - option: "config", - alias: "c", - type: "path::String", - description: "Use configuration from this file or shareable config" - }, - { - option: "eslintrc", - type: "Boolean", - default: "true", - description: "Disable use of configuration from .eslintrc" - }, - { - option: "env", - type: "[String]", - description: "Specify environments" - }, - { - option: "ext", - type: "[String]", - default: ".js", - description: "Specify JavaScript file extensions" - }, - { - option: "global", - type: "[String]", - description: "Define global variables" - }, - { - option: "parser", - type: "String", - default: "espree", - description: "Specify the parser to be used" - }, - { - heading: "Caching" - }, - { - option: "cache", - type: "Boolean", - default: "false", - description: "Only check changed files" - }, - { - option: "cache-file", - type: "path::String", - default: ".eslintcache", - description: "Path to the cache file. Deprecated: use --cache-location" - }, - { - option: "cache-location", - type: "path::String", - description: "Path to the cache file or directory" - }, - { - heading: "Specifying rules and plugins" - }, - { - option: "rulesdir", - type: "[path::String]", - description: "Use additional rules from this directory" - }, - { - option: "plugin", - type: "[String]", - description: "Specify plugins" - }, - { - option: "rule", - type: "Object", - description: "Specify rules" - }, - { - heading: "Ignoring files" - }, - { - option: "ignore-path", - type: "path::String", - description: "Specify path of ignore file" - }, - { - option: "ignore", - type: "Boolean", - default: "true", - description: "Disable use of .eslintignore" - }, - { - option: "ignore-pattern", - type: "[String]", - description: "Pattern of files to ignore (in addition to those in .eslintignore)" - }, - { - heading: "Using stdin" - }, - { - option: "stdin", - type: "Boolean", - default: "false", - description: "Lint code provided on " - }, - { - option: "stdin-filename", - type: "String", - description: "Specify filename to process STDIN as" - }, - { - heading: "Handling warnings" - }, - { - option: "quiet", - type: "Boolean", - default: "false", - description: "Report errors only" - }, - { - option: "max-warnings", - type: "Number", - default: "-1", - description: "Number of warnings to trigger nonzero exit code" - }, - { - heading: "Output" - }, - { - option: "output-file", - alias: "o", - type: "path::String", - description: "Specify file to write report to" - }, - { - option: "format", - alias: "f", - type: "String", - default: "stylish", - description: "Use a specific output format" - }, - { - option: "color", - type: "Boolean", - default: "true", - description: "Disable color in piped output" - }, - { - heading: "Miscellaneous" - }, - { - option: "init", - type: "Boolean", - default: "false", - description: "Run config initialization wizard" - }, - { - option: "fix", - type: "Boolean", - default: false, - description: "Automatically fix problems" - }, - { - option: "debug", - type: "Boolean", - default: false, - description: "Output debugging information" - }, - { - option: "help", - alias: "h", - type: "Boolean", - description: "Show help" - }, - { - option: "version", - alias: "v", - type: "Boolean", - description: "Outputs the version number" - }, - { - option: "inline-config", - type: "Boolean", - default: "true", - description: "Allow comments to change eslint config/rules" - } - ] -}); diff --git a/node_modules/eslint/lib/rule-context.js b/node_modules/eslint/lib/rule-context.js deleted file mode 100644 index 847f2fb..0000000 --- a/node_modules/eslint/lib/rule-context.js +++ /dev/null @@ -1,163 +0,0 @@ -/** - * @fileoverview RuleContext utility for rules - * @author Nicholas C. Zakas - * @copyright 2013 Nicholas C. Zakas. All rights reserved. - * See LICENSE file in root directory for full license. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var RuleFixer = require("./util/rule-fixer"); - -//------------------------------------------------------------------------------ -// Constants -//------------------------------------------------------------------------------ - -var PASSTHROUGHS = [ - "getAllComments", - "getAncestors", - "getComments", - "getDeclaredVariables", - "getFilename", - "getFirstToken", - "getFirstTokens", - "getJSDocComment", - "getLastToken", - "getLastTokens", - "getNodeByRangeIndex", - "getScope", - "getSource", - "getSourceLines", - "getTokenAfter", - "getTokenBefore", - "getTokenByRangeStart", - "getTokens", - "getTokensAfter", - "getTokensBefore", - "getTokensBetween", - "markVariableAsUsed", - "isMarkedAsUsed" -]; - -//------------------------------------------------------------------------------ -// Typedefs -//------------------------------------------------------------------------------ - -/** - * An error message description - * @typedef {Object} MessageDescriptor - * @property {string} nodeType The type of node. - * @property {Location} loc The location of the problem. - * @property {string} message The problem message. - * @property {Object} [data] Optional data to use to fill in placeholders in the - * message. - * @property {Function} fix The function to call that creates a fix command. - */ - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -/** - * Acts as an abstraction layer between rules and the main eslint object. - * @constructor - * @param {string} ruleId The ID of the rule using this object. - * @param {eslint} eslint The eslint object. - * @param {number} severity The configured severity level of the rule. - * @param {array} options The configuration information to be added to the rule. - * @param {object} settings The configuration settings passed from the config file. - * @param {object} ecmaFeatures The ecmaFeatures settings passed from the config file. - */ -function RuleContext(ruleId, eslint, severity, options, settings, ecmaFeatures) { - - /** - * The read-only ID of the rule. - */ - Object.defineProperty(this, "id", { - value: ruleId - }); - - /** - * The read-only options of the rule - */ - Object.defineProperty(this, "options", { - value: options - }); - - /** - * The read-only settings shared between all rules - */ - Object.defineProperty(this, "settings", { - value: settings - }); - - /** - * The read-only ecmaFeatures shared across all rules - */ - Object.defineProperty(this, "ecmaFeatures", { - value: Object.create(ecmaFeatures) - }); - Object.freeze(this.ecmaFeatures); - - // copy over passthrough methods - PASSTHROUGHS.forEach(function(name) { - this[name] = function() { - return eslint[name].apply(eslint, arguments); - }; - }, this); - - /** - * Passthrough to eslint.report() that automatically assigns the rule ID and severity. - * @param {ASTNode|MessageDescriptor} nodeOrDescriptor The AST node related to the message or a message - * descriptor. - * @param {Object=} location The location of the error. - * @param {string} message The message to display to the user. - * @param {Object} opts Optional template data which produces a formatted message - * with symbols being replaced by this object's values. - * @returns {void} - */ - this.report = function(nodeOrDescriptor, location, message, opts) { - - var descriptor, - fix = null; - - // check to see if it's a new style call - if (arguments.length === 1) { - descriptor = nodeOrDescriptor; - - // if there's a fix specified, get it - if (typeof descriptor.fix === "function") { - fix = descriptor.fix(new RuleFixer()); - } - - eslint.report( - ruleId, severity, descriptor.node, - descriptor.loc || descriptor.node.loc.start, - descriptor.message, descriptor.data, fix - ); - - return; - } - - // old style call - eslint.report(ruleId, severity, nodeOrDescriptor, location, message, opts); - }; - - /** - * Passthrough to eslint.getSourceCode(). - * @returns {SourceCode} The SourceCode object for the code. - */ - this.getSourceCode = function() { - return eslint.getSourceCode(); - }; - -} - -RuleContext.prototype = { - constructor: RuleContext -}; - -module.exports = RuleContext; diff --git a/node_modules/eslint/lib/rules.js b/node_modules/eslint/lib/rules.js deleted file mode 100644 index aafdbaf..0000000 --- a/node_modules/eslint/lib/rules.js +++ /dev/null @@ -1,96 +0,0 @@ -/** - * @fileoverview Defines a storage for rules. - * @author Nicholas C. Zakas - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var loadRules = require("./load-rules"); - -//------------------------------------------------------------------------------ -// Privates -//------------------------------------------------------------------------------ - -var rules = Object.create(null); - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -/** - * Registers a rule module for rule id in storage. - * @param {String} ruleId Rule id (file name). - * @param {Function} ruleModule Rule handler. - * @returns {void} - */ -function define(ruleId, ruleModule) { - rules[ruleId] = ruleModule; -} - -/** - * Loads and registers all rules from passed rules directory. - * @param {String} [rulesDir] Path to rules directory, may be relative. Defaults to `lib/rules`. - * @returns {void} - */ -function load(rulesDir) { - var newRules = loadRules(rulesDir); - Object.keys(newRules).forEach(function(ruleId) { - define(ruleId, newRules[ruleId]); - }); -} - -/** - * Registers all given rules of a plugin. - * @param {Object} pluginRules A key/value map of rule definitions. - * @param {String} pluginName The name of the plugin without prefix (`eslint-plugin-`). - * @returns {void} - */ -function importPlugin(pluginRules, pluginName) { - Object.keys(pluginRules).forEach(function(ruleId) { - var qualifiedRuleId = pluginName + "/" + ruleId, - rule = pluginRules[ruleId]; - - define(qualifiedRuleId, rule); - }); -} - -/** - * Access rule handler by id (file name). - * @param {String} ruleId Rule id (file name). - * @returns {Function} Rule handler. - */ -function get(ruleId) { - if (typeof rules[ruleId] === "string") { - return require(rules[ruleId]); - } else { - return rules[ruleId]; - } -} - -/** - * Reset rules storage. - * Should be used only in tests. - * @returns {void} - */ -function testClear() { - rules = Object.create(null); -} - -module.exports = { - define: define, - load: load, - import: importPlugin, - get: get, - testClear: testClear -}; - -//------------------------------------------------------------------------------ -// Initialization -//------------------------------------------------------------------------------ - -// loads built-in rules -load(); diff --git a/node_modules/eslint/lib/rules/accessor-pairs.js b/node_modules/eslint/lib/rules/accessor-pairs.js deleted file mode 100644 index e15ab3b..0000000 --- a/node_modules/eslint/lib/rules/accessor-pairs.js +++ /dev/null @@ -1,145 +0,0 @@ -/** - * @fileoverview Rule to flag wrapping non-iife in parens - * @author Gyandeep Singh - * @copyright 2015 Gyandeep Singh. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Checks whether or not a given node is an `Identifier` node which was named a given name. - * @param {ASTNode} node - A node to check. - * @param {string} name - An expected name of the node. - * @returns {boolean} `true` if the node is an `Identifier` node which was named as expected. - */ -function isIdentifier(node, name) { - return node.type === "Identifier" && node.name === name; -} - -/** - * Checks whether or not a given node is an argument of a specified method call. - * @param {ASTNode} node - A node to check. - * @param {number} index - An expected index of the node in arguments. - * @param {string} object - An expected name of the object of the method. - * @param {string} property - An expected name of the method. - * @returns {boolean} `true` if the node is an argument of the specified method call. - */ -function isArgumentOfMethodCall(node, index, object, property) { - var parent = node.parent; - return ( - parent.type === "CallExpression" && - parent.callee.type === "MemberExpression" && - parent.callee.computed === false && - isIdentifier(parent.callee.object, object) && - isIdentifier(parent.callee.property, property) && - parent.arguments[index] === node - ); -} - -/** - * Checks whether or not a given node is a property descriptor. - * @param {ASTNode} node - A node to check. - * @returns {boolean} `true` if the node is a property descriptor. - */ -function isPropertyDescriptor(node) { - // Object.defineProperty(obj, "foo", {set: ...}) - if (isArgumentOfMethodCall(node, 2, "Object", "defineProperty") || - isArgumentOfMethodCall(node, 2, "Reflect", "defineProperty") - ) { - return true; - } - - // Object.defineProperties(obj, {foo: {set: ...}}) - // Object.create(proto, {foo: {set: ...}}) - node = node.parent.parent; - return node.type === "ObjectExpression" && ( - isArgumentOfMethodCall(node, 1, "Object", "create") || - isArgumentOfMethodCall(node, 1, "Object", "defineProperties") - ); -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var config = context.options[0] || {}; - var checkGetWithoutSet = config.getWithoutSet === true; - var checkSetWithoutGet = config.setWithoutGet !== false; - - /** - * Checks a object expression to see if it has setter and getter both present or none. - * @param {ASTNode} node The node to check. - * @returns {void} - * @private - */ - function checkLonelySetGet(node) { - var isSetPresent = false; - var isGetPresent = false; - var isDescriptor = isPropertyDescriptor(node); - - for (var i = 0, end = node.properties.length; i < end; i++) { - var property = node.properties[i]; - - var propToCheck = ""; - if (property.kind === "init") { - if (isDescriptor && !property.computed) { - propToCheck = property.key.name; - } - } else { - propToCheck = property.kind; - } - - switch (propToCheck) { - case "set": - isSetPresent = true; - break; - - case "get": - isGetPresent = true; - break; - - default: - // Do nothing - } - - if (isSetPresent && isGetPresent) { - break; - } - } - - if (checkSetWithoutGet && isSetPresent && !isGetPresent) { - context.report(node, "Getter is not present"); - } else if (checkGetWithoutSet && isGetPresent && !isSetPresent) { - context.report(node, "Setter is not present"); - } - } - - return { - "ObjectExpression": function(node) { - if (checkSetWithoutGet || checkGetWithoutSet) { - checkLonelySetGet(node); - } - } - }; - -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "getWithoutSet": { - "type": "boolean" - }, - "setWithoutGet": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/array-bracket-spacing.js b/node_modules/eslint/lib/rules/array-bracket-spacing.js deleted file mode 100644 index 25c8ac3..0000000 --- a/node_modules/eslint/lib/rules/array-bracket-spacing.js +++ /dev/null @@ -1,209 +0,0 @@ -/** - * @fileoverview Disallows or enforces spaces inside of array brackets. - * @author Jamund Ferguson - * @copyright 2015 Jamund Ferguson. All rights reserved. - * @copyright 2014 Brandyn Bennett. All rights reserved. - * @copyright 2014 Michael Ficarra. No rights reserved. - * @copyright 2014 Vignesh Anand. All rights reserved. - */ -"use strict"; - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var spaced = context.options[0] === "always", - sourceCode = context.getSourceCode(); - - /** - * Determines whether an option is set, relative to the spacing option. - * If spaced is "always", then check whether option is set to false. - * If spaced is "never", then check whether option is set to true. - * @param {Object} option - The option to exclude. - * @returns {boolean} Whether or not the property is excluded. - */ - function isOptionSet(option) { - return context.options[1] ? context.options[1][option] === !spaced : false; - } - - var options = { - spaced: spaced, - singleElementException: isOptionSet("singleValue"), - objectsInArraysException: isOptionSet("objectsInArrays"), - arraysInArraysException: isOptionSet("arraysInArrays") - }; - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Reports that there shouldn't be a space after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportNoBeginningSpace(node, token) { - context.report({ - node: node, - loc: token.loc.start, - message: "There should be no space after '" + token.value + "'", - fix: function(fixer) { - var nextToken = context.getSourceCode().getTokenAfter(token); - return fixer.removeRange([token.range[1], nextToken.range[0]]); - } - }); - } - - /** - * Reports that there shouldn't be a space before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportNoEndingSpace(node, token) { - context.report({ - node: node, - loc: token.loc.start, - message: "There should be no space before '" + token.value + "'", - fix: function(fixer) { - var previousToken = context.getSourceCode().getTokenBefore(token); - return fixer.removeRange([previousToken.range[1], token.range[0]]); - } - }); - } - - /** - * Reports that there should be a space after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportRequiredBeginningSpace(node, token) { - context.report({ - node: node, - loc: token.loc.start, - message: "A space is required after '" + token.value + "'", - fix: function(fixer) { - return fixer.insertTextAfter(token, " "); - } - }); - } - - /** - * Reports that there should be a space before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportRequiredEndingSpace(node, token) { - context.report({ - node: node, - loc: token.loc.start, - message: "A space is required before '" + token.value + "'", - fix: function(fixer) { - return fixer.insertTextBefore(token, " "); - } - }); - } - - /** - * Determines if a node is an object type - * @param {ASTNode} node - The node to check. - * @returns {boolean} Whether or not the node is an object type. - */ - function isObjectType(node) { - return node && (node.type === "ObjectExpression" || node.type === "ObjectPattern"); - } - - /** - * Determines if a node is an array type - * @param {ASTNode} node - The node to check. - * @returns {boolean} Whether or not the node is an array type. - */ - function isArrayType(node) { - return node && (node.type === "ArrayExpression" || node.type === "ArrayPattern"); - } - - /** - * Validates the spacing around array brackets - * @param {ASTNode} node - The node we're checking for spacing - * @returns {void} - */ - function validateArraySpacing(node) { - if (options.spaced && node.elements.length === 0) { - return; - } - - var first = context.getFirstToken(node), - second = context.getFirstToken(node, 1), - penultimate = context.getLastToken(node, 1), - last = context.getLastToken(node), - firstElement = node.elements[0], - lastElement = node.elements[node.elements.length - 1]; - - var openingBracketMustBeSpaced = - options.objectsInArraysException && isObjectType(firstElement) || - options.arraysInArraysException && isArrayType(firstElement) || - options.singleElementException && node.elements.length === 1 - ? !options.spaced : options.spaced; - - var closingBracketMustBeSpaced = - options.objectsInArraysException && isObjectType(lastElement) || - options.arraysInArraysException && isArrayType(lastElement) || - options.singleElementException && node.elements.length === 1 - ? !options.spaced : options.spaced; - - if (astUtils.isTokenOnSameLine(first, second)) { - if (openingBracketMustBeSpaced && !sourceCode.isSpaceBetweenTokens(first, second)) { - reportRequiredBeginningSpace(node, first); - } - if (!openingBracketMustBeSpaced && sourceCode.isSpaceBetweenTokens(first, second)) { - reportNoBeginningSpace(node, first); - } - } - - if (first !== penultimate && astUtils.isTokenOnSameLine(penultimate, last)) { - if (closingBracketMustBeSpaced && !sourceCode.isSpaceBetweenTokens(penultimate, last)) { - reportRequiredEndingSpace(node, last); - } - if (!closingBracketMustBeSpaced && sourceCode.isSpaceBetweenTokens(penultimate, last)) { - reportNoEndingSpace(node, last); - } - } - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - ArrayPattern: validateArraySpacing, - ArrayExpression: validateArraySpacing - }; - -}; - -module.exports.schema = [ - { - "enum": ["always", "never"] - }, - { - "type": "object", - "properties": { - "singleValue": { - "type": "boolean" - }, - "objectsInArrays": { - "type": "boolean" - }, - "arraysInArrays": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/arrow-body-style.js b/node_modules/eslint/lib/rules/arrow-body-style.js deleted file mode 100644 index 92c8dc3..0000000 --- a/node_modules/eslint/lib/rules/arrow-body-style.js +++ /dev/null @@ -1,71 +0,0 @@ -/** - * @fileoverview Rule to require braces in arrow function body. - * @author Alberto Rodríguez - * @copyright 2015 Alberto Rodríguez. All rights reserved. - * See LICENSE file in root directory for full license. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var always = context.options[0] === "always"; - var asNeeded = !context.options[0] || context.options[0] === "as-needed"; - - /** - * Determines whether a arrow function body needs braces - * @param {ASTNode} node The arrow function node. - * @returns {void} - */ - function validate(node) { - var arrowBody = node.body; - if (arrowBody.type === "BlockStatement") { - var blockBody = arrowBody.body; - - if (blockBody.length > 1) { - return; - } - - if (blockBody.length === 0) { - var hasComments = context.getComments(arrowBody).trailing.length > 0; - if (hasComments) { - return; - } - - context.report({ - node: node, - loc: arrowBody.loc.start, - message: "Unexpected empty block in arrow body." - }); - } else { - if (asNeeded && blockBody[0].type === "ReturnStatement") { - context.report({ - node: node, - loc: arrowBody.loc.start, - message: "Unexpected block statement surrounding arrow body." - }); - } - } - } else { - if (always) { - context.report({ - node: node, - loc: arrowBody.loc.start, - message: "Expected block statement surrounding arrow body." - }); - } - } - } - - return { - "ArrowFunctionExpression": validate - }; -}; - -module.exports.schema = [ - { - "enum": ["always", "as-needed"] - } -]; diff --git a/node_modules/eslint/lib/rules/arrow-parens.js b/node_modules/eslint/lib/rules/arrow-parens.js deleted file mode 100644 index 2332dda..0000000 --- a/node_modules/eslint/lib/rules/arrow-parens.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @fileoverview Rule to require parens in arrow function arguments. - * @author Jxck - * @copyright 2015 Jxck. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var message = "Expected parentheses around arrow function argument."; - var asNeededMessage = "Unexpected parentheses around single function argument"; - var asNeeded = context.options[0] === "as-needed"; - - /** - * Determines whether a arrow function argument end with `)` - * @param {ASTNode} node The arrow function node. - * @returns {void} - */ - function parens(node) { - var token = context.getFirstToken(node); - - // as-needed: x => x - if (asNeeded && node.params.length === 1 && node.params[0].type === "Identifier") { - if (token.type === "Punctuator" && token.value === "(") { - context.report(node, asNeededMessage); - } - return; - } - - if (token.type === "Identifier") { - var after = context.getTokenAfter(token); - - // (x) => x - if (after.value !== ")") { - context.report(node, message); - } - } - } - - return { - "ArrowFunctionExpression": parens - }; -}; - -module.exports.schema = [ - { - "enum": ["always", "as-needed"] - } -]; diff --git a/node_modules/eslint/lib/rules/arrow-spacing.js b/node_modules/eslint/lib/rules/arrow-spacing.js deleted file mode 100644 index c1b1d73..0000000 --- a/node_modules/eslint/lib/rules/arrow-spacing.js +++ /dev/null @@ -1,124 +0,0 @@ -/** - * @fileoverview Rule to require parens in arrow function arguments. - * @author Jxck - * @copyright 2015 Jxck. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - // merge rules with default - var rule = { before: true, after: true }; - var option = context.options[0] || {}; - rule.before = option.before !== false; - rule.after = option.after !== false; - - /** - * Get tokens of arrow(`=>`) and before/after arrow. - * @param {ASTNode} node The arrow function node. - * @returns {Object} Tokens of arrow and before/after arrow. - */ - function getTokens(node) { - var t = context.getFirstToken(node); - var before; - while (t.type !== "Punctuator" || t.value !== "=>") { - before = t; - t = context.getTokenAfter(t); - } - var after = context.getTokenAfter(t); - return { before: before, arrow: t, after: after }; - } - - /** - * Count spaces before/after arrow(`=>`) token. - * @param {Object} tokens Tokens before/after arrow. - * @returns {Object} count of space before/after arrow. - */ - function countSpaces(tokens) { - var before = tokens.arrow.range[0] - tokens.before.range[1]; - var after = tokens.after.range[0] - tokens.arrow.range[1]; - return { before: before, after: after }; - } - - /** - * Determines whether space(s) before after arrow(`=>`) is satisfy rule. - * if before/after value is `true`, there should be space(s). - * if before/after value is `false`, there should be no space. - * @param {ASTNode} node The arrow function node. - * @returns {void} - */ - function spaces(node) { - var tokens = getTokens(node); - var countSpace = countSpaces(tokens); - - if (rule.before) { - // should be space(s) before arrow - if (countSpace.before === 0) { - context.report({ - node: tokens.before, - message: "Missing space before =>", - fix: function(fixer) { - return fixer.insertTextBefore(tokens.arrow, " "); - } - }); - } - } else { - // should be no space before arrow - if (countSpace.before > 0) { - context.report({ - node: tokens.before, - message: "Unexpected space before =>", - fix: function(fixer) { - return fixer.removeRange([tokens.before.range[1], tokens.arrow.range[0]]); - } - }); - } - } - - if (rule.after) { - // should be space(s) after arrow - if (countSpace.after === 0) { - context.report({ - node: tokens.after, - message: "Missing space after =>", - fix: function(fixer) { - return fixer.insertTextAfter(tokens.arrow, " "); - } - }); - } - } else { - // should be no space after arrow - if (countSpace.after > 0) { - context.report({ - node: tokens.after, - message: "Unexpected space after =>", - fix: function(fixer) { - return fixer.removeRange([tokens.arrow.range[1], tokens.after.range[0]]); - } - }); - } - } - } - - return { - "ArrowFunctionExpression": spaces - }; -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "before": { - "type": "boolean" - }, - "after": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/block-scoped-var.js b/node_modules/eslint/lib/rules/block-scoped-var.js deleted file mode 100644 index 1c6b055..0000000 --- a/node_modules/eslint/lib/rules/block-scoped-var.js +++ /dev/null @@ -1,142 +0,0 @@ -/** - * @fileoverview Rule to check for "block scoped" variables by binding context - * @author Matt DuVall - * @copyright 2015 Toru Nagashima. All rights reserved. - * @copyright 2015 Mathieu M-Gosselin. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Collects unresolved references from the global scope, then creates a map to references from its name. - * @param {RuleContext} context - The current context. - * @returns {object} A map object. Its key is the variable names. Its value is the references of each variable. - */ -function collectUnresolvedReferences(context) { - var unresolved = Object.create(null); - var references = context.getScope().through; - - for (var i = 0; i < references.length; ++i) { - var reference = references[i]; - var name = reference.identifier.name; - - if (name in unresolved === false) { - unresolved[name] = []; - } - unresolved[name].push(reference); - } - - return unresolved; -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var unresolvedReferences = Object.create(null); - var stack = []; - - /** - * Makes a block scope. - * @param {ASTNode} node - A node of a scope. - * @returns {void} - */ - function enterScope(node) { - stack.push(node.range); - } - - /** - * Pops the last block scope. - * @returns {void} - */ - function exitScope() { - stack.pop(); - } - - /** - * Reports a given reference. - * @param {escope.Reference} reference - A reference to report. - * @returns {void} - */ - function report(reference) { - var identifier = reference.identifier; - context.report( - identifier, - "\"{{name}}\" used outside of binding context.", - {name: identifier.name}); - } - - /** - * Finds and reports references which are outside of valid scopes. - * @param {ASTNode} node - A node to get variables. - * @returns {void} - */ - function checkForVariables(node) { - if (node.kind !== "var") { - return; - } - - var isGlobal = context.getScope().type === "global"; - - // Defines a predicate to check whether or not a given reference is outside of valid scope. - var scopeRange = stack[stack.length - 1]; - - /** - * Check if a reference is out of scope - * @param {ASTNode} reference node to examine - * @returns {boolean} True is its outside the scope - * @private - */ - function isOutsideOfScope(reference) { - var idRange = reference.identifier.range; - return idRange[0] < scopeRange[0] || idRange[1] > scopeRange[1]; - } - - // Gets declared variables, and checks its references. - var variables = context.getDeclaredVariables(node); - for (var i = 0; i < variables.length; ++i) { - var variable = variables[i]; - var references = variable.references; - - // Global variables are not resolved. - // In this case, use unresolved references. - if (isGlobal && variable.name in unresolvedReferences) { - references = unresolvedReferences[variable.name]; - } - - // Reports. - references.filter(isOutsideOfScope).forEach(report); - } - } - - return { - "Program": function(node) { - unresolvedReferences = collectUnresolvedReferences(context); - stack = [node.range]; - }, - - // Manages scopes. - "BlockStatement": enterScope, - "BlockStatement:exit": exitScope, - "ForStatement": enterScope, - "ForStatement:exit": exitScope, - "ForInStatement": enterScope, - "ForInStatement:exit": exitScope, - "ForOfStatement": enterScope, - "ForOfStatement:exit": exitScope, - "SwitchStatement": enterScope, - "SwitchStatement:exit": exitScope, - "CatchClause": enterScope, - "CatchClause:exit": exitScope, - - // Finds and reports references which are outside of valid scope. - "VariableDeclaration": checkForVariables - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/block-spacing.js b/node_modules/eslint/lib/rules/block-spacing.js deleted file mode 100644 index d7bbbf1..0000000 --- a/node_modules/eslint/lib/rules/block-spacing.js +++ /dev/null @@ -1,119 +0,0 @@ -/** - * @fileoverview A rule to disallow or enforce spaces inside of single line blocks. - * @author Toru Nagashima - * @copyright 2015 Toru Nagashima. All rights reserved. - */ - -"use strict"; - -var util = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var always = (context.options[0] !== "never"), - message = always ? "Requires a space" : "Unexpected space(s)", - sourceCode = context.getSourceCode(); - - /** - * Gets the open brace token from a given node. - * @param {ASTNode} node - A BlockStatement/SwitchStatement node to get. - * @returns {Token} The token of the open brace. - */ - function getOpenBrace(node) { - if (node.type === "SwitchStatement") { - if (node.cases.length > 0) { - return context.getTokenBefore(node.cases[0]); - } - return context.getLastToken(node, 1); - } - return context.getFirstToken(node); - } - - /** - * Checks whether or not: - * - given tokens are on same line. - * - there is/isn't a space between given tokens. - * @param {Token} left - A token to check. - * @param {Token} right - The token which is next to `left`. - * @returns {boolean} - * When the option is `"always"`, `true` if there are one or more spaces between given tokens. - * When the option is `"never"`, `true` if there are not any spaces between given tokens. - * If given tokens are not on same line, it's always `true`. - */ - function isValid(left, right) { - return ( - !util.isTokenOnSameLine(left, right) || - sourceCode.isSpaceBetweenTokens(left, right) === always - ); - } - - /** - * Reports invalid spacing style inside braces. - * @param {ASTNode} node - A BlockStatement/SwitchStatement node to get. - * @returns {void} - */ - function checkSpacingInsideBraces(node) { - // Gets braces and the first/last token of content. - var openBrace = getOpenBrace(node); - var closeBrace = context.getLastToken(node); - var firstToken = sourceCode.getTokenOrCommentAfter(openBrace); - var lastToken = sourceCode.getTokenOrCommentBefore(closeBrace); - - // Skip if the node is invalid or empty. - if (openBrace.type !== "Punctuator" || - openBrace.value !== "{" || - closeBrace.type !== "Punctuator" || - closeBrace.value !== "}" || - firstToken === closeBrace - ) { - return; - } - - // Skip line comments for option never - if (!always && firstToken.type === "Line") { - return; - } - - // Check. - if (!isValid(openBrace, firstToken)) { - context.report({ - node: node, - loc: openBrace.loc.start, - message: message + " after \"{\".", - fix: function(fixer) { - if (always) { - return fixer.insertTextBefore(firstToken, " "); - } - - return fixer.removeRange([openBrace.range[1], firstToken.range[0]]); - } - }); - } - if (!isValid(lastToken, closeBrace)) { - context.report({ - node: node, - loc: closeBrace.loc.start, - message: message + " before \"}\".", - fix: function(fixer) { - if (always) { - return fixer.insertTextAfter(lastToken, " "); - } - - return fixer.removeRange([lastToken.range[1], closeBrace.range[0]]); - } - }); - } - } - - return { - BlockStatement: checkSpacingInsideBraces, - SwitchStatement: checkSpacingInsideBraces - }; -}; - -module.exports.schema = [ - {enum: ["always", "never"]} -]; diff --git a/node_modules/eslint/lib/rules/brace-style.js b/node_modules/eslint/lib/rules/brace-style.js deleted file mode 100644 index a64d0c7..0000000 --- a/node_modules/eslint/lib/rules/brace-style.js +++ /dev/null @@ -1,229 +0,0 @@ -/** - * @fileoverview Rule to flag block statements that do not use the one true brace style - * @author Ian Christian Myers - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var style = context.options[0] || "1tbs"; - var params = context.options[1] || {}; - - var OPEN_MESSAGE = "Opening curly brace does not appear on the same line as controlling statement.", - OPEN_MESSAGE_ALLMAN = "Opening curly brace appears on the same line as controlling statement.", - BODY_MESSAGE = "Statement inside of curly braces should be on next line.", - CLOSE_MESSAGE = "Closing curly brace does not appear on the same line as the subsequent block.", - CLOSE_MESSAGE_SINGLE = "Closing curly brace should be on the same line as opening curly brace or on the line after the previous block.", - CLOSE_MESSAGE_STROUSTRUP_ALLMAN = "Closing curly brace appears on the same line as the subsequent block."; - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Determines if a given node is a block statement. - * @param {ASTNode} node The node to check. - * @returns {boolean} True if the node is a block statement, false if not. - * @private - */ - function isBlock(node) { - return node && node.type === "BlockStatement"; - } - - /** - * Check if the token is an punctuator with a value of curly brace - * @param {object} token - Token to check - * @returns {boolean} true if its a curly punctuator - * @private - */ - function isCurlyPunctuator(token) { - return token.value === "{" || token.value === "}"; - } - - /** - * Binds a list of properties to a function that verifies that the opening - * curly brace is on the same line as its controlling statement of a given - * node. - * @param {...string} The properties to check on the node. - * @returns {Function} A function that will perform the check on a node - * @private - */ - function checkBlock() { - var blockProperties = arguments; - - return function(node) { - [].forEach.call(blockProperties, function(blockProp) { - var block = node[blockProp], previousToken, curlyToken, curlyTokenEnd, curlyTokensOnSameLine; - - if (!isBlock(block)) { - return; - } - - previousToken = context.getTokenBefore(block); - curlyToken = context.getFirstToken(block); - curlyTokenEnd = context.getLastToken(block); - curlyTokensOnSameLine = curlyToken.loc.start.line === curlyTokenEnd.loc.start.line; - - if (style !== "allman" && previousToken.loc.start.line !== curlyToken.loc.start.line) { - context.report(node, OPEN_MESSAGE); - } else if (style === "allman" && previousToken.loc.start.line === curlyToken.loc.start.line && !params.allowSingleLine) { - context.report(node, OPEN_MESSAGE_ALLMAN); - } - - if (!block.body.length || curlyTokensOnSameLine && params.allowSingleLine) { - return; - } - - if (curlyToken.loc.start.line === block.body[0].loc.start.line) { - context.report(block.body[0], BODY_MESSAGE); - } else if (curlyTokenEnd.loc.start.line === block.body[block.body.length - 1].loc.start.line) { - context.report(block.body[block.body.length - 1], CLOSE_MESSAGE_SINGLE); - } - }); - }; - } - - /** - * Enforces the configured brace style on IfStatements - * @param {ASTNode} node An IfStatement node. - * @returns {void} - * @private - */ - function checkIfStatement(node) { - var tokens, - alternateIsBlock = false, - alternateIsIfBlock = false; - - checkBlock("consequent", "alternate")(node); - - if (node.alternate) { - - alternateIsBlock = isBlock(node.alternate); - alternateIsIfBlock = node.alternate.type === "IfStatement" && isBlock(node.alternate.consequent); - - if (alternateIsBlock || alternateIsIfBlock) { - tokens = context.getTokensBefore(node.alternate, 2); - - if (style === "1tbs") { - if (tokens[0].loc.start.line !== tokens[1].loc.start.line && - node.consequent.type === "BlockStatement" && - isCurlyPunctuator(tokens[0]) ) { - context.report(node.alternate, CLOSE_MESSAGE); - } - } else if (tokens[0].loc.start.line === tokens[1].loc.start.line) { - context.report(node.alternate, CLOSE_MESSAGE_STROUSTRUP_ALLMAN); - } - } - - } - } - - /** - * Enforces the configured brace style on TryStatements - * @param {ASTNode} node A TryStatement node. - * @returns {void} - * @private - */ - function checkTryStatement(node) { - var tokens; - - checkBlock("block", "finalizer")(node); - - if (isBlock(node.finalizer)) { - tokens = context.getTokensBefore(node.finalizer, 2); - if (style === "1tbs") { - if (tokens[0].loc.start.line !== tokens[1].loc.start.line) { - context.report(node.finalizer, CLOSE_MESSAGE); - } - } else if (tokens[0].loc.start.line === tokens[1].loc.start.line) { - context.report(node.finalizer, CLOSE_MESSAGE_STROUSTRUP_ALLMAN); - } - } - } - - /** - * Enforces the configured brace style on CatchClauses - * @param {ASTNode} node A CatchClause node. - * @returns {void} - * @private - */ - function checkCatchClause(node) { - var previousToken = context.getTokenBefore(node), - firstToken = context.getFirstToken(node); - - checkBlock("body")(node); - - if (isBlock(node.body)) { - if (style === "1tbs") { - if (previousToken.loc.start.line !== firstToken.loc.start.line) { - context.report(node, CLOSE_MESSAGE); - } - } else { - if (previousToken.loc.start.line === firstToken.loc.start.line) { - context.report(node, CLOSE_MESSAGE_STROUSTRUP_ALLMAN); - } - } - } - } - - /** - * Enforces the configured brace style on SwitchStatements - * @param {ASTNode} node A SwitchStatement node. - * @returns {void} - * @private - */ - function checkSwitchStatement(node) { - var tokens; - if (node.cases && node.cases.length) { - tokens = context.getTokensBefore(node.cases[0], 2); - } else { - tokens = context.getLastTokens(node, 3); - } - - if (style !== "allman" && tokens[0].loc.start.line !== tokens[1].loc.start.line) { - context.report(node, OPEN_MESSAGE); - } else if (style === "allman" && tokens[0].loc.start.line === tokens[1].loc.start.line) { - context.report(node, OPEN_MESSAGE_ALLMAN); - } - } - - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- - - return { - "FunctionDeclaration": checkBlock("body"), - "FunctionExpression": checkBlock("body"), - "ArrowFunctionExpression": checkBlock("body"), - "IfStatement": checkIfStatement, - "TryStatement": checkTryStatement, - "CatchClause": checkCatchClause, - "DoWhileStatement": checkBlock("body"), - "WhileStatement": checkBlock("body"), - "WithStatement": checkBlock("body"), - "ForStatement": checkBlock("body"), - "ForInStatement": checkBlock("body"), - "ForOfStatement": checkBlock("body"), - "SwitchStatement": checkSwitchStatement - }; - -}; - -module.exports.schema = [ - { - "enum": ["1tbs", "stroustrup", "allman"] - }, - { - "type": "object", - "properties": { - "allowSingleLine": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/callback-return.js b/node_modules/eslint/lib/rules/callback-return.js deleted file mode 100644 index d2a5d5f..0000000 --- a/node_modules/eslint/lib/rules/callback-return.js +++ /dev/null @@ -1,142 +0,0 @@ -/** - * @fileoverview Enforce return after a callback. - * @author Jamund Ferguson - * @copyright 2015 Jamund Ferguson. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var callbacks = context.options[0] || ["callback", "cb", "next"]; - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Find the closest parent matching a list of types. - * @param {ASTNode} node The node whose parents we are searching - * @param {Array} types The node types to match - * @returns {ASTNode} The matched node or undefined. - */ - function findClosestParentOfType(node, types) { - if (!node.parent) { - return null; - } - if (types.indexOf(node.parent.type) === -1) { - return findClosestParentOfType(node.parent, types); - } - return node.parent; - } - - /** - * Check to see if a CallExpression is in our callback list. - * @param {ASTNode} node The node to check against our callback names list. - * @returns {Boolean} Whether or not this function matches our callback name. - */ - function isCallback(node) { - return node.callee.type === "Identifier" && callbacks.indexOf(node.callee.name) > -1; - } - - /** - * Determines whether or not the callback is part of a callback expression. - * @param {ASTNode} node The callback node - * @param {ASTNode} parentNode The expression node - * @returns {boolean} Whether or not this is part of a callback expression - */ - function isCallbackExpression(node, parentNode) { - - // ensure the parent node exists and is an expression - if (!parentNode || parentNode.type !== "ExpressionStatement") { - return false; - } - - // cb() - if (parentNode.expression === node) { - return true; - } - - // special case for cb && cb() and similar - if (parentNode.expression.type === "BinaryExpression" || parentNode.expression.type === "LogicalExpression") { - if (parentNode.expression.right === node) { - return true; - } - } - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - "CallExpression": function(node) { - - // if we"re not a callback we can return - if (!isCallback(node)) { - return; - } - - // find the closest block, return or loop - var closestBlock = findClosestParentOfType(node, ["BlockStatement", "ReturnStatement", "ArrowFunctionExpression"]) || {}, - lastItem, parentType; - - // if our parent is a return we know we're ok - if (closestBlock.type === "ReturnStatement" ) { - return; - } - - // arrow functions don't always have blocks and implicitly return - if (closestBlock.type === "ArrowFunctionExpression") { - return; - } - - // block statements are part of functions and most if statements - if (closestBlock.type === "BlockStatement") { - - // find the last item in the block - lastItem = closestBlock.body[closestBlock.body.length - 1]; - - // if the callback is the last thing in a block that might be ok - if (isCallbackExpression(node, lastItem)) { - - parentType = closestBlock.parent.type; - - // but only if the block is part of a function - if (parentType === "FunctionExpression" || - parentType === "FunctionDeclaration" || - parentType === "ArrowFunctionExpression" - ) { - return; - } - - } - - // ending a block with a return is also ok - if (lastItem.type === "ReturnStatement") { - - // but only if the callback is immediately before - if (isCallbackExpression(node, closestBlock.body[closestBlock.body.length - 2])) { - return; - } - } - - } - - // as long as you're the child of a function at this point you should be asked to return - if (findClosestParentOfType(node, ["FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression"])) { - context.report(node, "Expected return with your callback function."); - } - - } - - }; -}; - -module.exports.schema = [{ - type: "array", - items: { type: "string" } -}]; diff --git a/node_modules/eslint/lib/rules/camelcase.js b/node_modules/eslint/lib/rules/camelcase.js deleted file mode 100644 index 3091b81..0000000 --- a/node_modules/eslint/lib/rules/camelcase.js +++ /dev/null @@ -1,111 +0,0 @@ -/** - * @fileoverview Rule to flag non-camelcased identifiers - * @author Nicholas C. Zakas - * @copyright 2015 Dieter Oberkofler. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Checks if a string contains an underscore and isn't all upper-case - * @param {String} name The string to check. - * @returns {boolean} if the string is underscored - * @private - */ - function isUnderscored(name) { - - // if there's an underscore, it might be A_CONSTANT, which is okay - return name.indexOf("_") > -1 && name !== name.toUpperCase(); - } - - /** - * Reports an AST node as a rule violation. - * @param {ASTNode} node The node to report. - * @returns {void} - * @private - */ - function report(node) { - context.report(node, "Identifier '{{name}}' is not in camel case.", { name: node.name }); - } - - var options = context.options[0] || {}, - properties = options.properties || ""; - - if (properties !== "always" && properties !== "never") { - properties = "always"; - } - - return { - - "Identifier": function(node) { - - // Leading and trailing underscores are commonly used to flag private/protected identifiers, strip them - var name = node.name.replace(/^_+|_+$/g, ""), - effectiveParent = (node.parent.type === "MemberExpression") ? node.parent.parent : node.parent; - - // MemberExpressions get special rules - if (node.parent.type === "MemberExpression") { - - // "never" check properties - if (properties === "never") { - return; - } - - // Always report underscored object names - if (node.parent.object.type === "Identifier" && - node.parent.object.name === node.name && - isUnderscored(name)) { - report(node); - - // Report AssignmentExpressions only if they are the left side of the assignment - } else if (effectiveParent.type === "AssignmentExpression" && - isUnderscored(name) && - (effectiveParent.right.type !== "MemberExpression" || - effectiveParent.left.type === "MemberExpression" && - effectiveParent.left.property.name === node.name)) { - report(node); - } - - // Properties have their own rules - } else if (node.parent.type === "Property") { - - // "never" check properties - if (properties === "never") { - return; - } - - if (isUnderscored(name) && effectiveParent.type !== "CallExpression") { - report(node); - } - - // Report anything that is underscored that isn't a CallExpression - } else if (isUnderscored(name) && effectiveParent.type !== "CallExpression") { - report(node); - } - } - - }; - -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "properties": { - "enum": ["always", "never"] - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/comma-dangle.js b/node_modules/eslint/lib/rules/comma-dangle.js deleted file mode 100644 index d1755e2..0000000 --- a/node_modules/eslint/lib/rules/comma-dangle.js +++ /dev/null @@ -1,208 +0,0 @@ -/** - * @fileoverview Rule to forbid or enforce dangling commas. - * @author Ian Christian Myers - * @copyright 2015 Toru Nagashima - * @copyright 2015 Mathias Schreck - * @copyright 2013 Ian Christian Myers - * See LICENSE file in root directory for full license. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Gets the last element of a given array. - * - * @param {*[]} xs - An array to get. - * @returns {*} The last element, or undefined. - */ -function getLast(xs) { - if (xs.length === 0) { - return null; - } - return xs[xs.length - 1]; -} - -/** - * Checks whether or not a trailing comma is allowed in a given node. - * `ArrayPattern` which has `RestElement` disallows it. - * - * @param {ASTNode} node - A node to check. - * @param {ASTNode} lastItem - The node of the last element in the given node. - * @returns {boolean} `true` if a trailing comma is allowed. - */ -function isTrailingCommaAllowed(node, lastItem) { - switch (node.type) { - case "ArrayPattern": - // TODO(t-nagashima): Remove SpreadElement after https://github.com/eslint/espree/issues/194 was fixed. - return ( - lastItem.type !== "RestElement" && - lastItem.type !== "SpreadElement" - ); - - // TODO(t-nagashima): Remove this case after https://github.com/eslint/espree/issues/195 was fixed. - case "ArrayExpression": - return ( - node.parent.type !== "ForOfStatement" || - node.parent.left !== node || - lastItem.type !== "SpreadElement" - ); - - default: - return true; - } -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var mode = context.options[0]; - var UNEXPECTED_MESSAGE = "Unexpected trailing comma."; - var MISSING_MESSAGE = "Missing trailing comma."; - - /** - * Checks whether or not a given node is multiline. - * This rule handles a given node as multiline when the closing parenthesis - * and the last element are not on the same line. - * - * @param {ASTNode} node - A ndoe to check. - * @returns {boolean} `true` if the node is multiline. - */ - function isMultiline(node) { - var lastItem = getLast(node.properties || node.elements || node.specifiers); - if (!lastItem) { - return false; - } - - var sourceCode = context.getSourceCode(), - penultimateToken = sourceCode.getLastToken(lastItem), - lastToken = sourceCode.getLastToken(node); - - if (lastToken.value === ",") { - penultimateToken = lastToken; - lastToken = sourceCode.getTokenAfter(lastToken); - } - - return lastToken.loc.end.line !== penultimateToken.loc.end.line; - } - - /** - * Reports a trailing comma if it exists. - * - * @param {ASTNode} node - A node to check. Its type is one of - * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, - * ImportDeclaration, and ExportNamedDeclaration. - * @returns {void} - */ - function forbidTrailingComma(node) { - var lastItem = getLast(node.properties || node.elements || node.specifiers); - if (!lastItem || (node.type === "ImportDeclaration" && lastItem.type !== "ImportSpecifier")) { - return; - } - - var sourceCode = context.getSourceCode(), - trailingToken; - - // last item can be surrounded by parentheses for object and array literals - if (node.type === "ObjectExpression" || node.type === "ArrayExpression") { - trailingToken = sourceCode.getTokenBefore(sourceCode.getLastToken(node)); - } else { - trailingToken = sourceCode.getTokenAfter(lastItem); - } - - if (trailingToken.value === ",") { - context.report( - lastItem, - trailingToken.loc.start, - UNEXPECTED_MESSAGE); - } - } - - /** - * Reports the last element of a given node if it does not have a trailing - * comma. - * - * If a given node is `ArrayPattern` which has `RestElement`, the trailing - * comma is disallowed, so report if it exists. - * - * @param {ASTNode} node - A node to check. Its type is one of - * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, - * ImportDeclaration, and ExportNamedDeclaration. - * @returns {void} - */ - function forceTrailingComma(node) { - var lastItem = getLast(node.properties || node.elements || node.specifiers); - if (!lastItem || (node.type === "ImportDeclaration" && lastItem.type !== "ImportSpecifier")) { - return; - } - if (!isTrailingCommaAllowed(node, lastItem)) { - forbidTrailingComma(node); - return; - } - - var sourceCode = context.getSourceCode(), - trailingToken; - - // last item can be surrounded by parentheses for object and array literals - if (node.type === "ObjectExpression" || node.type === "ArrayExpression") { - trailingToken = sourceCode.getTokenBefore(sourceCode.getLastToken(node)); - } else { - trailingToken = sourceCode.getTokenAfter(lastItem); - } - - if (trailingToken.value !== ",") { - context.report( - lastItem, - lastItem.loc.end, - MISSING_MESSAGE); - } - } - - /** - * If a given node is multiline, reports the last element of a given node - * when it does not have a trailing comma. - * Otherwise, reports a trailing comma if it exists. - * - * @param {ASTNode} node - A node to check. Its type is one of - * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, - * ImportDeclaration, and ExportNamedDeclaration. - * @returns {void} - */ - function forceTrailingCommaIfMultiline(node) { - if (isMultiline(node)) { - forceTrailingComma(node); - } else { - forbidTrailingComma(node); - } - } - - // Chooses a checking function. - var checkForTrailingComma; - if (mode === "always") { - checkForTrailingComma = forceTrailingComma; - } else if (mode === "always-multiline") { - checkForTrailingComma = forceTrailingCommaIfMultiline; - } else { - checkForTrailingComma = forbidTrailingComma; - } - - return { - "ObjectExpression": checkForTrailingComma, - "ObjectPattern": checkForTrailingComma, - "ArrayExpression": checkForTrailingComma, - "ArrayPattern": checkForTrailingComma, - "ImportDeclaration": checkForTrailingComma, - "ExportNamedDeclaration": checkForTrailingComma - }; -}; - -module.exports.schema = [ - { - "enum": ["always", "always-multiline", "never"] - } -]; diff --git a/node_modules/eslint/lib/rules/comma-spacing.js b/node_modules/eslint/lib/rules/comma-spacing.js deleted file mode 100644 index de7da6a..0000000 --- a/node_modules/eslint/lib/rules/comma-spacing.js +++ /dev/null @@ -1,183 +0,0 @@ -/** - * @fileoverview Comma spacing - validates spacing before and after comma - * @author Vignesh Anand aka vegetableman. - * @copyright 2014 Vignesh Anand. All rights reserved. - */ -"use strict"; - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var sourceCode = context.getSourceCode(); - var tokensAndComments = sourceCode.tokensAndComments; - - var options = { - before: context.options[0] ? !!context.options[0].before : false, - after: context.options[0] ? !!context.options[0].after : true - }; - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - // list of comma tokens to ignore for the check of leading whitespace - var commaTokensToIgnore = []; - - /** - * Determines if a given token is a comma operator. - * @param {ASTNode} token The token to check. - * @returns {boolean} True if the token is a comma, false if not. - * @private - */ - function isComma(token) { - return !!token && (token.type === "Punctuator") && (token.value === ","); - } - - /** - * Reports a spacing error with an appropriate message. - * @param {ASTNode} node The binary expression node to report. - * @param {string} dir Is the error "before" or "after" the comma? - * @param {ASTNode} otherNode The node at the left or right of `node` - * @returns {void} - * @private - */ - function report(node, dir, otherNode) { - context.report({ - node: node, - fix: function(fixer) { - if (options[dir]) { - if (dir === "before") { - return fixer.insertTextBefore(node, " "); - } else { - return fixer.insertTextAfter(node, " "); - } - } else { - var start, end; - var newText = ""; - - if (dir === "before") { - start = otherNode.range[1]; - end = node.range[0]; - } else { - start = node.range[1]; - end = otherNode.range[0]; - } - - return fixer.replaceTextRange([start, end], newText); - } - }, - message: options[dir] ? - "A space is required " + dir + " ','." : - "There should be no space " + dir + " ','." - }); - } - - /** - * Validates the spacing around a comma token. - * @param {Object} tokens - The tokens to be validated. - * @param {Token} tokens.comma The token representing the comma. - * @param {Token} [tokens.left] The last token before the comma. - * @param {Token} [tokens.right] The first token after the comma. - * @param {Token|ASTNode} reportItem The item to use when reporting an error. - * @returns {void} - * @private - */ - function validateCommaItemSpacing(tokens, reportItem) { - if (tokens.left && astUtils.isTokenOnSameLine(tokens.left, tokens.comma) && - (options.before !== sourceCode.isSpaceBetweenTokens(tokens.left, tokens.comma)) - ) { - report(reportItem, "before", tokens.left); - } - - if (tokens.right && !options.after && tokens.right.type === "Line") { - return false; - } - - if (tokens.right && astUtils.isTokenOnSameLine(tokens.comma, tokens.right) && - (options.after !== sourceCode.isSpaceBetweenTokens(tokens.comma, tokens.right)) - ) { - report(reportItem, "after", tokens.right); - } - } - - /** - * Adds null elements of the given ArrayExpression or ArrayPattern node to the ignore list. - * @param {ASTNode} node An ArrayExpression or ArrayPattern node. - * @returns {void} - */ - function addNullElementsToIgnoreList(node) { - var previousToken = context.getFirstToken(node); - - node.elements.forEach(function(element) { - var token; - - if (element === null) { - token = context.getTokenAfter(previousToken); - - if (isComma(token)) { - commaTokensToIgnore.push(token); - } - } else { - token = context.getTokenAfter(element); - } - - previousToken = token; - }); - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - "Program:exit": function() { - - var previousToken, - nextToken; - - tokensAndComments.forEach(function(token, i) { - - if (!isComma(token)) { - return; - } - - if (token && token.type === "JSXText") { - return; - } - - previousToken = tokensAndComments[i - 1]; - nextToken = tokensAndComments[i + 1]; - - validateCommaItemSpacing({ - comma: token, - left: isComma(previousToken) || commaTokensToIgnore.indexOf(token) > -1 ? null : previousToken, - right: isComma(nextToken) ? null : nextToken - }, token); - }); - }, - "ArrayExpression": addNullElementsToIgnoreList, - "ArrayPattern": addNullElementsToIgnoreList - - }; - -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "before": { - "type": "boolean" - }, - "after": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/comma-style.js b/node_modules/eslint/lib/rules/comma-style.js deleted file mode 100644 index af00137..0000000 --- a/node_modules/eslint/lib/rules/comma-style.js +++ /dev/null @@ -1,186 +0,0 @@ -/** - * @fileoverview Comma style - enforces comma styles of two types: last and first - * @author Vignesh Anand aka vegetableman - * @copyright 2014 Vignesh Anand. All rights reserved. - * @copyright 2015 Evan Simmons. All rights reserved. - */ - -"use strict"; - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var style = context.options[0] || "last", - exceptions = {}; - - if (context.options.length === 2 && context.options[1].hasOwnProperty("exceptions")) { - exceptions = context.options[1].exceptions; - } - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Determines if a given token is a comma operator. - * @param {ASTNode} token The token to check. - * @returns {boolean} True if the token is a comma, false if not. - * @private - */ - function isComma(token) { - return !!token && (token.type === "Punctuator") && (token.value === ","); - } - - /** - * Validates the spacing around single items in lists. - * @param {Token} previousItemToken The last token from the previous item. - * @param {Token} commaToken The token representing the comma. - * @param {Token} currentItemToken The first token of the current item. - * @param {Token} reportItem The item to use when reporting an error. - * @returns {void} - * @private - */ - function validateCommaItemSpacing(previousItemToken, commaToken, currentItemToken, reportItem) { - - // if single line - if (astUtils.isTokenOnSameLine(commaToken, currentItemToken) && - astUtils.isTokenOnSameLine(previousItemToken, commaToken)) { - - return; - - } else if (!astUtils.isTokenOnSameLine(commaToken, currentItemToken) && - !astUtils.isTokenOnSameLine(previousItemToken, commaToken)) { - - // lone comma - context.report(reportItem, { - line: commaToken.loc.end.line, - column: commaToken.loc.start.column - }, "Bad line breaking before and after ','."); - - } else if (style === "first" && !astUtils.isTokenOnSameLine(commaToken, currentItemToken)) { - - context.report(reportItem, "',' should be placed first."); - - } else if (style === "last" && astUtils.isTokenOnSameLine(commaToken, currentItemToken)) { - - context.report(reportItem, { - line: commaToken.loc.end.line, - column: commaToken.loc.end.column - }, "',' should be placed last."); - } - } - - /** - * Checks the comma placement with regards to a declaration/property/element - * @param {ASTNode} node The binary expression node to check - * @param {string} property The property of the node containing child nodes. - * @private - * @returns {void} - */ - function validateComma(node, property) { - var items = node[property], - arrayLiteral = (node.type === "ArrayExpression"), - previousItemToken; - - if (items.length > 1 || arrayLiteral) { - - // seed as opening [ - previousItemToken = context.getFirstToken(node); - - items.forEach(function(item) { - var commaToken = item ? context.getTokenBefore(item) : previousItemToken, - currentItemToken = item ? context.getFirstToken(item) : context.getTokenAfter(commaToken), - reportItem = item || currentItemToken; - - /* - * This works by comparing three token locations: - * - previousItemToken is the last token of the previous item - * - commaToken is the location of the comma before the current item - * - currentItemToken is the first token of the current item - * - * These values get switched around if item is undefined. - * previousItemToken will refer to the last token not belonging - * to the current item, which could be a comma or an opening - * square bracket. currentItemToken could be a comma. - * - * All comparisons are done based on these tokens directly, so - * they are always valid regardless of an undefined item. - */ - if (isComma(commaToken)) { - validateCommaItemSpacing(previousItemToken, commaToken, - currentItemToken, reportItem); - } - - previousItemToken = item ? context.getLastToken(item) : previousItemToken; - }); - - /* - * Special case for array literals that have empty last items, such - * as [ 1, 2, ]. These arrays only have two items show up in the - * AST, so we need to look at the token to verify that there's no - * dangling comma. - */ - if (arrayLiteral) { - - var lastToken = context.getLastToken(node), - nextToLastToken = context.getTokenBefore(lastToken); - - if (isComma(nextToLastToken)) { - validateCommaItemSpacing( - context.getTokenBefore(nextToLastToken), - nextToLastToken, - lastToken, - lastToken - ); - } - } - } - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - var nodes = {}; - - if (!exceptions.VariableDeclaration) { - nodes.VariableDeclaration = function(node) { - validateComma(node, "declarations"); - }; - } - if (!exceptions.ObjectExpression) { - nodes.ObjectExpression = function(node) { - validateComma(node, "properties"); - }; - } - if (!exceptions.ArrayExpression) { - nodes.ArrayExpression = function(node) { - validateComma(node, "elements"); - }; - } - - return nodes; -}; - -module.exports.schema = [ - { - "enum": ["first", "last"] - }, - { - "type": "object", - "properties": { - "exceptions": { - "type": "object", - "additionalProperties": { - "type": "boolean" - } - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/complexity.js b/node_modules/eslint/lib/rules/complexity.js deleted file mode 100644 index e8dd3cf..0000000 --- a/node_modules/eslint/lib/rules/complexity.js +++ /dev/null @@ -1,121 +0,0 @@ -/** - * @fileoverview Counts the cyclomatic complexity of each function of the script. See http://en.wikipedia.org/wiki/Cyclomatic_complexity. - * Counts the number of if, conditional, for, whilte, try, switch/case, - * @author Patrick Brosset - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var THRESHOLD = context.options[0]; - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - // Using a stack to store complexity (handling nested functions) - var fns = []; - - /** - * When parsing a new function, store it in our function stack - * @returns {void} - * @private - */ - function startFunction() { - fns.push(1); - } - - /** - * Evaluate the node at the end of function - * @param {ASTNode} node node to evaluate - * @returns {void} - * @private - */ - function endFunction(node) { - var complexity = fns.pop(), - name = "anonymous"; - - if (node.id) { - name = node.id.name; - } else if (node.parent.type === "MethodDefinition" || node.parent.type === "Property") { - name = node.parent.key.name; - } - - if (complexity > THRESHOLD) { - context.report(node, "Function '{{name}}' has a complexity of {{complexity}}.", { name: name, complexity: complexity }); - } - } - - /** - * Increase the complexity of the function in context - * @returns {void} - * @private - */ - function increaseComplexity() { - if (fns.length) { - fns[fns.length - 1] ++; - } - } - - /** - * Increase the switch complexity in context - * @param {ASTNode} node node to evaluate - * @returns {void} - * @private - */ - function increaseSwitchComplexity(node) { - // Avoiding `default` - if (node.test) { - increaseComplexity(node); - } - } - - /** - * Increase the logical path complexity in context - * @param {ASTNode} node node to evaluate - * @returns {void} - * @private - */ - function increaseLogicalComplexity(node) { - // Avoiding && - if (node.operator === "||") { - increaseComplexity(node); - } - } - - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- - - return { - "FunctionDeclaration": startFunction, - "FunctionExpression": startFunction, - "ArrowFunctionExpression": startFunction, - "FunctionDeclaration:exit": endFunction, - "FunctionExpression:exit": endFunction, - "ArrowFunctionExpression:exit": endFunction, - - "CatchClause": increaseComplexity, - "ConditionalExpression": increaseComplexity, - "LogicalExpression": increaseLogicalComplexity, - "ForStatement": increaseComplexity, - "ForInStatement": increaseComplexity, - "ForOfStatement": increaseComplexity, - "IfStatement": increaseComplexity, - "SwitchCase": increaseSwitchComplexity, - "WhileStatement": increaseComplexity, - "DoWhileStatement": increaseComplexity - }; - -}; - -module.exports.schema = [ - { - "type": "integer" - } -]; diff --git a/node_modules/eslint/lib/rules/computed-property-spacing.js b/node_modules/eslint/lib/rules/computed-property-spacing.js deleted file mode 100644 index 6462dfb..0000000 --- a/node_modules/eslint/lib/rules/computed-property-spacing.js +++ /dev/null @@ -1,153 +0,0 @@ -/** - * @fileoverview Disallows or enforces spaces inside computed properties. - * @author Jamund Ferguson - * @copyright 2015 Jamund Ferguson. All rights reserved. - */ -"use strict"; - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var sourceCode = context.getSourceCode(); - var propertyNameMustBeSpaced = context.options[0] === "always"; // default is "never" - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Reports that there shouldn't be a space after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @param {Token} tokenAfter - The token after `token`. - * @returns {void} - */ - function reportNoBeginningSpace(node, token, tokenAfter) { - context.report({ - node: node, - loc: token.loc.start, - message: "There should be no space after '" + token.value + "'", - fix: function(fixer) { - return fixer.removeRange([token.range[1], tokenAfter.range[0]]); - } - }); - } - - /** - * Reports that there shouldn't be a space before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @param {Token} tokenBefore - The token before `token`. - * @returns {void} - */ - function reportNoEndingSpace(node, token, tokenBefore) { - context.report({ - node: node, - loc: token.loc.start, - message: "There should be no space before '" + token.value + "'", - fix: function(fixer) { - return fixer.removeRange([tokenBefore.range[1], token.range[0]]); - } - }); - } - - /** - * Reports that there should be a space after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportRequiredBeginningSpace(node, token) { - context.report({ - node: node, - loc: token.loc.start, - message: "A space is required after '" + token.value + "'", - fix: function(fixer) { - return fixer.insertTextAfter(token, " "); - } - }); - } - - /** - * Reports that there should be a space before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportRequiredEndingSpace(node, token) { - context.report({ - node: node, - loc: token.loc.start, - message: "A space is required before '" + token.value + "'", - fix: function(fixer) { - return fixer.insertTextBefore(token, " "); - } - }); - } - - /** - * Returns a function that checks the spacing of a node on the property name - * that was passed in. - * @param {String} propertyName The property on the node to check for spacing - * @returns {Function} A function that will check spacing on a node - */ - function checkSpacing(propertyName) { - return function(node) { - if (!node.computed) { - return; - } - - var property = node[propertyName]; - - var before = context.getTokenBefore(property), - first = context.getFirstToken(property), - last = context.getLastToken(property), - after = context.getTokenAfter(property); - - if (astUtils.isTokenOnSameLine(before, first)) { - if (propertyNameMustBeSpaced) { - if (!sourceCode.isSpaceBetweenTokens(before, first) && astUtils.isTokenOnSameLine(before, first)) { - reportRequiredBeginningSpace(node, before); - } - } else { - if (sourceCode.isSpaceBetweenTokens(before, first)) { - reportNoBeginningSpace(node, before, first); - } - } - } - - if (astUtils.isTokenOnSameLine(last, after)) { - if (propertyNameMustBeSpaced) { - if (!sourceCode.isSpaceBetweenTokens(last, after) && astUtils.isTokenOnSameLine(last, after)) { - reportRequiredEndingSpace(node, after); - } - } else { - if (sourceCode.isSpaceBetweenTokens(last, after)) { - reportNoEndingSpace(node, after, last); - } - } - } - }; - } - - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - Property: checkSpacing("key"), - MemberExpression: checkSpacing("property") - }; - -}; - -module.exports.schema = [ - { - "enum": ["always", "never"] - } -]; diff --git a/node_modules/eslint/lib/rules/consistent-return.js b/node_modules/eslint/lib/rules/consistent-return.js deleted file mode 100644 index e5eb5f9..0000000 --- a/node_modules/eslint/lib/rules/consistent-return.js +++ /dev/null @@ -1,75 +0,0 @@ -/** - * @fileoverview Rule to flag consistent return values - * @author Nicholas C. Zakas - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var functions = []; - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Marks entrance into a function by pushing a new object onto the functions - * stack. - * @returns {void} - * @private - */ - function enterFunction() { - functions.push({}); - } - - /** - * Marks exit of a function by popping off the functions stack. - * @returns {void} - * @private - */ - function exitFunction() { - functions.pop(); - } - - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - - "Program": enterFunction, - "FunctionDeclaration": enterFunction, - "FunctionExpression": enterFunction, - "ArrowFunctionExpression": enterFunction, - - "Program:exit": exitFunction, - "FunctionDeclaration:exit": exitFunction, - "FunctionExpression:exit": exitFunction, - "ArrowFunctionExpression:exit": exitFunction, - - "ReturnStatement": function(node) { - - var returnInfo = functions[functions.length - 1], - returnTypeDefined = "type" in returnInfo; - - if (returnTypeDefined) { - - if (returnInfo.type !== !!node.argument) { - context.report(node, "Expected " + (returnInfo.type ? "a" : "no") + " return value."); - } - - } else { - returnInfo.type = !!node.argument; - } - - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/consistent-this.js b/node_modules/eslint/lib/rules/consistent-this.js deleted file mode 100644 index 81dc847..0000000 --- a/node_modules/eslint/lib/rules/consistent-this.js +++ /dev/null @@ -1,115 +0,0 @@ -/** - * @fileoverview Rule to enforce consistent naming of "this" context variables - * @author Raphael Pigulla - * @copyright 2015 Timothy Jones. All rights reserved. - * @copyright 2015 David Aurelio. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var alias = context.options[0]; - - /** - * Reports that a variable declarator or assignment expression is assigning - * a non-'this' value to the specified alias. - * @param {ASTNode} node - The assigning node. - * @returns {void} - */ - function reportBadAssignment(node) { - context.report(node, - "Designated alias '{{alias}}' is not assigned to 'this'.", - { alias: alias }); - } - - /** - * Checks that an assignment to an identifier only assigns 'this' to the - * appropriate alias, and the alias is only assigned to 'this'. - * @param {ASTNode} node - The assigning node. - * @param {Identifier} name - The name of the variable assigned to. - * @param {Expression} value - The value of the assignment. - * @returns {void} - */ - function checkAssignment(node, name, value) { - var isThis = value.type === "ThisExpression"; - - if (name === alias) { - if (!isThis || node.operator && node.operator !== "=") { - reportBadAssignment(node); - } - } else if (isThis) { - context.report(node, - "Unexpected alias '{{name}}' for 'this'.", { name: name }); - } - } - - /** - * Ensures that a variable declaration of the alias in a program or function - * is assigned to the correct value. - * @returns {void} - */ - function ensureWasAssigned() { - var scope = context.getScope(); - var variable = scope.set.get(alias); - if (!variable) { - return; - } - - if (variable.defs.some(function(def) { - return def.node.type === "VariableDeclarator" && - def.node.init !== null; - })) { - return; - } - - var lookup = (variable.references.length === 0 && scope.type === "global") ? scope : variable; - - // The alias has been declared and not assigned: check it was - // assigned later in the same scope. - if (!lookup.references.some(function(reference) { - var write = reference.writeExpr; - - if (reference.from === scope && - write && write.type === "ThisExpression" && - write.parent.operator === "=") { - return true; - } - })) { - variable.defs.map(function(def) { - return def.node; - }).forEach(reportBadAssignment); - } - } - - return { - "Program:exit": ensureWasAssigned, - "FunctionExpression:exit": ensureWasAssigned, - "FunctionDeclaration:exit": ensureWasAssigned, - - "VariableDeclarator": function(node) { - var id = node.id; - var isDestructuring = - id.type === "ArrayPattern" || id.type === "ObjectPattern"; - - if (node.init !== null && !isDestructuring) { - checkAssignment(node, id.name, node.init); - } - }, - - "AssignmentExpression": function(node) { - if (node.left.type === "Identifier") { - checkAssignment(node, node.left.name, node.right); - } - } - }; - -}; - -module.exports.schema = [ - { - "type": "string" - } -]; diff --git a/node_modules/eslint/lib/rules/constructor-super.js b/node_modules/eslint/lib/rules/constructor-super.js deleted file mode 100644 index 217d90b..0000000 --- a/node_modules/eslint/lib/rules/constructor-super.js +++ /dev/null @@ -1,108 +0,0 @@ -/** - * @fileoverview A rule to verify `super()` callings in constructor. - * @author Toru Nagashima - * @copyright 2015 Toru Nagashima. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Searches a class node from ancestors of a node. - * @param {Node} node - A node to get. - * @returns {ClassDeclaration|ClassExpression|null} the found class node or `null`. - */ - function getClassInAncestor(node) { - while (node) { - if (node.type === "ClassDeclaration" || node.type === "ClassExpression") { - return node; - } - node = node.parent; - } - /* istanbul ignore next */ - return null; - } - - /** - * Checks whether or not a node is the null literal. - * @param {Node} node - A node to check. - * @returns {boolean} whether or not a node is the null literal. - */ - function isNullLiteral(node) { - return node && node.type === "Literal" && node.value === null; - } - - /** - * Checks whether or not the current traversal context is on constructors. - * @param {{scope: Scope}} item - A checking context to check. - * @returns {boolean} whether or not the current traversal context is on constructors. - */ - function isOnConstructor(item) { - return item && item.scope === context.getScope().variableScope.upper.variableScope; - } - - // A stack for checking context. - var stack = []; - - return { - /** - * Start checking. - * @param {MethodDefinition} node - A target node. - * @returns {void} - */ - "MethodDefinition": function(node) { - if (node.kind !== "constructor") { - return; - } - stack.push({ - superCallings: [], - scope: context.getScope().variableScope - }); - }, - - /** - * Checks the result, then reports invalid/missing `super()`. - * @param {MethodDefinition} node - A target node. - * @returns {void} - */ - "MethodDefinition:exit": function(node) { - if (node.kind !== "constructor") { - return; - } - var result = stack.pop(); - - var classNode = getClassInAncestor(node); - /* istanbul ignore if */ - if (!classNode) { - return; - } - - if (classNode.superClass === null || isNullLiteral(classNode.superClass)) { - result.superCallings.forEach(function(superCalling) { - context.report(superCalling, "unexpected `super()`."); - }); - } else if (result.superCallings.length === 0) { - context.report(node.key, "this constructor requires `super()`."); - } - }, - - /** - * Checks the result of checking, then reports invalid/missing `super()`. - * @param {MethodDefinition} node - A target node. - * @returns {void} - */ - "CallExpression": function(node) { - var item = stack[stack.length - 1]; - if (isOnConstructor(item) && node.callee.type === "Super") { - item.superCallings.push(node); - } - } - }; -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/curly.js b/node_modules/eslint/lib/rules/curly.js deleted file mode 100644 index dacd9c5..0000000 --- a/node_modules/eslint/lib/rules/curly.js +++ /dev/null @@ -1,294 +0,0 @@ -/** - * @fileoverview Rule to flag statements without curly braces - * @author Nicholas C. Zakas - * @copyright 2015 Ivan Nikulin. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var multiOnly = (context.options[0] === "multi"); - var multiLine = (context.options[0] === "multi-line"); - var multiOrNest = (context.options[0] === "multi-or-nest"); - var consistent = (context.options[1] === "consistent"); - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Determines if a given node is a one-liner that's on the same line as it's preceding code. - * @param {ASTNode} node The node to check. - * @returns {boolean} True if the node is a one-liner that's on the same line as it's preceding code. - * @private - */ - function isCollapsedOneLiner(node) { - var before = context.getTokenBefore(node), - last = context.getLastToken(node); - return before.loc.start.line === last.loc.end.line; - } - - /** - * Determines if a given node is a one-liner. - * @param {ASTNode} node The node to check. - * @returns {boolean} True if the node is a one-liner. - * @private - */ - function isOneLiner(node) { - var first = context.getFirstToken(node), - last = context.getLastToken(node); - - return first.loc.start.line === last.loc.end.line; - } - - /** - * Gets the `else` keyword token of a given `IfStatement` node. - * @param {ASTNode} node - A `IfStatement` node to get. - * @returns {Token} The `else` keyword token. - */ - function getElseKeyword(node) { - var sourceCode = context.getSourceCode(); - var token = sourceCode.getTokenAfter(node.consequent); - - while (token.type !== "Keyword" || token.value !== "else") { - token = sourceCode.getTokenAfter(token); - } - - return token; - } - - /** - * Checks a given IfStatement node requires braces of the consequent chunk. - * This returns `true` when below: - * - * 1. The given node has the `alternate` node. - * 2. There is a `IfStatement` which doesn't have `alternate` node in the - * trailing statement chain of the `consequent` node. - * - * @param {ASTNode} node - A IfStatement node to check. - * @returns {boolean} `true` if the node requires braces of the consequent chunk. - */ - function requiresBraceOfConsequent(node) { - if (node.alternate && node.consequent.type === "BlockStatement") { - if (node.consequent.body.length >= 2) { - return true; - } - - node = node.consequent.body[0]; - while (node) { - if (node.type === "IfStatement" && !node.alternate) { - return true; - } - node = astUtils.getTrailingStatement(node); - } - } - - return false; - } - - /** - * Reports "Expected { after ..." error - * @param {ASTNode} node The node to report. - * @param {string} name The name to report. - * @param {string} suffix Additional string to add to the end of a report. - * @returns {void} - * @private - */ - function reportExpectedBraceError(node, name, suffix) { - context.report({ - node: node, - loc: (name !== "else" ? node : getElseKeyword(node)).loc.start, - message: "Expected { after '{{name}}'{{suffix}}.", - data: { - name: name, - suffix: (suffix ? " " + suffix : "") - } - }); - } - - /** - * Reports "Unnecessary { after ..." error - * @param {ASTNode} node The node to report. - * @param {string} name The name to report. - * @param {string} suffix Additional string to add to the end of a report. - * @returns {void} - * @private - */ - function reportUnnecessaryBraceError(node, name, suffix) { - context.report({ - node: node, - loc: (name !== "else" ? node : getElseKeyword(node)).loc.start, - message: "Unnecessary { after '{{name}}'{{suffix}}.", - data: { - name: name, - suffix: (suffix ? " " + suffix : "") - } - }); - } - - /** - * Prepares to check the body of a node to see if it's a block statement. - * @param {ASTNode} node The node to report if there's a problem. - * @param {ASTNode} body The body node to check for blocks. - * @param {string} name The name to report if there's a problem. - * @param {string} suffix Additional string to add to the end of a report. - * @returns {object} a prepared check object, with "actual", "expected", "check" properties. - * "actual" will be `true` or `false` whether the body is already a block statement. - * "expected" will be `true` or `false` if the body should be a block statement or not, or - * `null` if it doesn't matter, depending on the rule options. It can be modified to change - * the final behavior of "check". - * "check" will be a function reporting appropriate problems depending on the other - * properties. - */ - function prepareCheck(node, body, name, suffix) { - var hasBlock = (body.type === "BlockStatement"); - var expected = null; - - if (node.type === "IfStatement" && node.consequent === body && requiresBraceOfConsequent(node)) { - expected = true; - } else if (multiOnly) { - if (hasBlock && body.body.length === 1) { - expected = false; - } - } else if (multiLine) { - if (!isCollapsedOneLiner(body)) { - expected = true; - } - } else if (multiOrNest) { - if (hasBlock && body.body.length === 1 && isOneLiner(body.body[0])) { - expected = false; - } else if (!isOneLiner(body)) { - expected = true; - } - } else { - expected = true; - } - - return { - actual: hasBlock, - expected: expected, - check: function() { - if (this.expected !== null && this.expected !== this.actual) { - if (this.expected) { - reportExpectedBraceError(node, name, suffix); - } else { - reportUnnecessaryBraceError(node, name, suffix); - } - } - } - }; - } - - /** - * Prepares to check the bodies of a "if", "else if" and "else" chain. - * @param {ASTNode} node The first IfStatement node of the chain. - * @returns {object[]} prepared checks for each body of the chain. See `prepareCheck` for more - * information. - */ - function prepareIfChecks(node) { - var preparedChecks = []; - do { - preparedChecks.push(prepareCheck(node, node.consequent, "if", "condition")); - if (node.alternate && node.alternate.type !== "IfStatement") { - preparedChecks.push(prepareCheck(node, node.alternate, "else")); - break; - } - node = node.alternate; - } while (node); - - if (consistent) { - // If any node should have or already have braces, make sure they all have braces. - // If all nodes shouldn't have braces, make sure they don't. - var expected = preparedChecks.some(function(preparedCheck) { - if (preparedCheck.expected !== null) { - return preparedCheck.expected; - } - return preparedCheck.actual; - }); - - preparedChecks.forEach(function(preparedCheck) { - preparedCheck.expected = expected; - }); - } - - return preparedChecks; - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - "IfStatement": function(node) { - if (node.parent.type !== "IfStatement") { - prepareIfChecks(node).forEach(function(preparedCheck) { - preparedCheck.check(); - }); - } - }, - - "WhileStatement": function(node) { - prepareCheck(node, node.body, "while", "condition").check(); - }, - - "DoWhileStatement": function(node) { - prepareCheck(node, node.body, "do").check(); - }, - - "ForStatement": function(node) { - prepareCheck(node, node.body, "for", "condition").check(); - }, - - "ForInStatement": function(node) { - prepareCheck(node, node.body, "for-in").check(); - }, - - "ForOfStatement": function(node) { - prepareCheck(node, node.body, "for-of").check(); - } - }; -}; - -module.exports.schema = { - "anyOf": [ - { - "type": "array", - "items": [ - { - "enum": [0, 1, 2] - }, - { - "enum": ["all"] - } - ], - "minItems": 1, - "maxItems": 2 - }, - { - "type": "array", - "items": [ - { - "enum": [0, 1, 2] - }, - { - "enum": ["multi", "multi-line", "multi-or-nest"] - }, - { - "enum": ["consistent"] - } - ], - "minItems": 1, - "maxItems": 3 - } - ] -}; diff --git a/node_modules/eslint/lib/rules/default-case.js b/node_modules/eslint/lib/rules/default-case.js deleted file mode 100644 index e8a7484..0000000 --- a/node_modules/eslint/lib/rules/default-case.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * @fileoverview require default case in switch statements - * @author Aliaksei Shytkin - */ -"use strict"; - -var COMMENT_VALUE = "no default"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Shortcut to get last element of array - * @param {*[]} collection Array - * @returns {*} Last element - */ - function last(collection) { - return collection[collection.length - 1]; - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - - "SwitchStatement": function(node) { - - if (!node.cases.length) { - // skip check of empty switch because there is no easy way - // to extract comments inside it now - return; - } - - var hasDefault = node.cases.some(function(v) { - return v.test === null; - }); - - if (!hasDefault) { - - var comment; - var comments; - - var lastCase = last(node.cases); - comments = context.getComments(lastCase).trailing; - - if (comments.length) { - comment = last(comments); - } - - if (!comment || comment.value.trim() !== COMMENT_VALUE) { - context.report(node, "Expected a default case."); - } - } - } - }; -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/dot-location.js b/node_modules/eslint/lib/rules/dot-location.js deleted file mode 100644 index 403ffe2..0000000 --- a/node_modules/eslint/lib/rules/dot-location.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @fileoverview Validates newlines before and after dots - * @author Greg Cochard - * @copyright 2015 Greg Cochard - */ - -"use strict"; - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var config = context.options[0], - // default to onObject if no preference is passed - onObject = config === "object" || !config; - - /** - * Reports if the dot between object and property is on the correct loccation. - * @param {ASTNode} obj The object owning the property. - * @param {ASTNode} prop The property of the object. - * @param {ASTNode} node The corresponding node of the token. - * @returns {void} - */ - function checkDotLocation(obj, prop, node) { - var dot = context.getTokenBefore(prop); - - if (dot.type === "Punctuator" && dot.value === ".") { - if (onObject) { - if (!astUtils.isTokenOnSameLine(obj, dot)) { - context.report(node, dot.loc.start, "Expected dot to be on same line as object."); - } - } else if (!astUtils.isTokenOnSameLine(dot, prop)) { - context.report(node, dot.loc.start, "Expected dot to be on same line as property."); - } - } - } - - /** - * Checks the spacing of the dot within a member expression. - * @param {ASTNode} node The node to check. - * @returns {void} - */ - function checkNode(node) { - checkDotLocation(node.object, node.property, node); - } - - return { - "MemberExpression": checkNode - }; -}; - -module.exports.schema = [ - { - "enum": ["object", "property"] - } -]; diff --git a/node_modules/eslint/lib/rules/dot-notation.js b/node_modules/eslint/lib/rules/dot-notation.js deleted file mode 100644 index 255d08a..0000000 --- a/node_modules/eslint/lib/rules/dot-notation.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * @fileoverview Rule to warn about using dot notation instead of square bracket notation when possible. - * @author Josh Perez - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -var validIdentifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/; -var keywords = require("../util/keywords"); - -module.exports = function(context) { - var options = context.options[0] || {}; - var allowKeywords = options.allowKeywords === void 0 || !!options.allowKeywords; - - var allowPattern; - if (options.allowPattern) { - allowPattern = new RegExp(options.allowPattern); - } - - return { - "MemberExpression": function(node) { - if ( - node.computed && - node.property.type === "Literal" && - validIdentifier.test(node.property.value) && - (allowKeywords || keywords.indexOf("" + node.property.value) === -1) - ) { - if (!(allowPattern && allowPattern.test(node.property.value))) { - context.report(node, "[" + JSON.stringify(node.property.value) + "] is better written in dot notation."); - } - } - if ( - !allowKeywords && - !node.computed && - keywords.indexOf("" + node.property.name) !== -1 - ) { - context.report(node, "." + node.property.name + " is a syntax error."); - } - } - }; -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "allowKeywords": { - "type": "boolean" - }, - "allowPattern": { - "type": "string" - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/eol-last.js b/node_modules/eslint/lib/rules/eol-last.js deleted file mode 100644 index ebc4a59..0000000 --- a/node_modules/eslint/lib/rules/eol-last.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @fileoverview Require file to end with single newline. - * @author Nodeca Team - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - - "Program": function checkBadEOF(node) { - // Get the whole source code, not for node only. - var src = context.getSource(), - location = {column: 1}, - linebreakStyle = context.options[0] || "unix", - linebreak = linebreakStyle === "unix" ? "\n" : "\r\n"; - if (src.length === 0) { - return; - } - - if (src[src.length - 1] !== "\n") { - // file is not newline-terminated - location.line = src.split(/\n/g).length; - context.report({ - node: node, - loc: location, - message: "Newline required at end of file but not found.", - fix: function(fixer) { - return fixer.insertTextAfterRange([0, src.length], linebreak); - } - }); - } - } - - }; - -}; - -module.exports.schema = [ - { - "enum": ["unix", "windows"] - } -]; diff --git a/node_modules/eslint/lib/rules/eqeqeq.js b/node_modules/eslint/lib/rules/eqeqeq.js deleted file mode 100644 index f4ef2e5..0000000 --- a/node_modules/eslint/lib/rules/eqeqeq.js +++ /dev/null @@ -1,120 +0,0 @@ -/** - * @fileoverview Rule to flag statements that use != and == instead of !== and === - * @author Nicholas C. Zakas - * @copyright 2013 Nicholas C. Zakas. All rights reserved. - * See LICENSE file in root directory for full license. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var sourceCode = context.getSourceCode(), - replacements = { - "==": "===", - "!=": "!==" - }; - - /** - * Checks if an expression is a typeof expression - * @param {ASTNode} node The node to check - * @returns {boolean} if the node is a typeof expression - */ - function isTypeOf(node) { - return node.type === "UnaryExpression" && node.operator === "typeof"; - } - - /** - * Checks if either operand of a binary expression is a typeof operation - * @param {ASTNode} node The node to check - * @returns {boolean} if one of the operands is typeof - * @private - */ - function isTypeOfBinary(node) { - return isTypeOf(node.left) || isTypeOf(node.right); - } - - /** - * Checks if operands are literals of the same type (via typeof) - * @param {ASTNode} node The node to check - * @returns {boolean} if operands are of same type - * @private - */ - function areLiteralsAndSameType(node) { - return node.left.type === "Literal" && node.right.type === "Literal" && - typeof node.left.value === typeof node.right.value; - } - - /** - * Checks if one of the operands is a literal null - * @param {ASTNode} node The node to check - * @returns {boolean} if operands are null - * @private - */ - function isNullCheck(node) { - return (node.right.type === "Literal" && node.right.value === null) || - (node.left.type === "Literal" && node.left.value === null); - } - - /** - * Gets the location (line and column) of the binary expression's operator - * @param {ASTNode} node The binary expression node to check - * @param {String} operator The operator to find - * @returns {Object} { line, column } location of operator - * @private - */ - function getOperatorLocation(node) { - var opToken = context.getTokenAfter(node.left); - return {line: opToken.loc.start.line, column: opToken.loc.start.column}; - } - - return { - "BinaryExpression": function(node) { - if (node.operator !== "==" && node.operator !== "!=") { - return; - } - - if (context.options[0] === "smart" && (isTypeOfBinary(node) || - areLiteralsAndSameType(node) || isNullCheck(node))) { - return; - } - - if (context.options[0] === "allow-null" && isNullCheck(node)) { - return; - } - - context.report({ - node: node, - loc: getOperatorLocation(node), - message: "Expected '{{op}}=' and instead saw '{{op}}'.", - data: { op: node.operator }, - fix: function(fixer) { - var tokens = sourceCode.getTokensBetween(node.left, node.right), - opToken, - i; - - for (i = 0; i < tokens.length; ++i) { - if (tokens[i].value === node.operator) { - opToken = tokens[i]; - break; - } - } - - return fixer.replaceTextRange(opToken.range, replacements[node.operator]); - } - }); - - } - }; - -}; - -module.exports.schema = [ - { - "enum": ["smart", "allow-null"] - } -]; diff --git a/node_modules/eslint/lib/rules/func-names.js b/node_modules/eslint/lib/rules/func-names.js deleted file mode 100644 index a4fb59e..0000000 --- a/node_modules/eslint/lib/rules/func-names.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @fileoverview Rule to warn when a function expression does not have a name. - * @author Kyle T. Nunery - * @copyright 2015 Brandon Mills. All rights reserved. - * @copyright 2014 Kyle T. Nunery. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Determines whether the current FunctionExpression node is a get, set, or - * shorthand method in an object literal or a class. - * @returns {boolean} True if the node is a get, set, or shorthand method. - */ - function isObjectOrClassMethod() { - var parent = context.getAncestors().pop(); - - return (parent.type === "MethodDefinition" || ( - parent.type === "Property" && ( - parent.method || - parent.kind === "get" || - parent.kind === "set" - ) - )); - } - - return { - "FunctionExpression": function(node) { - - var name = node.id && node.id.name; - - if (!name && !isObjectOrClassMethod()) { - context.report(node, "Missing function expression name."); - } - } - }; -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/func-style.js b/node_modules/eslint/lib/rules/func-style.js deleted file mode 100644 index 3a26aa3..0000000 --- a/node_modules/eslint/lib/rules/func-style.js +++ /dev/null @@ -1,84 +0,0 @@ -/** - * @fileoverview Rule to enforce a particular function style - * @author Nicholas C. Zakas - * @copyright 2013 Nicholas C. Zakas. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var style = context.options[0], - allowArrowFunctions = context.options[1] && context.options[1].allowArrowFunctions === true, - enforceDeclarations = (style === "declaration"), - stack = []; - - var nodesToCheck = { - "Program": function() { - stack = []; - }, - - "FunctionDeclaration": function(node) { - stack.push(false); - - if (!enforceDeclarations) { - context.report(node, "Expected a function expression."); - } - }, - "FunctionDeclaration:exit": function() { - stack.pop(); - }, - - "FunctionExpression": function(node) { - stack.push(false); - - if (enforceDeclarations && node.parent.type === "VariableDeclarator") { - context.report(node.parent, "Expected a function declaration."); - } - }, - "FunctionExpression:exit": function() { - stack.pop(); - }, - - "ThisExpression": function() { - if (stack.length > 0) { - stack[stack.length - 1] = true; - } - } - }; - - if (!allowArrowFunctions) { - nodesToCheck.ArrowFunctionExpression = function() { - stack.push(false); - }; - - nodesToCheck["ArrowFunctionExpression:exit"] = function(node) { - var hasThisExpr = stack.pop(); - - if (enforceDeclarations && !hasThisExpr && node.parent.type === "VariableDeclarator") { - context.report(node.parent, "Expected a function declaration."); - } - }; - } - - return nodesToCheck; - -}; - -module.exports.schema = [ - { - "enum": ["declaration", "expression"] - }, - { - "type": "object", - "properties": { - "allowArrowFunctions": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/generator-star-spacing.js b/node_modules/eslint/lib/rules/generator-star-spacing.js deleted file mode 100644 index 210638a..0000000 --- a/node_modules/eslint/lib/rules/generator-star-spacing.js +++ /dev/null @@ -1,114 +0,0 @@ -/** - * @fileoverview Rule to check the spacing around the * in generator functions. - * @author Jamund Ferguson - * @copyright 2015 Brandon Mills. All rights reserved. - * @copyright 2014 Jamund Ferguson. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var mode = (function(option) { - if (!option || typeof option === "string") { - return { - before: { before: true, after: false }, - after: { before: false, after: true }, - both: { before: true, after: true }, - neither: { before: false, after: false } - }[option || "before"]; - } - return option; - }(context.options[0])); - - /** - * Checks the spacing between two tokens before or after the star token. - * @param {string} side Either "before" or "after". - * @param {Token} leftToken `function` keyword token if side is "before", or - * star token if side is "after". - * @param {Token} rightToken Star token if side is "before", or identifier - * token if side is "after". - * @returns {void} - */ - function checkSpacing(side, leftToken, rightToken) { - if (!!(rightToken.range[0] - leftToken.range[1]) !== mode[side]) { - var after = leftToken.value === "*"; - var spaceRequired = mode[side]; - var node = after ? leftToken : rightToken; - var type = spaceRequired ? "Missing" : "Unexpected"; - var message = type + " space " + side + " *."; - context.report({ - node: node, - message: message, - fix: function(fixer) { - if (spaceRequired) { - if (after) { - return fixer.insertTextAfter(node, " "); - } - return fixer.insertTextBefore(node, " "); - } - return fixer.removeRange([leftToken.range[1], rightToken.range[0]]); - } - }); - } - } - - /** - * Enforces the spacing around the star if node is a generator function. - * @param {ASTNode} node A function expression or declaration node. - * @returns {void} - */ - function checkFunction(node) { - var prevToken, starToken, nextToken; - - if (!node.generator) { - return; - } - - if (node.parent.method || node.parent.type === "MethodDefinition") { - starToken = context.getTokenBefore(node, 1); - } else { - starToken = context.getFirstToken(node, 1); - } - - // Only check before when preceded by `function` keyword - prevToken = context.getTokenBefore(starToken); - if (prevToken.value === "function" || prevToken.value === "static") { - checkSpacing("before", prevToken, starToken); - } - - // Only check after when followed by an identifier - nextToken = context.getTokenAfter(starToken); - if (nextToken.type === "Identifier") { - checkSpacing("after", starToken, nextToken); - } - } - - return { - "FunctionDeclaration": checkFunction, - "FunctionExpression": checkFunction - }; - -}; - -module.exports.schema = [ - { - "oneOf": [ - { - "enum": ["before", "after", "both", "neither"] - }, - { - "type": "object", - "properties": { - "before": {"type": "boolean"}, - "after": {"type": "boolean"} - }, - "additionalProperties": false - } - ] - } -]; diff --git a/node_modules/eslint/lib/rules/global-require.js b/node_modules/eslint/lib/rules/global-require.js deleted file mode 100644 index f09657e..0000000 --- a/node_modules/eslint/lib/rules/global-require.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @fileoverview Rule for disallowing require() outside of the top-level module context - * @author Jamund Ferguson - * @copyright 2015 Jamund Ferguson. All rights reserved. - */ - -"use strict"; - -var ACCEPTABLE_PARENTS = [ - "AssignmentExpression", - "VariableDeclarator", - "MemberExpression", - "ExpressionStatement", - "CallExpression", - "ConditionalExpression", - "Program", - "VariableDeclaration" -]; - -module.exports = function(context) { - return { - "CallExpression": function(node) { - if (node.callee.name === "require") { - var isGoodRequire = context.getAncestors().every(function(parent) { - return ACCEPTABLE_PARENTS.indexOf(parent.type) > -1; - }); - if (!isGoodRequire) { - context.report(node, "Unexpected require()."); - } - } - } - }; -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/guard-for-in.js b/node_modules/eslint/lib/rules/guard-for-in.js deleted file mode 100644 index 925e118..0000000 --- a/node_modules/eslint/lib/rules/guard-for-in.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @fileoverview Rule to flag for-in loops without if statements inside - * @author Nicholas C. Zakas - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "ForInStatement": function(node) { - - /* - * If the for-in statement has {}, then the real body is the body - * of the BlockStatement. Otherwise, just use body as provided. - */ - var body = node.body.type === "BlockStatement" ? node.body.body[0] : node.body; - - if (body && body.type !== "IfStatement") { - context.report(node, "The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype."); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/handle-callback-err.js b/node_modules/eslint/lib/rules/handle-callback-err.js deleted file mode 100644 index 600a04f..0000000 --- a/node_modules/eslint/lib/rules/handle-callback-err.js +++ /dev/null @@ -1,81 +0,0 @@ -/** - * @fileoverview Ensure handling of errors when we know they exist. - * @author Jamund Ferguson - * @copyright 2015 Mathias Schreck. - * @copyright 2014 Jamund Ferguson. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var errorArgument = context.options[0] || "err"; - - /** - * Checks if the given argument should be interpreted as a regexp pattern. - * @param {string} stringToCheck The string which should be checked. - * @returns {boolean} Whether or not the string should be interpreted as a pattern. - */ - function isPattern(stringToCheck) { - var firstChar = stringToCheck[0]; - return firstChar === "^"; - } - - /** - * Checks if the given name matches the configured error argument. - * @param {string} name The name which should be compared. - * @returns {boolean} Whether or not the given name matches the configured error variable name. - */ - function matchesConfiguredErrorName(name) { - if (isPattern(errorArgument)) { - var regexp = new RegExp(errorArgument); - return regexp.test(name); - } - return name === errorArgument; - } - - /** - * Get the parameters of a given function scope. - * @param {object} scope The function scope. - * @returns {array} All parameters of the given scope. - */ - function getParameters(scope) { - return scope.variables.filter(function(variable) { - return variable.defs[0] && variable.defs[0].type === "Parameter"; - }); - } - - /** - * Check to see if we're handling the error object properly. - * @param {ASTNode} node The AST node to check. - * @returns {void} - */ - function checkForError(node) { - var scope = context.getScope(), - parameters = getParameters(scope), - firstParameter = parameters[0]; - - if (firstParameter && matchesConfiguredErrorName(firstParameter.name)) { - if (firstParameter.references.length === 0) { - context.report(node, "Expected error to be handled."); - } - } - } - - return { - "FunctionDeclaration": checkForError, - "FunctionExpression": checkForError, - "ArrowFunctionExpression": checkForError - }; - -}; - -module.exports.schema = [ - { - "type": "string" - } -]; diff --git a/node_modules/eslint/lib/rules/id-length.js b/node_modules/eslint/lib/rules/id-length.js deleted file mode 100644 index 0ea42e1..0000000 --- a/node_modules/eslint/lib/rules/id-length.js +++ /dev/null @@ -1,106 +0,0 @@ -/** - * @fileoverview Rule that warns when identifier names are shorter or longer - * than the values provided in configuration. - * @author Burak Yigit Kaya aka BYK - * @copyright 2015 Burak Yigit Kaya. All rights reserved. - * @copyright 2015 Mathieu M-Gosselin. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var options = context.options[0] || {}; - var minLength = typeof options.min !== "undefined" ? options.min : 2; - var maxLength = typeof options.max !== "undefined" ? options.max : Infinity; - var properties = options.properties !== "never"; - var exceptions = (options.exceptions ? options.exceptions : []) - .reduce(function(obj, item) { - obj[item] = true; - - return obj; - }, {}); - - var SUPPORTED_EXPRESSIONS = { - "MemberExpression": properties && function(parent) { - return !parent.computed && ( - // regular property assignment - parent.parent.left === parent || ( - // or the last identifier in an ObjectPattern destructuring - parent.parent.type === "Property" && parent.parent.value === parent && - parent.parent.parent.type === "ObjectPattern" && parent.parent.parent.parent.left === parent.parent.parent - ) - ); - }, - "AssignmentPattern": function(parent, node) { - return parent.left === node; - }, - "VariableDeclarator": function(parent, node) { - return parent.id === node; - }, - "Property": properties && function(parent, node) { - return parent.key === node; - }, - "ImportDefaultSpecifier": true, - "RestElement": true, - "FunctionExpression": true, - "ArrowFunctionExpression": true, - "ClassDeclaration": true, - "FunctionDeclaration": true, - "MethodDefinition": true, - "CatchClause": true - }; - - return { - Identifier: function(node) { - var name = node.name; - var parent = node.parent; - - var isShort = name.length < minLength; - var isLong = name.length > maxLength; - if (!(isShort || isLong) || exceptions[name]) { - return; // Nothing to report - } - - var isValidExpression = SUPPORTED_EXPRESSIONS[parent.type]; - - if (isValidExpression && (isValidExpression === true || isValidExpression(parent, node))) { - context.report( - node, - isShort ? - "Identifier name '{{name}}' is too short. (< {{min}})" : - "Identifier name '{{name}}' is too long. (> {{max}})", - { name: name, min: minLength, max: maxLength } - ); - } - } - }; -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "min": { - "type": "number" - }, - "max": { - "type": "number" - }, - "exceptions": { - "type": "array", - "uniqueItems": true, - "items": { - "type": "string" - } - }, - "properties": { - "enum": ["always", "never"] - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/id-match.js b/node_modules/eslint/lib/rules/id-match.js deleted file mode 100644 index 416689c..0000000 --- a/node_modules/eslint/lib/rules/id-match.js +++ /dev/null @@ -1,129 +0,0 @@ -/** - * @fileoverview Rule to flag non-matching identifiers - * @author Matthieu Larcher - * @copyright 2015 Matthieu Larcher. All rights reserved. - * See LICENSE in root directory for full license. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - var pattern = context.options[0] || "^.+$", - regexp = new RegExp(pattern); - - var options = context.options[1] || {}, - properties = options.properties; - - // cast to boolean and default to false - properties = !!properties; - - - /** - * Checks if a string matches the provided pattern - * @param {String} name The string to check. - * @returns {boolean} if the string is a match - * @private - */ - function isInvalid(name) { - return !regexp.test(name); - } - - /** - * Verifies if we should report an error or not based on the effective - * parent node and the identifier name. - * @param {ASTNode} effectiveParent The effective parent node of the node to be reported - * @param {String} name The identifier name of the identifier node - * @returns {boolean} whether an error should be reported or not - */ - function shouldReport(effectiveParent, name) { - return effectiveParent.type !== "CallExpression" - && effectiveParent.type !== "NewExpression" && - isInvalid(name); - } - - /** - * Reports an AST node as a rule violation. - * @param {ASTNode} node The node to report. - * @returns {void} - * @private - */ - function report(node) { - context.report(node, "Identifier '{{name}}' does not match the pattern '{{pattern}}'.", { - name: node.name, - pattern: pattern - }); - } - - return { - - "Identifier": function(node) { - var name = node.name, - effectiveParent = (node.parent.type === "MemberExpression") ? node.parent.parent : node.parent; - - // MemberExpressions get special rules - if (node.parent.type === "MemberExpression") { - // return early if properties is false - if (!properties) { - return; - } - - // Always check object names - if (node.parent.object.type === "Identifier" && - node.parent.object.name === node.name) { - if (isInvalid(name)) { - report(node); - } - - // Report AssignmentExpressions only if they are the left side of the assignment - } else if (effectiveParent.type === "AssignmentExpression" && - (effectiveParent.right.type !== "MemberExpression" || - effectiveParent.left.type === "MemberExpression" && - effectiveParent.left.property.name === node.name)) { - if (isInvalid(name)) { - report(node); - } - } - - // Properties have their own rules - } else if (node.parent.type === "Property") { - // return early if properties is false - if (!properties) { - return; - } - - if (shouldReport(effectiveParent, name)) { - report(node); - } - - // Report anything that is a match and not a CallExpression - } else if (shouldReport(effectiveParent, name)) { - report(node); - } - } - - }; - -}; - -module.exports.schema = [ - { - "type": "string" - }, - { - "type": "object", - "properties": { - "properties": { - "type": "boolean" - } - } - } -]; diff --git a/node_modules/eslint/lib/rules/indent.js b/node_modules/eslint/lib/rules/indent.js deleted file mode 100644 index b69539b..0000000 --- a/node_modules/eslint/lib/rules/indent.js +++ /dev/null @@ -1,714 +0,0 @@ -/** - * @fileoverview This option sets a specific tab width for your code - - * This rule has been ported and modified from nodeca. - * @author Vitaly Puzrin - * @author Gyandeep Singh - * @copyright 2015 Vitaly Puzrin. All rights reserved. - * @copyright 2015 Gyandeep Singh. All rights reserved. - Copyright (C) 2014 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. -*/ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ -var util = require("util"); -var assign = require("object-assign"); - -module.exports = function(context) { - - var MESSAGE = "Expected indentation of {{needed}} {{type}} {{characters}} but found {{gotten}}."; - var DEFAULT_VARIABLE_INDENT = 1; - - var indentType = "space"; - var indentSize = 4; - var options = { - SwitchCase: 0, - VariableDeclarator: { - var: DEFAULT_VARIABLE_INDENT, - let: DEFAULT_VARIABLE_INDENT, - const: DEFAULT_VARIABLE_INDENT - } - }; - - if (context.options.length) { - if (context.options[0] === "tab") { - indentSize = 1; - indentType = "tab"; - } else /* istanbul ignore else : this will be caught by options validation */ if (typeof context.options[0] === "number") { - indentSize = context.options[0]; - indentType = "space"; - } - - if (context.options[1]) { - var opts = context.options[1]; - options.SwitchCase = opts.SwitchCase || 0; - var variableDeclaratorRules = opts.VariableDeclarator; - if (typeof variableDeclaratorRules === "number") { - options.VariableDeclarator = { - var: variableDeclaratorRules, - let: variableDeclaratorRules, - const: variableDeclaratorRules - }; - } else if (typeof variableDeclaratorRules === "object") { - assign(options.VariableDeclarator, variableDeclaratorRules); - } - } - } - - var indentPattern = { - normal: indentType === "space" ? /^ +/ : /^\t+/, - excludeCommas: indentType === "space" ? /^[ ,]+/ : /^[\t,]+/ - }; - - var caseIndentStore = {}; - - /** - * Reports a given indent violation and properly pluralizes the message - * @param {ASTNode} node Node violating the indent rule - * @param {int} needed Expected indentation character count - * @param {int} gotten Indentation character count in the actual node/code - * @param {Object=} loc Error line and column location - * @param {boolean} isLastNodeCheck Is the error for last node check - * @returns {void} - */ - function report(node, needed, gotten, loc, isLastNodeCheck) { - var msgContext = { - needed: needed, - type: indentType, - characters: needed === 1 ? "character" : "characters", - gotten: gotten - }; - var indentChar = indentType === "space" ? " " : "\t"; - - /** - * Responsible for fixing the indentation issue fix - * @returns {Function} function to be executed by the fixer - * @private - */ - function getFixerFunction() { - var rangeToFix = []; - - if (needed > gotten) { - var spaces = "" + new Array(needed - gotten + 1).join(indentChar); // replace with repeat in future - - if (isLastNodeCheck === true) { - rangeToFix = [ - node.range[1] - 1, - node.range[1] - 1 - ]; - } else { - rangeToFix = [ - node.range[0], - node.range[0] - ]; - } - - return function(fixer) { - return fixer.insertTextBeforeRange(rangeToFix, spaces); - }; - } else { - if (isLastNodeCheck === true) { - rangeToFix = [ - node.range[1] - (gotten - needed) - 1, - node.range[1] - 1 - ]; - } else { - rangeToFix = [ - node.range[0] - (gotten - needed), - node.range[0] - ]; - } - - return function(fixer) { - return fixer.removeRange(rangeToFix); - }; - } - } - - if (loc) { - context.report({ - node: node, - loc: loc, - message: MESSAGE, - data: msgContext, - fix: getFixerFunction() - }); - } else { - context.report({ - node: node, - message: MESSAGE, - data: msgContext, - fix: getFixerFunction() - }); - } - } - - /** - * Get node indent - * @param {ASTNode|Token} node Node to examine - * @param {boolean} [byLastLine=false] get indent of node's last line - * @param {boolean} [excludeCommas=false] skip comma on start of line - * @returns {int} Indent - */ - function getNodeIndent(node, byLastLine, excludeCommas) { - var token = byLastLine ? context.getLastToken(node) : context.getFirstToken(node); - var src = context.getSource(token, token.loc.start.column); - var regExp = excludeCommas ? indentPattern.excludeCommas : indentPattern.normal; - var indent = regExp.exec(src); - - return indent ? indent[0].length : 0; - } - - /** - * Checks node is the first in its own start line. By default it looks by start line. - * @param {ASTNode} node The node to check - * @param {boolean} [byEndLocation=false] Lookup based on start position or end - * @returns {boolean} true if its the first in the its start line - */ - function isNodeFirstInLine(node, byEndLocation) { - var firstToken = byEndLocation === true ? context.getLastToken(node, 1) : context.getTokenBefore(node), - startLine = byEndLocation === true ? node.loc.end.line : node.loc.start.line, - endLine = firstToken ? firstToken.loc.end.line : -1; - - return startLine !== endLine; - } - - /** - * Check indent for nodes list - * @param {ASTNode[]} nodes list of node objects - * @param {int} indent needed indent - * @param {boolean} [excludeCommas=false] skip comma on start of line - * @returns {void} - */ - function checkNodesIndent(nodes, indent, excludeCommas) { - nodes.forEach(function(node) { - var nodeIndent = getNodeIndent(node, false, excludeCommas); - if ( - node.type !== "ArrayExpression" && node.type !== "ObjectExpression" && - nodeIndent !== indent && isNodeFirstInLine(node) - ) { - report(node, indent, nodeIndent); - } - }); - } - - /** - * Check last node line indent this detects, that block closed correctly - * @param {ASTNode} node Node to examine - * @param {int} lastLineIndent needed indent - * @returns {void} - */ - function checkLastNodeLineIndent(node, lastLineIndent) { - var lastToken = context.getLastToken(node); - var endIndent = getNodeIndent(lastToken, true); - - if (endIndent !== lastLineIndent && isNodeFirstInLine(node, true)) { - report( - node, - lastLineIndent, - endIndent, - { line: lastToken.loc.start.line, column: lastToken.loc.start.column }, - true - ); - } - } - - /** - * Check first node line indent is correct - * @param {ASTNode} node Node to examine - * @param {int} firstLineIndent needed indent - * @returns {void} - */ - function checkFirstNodeLineIndent(node, firstLineIndent) { - var startIndent = getNodeIndent(node, false); - if (startIndent !== firstLineIndent && isNodeFirstInLine(node)) { - report( - node, - firstLineIndent, - startIndent, - { line: node.loc.start.line, column: node.loc.start.column } - ); - } - } - - /** - * Returns the VariableDeclarator based on the current node - * if not present then return null - * @param {ASTNode} node node to examine - * @returns {ASTNode|void} if found then node otherwise null - */ - function getVariableDeclaratorNode(node) { - var parent = node.parent; - - while (parent.type !== "VariableDeclarator" && parent.type !== "Program") { - parent = parent.parent; - } - - return parent.type === "VariableDeclarator" ? parent : null; - } - - /** - * Check to see if the node is part of the multi-line variable declaration. - * Also if its on the same line as the varNode - * @param {ASTNode} node node to check - * @param {ASTNode} varNode variable declaration node to check against - * @returns {boolean} True if all the above condition satisfy - */ - function isNodeInVarOnTop(node, varNode) { - return varNode && - varNode.parent.loc.start.line === node.loc.start.line && - varNode.parent.declarations.length > 1; - } - - /** - * Check to see if the argument before the callee node is multi-line and - * there should only be 1 argument before the callee node - * @param {ASTNode} node node to check - * @returns {boolean} True if arguments are multi-line - */ - function isArgBeforeCalleeNodeMultiline(node) { - var parent = node.parent; - - if (parent.arguments.length >= 2 && parent.arguments[1] === node) { - return parent.arguments[0].loc.end.line > parent.arguments[0].loc.start.line; - } - - return false; - } - - /** - * Check indent for function block content - * @param {ASTNode} node node to examine - * @returns {void} - */ - function checkIndentInFunctionBlock(node) { - - // Search first caller in chain. - // Ex.: - // - // Models <- Identifier - // .User - // .find() - // .exec(function() { - // // function body - // }); - // - // Looks for 'Models' - var calleeNode = node.parent; // FunctionExpression - var indent; - - if (calleeNode.parent && - (calleeNode.parent.type === "Property" || - calleeNode.parent.type === "ArrayExpression")) { - // If function is part of array or object, comma can be put at left - indent = getNodeIndent(calleeNode, false, true); - } else { - // If function is standalone, simple calculate indent - indent = getNodeIndent(calleeNode); - } - - if (calleeNode.parent.type === "CallExpression") { - var calleeParent = calleeNode.parent; - - if (calleeNode.type !== "FunctionExpression" && calleeNode.type !== "ArrowFunctionExpression") { - if (calleeParent && calleeParent.loc.start.line < node.loc.start.line) { - indent = getNodeIndent(calleeParent); - } - } else { - if (isArgBeforeCalleeNodeMultiline(calleeNode) && - calleeParent.callee.loc.start.line === calleeParent.callee.loc.end.line && - !isNodeFirstInLine(calleeNode)) { - indent = getNodeIndent(calleeParent); - } - } - } - - // function body indent should be indent + indent size - indent += indentSize; - - // check if the node is inside a variable - var parentVarNode = getVariableDeclaratorNode(node); - if (parentVarNode && isNodeInVarOnTop(node, parentVarNode)) { - indent += indentSize * options.VariableDeclarator[parentVarNode.parent.kind]; - } - - if (node.body.length > 0) { - checkNodesIndent(node.body, indent); - } - - checkLastNodeLineIndent(node, indent - indentSize); - } - - - /** - * Checks if the given node starts and ends on the same line - * @param {ASTNode} node The node to check - * @returns {boolean} Whether or not the block starts and ends on the same line. - */ - function isSingleLineNode(node) { - var lastToken = context.getLastToken(node), - startLine = node.loc.start.line, - endLine = lastToken.loc.end.line; - - return startLine === endLine; - } - - /** - * Check to see if the first element inside an array is an object and on the same line as the node - * If the node is not an array then it will return false. - * @param {ASTNode} node node to check - * @returns {boolean} success/failure - */ - function isFirstArrayElementOnSameLine(node) { - if (node.type === "ArrayExpression" && node.elements[0]) { - return node.elements[0].loc.start.line === node.loc.start.line && node.elements[0].type === "ObjectExpression"; - } else { - return false; - } - } - - /** - * Check indent for array block content or object block content - * @param {ASTNode} node node to examine - * @returns {void} - */ - function checkIndentInArrayOrObjectBlock(node) { - // Skip inline - if (isSingleLineNode(node)) { - return; - } - - var elements = (node.type === "ArrayExpression") ? node.elements : node.properties; - - // filter out empty elements example would be [ , 2] so remove first element as espree considers it as null - elements = elements.filter(function(elem) { - return elem !== null; - }); - - // Skip if first element is in same line with this node - if (elements.length > 0 && elements[0].loc.start.line === node.loc.start.line) { - return; - } - - var nodeIndent; - var elementsIndent; - var parentVarNode = getVariableDeclaratorNode(node); - - // TODO - come up with a better strategy in future - if (isNodeFirstInLine(node)) { - var parent = node.parent; - var effectiveParent = parent; - - if (parent.type === "MemberExpression") { - if (isNodeFirstInLine(parent)) { - effectiveParent = parent.parent.parent; - } else { - effectiveParent = parent.parent; - } - } - nodeIndent = getNodeIndent(effectiveParent); - if (parentVarNode && parentVarNode.loc.start.line !== node.loc.start.line) { - if (parent.type !== "VariableDeclarator" || parentVarNode === parentVarNode.parent.declarations[0]) { - nodeIndent = nodeIndent + (indentSize * options.VariableDeclarator[parentVarNode.parent.kind]); - } else if (parent.loc.start.line !== node.loc.start.line && parentVarNode === parentVarNode.parent.declarations[0]) { - nodeIndent = nodeIndent + indentSize; - } - } else if (!parentVarNode && !isFirstArrayElementOnSameLine(parent) && effectiveParent.type !== "MemberExpression" && effectiveParent.type !== "ExpressionStatement" && effectiveParent.type !== "AssignmentExpression" && effectiveParent.type !== "Property") { - nodeIndent = nodeIndent + indentSize; - } - - elementsIndent = nodeIndent + indentSize; - - checkFirstNodeLineIndent(node, nodeIndent); - } else { - nodeIndent = getNodeIndent(node); - elementsIndent = nodeIndent + indentSize; - } - - // check if the node is a multiple variable declaration, if yes then make sure indentation takes into account - // variable indentation concept - if (isNodeInVarOnTop(node, parentVarNode)) { - elementsIndent += indentSize * options.VariableDeclarator[parentVarNode.parent.kind]; - } - - // Comma can be placed before property name - checkNodesIndent(elements, elementsIndent, true); - - if (elements.length > 0) { - // Skip last block line check if last item in same line - if (elements[elements.length - 1].loc.end.line === node.loc.end.line) { - return; - } - } - - checkLastNodeLineIndent(node, elementsIndent - indentSize); - } - - /** - * Check if the node or node body is a BlockStatement or not - * @param {ASTNode} node node to test - * @returns {boolean} True if it or its body is a block statement - */ - function isNodeBodyBlock(node) { - return node.type === "BlockStatement" || (node.body && node.body.type === "BlockStatement") || - (node.consequent && node.consequent.type === "BlockStatement"); - } - - /** - * Check indentation for blocks - * @param {ASTNode} node node to check - * @returns {void} - */ - function blockIndentationCheck(node) { - // Skip inline blocks - if (isSingleLineNode(node)) { - return; - } - - if (node.parent && ( - node.parent.type === "FunctionExpression" || - node.parent.type === "FunctionDeclaration" || - node.parent.type === "ArrowFunctionExpression" - )) { - checkIndentInFunctionBlock(node); - return; - } - - var indent; - var nodesToCheck = []; - - // For this statements we should check indent from statement begin - // (not from block begin) - var statementsWithProperties = [ - "IfStatement", "WhileStatement", "ForStatement", "ForInStatement", "ForOfStatement", "DoWhileStatement" - ]; - - if (node.parent && statementsWithProperties.indexOf(node.parent.type) !== -1 && isNodeBodyBlock(node)) { - indent = getNodeIndent(node.parent); - } else { - indent = getNodeIndent(node); - } - - if (node.type === "IfStatement" && node.consequent.type !== "BlockStatement") { - nodesToCheck = [node.consequent]; - } else if (util.isArray(node.body)) { - nodesToCheck = node.body; - } else { - nodesToCheck = [node.body]; - } - - if (nodesToCheck.length > 0) { - checkNodesIndent(nodesToCheck, indent + indentSize); - } - - if (node.type === "BlockStatement") { - checkLastNodeLineIndent(node, indent); - } - } - - /** - * Filter out the elements which are on the same line of each other or the node. - * basically have only 1 elements from each line except the variable declaration line. - * @param {ASTNode} node Variable declaration node - * @returns {ASTNode[]} Filtered elements - */ - function filterOutSameLineVars(node) { - return node.declarations.reduce(function(finalCollection, elem) { - var lastElem = finalCollection[finalCollection.length - 1]; - - if ((elem.loc.start.line !== node.loc.start.line && !lastElem) || - (lastElem && lastElem.loc.start.line !== elem.loc.start.line)) { - finalCollection.push(elem); - } - - return finalCollection; - }, []); - } - - /** - * Check indentation for variable declarations - * @param {ASTNode} node node to examine - * @returns {void} - */ - function checkIndentInVariableDeclarations(node) { - var elements = filterOutSameLineVars(node); - var nodeIndent = getNodeIndent(node); - var lastElement = elements[elements.length - 1]; - - var elementsIndent = nodeIndent + indentSize * options.VariableDeclarator[node.kind]; - - // Comma can be placed before declaration - checkNodesIndent(elements, elementsIndent, true); - - // Only check the last line if there is any token after the last item - if (context.getLastToken(node).loc.end.line <= lastElement.loc.end.line) { - return; - } - - var tokenBeforeLastElement = context.getTokenBefore(lastElement); - - if (tokenBeforeLastElement.value === ",") { - // Special case for comma-first syntax where the semicolon is indented - checkLastNodeLineIndent(node, getNodeIndent(tokenBeforeLastElement)); - } else { - checkLastNodeLineIndent(node, elementsIndent - indentSize); - } - } - - /** - * Check and decide whether to check for indentation for blockless nodes - * Scenarios are for or while statements without braces around them - * @param {ASTNode} node node to examine - * @returns {void} - */ - function blockLessNodes(node) { - if (node.body.type !== "BlockStatement") { - blockIndentationCheck(node); - } - } - - /** - * Returns the expected indentation for the case statement - * @param {ASTNode} node node to examine - * @param {int} [switchIndent] indent for switch statement - * @returns {int} indent size - */ - function expectedCaseIndent(node, switchIndent) { - var switchNode = (node.type === "SwitchStatement") ? node : node.parent; - var caseIndent; - - if (caseIndentStore[switchNode.loc.start.line]) { - return caseIndentStore[switchNode.loc.start.line]; - } else { - if (typeof switchIndent === "undefined") { - switchIndent = getNodeIndent(switchNode); - } - - if (switchNode.cases.length > 0 && options.SwitchCase === 0) { - caseIndent = switchIndent; - } else { - caseIndent = switchIndent + (indentSize * options.SwitchCase); - } - - caseIndentStore[switchNode.loc.start.line] = caseIndent; - return caseIndent; - } - } - - return { - "Program": function(node) { - if (node.body.length > 0) { - // Root nodes should have no indent - checkNodesIndent(node.body, getNodeIndent(node)); - } - }, - - "BlockStatement": blockIndentationCheck, - - "WhileStatement": blockLessNodes, - - "ForStatement": blockLessNodes, - - "ForInStatement": blockLessNodes, - - "ForOfStatement": blockLessNodes, - - "DoWhileStatement": blockLessNodes, - - "IfStatement": function(node) { - if (node.consequent.type !== "BlockStatement" && node.consequent.loc.start.line > node.loc.start.line) { - blockIndentationCheck(node); - } - }, - - "VariableDeclaration": function(node) { - if (node.declarations[node.declarations.length - 1].loc.start.line > node.declarations[0].loc.start.line) { - checkIndentInVariableDeclarations(node); - } - }, - - "ObjectExpression": function(node) { - checkIndentInArrayOrObjectBlock(node); - }, - - "ArrayExpression": function(node) { - checkIndentInArrayOrObjectBlock(node); - }, - - "SwitchStatement": function(node) { - // Switch is not a 'BlockStatement' - var switchIndent = getNodeIndent(node); - var caseIndent = expectedCaseIndent(node, switchIndent); - checkNodesIndent(node.cases, caseIndent); - - - checkLastNodeLineIndent(node, switchIndent); - }, - - "SwitchCase": function(node) { - // Skip inline cases - if (isSingleLineNode(node)) { - return; - } - var caseIndent = expectedCaseIndent(node); - checkNodesIndent(node.consequent, caseIndent + indentSize); - } - }; - -}; - -module.exports.schema = [ - { - "oneOf": [ - { - "enum": ["tab"] - }, - { - "type": "integer" - } - ] - }, - { - "type": "object", - "properties": { - "SwitchCase": { - "type": "integer" - }, - "VariableDeclarator": { - "type": ["integer", "object"], - "properties": { - "var": { - "type": "integer" - }, - "let": { - "type": "integer" - }, - "const": { - "type": "integer" - } - } - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/init-declarations.js b/node_modules/eslint/lib/rules/init-declarations.js deleted file mode 100644 index f10e91c..0000000 --- a/node_modules/eslint/lib/rules/init-declarations.js +++ /dev/null @@ -1,120 +0,0 @@ -/** - * @fileoverview A rule to control the style of variable initializations. - * @author Colin Ihrig - * @copyright 2015 Colin Ihrig. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Checks whether or not a given node is a for loop. - * @param {ASTNode} block - A node to check. - * @returns {boolean} `true` when the node is a for loop. - */ -function isForLoop(block) { - return block.type === "ForInStatement" || - block.type === "ForOfStatement" || - block.type === "ForStatement"; -} - -/** - * Checks whether or not a given declarator node has its initializer. - * @param {ASTNode} node - A declarator node to check. - * @returns {boolean} `true` when the node has its initializer. - */ -function isInitialized(node) { - var declaration = node.parent; - var block = declaration.parent; - - if (isForLoop(block)) { - if (block.type === "ForStatement") { - return block.init === declaration; - } - return block.left === declaration; - } - return Boolean(node.init); -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var MODE_ALWAYS = "always", - MODE_NEVER = "never"; - - var mode = context.options[0] || MODE_ALWAYS; - var params = context.options[1] || {}; - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- - - return { - "VariableDeclaration:exit": function(node) { - - var kind = node.kind, - declarations = node.declarations; - - for (var i = 0; i < declarations.length; ++i) { - var declaration = declarations[i], - id = declaration.id, - initialized = isInitialized(declaration), - isIgnoredForLoop = params.ignoreForLoopInit && isForLoop(node.parent); - if (id.type !== "Identifier") { - continue; - } - - if (mode === MODE_ALWAYS && !initialized) { - context.report(declaration, "Variable '" + id.name + "' should be initialized on declaration."); - } else if (mode === MODE_NEVER && kind !== "const" && initialized && !isIgnoredForLoop) { - context.report(declaration, "Variable '" + id.name + "' should not be initialized on declaration."); - } - } - } - }; -}; - -module.exports.schema = { - "anyOf": [ - { - "type": "array", - "items": [ - { - "enum": [0, 1, 2] - }, - { - "enum": ["always"] - } - ], - "minItems": 1, - "maxItems": 2 - }, - { - "type": "array", - "items": [ - { - "enum": [0, 1, 2] - }, - { - "enum": ["never"] - }, - { - "type": "object", - "properties": { - "ignoreForLoopInit": { - "type": "boolean" - } - }, - "additionalProperties": false - } - ], - "minItems": 1, - "maxItems": 3 - } - ] -}; diff --git a/node_modules/eslint/lib/rules/jsx-quotes.js b/node_modules/eslint/lib/rules/jsx-quotes.js deleted file mode 100644 index dba7160..0000000 --- a/node_modules/eslint/lib/rules/jsx-quotes.js +++ /dev/null @@ -1,63 +0,0 @@ -/** - * @fileoverview A rule to ensure consistent quotes used in jsx syntax. - * @author Mathias Schreck - * @copyright 2015 Mathias Schreck - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Constants -//------------------------------------------------------------------------------ - -var QUOTE_SETTINGS = { - "prefer-double": { - quote: "\"", - description: "singlequote" - }, - "prefer-single": { - quote: "'", - description: "doublequote" - } -}; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var quoteOption = context.options[0] || "prefer-double", - setting = QUOTE_SETTINGS[quoteOption]; - - /** - * Checks if the given string literal node uses the expected quotes - * @param {ASTNode} node - A string literal node. - * @returns {boolean} Whether or not the string literal used the expected quotes. - * @public - */ - function usesExpectedQuotes(node) { - return node.value.indexOf(setting.quote) !== -1 || astUtils.isSurroundedBy(node.raw, setting.quote); - } - - return { - "JSXAttribute": function(node) { - var attributeValue = node.value; - - if (attributeValue && astUtils.isStringLiteral(attributeValue) && !usesExpectedQuotes(attributeValue)) { - context.report(attributeValue, "Unexpected usage of {{description}}.", setting); - } - } - }; -}; - -module.exports.schema = [ - { - "enum": [ "prefer-single", "prefer-double" ] - } -]; diff --git a/node_modules/eslint/lib/rules/key-spacing.js b/node_modules/eslint/lib/rules/key-spacing.js deleted file mode 100644 index a3d3a89..0000000 --- a/node_modules/eslint/lib/rules/key-spacing.js +++ /dev/null @@ -1,339 +0,0 @@ -/** - * @fileoverview Rule to specify spacing of object literal keys and values - * @author Brandon Mills - * @copyright 2014 Brandon Mills. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Checks whether a string contains a line terminator as defined in - * http://www.ecma-international.org/ecma-262/5.1/#sec-7.3 - * @param {string} str String to test. - * @returns {boolean} True if str contains a line terminator. - */ -function containsLineTerminator(str) { - return /[\n\r\u2028\u2029]/.test(str); -} - -/** - * Gets the last element of an array. - * @param {Array} arr An array. - * @returns {any} Last element of arr. - */ -function last(arr) { - return arr[arr.length - 1]; -} - -/** - * Checks whether a property is a member of the property group it follows. - * @param {ASTNode} lastMember The last Property known to be in the group. - * @param {ASTNode} candidate The next Property that might be in the group. - * @returns {boolean} True if the candidate property is part of the group. - */ -function continuesPropertyGroup(lastMember, candidate) { - var groupEndLine = lastMember.loc.start.line, - candidateStartLine = candidate.loc.start.line, - comments, i; - - if (candidateStartLine - groupEndLine <= 1) { - return true; - } - - // Check that the first comment is adjacent to the end of the group, the - // last comment is adjacent to the candidate property, and that successive - // comments are adjacent to each other. - comments = candidate.leadingComments; - if ( - comments && - comments[0].loc.start.line - groupEndLine <= 1 && - candidateStartLine - last(comments).loc.end.line <= 1 - ) { - for (i = 1; i < comments.length; i++) { - if (comments[i].loc.start.line - comments[i - 1].loc.end.line > 1) { - return false; - } - } - return true; - } - - return false; -} - -/** - * Checks whether a node is contained on a single line. - * @param {ASTNode} node AST Node being evaluated. - * @returns {boolean} True if the node is a single line. - */ -function isSingleLine(node) { - return (node.loc.end.line === node.loc.start.line); -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -var messages = { - key: "{{error}} space after {{computed}}key \"{{key}}\".", - value: "{{error}} space before value for {{computed}}key \"{{key}}\"." -}; - -module.exports = function(context) { - - /** - * OPTIONS - * "key-spacing": [2, { - * beforeColon: false, - * afterColon: true, - * align: "colon" // Optional, or "value" - * } - */ - - var options = context.options[0] || {}, - align = options.align, - mode = options.mode || "strict", - beforeColon = +!!options.beforeColon, // Defaults to false - afterColon = +!(options.afterColon === false); // Defaults to true - - /** - * Starting from the given a node (a property.key node here) looks forward - * until it finds the last token before a colon punctuator and returns it. - * @param {ASTNode} node The node to start looking from. - * @returns {ASTNode} The last token before a colon punctuator. - */ - function getLastTokenBeforeColon(node) { - var prevNode; - - while (node && (node.type !== "Punctuator" || node.value !== ":")) { - prevNode = node; - node = context.getTokenAfter(node); - } - - return prevNode; - } - - /** - * Gets an object literal property's key as the identifier name or string value. - * @param {ASTNode} property Property node whose key to retrieve. - * @returns {string} The property's key. - */ - function getKey(property) { - var key = property.key; - - if (property.computed) { - return context.getSource().slice(key.range[0], key.range[1]); - } - - return property.key.name || property.key.value; - } - - /** - * Reports an appropriately-formatted error if spacing is incorrect on one - * side of the colon. - * @param {ASTNode} property Key-value pair in an object literal. - * @param {string} side Side being verified - either "key" or "value". - * @param {string} whitespace Actual whitespace string. - * @param {int} expected Expected whitespace length. - * @returns {void} - */ - function report(property, side, whitespace, expected) { - var diff = whitespace.length - expected, - key = property.key, - firstTokenAfterColon = context.getTokenAfter(key, 1), - location = side === "key" ? key.loc.start : firstTokenAfterColon.loc.start; - - if ((diff && mode === "strict" || diff < 0 && mode === "minimum") && - !(expected && containsLineTerminator(whitespace)) - ) { - context.report(property[side], location, messages[side], { - error: diff > 0 ? "Extra" : "Missing", - computed: property.computed ? "computed " : "", - key: getKey(property) - }); - } - } - - /** - * Gets the number of characters in a key, including quotes around string - * keys and braces around computed property keys. - * @param {ASTNode} property Property of on object literal. - * @returns {int} Width of the key. - */ - function getKeyWidth(property) { - var startToken, endToken; - - // Ignore shorthand methods and properties, as they have no colon - if (property.method || property.shorthand) { - return 0; - } - - startToken = context.getFirstToken(property); - endToken = getLastTokenBeforeColon(property.key); - - return endToken.range[1] - startToken.range[0]; - } - - /** - * Gets the whitespace around the colon in an object literal property. - * @param {ASTNode} property Property node from an object literal. - * @returns {Object} Whitespace before and after the property's colon. - */ - function getPropertyWhitespace(property) { - var whitespace = /(\s*):(\s*)/.exec(context.getSource().slice( - property.key.range[1], property.value.range[0] - )); - - if (whitespace) { - return { - beforeColon: whitespace[1], - afterColon: whitespace[2] - }; - } - } - - /** - * Creates groups of properties. - * @param {ASTNode} node ObjectExpression node being evaluated. - * @returns {Array.} Groups of property AST node lists. - */ - function createGroups(node) { - if (node.properties.length === 1) { - return [node.properties]; - } - - return node.properties.reduce(function(groups, property) { - var currentGroup = last(groups), - prev = last(currentGroup); - - if (!prev || continuesPropertyGroup(prev, property)) { - currentGroup.push(property); - } else { - groups.push([property]); - } - - return groups; - }, [[]]); - } - - /** - * Verifies correct vertical alignment of a group of properties. - * @param {ASTNode[]} properties List of Property AST nodes. - * @returns {void} - */ - function verifyGroupAlignment(properties) { - var length = properties.length, - widths = properties.map(getKeyWidth), // Width of keys, including quotes - targetWidth = Math.max.apply(null, widths), - i, property, whitespace, width; - - // Conditionally include one space before or after colon - targetWidth += (align === "colon" ? beforeColon : afterColon); - - for (i = 0; i < length; i++) { - property = properties[i]; - whitespace = getPropertyWhitespace(property); - - if (!whitespace) { - continue; // Object literal getters/setters lack a colon - } - - width = widths[i]; - - if (align === "value") { - report(property, "key", whitespace.beforeColon, beforeColon); - report(property, "value", whitespace.afterColon, targetWidth - width); - } else { // align = "colon" - report(property, "key", whitespace.beforeColon, targetWidth - width); - report(property, "value", whitespace.afterColon, afterColon); - } - } - } - - /** - * Verifies vertical alignment, taking into account groups of properties. - * @param {ASTNode} node ObjectExpression node being evaluated. - * @returns {void} - */ - function verifyAlignment(node) { - createGroups(node).forEach(function(group) { - verifyGroupAlignment(group); - }); - } - - /** - * Verifies spacing of property conforms to specified options. - * @param {ASTNode} node Property node being evaluated. - * @returns {void} - */ - function verifySpacing(node) { - var whitespace = getPropertyWhitespace(node); - if (whitespace) { // Object literal getters/setters lack colons - report(node, "key", whitespace.beforeColon, beforeColon); - report(node, "value", whitespace.afterColon, afterColon); - } - } - - /** - * Verifies spacing of each property in a list. - * @param {ASTNode[]} properties List of Property AST nodes. - * @returns {void} - */ - function verifyListSpacing(properties) { - var length = properties.length; - - for (var i = 0; i < length; i++) { - verifySpacing(properties[i]); - } - } - - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- - - if (align) { // Verify vertical alignment - - return { - "ObjectExpression": function(node) { - if (isSingleLine(node)) { - verifyListSpacing(node.properties); - } else { - verifyAlignment(node); - } - } - }; - - } else { // Strictly obey beforeColon and afterColon in each property - - return { - "Property": function(node) { - verifySpacing(node); - } - }; - - } - -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "align": { - "enum": ["colon", "value"] - }, - "mode": { - "enum": ["strict", "minimum"] - }, - "beforeColon": { - "type": "boolean" - }, - "afterColon": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/linebreak-style.js b/node_modules/eslint/lib/rules/linebreak-style.js deleted file mode 100644 index 29a9dfb..0000000 --- a/node_modules/eslint/lib/rules/linebreak-style.js +++ /dev/null @@ -1,79 +0,0 @@ -/** - * @fileoverview Rule to forbid mixing LF and LFCR line breaks. - * @author Erik Mueller - * @copyright 2015 Varun Verma. All rights reserverd. - * @copyright 2015 James Whitney. All rights reserved. - * @copyright 2015 Erik Mueller. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var EXPECTED_LF_MSG = "Expected linebreaks to be 'LF' but found 'CRLF'.", - EXPECTED_CRLF_MSG = "Expected linebreaks to be 'CRLF' but found 'LF'."; - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Builds a fix function that replaces text at the specified range in the source text. - * @param {int[]} range The range to replace - * @param {string} text The text to insert. - * @returns {function} Fixer function - * @private - */ - function createFix(range, text) { - return function(fixer) { - return fixer.replaceTextRange(range, text); - }; - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - "Program": function checkForlinebreakStyle(node) { - var linebreakStyle = context.options[0] || "unix", - expectedLF = linebreakStyle === "unix", - expectedLFChars = expectedLF ? "\n" : "\r\n", - source = context.getSource(), - pattern = /\r\n|\r|\n|\u2028|\u2029/g, - match, - index, - range; - - var i = 0; - while ((match = pattern.exec(source)) !== null) { - i++; - if (match[0] === expectedLFChars) { - continue; - } - - index = match.index; - range = [index, index + match[0].length]; - context.report({ - node: node, - loc: { - line: i, - column: context.getSourceLines()[i - 1].length - }, - message: expectedLF ? EXPECTED_LF_MSG : EXPECTED_CRLF_MSG, - fix: createFix(range, expectedLFChars) - }); - } - } - }; -}; - -module.exports.schema = [ - { - "enum": ["unix", "windows"] - } -]; diff --git a/node_modules/eslint/lib/rules/lines-around-comment.js b/node_modules/eslint/lib/rules/lines-around-comment.js deleted file mode 100644 index e2416fc..0000000 --- a/node_modules/eslint/lib/rules/lines-around-comment.js +++ /dev/null @@ -1,334 +0,0 @@ -/** - * @fileoverview Enforces empty lines around comments. - * @author Jamund Ferguson - * @copyright 2015 Mathieu M-Gosselin. All rights reserved. - * @copyright 2015 Jamund Ferguson. All rights reserved. - * @copyright 2015 Gyandeep Singh. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var assign = require("object-assign"); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Return an array with with any line numbers that are empty. - * @param {Array} lines An array of each line of the file. - * @returns {Array} An array of line numbers. - */ -function getEmptyLineNums(lines) { - var emptyLines = lines.map(function(line, i) { - return { - code: line.trim(), - num: i + 1 - }; - }).filter(function(line) { - return !line.code; - }).map(function(line) { - return line.num; - }); - return emptyLines; -} - -/** - * Return an array with with any line numbers that contain comments. - * @param {Array} comments An array of comment nodes. - * @returns {Array} An array of line numbers. - */ -function getCommentLineNums(comments) { - var lines = []; - comments.forEach(function(token) { - var start = token.loc.start.line; - var end = token.loc.end.line; - lines.push(start, end); - }); - return lines; -} - -/** - * Determines if a value is an array. - * @param {number} val The value we wish to check for in the array.. - * @param {Array} array An array. - * @returns {boolean} True if the value is in the array.. - */ -function contains(val, array) { - return array.indexOf(val) > -1; -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var options = context.options[0] ? assign({}, context.options[0]) : {}; - options.beforeLineComment = options.beforeLineComment || false; - options.afterLineComment = options.afterLineComment || false; - options.beforeBlockComment = typeof options.beforeBlockComment !== "undefined" ? options.beforeBlockComment : true; - options.afterBlockComment = options.afterBlockComment || false; - options.allowBlockStart = options.allowBlockStart || false; - options.allowBlockEnd = options.allowBlockEnd || false; - - var sourceCode = context.getSourceCode(); - /** - * Returns whether or not comments are on lines starting with or ending with code - * @param {ASTNode} node The comment node to check. - * @returns {boolean} True if the comment is not alone. - */ - function codeAroundComment(node) { - var token; - - token = node; - do { - token = sourceCode.getTokenOrCommentBefore(token); - } while (token && (token.type === "Block" || token.type === "Line")); - - if (token && token.loc.end.line === node.loc.start.line) { - return true; - } - - token = node; - do { - token = sourceCode.getTokenOrCommentAfter(token); - } while (token && (token.type === "Block" || token.type === "Line")); - - if (token && token.loc.start.line === node.loc.end.line) { - return true; - } - - return false; - } - - /** - * Returns whether or not comments are inside a node type or not. - * @param {ASTNode} node The Comment node. - * @param {ASTNode} parent The Comment parent node. - * @param {string} nodeType The parent type to check against. - * @returns {boolean} True if the comment is inside nodeType. - */ - function isCommentInsideNodeType(node, parent, nodeType) { - return parent.type === nodeType || - (parent.body && parent.body.type === nodeType) || - (parent.consequent && parent.consequent.type === nodeType); - } - - /** - * Returns whether or not comments are at the parent start or not. - * @param {ASTNode} node The Comment node. - * @param {string} nodeType The parent type to check against. - * @returns {boolean} True if the comment is at parent start. - */ - function isCommentAtParentStart(node, nodeType) { - var ancestors = context.getAncestors(); - var parent; - - if (ancestors.length) { - parent = ancestors.pop(); - } - - return parent && isCommentInsideNodeType(node, parent, nodeType) && - node.loc.start.line - parent.loc.start.line === 1; - } - - /** - * Returns whether or not comments are at the parent end or not. - * @param {ASTNode} node The Comment node. - * @param {string} nodeType The parent type to check against. - * @returns {boolean} True if the comment is at parent end. - */ - function isCommentAtParentEnd(node, nodeType) { - var ancestors = context.getAncestors(); - var parent; - - if (ancestors.length) { - parent = ancestors.pop(); - } - - return parent && isCommentInsideNodeType(node, parent, nodeType) && - parent.loc.end.line - node.loc.end.line === 1; - } - - /** - * Returns whether or not comments are at the block start or not. - * @param {ASTNode} node The Comment node. - * @returns {boolean} True if the comment is at block start. - */ - function isCommentAtBlockStart(node) { - return isCommentAtParentStart(node, "ClassBody") || isCommentAtParentStart(node, "BlockStatement"); - } - - /** - * Returns whether or not comments are at the block end or not. - * @param {ASTNode} node The Comment node. - * @returns {boolean} True if the comment is at block end. - */ - function isCommentAtBlockEnd(node) { - return isCommentAtParentEnd(node, "ClassBody") || isCommentAtParentEnd(node, "BlockStatement"); - } - - /** - * Returns whether or not comments are at the object start or not. - * @param {ASTNode} node The Comment node. - * @returns {boolean} True if the comment is at object start. - */ - function isCommentAtObjectStart(node) { - return isCommentAtParentStart(node, "ObjectExpression") || isCommentAtParentStart(node, "ObjectPattern"); - } - - /** - * Returns whether or not comments are at the object end or not. - * @param {ASTNode} node The Comment node. - * @returns {boolean} True if the comment is at object end. - */ - function isCommentAtObjectEnd(node) { - return isCommentAtParentEnd(node, "ObjectExpression") || isCommentAtParentEnd(node, "ObjectPattern"); - } - - /** - * Returns whether or not comments are at the array start or not. - * @param {ASTNode} node The Comment node. - * @returns {boolean} True if the comment is at array start. - */ - function isCommentAtArrayStart(node) { - return isCommentAtParentStart(node, "ArrayExpression") || isCommentAtParentStart(node, "ArrayPattern"); - } - - /** - * Returns whether or not comments are at the array end or not. - * @param {ASTNode} node The Comment node. - * @returns {boolean} True if the comment is at array end. - */ - function isCommentAtArrayEnd(node) { - return isCommentAtParentEnd(node, "ArrayExpression") || isCommentAtParentEnd(node, "ArrayPattern"); - } - - /** - * Checks if a comment node has lines around it (ignores inline comments) - * @param {ASTNode} node The Comment node. - * @param {Object} opts Options to determine the newline. - * @param {Boolean} opts.after Should have a newline after this line. - * @param {Boolean} opts.before Should have a newline before this line. - * @returns {void} - */ - function checkForEmptyLine(node, opts) { - - var lines = context.getSourceLines(), - numLines = lines.length + 1, - comments = context.getAllComments(), - commentLines = getCommentLineNums(comments), - emptyLines = getEmptyLineNums(lines), - commentAndEmptyLines = commentLines.concat(emptyLines); - - var after = opts.after, - before = opts.before; - - var prevLineNum = node.loc.start.line - 1, - nextLineNum = node.loc.end.line + 1, - commentIsNotAlone = codeAroundComment(node); - - var blockStartAllowed = options.allowBlockStart && isCommentAtBlockStart(node), - blockEndAllowed = options.allowBlockEnd && isCommentAtBlockEnd(node), - objectStartAllowed = options.allowObjectStart && isCommentAtObjectStart(node), - objectEndAllowed = options.allowObjectEnd && isCommentAtObjectEnd(node), - arrayStartAllowed = options.allowArrayStart && isCommentAtArrayStart(node), - arrayEndAllowed = options.allowArrayEnd && isCommentAtArrayEnd(node); - - var exceptionStartAllowed = blockStartAllowed || objectStartAllowed || arrayStartAllowed; - var exceptionEndAllowed = blockEndAllowed || objectEndAllowed || arrayEndAllowed; - - // ignore top of the file and bottom of the file - if (prevLineNum < 1) { - before = false; - } - if (nextLineNum >= numLines) { - after = false; - } - - // we ignore all inline comments - if (commentIsNotAlone) { - return; - } - - // check for newline before - if (!exceptionStartAllowed && before && !contains(prevLineNum, commentAndEmptyLines)) { - context.report(node, "Expected line before comment."); - } - - // check for newline after - if (!exceptionEndAllowed && after && !contains(nextLineNum, commentAndEmptyLines)) { - context.report(node, "Expected line after comment."); - } - - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - - "LineComment": function(node) { - if (options.beforeLineComment || options.afterLineComment) { - checkForEmptyLine(node, { - after: options.afterLineComment, - before: options.beforeLineComment - }); - } - }, - - "BlockComment": function(node) { - if (options.beforeBlockComment || options.afterBlockComment) { - checkForEmptyLine(node, { - after: options.afterBlockComment, - before: options.beforeBlockComment - }); - } - } - - }; -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "beforeBlockComment": { - "type": "boolean" - }, - "afterBlockComment": { - "type": "boolean" - }, - "beforeLineComment": { - "type": "boolean" - }, - "afterLineComment": { - "type": "boolean" - }, - "allowBlockStart": { - "type": "boolean" - }, - "allowBlockEnd": { - "type": "boolean" - }, - "allowObjectStart": { - "type": "boolean" - }, - "allowObjectEnd": { - "type": "boolean" - }, - "allowArrayStart": { - "type": "boolean" - }, - "allowArrayEnd": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/max-depth.js b/node_modules/eslint/lib/rules/max-depth.js deleted file mode 100644 index a0159e1..0000000 --- a/node_modules/eslint/lib/rules/max-depth.js +++ /dev/null @@ -1,110 +0,0 @@ -/** - * @fileoverview A rule to set the maximum depth block can be nested in a function. - * @author Ian Christian Myers - * @copyright 2013 Ian Christian Myers. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - var functionStack = [], - maxDepth = context.options[0] || 4; - - /** - * When parsing a new function, store it in our function stack - * @returns {void} - * @private - */ - function startFunction() { - functionStack.push(0); - } - - /** - * When parsing is done then pop out the reference - * @returns {void} - * @private - */ - function endFunction() { - functionStack.pop(); - } - - /** - * Save the block and Evaluate the node - * @param {ASTNode} node node to evaluate - * @returns {void} - * @private - */ - function pushBlock(node) { - var len = ++functionStack[functionStack.length - 1]; - - if (len > maxDepth) { - context.report(node, "Blocks are nested too deeply ({{depth}}).", - { depth: len }); - } - } - - /** - * Pop the saved block - * @returns {void} - * @private - */ - function popBlock() { - functionStack[functionStack.length - 1]--; - } - - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- - - return { - "Program": startFunction, - "FunctionDeclaration": startFunction, - "FunctionExpression": startFunction, - "ArrowFunctionExpression": startFunction, - - "IfStatement": function(node) { - if (node.parent.type !== "IfStatement") { - pushBlock(node); - } - }, - "SwitchStatement": pushBlock, - "TryStatement": pushBlock, - "DoWhileStatement": pushBlock, - "WhileStatement": pushBlock, - "WithStatement": pushBlock, - "ForStatement": pushBlock, - "ForInStatement": pushBlock, - "ForOfStatement": pushBlock, - - "IfStatement:exit": popBlock, - "SwitchStatement:exit": popBlock, - "TryStatement:exit": popBlock, - "DoWhileStatement:exit": popBlock, - "WhileStatement:exit": popBlock, - "WithStatement:exit": popBlock, - "ForStatement:exit": popBlock, - "ForInStatement:exit": popBlock, - "ForOfStatement:exit": popBlock, - - "FunctionDeclaration:exit": endFunction, - "FunctionExpression:exit": endFunction, - "ArrowFunctionExpression:exit": endFunction, - "Program:exit": endFunction - }; - -}; - -module.exports.schema = [ - { - "type": "integer" - } -]; diff --git a/node_modules/eslint/lib/rules/max-len.js b/node_modules/eslint/lib/rules/max-len.js deleted file mode 100644 index 13cf73c..0000000 --- a/node_modules/eslint/lib/rules/max-len.js +++ /dev/null @@ -1,165 +0,0 @@ -/** - * @fileoverview Rule to check for max length on a line. - * @author Matt DuVall - * @copyright 2013 Matt DuVall. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - // takes some ideas from http://tools.ietf.org/html/rfc3986#appendix-B, however: - // - They're matching an entire string that we know is a URI - // - We're matching part of a string where we think there *might* be a URL - // - We're only concerned about URLs, as picking out any URI would cause too many false positives - // - We don't care about matching the entire URL, any small segment is fine - var URL_REGEXP = /[^:/?#]:\/\/[^?#]/; - - /** - * Creates a string that is made up of repeating a given string a certain - * number of times. This uses exponentiation of squares to achieve significant - * performance gains over the more traditional implementation of such - * functionality. - * @param {string} str The string to repeat. - * @param {int} num The number of times to repeat the string. - * @returns {string} The created string. - * @private - */ - function stringRepeat(str, num) { - var result = ""; - for (num |= 0; num > 0; num >>>= 1, str += str) { - if (num & 1) { - result += str; - } - } - return result; - } - - var maxLength = context.options[0] || 80, - tabWidth = context.options[1] || 4, - ignoreOptions = context.options[2] || {}, - ignorePattern = ignoreOptions.ignorePattern || null, - ignoreComments = ignoreOptions.ignoreComments || false, - ignoreUrls = ignoreOptions.ignoreUrls || false, - tabString = stringRepeat(" ", tabWidth); - - if (ignorePattern) { - ignorePattern = new RegExp(ignorePattern); - } - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Tells if a given comment is trailing: it starts on the current line and - * extends to or past the end of the current line. - * @param {string} line The source line we want to check for a trailing comment on - * @param {number} lineNumber The one-indexed line number for line - * @param {ASTNode} comment The comment to inspect - * @returns {boolean} If the comment is trailing on the given line - */ - function isTrailingComment(line, lineNumber, comment) { - return comment && - (comment.loc.start.line <= lineNumber && lineNumber <= comment.loc.end.line) && - (comment.loc.end.line > lineNumber || comment.loc.end.column === line.length); - } - - /** - * Gets the line after the comment and any remaining trailing whitespace is - * stripped. - * @param {string} line The source line with a trailing comment - * @param {number} lineNumber The one-indexed line number this is on - * @param {ASTNode} comment The comment to remove - * @returns {string} Line without comment and trailing whitepace - */ - function stripTrailingComment(line, lineNumber, comment) { - if (comment.loc.start.line < lineNumber) { - // this entire line is a comment - return ""; - } else { - // loc.column is zero-indexed - return line.slice(0, comment.loc.start.column).replace(/\s+$/, ""); - } - } - - /** - * Check the program for max length - * @param {ASTNode} node Node to examine - * @returns {void} - * @private - */ - function checkProgramForMaxLength(node) { - // split (honors line-ending) - var lines = context.getSourceLines(), - // list of comments to ignore - comments = ignoreComments ? context.getAllComments() : [], - // we iterate over comments in parallel with the lines - commentsIndex = 0; - - lines.forEach(function(line, i) { - // i is zero-indexed, line numbers are one-indexed - var lineNumber = i + 1; - // we can short-circuit the comment checks if we're already out of comments to check - if (commentsIndex < comments.length) { - // iterate over comments until we find one past the current line - do { - var comment = comments[++commentsIndex]; - } while (comment && comment.loc.start.line <= lineNumber); - // and step back by one - comment = comments[--commentsIndex]; - if (isTrailingComment(line, lineNumber, comment)) { - line = stripTrailingComment(line, lineNumber, comment); - } - } - if (ignorePattern && ignorePattern.test(line) || - ignoreUrls && URL_REGEXP.test(line)) { - // ignore this line - return; - } - // replace the tabs - if (line.replace(/\t/g, tabString).length > maxLength) { - context.report(node, { line: lineNumber, column: 0 }, "Line " + (i + 1) + " exceeds the maximum line length of " + maxLength + "."); - } - }); - } - - - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- - - return { - "Program": checkProgramForMaxLength - }; - -}; - -module.exports.schema = [ - { - "type": "integer", - "minimum": 0 - }, - { - "type": "integer", - "minimum": 0 - }, - { - "type": "object", - "properties": { - "ignorePattern": { - "type": "string" - }, - "ignoreComments": { - "type": "boolean" - }, - "ignoreUrls": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/max-nested-callbacks.js b/node_modules/eslint/lib/rules/max-nested-callbacks.js deleted file mode 100644 index 10753bd..0000000 --- a/node_modules/eslint/lib/rules/max-nested-callbacks.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * @fileoverview Rule to enforce a maximum number of nested callbacks. - * @author Ian Christian Myers - * @copyright 2013 Ian Christian Myers. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - //-------------------------------------------------------------------------- - // Constants - //-------------------------------------------------------------------------- - - var THRESHOLD = context.options[0] || 10; - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - var callbackStack = []; - - /** - * Checks a given function node for too many callbacks. - * @param {ASTNode} node The node to check. - * @returns {void} - * @private - */ - function checkFunction(node) { - var parent = node.parent; - - if (parent.type === "CallExpression") { - callbackStack.push(node); - } - - if (callbackStack.length > THRESHOLD) { - var opts = {num: callbackStack.length, max: THRESHOLD}; - context.report(node, "Too many nested callbacks ({{num}}). Maximum allowed is {{max}}.", opts); - } - } - - /** - * Pops the call stack. - * @returns {void} - * @private - */ - function popStack() { - callbackStack.pop(); - } - - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- - - return { - "ArrowFunctionExpression": checkFunction, - "ArrowFunctionExpression:exit": popStack, - - "FunctionExpression": checkFunction, - "FunctionExpression:exit": popStack - }; - -}; - -module.exports.schema = [ - { - "type": "integer" - } -]; diff --git a/node_modules/eslint/lib/rules/max-params.js b/node_modules/eslint/lib/rules/max-params.js deleted file mode 100644 index c09fba0..0000000 --- a/node_modules/eslint/lib/rules/max-params.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @fileoverview Rule to flag when a function has too many parameters - * @author Ilya Volodin - * @copyright 2014 Nicholas C. Zakas. All rights reserved. - * @copyright 2013 Ilya Volodin. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var numParams = context.options[0] || 3; - - /** - * Checks a function to see if it has too many parameters. - * @param {ASTNode} node The node to check. - * @returns {void} - * @private - */ - function checkFunction(node) { - if (node.params.length > numParams) { - context.report(node, "This function has too many parameters ({{count}}). Maximum allowed is {{max}}.", { - count: node.params.length, - max: numParams - }); - } - } - - return { - "FunctionDeclaration": checkFunction, - "ArrowFunctionExpression": checkFunction, - "FunctionExpression": checkFunction - }; - -}; - -module.exports.schema = [ - { - "type": "integer" - } -]; diff --git a/node_modules/eslint/lib/rules/max-statements.js b/node_modules/eslint/lib/rules/max-statements.js deleted file mode 100644 index 35a4960..0000000 --- a/node_modules/eslint/lib/rules/max-statements.js +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @fileoverview A rule to set the maximum number of statements in a function. - * @author Ian Christian Myers - * @copyright 2013 Ian Christian Myers. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - var functionStack = [], - maxStatements = context.options[0] || 10; - - /** - * When parsing a new function, store it in our function stack - * @returns {void} - * @private - */ - function startFunction() { - functionStack.push(0); - } - - /** - * Evaluate the node at the end of function - * @param {ASTNode} node node to evaluate - * @returns {void} - * @private - */ - function endFunction(node) { - var count = functionStack.pop(); - - if (count > maxStatements) { - context.report(node, "This function has too many statements ({{count}}). Maximum allowed is {{max}}.", - { count: count, max: maxStatements }); - } - } - - /** - * Increment the count of the functions - * @param {ASTNode} node node to evaluate - * @returns {void} - * @private - */ - function countStatements(node) { - functionStack[functionStack.length - 1] += node.body.length; - } - - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- - - return { - "FunctionDeclaration": startFunction, - "FunctionExpression": startFunction, - "ArrowFunctionExpression": startFunction, - - "BlockStatement": countStatements, - - "FunctionDeclaration:exit": endFunction, - "FunctionExpression:exit": endFunction, - "ArrowFunctionExpression:exit": endFunction - }; - -}; - -module.exports.schema = [ - { - "type": "integer" - } -]; diff --git a/node_modules/eslint/lib/rules/new-cap.js b/node_modules/eslint/lib/rules/new-cap.js deleted file mode 100644 index 9518b1e..0000000 --- a/node_modules/eslint/lib/rules/new-cap.js +++ /dev/null @@ -1,241 +0,0 @@ -/** - * @fileoverview Rule to flag use of constructors without capital letters - * @author Nicholas C. Zakas - * @copyright 2014 Jordan Harband. All rights reserved. - * @copyright 2013-2014 Nicholas C. Zakas. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var assign = require("object-assign"); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -var CAPS_ALLOWED = [ - "Array", - "Boolean", - "Date", - "Error", - "Function", - "Number", - "Object", - "RegExp", - "String", - "Symbol" -]; - -/** - * Ensure that if the key is provided, it must be an array. - * @param {Object} obj Object to check with `key`. - * @param {string} key Object key to check on `obj`. - * @param {*} fallback If obj[key] is not present, this will be returned. - * @returns {string[]} Returns obj[key] if it's an Array, otherwise `fallback` - */ -function checkArray(obj, key, fallback) { - /* istanbul ignore if */ - if (Object.prototype.hasOwnProperty.call(obj, key) && !Array.isArray(obj[key])) { - throw new TypeError(key + ", if provided, must be an Array"); - } - return obj[key] || fallback; -} - -/** - * A reducer function to invert an array to an Object mapping the string form of the key, to `true`. - * @param {Object} map Accumulator object for the reduce. - * @param {string} key Object key to set to `true`. - * @returns {Object} Returns the updated Object for further reduction. - */ -function invert(map, key) { - map[key] = true; - return map; -} - -/** - * Creates an object with the cap is new exceptions as its keys and true as their values. - * @param {Object} config Rule configuration - * @returns {Object} Object with cap is new exceptions. - */ -function calculateCapIsNewExceptions(config) { - var capIsNewExceptions = checkArray(config, "capIsNewExceptions", CAPS_ALLOWED); - - if (capIsNewExceptions !== CAPS_ALLOWED) { - capIsNewExceptions = capIsNewExceptions.concat(CAPS_ALLOWED); - } - - return capIsNewExceptions.reduce(invert, {}); -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var config = context.options[0] ? assign({}, context.options[0]) : {}; - config.newIsCap = config.newIsCap !== false; - config.capIsNew = config.capIsNew !== false; - var skipProperties = config.properties === false; - - var newIsCapExceptions = checkArray(config, "newIsCapExceptions", []).reduce(invert, {}); - - var capIsNewExceptions = calculateCapIsNewExceptions(config); - - var listeners = {}; - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Get exact callee name from expression - * @param {ASTNode} node CallExpression or NewExpression node - * @returns {string} name - */ - function extractNameFromExpression(node) { - - var name = "", - property; - - if (node.callee.type === "MemberExpression") { - property = node.callee.property; - - if (property.type === "Literal" && (typeof property.value === "string")) { - name = property.value; - } else if (property.type === "Identifier" && !node.callee.computed) { - name = property.name; - } - } else { - name = node.callee.name; - } - return name; - } - - /** - * Returns the capitalization state of the string - - * Whether the first character is uppercase, lowercase, or non-alphabetic - * @param {string} str String - * @returns {string} capitalization state: "non-alpha", "lower", or "upper" - */ - function getCap(str) { - var firstChar = str.charAt(0); - - var firstCharLower = firstChar.toLowerCase(); - var firstCharUpper = firstChar.toUpperCase(); - - if (firstCharLower === firstCharUpper) { - // char has no uppercase variant, so it's non-alphabetic - return "non-alpha"; - } else if (firstChar === firstCharLower) { - return "lower"; - } else { - return "upper"; - } - } - - /** - * Check if capitalization is allowed for a CallExpression - * @param {Object} allowedMap Object mapping calleeName to a Boolean - * @param {ASTNode} node CallExpression node - * @param {string} calleeName Capitalized callee name from a CallExpression - * @returns {Boolean} Returns true if the callee may be capitalized - */ - function isCapAllowed(allowedMap, node, calleeName) { - if (allowedMap[calleeName] || allowedMap[context.getSource(node.callee)]) { - return true; - } - - if (calleeName === "UTC" && node.callee.type === "MemberExpression") { - // allow if callee is Date.UTC - return node.callee.object.type === "Identifier" && - node.callee.object.name === "Date"; - } - - return skipProperties && node.callee.type === "MemberExpression"; - } - - /** - * Reports the given message for the given node. The location will be the start of the property or the callee. - * @param {ASTNode} node CallExpression or NewExpression node. - * @param {string} message The message to report. - * @returns {void} - */ - function report(node, message) { - var callee = node.callee; - - if (callee.type === "MemberExpression") { - callee = callee.property; - } - - context.report(node, callee.loc.start, message); - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - if (config.newIsCap) { - listeners.NewExpression = function(node) { - - var constructorName = extractNameFromExpression(node); - if (constructorName) { - var capitalization = getCap(constructorName); - var isAllowed = capitalization !== "lower" || isCapAllowed(newIsCapExceptions, node, constructorName); - if (!isAllowed) { - report(node, "A constructor name should not start with a lowercase letter."); - } - } - }; - } - - if (config.capIsNew) { - listeners.CallExpression = function(node) { - - var calleeName = extractNameFromExpression(node); - if (calleeName) { - var capitalization = getCap(calleeName); - var isAllowed = capitalization !== "upper" || isCapAllowed(capIsNewExceptions, node, calleeName); - if (!isAllowed) { - report(node, "A function with a name starting with an uppercase letter should only be used as a constructor."); - } - } - }; - } - - return listeners; -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "newIsCap": { - "type": "boolean" - }, - "capIsNew": { - "type": "boolean" - }, - "newIsCapExceptions": { - "type": "array", - "items": { - "type": "string" - } - }, - "capIsNewExceptions": { - "type": "array", - "items": { - "type": "string" - } - }, - "properties": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/new-parens.js b/node_modules/eslint/lib/rules/new-parens.js deleted file mode 100644 index 903564b..0000000 --- a/node_modules/eslint/lib/rules/new-parens.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @fileoverview Rule to flag when using constructor without parentheses - * @author Ilya Volodin - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "NewExpression": function(node) { - var tokens = context.getTokens(node); - var prenticesTokens = tokens.filter(function(token) { - return token.value === "(" || token.value === ")"; - }); - if (prenticesTokens.length < 2) { - context.report(node, "Missing '()' invoking a constructor"); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/newline-after-var.js b/node_modules/eslint/lib/rules/newline-after-var.js deleted file mode 100644 index 9e7d859..0000000 --- a/node_modules/eslint/lib/rules/newline-after-var.js +++ /dev/null @@ -1,176 +0,0 @@ -/** - * @fileoverview Rule to check empty newline after "var" statement - * @author Gopal Venkatesan - * @copyright 2015 Gopal Venkatesan. All rights reserved. - * @copyright 2015 Casey Visco. All rights reserved. - * @copyright 2015 Ian VanSchooten. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var ALWAYS_MESSAGE = "Expected blank line after variable declarations.", - NEVER_MESSAGE = "Unexpected blank line after variable declarations."; - - // Default `mode` to "always". This means that invalid options will also - // be treated as "always" and the only special case is "never" - var mode = context.options[0] === "never" ? "never" : "always"; - - // Cache starting and ending line numbers of comments for faster lookup - var commentEndLine = context.getAllComments().reduce(function(result, token) { - result[token.loc.start.line] = token.loc.end.line; - return result; - }, {}); - - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Determine if provided keyword is a variable declaration - * @private - * @param {string} keyword - keyword to test - * @returns {boolean} True if `keyword` is a type of var - */ - function isVar(keyword) { - return keyword === "var" || keyword === "let" || keyword === "const"; - } - - /** - * Determine if provided keyword is a variant of for specifiers - * @private - * @param {string} keyword - keyword to test - * @returns {boolean} True if `keyword` is a variant of for specifier - */ - function isForTypeSpecifier(keyword) { - return keyword === "ForStatement" || keyword === "ForInStatement" || keyword === "ForOfStatement"; - } - - /** - * Determine if provided keyword is an export specifiers - * @private - * @param {string} nodeType - nodeType to test - * @returns {boolean} True if `nodeType` is an export specifier - */ - function isExportSpecifier(nodeType) { - return nodeType === "ExportNamedDeclaration" || nodeType === "ExportSpecifier" || - nodeType === "ExportDefaultDeclaration" || nodeType === "ExportAllDeclaration"; - } - - /** - * Determine if provided nodeType is a function specifier - * @private - * @param {string} nodeType - nodeType to test - * @returns {boolean} True if `nodeType` is a function specifier - */ - function isFunctionSpecifier(nodeType) { - return nodeType === "FunctionDeclaration" || nodeType === "FunctionExpression" || - nodeType === "ArrowFunctionExpression"; - } - - /** - * Determine if provided node is the last of his parent - * @private - * @param {ASTNode} node - node to test - * @returns {boolean} True if `node` is last of his parent - */ - function isLastNode(node) { - return node.parent.body[node.parent.body.length - 1] === node; - } - - /** - * Determine if a token starts more than one line after a comment ends - * @param {token} token The token being checked - * @param {integer} commentStartLine The line number on which the comment starts - * @returns {boolean} True if `token` does not start immediately after a comment - */ - function hasBlankLineAfterComment(token, commentStartLine) { - var commentEnd = commentEndLine[commentStartLine]; - // If there's another comment, repeat check for blank line - if (commentEndLine[commentEnd + 1]) { - return hasBlankLineAfterComment(token, commentEnd + 1); - } - return (token.loc.start.line > commentEndLine[commentStartLine] + 1); - } - - /** - * Checks that a blank line exists after a variable declaration when mode is - * set to "always", or checks that there is no blank line when mode is set - * to "never" - * @private - * @param {ASTNode} node - `VariableDeclaration` node to test - * @returns {void} - */ - function checkForBlankLine(node) { - var lastToken = context.getLastToken(node), - nextToken = context.getTokenAfter(node), - nextLineNum = lastToken.loc.end.line + 1, - noNextLineToken, - hasNextLineComment; - - // Ignore if there is no following statement - if (!nextToken) { - return; - } - - // Ignore if parent of node is a for variant - if (isForTypeSpecifier(node.parent.type)) { - return; - } - - // Ignore if parent of node is an export specifier - if (isExportSpecifier(node.parent.type)) { - return; - } - - // Some coding styles use multiple `var` statements, so do nothing if - // the next token is a `var` statement. - if (nextToken.type === "Keyword" && isVar(nextToken.value)) { - return; - } - - // Ignore if it is last statement in a function - if (node.parent.parent && isFunctionSpecifier(node.parent.parent.type) && isLastNode(node)) { - return; - } - - // Next statement is not a `var`... - noNextLineToken = nextToken.loc.start.line > nextLineNum; - hasNextLineComment = (typeof commentEndLine[nextLineNum] !== "undefined"); - - if (mode === "never" && noNextLineToken && !hasNextLineComment) { - context.report(node, NEVER_MESSAGE, { identifier: node.name }); - } - - // Token on the next line, or comment without blank line - if ( - mode === "always" && ( - !noNextLineToken || - hasNextLineComment && !hasBlankLineAfterComment(nextToken, nextLineNum) - ) - ) { - context.report(node, ALWAYS_MESSAGE, { identifier: node.name }); - } - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - "VariableDeclaration": checkForBlankLine - }; - -}; - -module.exports.schema = [ - { - "enum": ["never", "always"] - } -]; diff --git a/node_modules/eslint/lib/rules/no-alert.js b/node_modules/eslint/lib/rules/no-alert.js deleted file mode 100644 index bfe834b..0000000 --- a/node_modules/eslint/lib/rules/no-alert.js +++ /dev/null @@ -1,152 +0,0 @@ -/** - * @fileoverview Rule to flag use of alert, confirm, prompt - * @author Nicholas C. Zakas - * @copyright 2015 Mathias Schreck - * @copyright 2013 Nicholas C. Zakas - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Checks if the given name is a prohibited identifier. - * @param {string} name The name to check - * @returns {boolean} Whether or not the name is prohibited. - */ -function isProhibitedIdentifier(name) { - return /^(alert|confirm|prompt)$/.test(name); -} - -/** - * Reports the given node and identifier name. - * @param {RuleContext} context The ESLint rule context. - * @param {ASTNode} node The node to report on. - * @param {string} identifierName The name of the identifier. - * @returns {void} - */ -function report(context, node, identifierName) { - context.report(node, "Unexpected {{name}}.", { name: identifierName }); -} - -/** - * Returns the property name of a MemberExpression. - * @param {ASTNode} memberExpressionNode The MemberExpression node. - * @returns {string|undefined} Returns the property name if available, undefined else. - */ -function getPropertyName(memberExpressionNode) { - if (memberExpressionNode.computed) { - if (memberExpressionNode.property.type === "Literal") { - return memberExpressionNode.property.value; - } - } else { - return memberExpressionNode.property.name; - } -} - -/** - * Finds the escope reference in the given scope. - * @param {Object} scope The scope to search. - * @param {ASTNode} node The identifier node. - * @returns {Reference|undefined} Returns the found reference or undefined if none were found. - */ -function findReference(scope, node) { - var references = scope.references.filter(function(reference) { - return reference.identifier.range[0] === node.range[0] && - reference.identifier.range[1] === node.range[1]; - }); - - if (references.length === 1) { - return references[0]; - } -} - -/** - * Checks if the given identifier name is shadowed in the given global scope. - * @param {Object} globalScope The global scope. - * @param {string} identifierName The identifier name to check - * @returns {boolean} Whether or not the name is shadowed globally. - */ -function isGloballyShadowed(globalScope, identifierName) { - var variable = globalScope.set.get(identifierName); - return Boolean(variable && variable.defs.length > 0); -} - -/** - * Checks if the given identifier node is shadowed in the given scope. - * @param {Object} scope The current scope. - * @param {Object} globalScope The global scope. - * @param {string} node The identifier node to check - * @returns {boolean} Whether or not the name is shadowed. - */ -function isShadowed(scope, globalScope, node) { - var reference = findReference(scope, node), - identifierName = node.name; - - if (reference) { - if (reference.resolved || isGloballyShadowed(globalScope, identifierName)) { - return true; - } - } - - return false; -} - -/** - * Checks if the given identifier node is a ThisExpression in the global scope or the global window property. - * @param {Object} scope The current scope. - * @param {Object} globalScope The global scope. - * @param {string} node The identifier node to check - * @returns {boolean} Whether or not the node is a reference to the global object. - */ -function isGlobalThisReferenceOrGlobalWindow(scope, globalScope, node) { - if (scope.type === "global" && node.type === "ThisExpression") { - return true; - } else if (node.name === "window") { - return !isShadowed(scope, globalScope, node); - } - - return false; -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var globalScope; - - return { - - "Program": function() { - globalScope = context.getScope(); - }, - - "CallExpression": function(node) { - var callee = node.callee, - identifierName, - currentScope = context.getScope(); - - // without window. - if (callee.type === "Identifier") { - identifierName = callee.name; - - if (!isShadowed(currentScope, globalScope, callee) && isProhibitedIdentifier(callee.name)) { - report(context, node, identifierName); - } - - } else if (callee.type === "MemberExpression" && isGlobalThisReferenceOrGlobalWindow(currentScope, globalScope, callee.object)) { - identifierName = getPropertyName(callee); - - if (isProhibitedIdentifier(identifierName)) { - report(context, node, identifierName); - } - } - - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-array-constructor.js b/node_modules/eslint/lib/rules/no-array-constructor.js deleted file mode 100644 index ecf5837..0000000 --- a/node_modules/eslint/lib/rules/no-array-constructor.js +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @fileoverview Disallow construction of dense arrays using the Array constructor - * @author Matt DuVall - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Disallow construction of dense arrays using the Array constructor - * @param {ASTNode} node node to evaluate - * @returns {void} - * @private - */ - function check(node) { - if ( - node.arguments.length !== 1 && - node.callee.type === "Identifier" && - node.callee.name === "Array" - ) { - context.report(node, "The array literal notation [] is preferrable."); - } - } - - return { - "CallExpression": check, - "NewExpression": check - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-arrow-condition.js b/node_modules/eslint/lib/rules/no-arrow-condition.js deleted file mode 100644 index 5e47865..0000000 --- a/node_modules/eslint/lib/rules/no-arrow-condition.js +++ /dev/null @@ -1,88 +0,0 @@ -/** - * @fileoverview A rule to warn against using arrow functions in conditions. - * @author Jxck - * @copyright 2015 Luke Karrys. All rights reserved. - * The MIT License (MIT) - - * Copyright (c) 2015 Jxck - - * 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. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Checks whether or not a node is an arrow function expression. - * @param {ASTNode} node - node to test - * @returns {boolean} `true` if the node is an arrow function expression. - */ -function isArrowFunction(node) { - return node.test && node.test.type === "ArrowFunctionExpression"; -} - -/** - * Checks whether or not a node is a conditional expression. - * @param {ASTNode} node - node to test - * @returns {boolean} `true` if the node is a conditional expression. - */ -function isConditional(node) { - return node.body && node.body.type === "ConditionalExpression"; -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - /** - * Reports if a conditional statement is an arrow function. - * @param {ASTNode} node - A node to check and report. - * @returns {void} - */ - function checkCondition(node) { - if (isArrowFunction(node)) { - context.report(node, "Arrow function `=>` used inside {{statementType}} instead of comparison operator.", {statementType: node.type}); - } - } - - /** - * Reports if an arrow function contains an ambiguous conditional. - * @param {ASTNode} node - A node to check and report. - * @returns {void} - */ - function checkArrowFunc(node) { - if (isConditional(node)) { - context.report(node, "Arrow function used ambiguously with a conditional expression."); - } - } - - return { - "IfStatement": checkCondition, - "WhileStatement": checkCondition, - "ForStatement": checkCondition, - "ConditionalExpression": checkCondition, - "ArrowFunctionExpression": checkArrowFunc - }; -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-bitwise.js b/node_modules/eslint/lib/rules/no-bitwise.js deleted file mode 100644 index 439b7be..0000000 --- a/node_modules/eslint/lib/rules/no-bitwise.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * @fileoverview Rule to flag bitwise identifiers - * @author Nicholas C. Zakas - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var BITWISE_OPERATORS = [ - "^", "|", "&", "<<", ">>", ">>>", - "^=", "|=", "&=", "<<=", ">>=", ">>>=", - "~" - ]; - - /** - * Reports an unexpected use of a bitwise operator. - * @param {ASTNode} node Node which contains the bitwise operator. - * @returns {void} - */ - function report(node) { - context.report(node, "Unexpected use of '{{operator}}'.", { operator: node.operator }); - } - - /** - * Checks if the given node has a bitwise operator. - * @param {ASTNode} node The node to check. - * @returns {boolean} Whether or not the node has a bitwise operator. - */ - function hasBitwiseOperator(node) { - return BITWISE_OPERATORS.indexOf(node.operator) !== -1; - } - - /** - * Report if the given node contains a bitwise operator. - * @param {ASTNode} node The node to check. - * @returns {void} - */ - function checkNodeForBitwiseOperator(node) { - if (hasBitwiseOperator(node)) { - report(node); - } - } - - return { - "AssignmentExpression": checkNodeForBitwiseOperator, - "BinaryExpression": checkNodeForBitwiseOperator, - "UnaryExpression": checkNodeForBitwiseOperator - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-caller.js b/node_modules/eslint/lib/rules/no-caller.js deleted file mode 100644 index aacb3fe..0000000 --- a/node_modules/eslint/lib/rules/no-caller.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @fileoverview Rule to flag use of arguments.callee and arguments.caller. - * @author Nicholas C. Zakas - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "MemberExpression": function(node) { - var objectName = node.object.name, - propertyName = node.property.name; - - if (objectName === "arguments" && !node.computed && propertyName && propertyName.match(/^calle[er]$/)) { - context.report(node, "Avoid arguments.{{property}}.", { property: propertyName }); - } - - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-case-declarations.js b/node_modules/eslint/lib/rules/no-case-declarations.js deleted file mode 100644 index 443328b..0000000 --- a/node_modules/eslint/lib/rules/no-case-declarations.js +++ /dev/null @@ -1,47 +0,0 @@ -/** - * @fileoverview Rule to flag use of an lexical declarations inside a case clause - * @author Erik Arvidsson - * @copyright 2015 Erik Arvidsson. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Checks whether or not a node is a lexical declaration. - * @param {ASTNode} node A direct child statement of a switch case. - * @returns {boolean} Whether or not the node is a lexical declaration. - */ - function isLexicalDeclaration(node) { - switch (node.type) { - case "FunctionDeclaration": - case "ClassDeclaration": - return true; - case "VariableDeclaration": - return node.kind !== "var"; - default: - return false; - } - } - - return { - "SwitchCase": function(node) { - for (var i = 0; i < node.consequent.length; i++) { - var statement = node.consequent[i]; - if (isLexicalDeclaration(statement)) { - context.report({ - node: node, - message: "Unexpected lexical declaration in case block." - }); - } - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-catch-shadow.js b/node_modules/eslint/lib/rules/no-catch-shadow.js deleted file mode 100644 index 88eeb02..0000000 --- a/node_modules/eslint/lib/rules/no-catch-shadow.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @fileoverview Rule to flag variable leak in CatchClauses in IE 8 and earlier - * @author Ian Christian Myers - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Check if the parameters are been shadowed - * @param {object} scope current scope - * @param {string} name parameter name - * @returns {boolean} True is its been shadowed - */ - function paramIsShadowing(scope, name) { - return astUtils.getVariableByName(scope, name) !== null; - } - - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- - - return { - - "CatchClause": function(node) { - var scope = context.getScope(); - - // When blockBindings is enabled, CatchClause creates its own scope - // so start from one upper scope to exclude the current node - if (scope.block === node) { - scope = scope.upper; - } - - if (paramIsShadowing(scope, node.param.name)) { - context.report(node, "Value of '{{name}}' may be overwritten in IE 8 and earlier.", - { name: node.param.name }); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-class-assign.js b/node_modules/eslint/lib/rules/no-class-assign.js deleted file mode 100644 index fe3b56c..0000000 --- a/node_modules/eslint/lib/rules/no-class-assign.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @fileoverview A rule to disallow modifying variables of class declarations - * @author Toru Nagashima - * @copyright 2015 Toru Nagashima. All rights reserved. - */ - -"use strict"; - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Finds and reports references that are non initializer and writable. - * @param {Variable} variable - A variable to check. - * @returns {void} - */ - function checkVariable(variable) { - astUtils.getModifyingReferences(variable.references).forEach(function(reference) { - context.report( - reference.identifier, - "`{{name}}` is a class.", - {name: reference.identifier.name}); - - }); - } - - /** - * Finds and reports references that are non initializer and writable. - * @param {ASTNode} node - A ClassDeclaration/ClassExpression node to check. - * @returns {void} - */ - function checkForClass(node) { - context.getDeclaredVariables(node).forEach(checkVariable); - } - - return { - "ClassDeclaration": checkForClass, - "ClassExpression": checkForClass - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-cond-assign.js b/node_modules/eslint/lib/rules/no-cond-assign.js deleted file mode 100644 index c83afca..0000000 --- a/node_modules/eslint/lib/rules/no-cond-assign.js +++ /dev/null @@ -1,133 +0,0 @@ -/** - * @fileoverview Rule to flag assignment in a conditional statement's test expression - * @author Stephen Murray - */ -"use strict"; - -var NODE_DESCRIPTIONS = { - "DoWhileStatement": "a 'do...while' statement", - "ForStatement": "a 'for' statement", - "IfStatement": "an 'if' statement", - "WhileStatement": "a 'while' statement" -}; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var prohibitAssign = (context.options[0] || "except-parens"); - - /** - * Check whether an AST node is the test expression for a conditional statement. - * @param {!Object} node The node to test. - * @returns {boolean} `true` if the node is the text expression for a conditional statement; otherwise, `false`. - */ - function isConditionalTestExpression(node) { - return node.parent && - node.parent.test && - node === node.parent.test; - } - - /** - * Given an AST node, perform a bottom-up search for the first ancestor that represents a conditional statement. - * @param {!Object} node The node to use at the start of the search. - * @returns {?Object} The closest ancestor node that represents a conditional statement. - */ - function findConditionalAncestor(node) { - var currentAncestor = node; - - do { - if (isConditionalTestExpression(currentAncestor)) { - return currentAncestor.parent; - } - } while ((currentAncestor = currentAncestor.parent)); - - return null; - } - - /** - * Check whether the code represented by an AST node is enclosed in parentheses. - * @param {!Object} node The node to test. - * @returns {boolean} `true` if the code is enclosed in parentheses; otherwise, `false`. - */ - function isParenthesised(node) { - var previousToken = context.getTokenBefore(node), - nextToken = context.getTokenAfter(node); - - return previousToken.value === "(" && previousToken.range[1] <= node.range[0] && - nextToken.value === ")" && nextToken.range[0] >= node.range[1]; - } - - /** - * Check whether the code represented by an AST node is enclosed in two sets of parentheses. - * @param {!Object} node The node to test. - * @returns {boolean} `true` if the code is enclosed in two sets of parentheses; otherwise, `false`. - */ - function isParenthesisedTwice(node) { - var previousToken = context.getTokenBefore(node, 1), - nextToken = context.getTokenAfter(node, 1); - - return isParenthesised(node) && - previousToken.value === "(" && previousToken.range[1] <= node.range[0] && - nextToken.value === ")" && nextToken.range[0] >= node.range[1]; - } - - /** - * Check a conditional statement's test expression for top-level assignments that are not enclosed in parentheses. - * @param {!Object} node The node for the conditional statement. - * @returns {void} - */ - function testForAssign(node) { - if (node.test && - (node.test.type === "AssignmentExpression") && - (node.type === "ForStatement" ? - !isParenthesised(node.test) : - !isParenthesisedTwice(node.test) - ) - ) { - // must match JSHint's error message - context.report({ - node: node, - loc: node.test.loc.start, - message: "Expected a conditional expression and instead saw an assignment." - }); - } - } - - /** - * Check whether an assignment expression is descended from a conditional statement's test expression. - * @param {!Object} node The node for the assignment expression. - * @returns {void} - */ - function testForConditionalAncestor(node) { - var ancestor = findConditionalAncestor(node); - - if (ancestor) { - context.report(ancestor, "Unexpected assignment within {{type}}.", { - type: NODE_DESCRIPTIONS[ancestor.type] || ancestor.type - }); - } - } - - if (prohibitAssign === "always") { - return { - "AssignmentExpression": testForConditionalAncestor - }; - } - - return { - "DoWhileStatement": testForAssign, - "ForStatement": testForAssign, - "IfStatement": testForAssign, - "WhileStatement": testForAssign - }; - -}; - -module.exports.schema = [ - { - "enum": ["except-parens", "always"] - } -]; diff --git a/node_modules/eslint/lib/rules/no-console.js b/node_modules/eslint/lib/rules/no-console.js deleted file mode 100644 index 5de6ada..0000000 --- a/node_modules/eslint/lib/rules/no-console.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @fileoverview Rule to flag use of console object - * @author Nicholas C. Zakas - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "MemberExpression": function(node) { - - if (node.object.name === "console") { - context.report(node, "Unexpected console statement."); - } - - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-const-assign.js b/node_modules/eslint/lib/rules/no-const-assign.js deleted file mode 100644 index 47e73b8..0000000 --- a/node_modules/eslint/lib/rules/no-const-assign.js +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @fileoverview A rule to disallow modifying variables that are declared using `const` - * @author Toru Nagashima - * @copyright 2015 Toru Nagashima. All rights reserved. - */ - -"use strict"; - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Finds and reports references that are non initializer and writable. - * @param {Variable} variable - A variable to check. - * @returns {void} - */ - function checkVariable(variable) { - astUtils.getModifyingReferences(variable.references).forEach(function(reference) { - context.report( - reference.identifier, - "`{{name}}` is constant.", - {name: reference.identifier.name}); - }); - } - - return { - "VariableDeclaration": function(node) { - if (node.kind === "const") { - context.getDeclaredVariables(node).forEach(checkVariable); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-constant-condition.js b/node_modules/eslint/lib/rules/no-constant-condition.js deleted file mode 100644 index 0fe0845..0000000 --- a/node_modules/eslint/lib/rules/no-constant-condition.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * @fileoverview Rule to flag use constant conditions - * @author Christian Schulz - * @copyright 2014 Christian Schulz. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Checks if a node has a constant truthiness value. - * @param {ASTNode} node The AST node to check. - * @returns {Bool} true when node's truthiness is constant - * @private - */ - function isConstant(node) { - switch (node.type) { - case "Literal": - case "ArrowFunctionExpression": - case "FunctionExpression": - case "ObjectExpression": - case "ArrayExpression": - return true; - case "UnaryExpression": - return isConstant(node.argument); - case "BinaryExpression": - case "LogicalExpression": - return isConstant(node.left) && isConstant(node.right); - case "AssignmentExpression": - return (node.operator === "=") && isConstant(node.right); - case "SequenceExpression": - return isConstant(node.expressions[node.expressions.length - 1]); - // no default - } - return false; - } - - /** - * Reports when the given node contains a constant condition. - * @param {ASTNode} node The AST node to check. - * @returns {void} - * @private - */ - function checkConstantCondition(node) { - if (node.test && isConstant(node.test)) { - context.report(node, "Unexpected constant condition."); - } - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - "ConditionalExpression": checkConstantCondition, - "IfStatement": checkConstantCondition, - "WhileStatement": checkConstantCondition, - "DoWhileStatement": checkConstantCondition, - "ForStatement": checkConstantCondition - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-continue.js b/node_modules/eslint/lib/rules/no-continue.js deleted file mode 100644 index 89fa184..0000000 --- a/node_modules/eslint/lib/rules/no-continue.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @fileoverview Rule to flag use of continue statement - * @author Borislav Zhivkov - * @copyright 2015 Borislav Zhivkov. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - "ContinueStatement": function(node) { - context.report(node, "Unexpected use of continue statement"); - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-control-regex.js b/node_modules/eslint/lib/rules/no-control-regex.js deleted file mode 100644 index 29c27fa..0000000 --- a/node_modules/eslint/lib/rules/no-control-regex.js +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @fileoverview Rule to forbid control charactes from regular expressions. - * @author Nicholas C. Zakas - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Get the regex expression - * @param {ASTNode} node node to evaluate - * @returns {*} Regex if found else null - * @private - */ - function getRegExp(node) { - - if (node.value instanceof RegExp) { - return node.value; - } else if (typeof node.value === "string") { - - var parent = context.getAncestors().pop(); - if ((parent.type === "NewExpression" || parent.type === "CallExpression") && - parent.callee.type === "Identifier" && parent.callee.name === "RegExp") { - - // there could be an invalid regular expression string - try { - return new RegExp(node.value); - } catch (ex) { - return null; - } - - } - } else { - return null; - } - - } - - - - return { - - "Literal": function(node) { - - var computedValue, - regex = getRegExp(node); - - if (regex) { - computedValue = regex.toString(); - if (/[\x00-\x1f]/.test(computedValue)) { - context.report(node, "Unexpected control character in regular expression."); - } - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-debugger.js b/node_modules/eslint/lib/rules/no-debugger.js deleted file mode 100644 index 7d86e76..0000000 --- a/node_modules/eslint/lib/rules/no-debugger.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @fileoverview Rule to flag use of a debugger statement - * @author Nicholas C. Zakas - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - "DebuggerStatement": function(node) { - context.report(node, "Unexpected 'debugger' statement."); - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-delete-var.js b/node_modules/eslint/lib/rules/no-delete-var.js deleted file mode 100644 index d6ffbd1..0000000 --- a/node_modules/eslint/lib/rules/no-delete-var.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @fileoverview Rule to flag when deleting variables - * @author Ilya Volodin - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "UnaryExpression": function(node) { - if (node.operator === "delete" && node.argument.type === "Identifier") { - context.report(node, "Variables should not be deleted."); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-div-regex.js b/node_modules/eslint/lib/rules/no-div-regex.js deleted file mode 100644 index 61e7a1c..0000000 --- a/node_modules/eslint/lib/rules/no-div-regex.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @fileoverview Rule to check for ambiguous div operator in regexes - * @author Matt DuVall - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "Literal": function(node) { - var token = context.getFirstToken(node); - - if (token.type === "RegularExpression" && token.value[1] === "=") { - context.report(node, "A regular expression literal can be confused with '/='."); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-dupe-args.js b/node_modules/eslint/lib/rules/no-dupe-args.js deleted file mode 100644 index 80b52ca..0000000 --- a/node_modules/eslint/lib/rules/no-dupe-args.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * @fileoverview Rule to flag duplicate arguments - * @author Jamund Ferguson - * @copyright 2015 Jamund Ferguson. All rights reserved. - * @copyright 2015 Toru Nagashima. All rights reserved. - * See LICENSE file in root directory for full license. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Checks whether or not a given definition is a parameter's. - * @param {escope.DefEntry} def - A definition to check. - * @returns {boolean} `true` if the definition is a parameter's. - */ - function isParameter(def) { - return def.type === "Parameter"; - } - - /** - * Determines if a given node has duplicate parameters. - * @param {ASTNode} node The node to check. - * @returns {void} - * @private - */ - function checkParams(node) { - var variables = context.getDeclaredVariables(node); - var keyMap = Object.create(null); - - for (var i = 0; i < variables.length; ++i) { - var variable = variables[i]; - - // TODO(nagashima): Remove this duplication check after https://github.com/estools/escope/pull/79 - var key = "$" + variable.name; // to avoid __proto__. - if (!isParameter(variable.defs[0]) || keyMap[key]) { - continue; - } - keyMap[key] = true; - - // Checks and reports duplications. - var defs = variable.defs.filter(isParameter); - if (defs.length >= 2) { - context.report({ - node: node, - message: "Duplicate param '{{name}}'.", - data: {name: variable.name} - }); - } - } - } - - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- - - return { - "FunctionDeclaration": checkParams, - "FunctionExpression": checkParams - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-dupe-class-members.js b/node_modules/eslint/lib/rules/no-dupe-class-members.js deleted file mode 100644 index c3adb2e..0000000 --- a/node_modules/eslint/lib/rules/no-dupe-class-members.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - * @fileoverview A rule to disallow duplicate name in class members. - * @author Toru Nagashima - * @copyright 2015 Toru Nagashima. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var stack = []; - - /** - * Gets state of a given member name. - * @param {string} name - A name of a member. - * @param {boolean} isStatic - A flag which specifies that is a static member. - * @returns {object} A state of a given member name. - * - retv.init {boolean} A flag which shows the name is declared as normal member. - * - retv.get {boolean} A flag which shows the name is declared as getter. - * - retv.set {boolean} A flag which shows the name is declared as setter. - */ - function getState(name, isStatic) { - var stateMap = stack[stack.length - 1]; - var key = "$" + name; // to avoid "__proto__". - - if (!stateMap[key]) { - stateMap[key] = { - nonStatic: {init: false, get: false, set: false}, - static: {init: false, get: false, set: false} - }; - } - - return stateMap[key][isStatic ? "static" : "nonStatic"]; - } - - return { - // Initializes the stack of state of member declarations. - "Program": function() { - stack = []; - }, - - // Initializes state of member declarations for the class. - "ClassBody": function() { - stack.push(Object.create(null)); - }, - - // Disposes the state for the class. - "ClassBody:exit": function() { - stack.pop(); - }, - - // Reports the node if its name has been declared already. - "MethodDefinition": function(node) { - if (node.computed) { - return; - } - - var name = node.key.name; - var state = getState(name, node.static); - var isDuplicate = false; - if (node.kind === "get") { - isDuplicate = (state.init || state.get); - state.get = true; - } else if (node.kind === "set") { - isDuplicate = (state.init || state.set); - state.set = true; - } else { - isDuplicate = (state.init || state.get || state.set); - state.init = true; - } - - if (isDuplicate) { - context.report(node, "Duplicate name \"{{name}}\".", {name: name}); - } - } - }; -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-dupe-keys.js b/node_modules/eslint/lib/rules/no-dupe-keys.js deleted file mode 100644 index e07f081..0000000 --- a/node_modules/eslint/lib/rules/no-dupe-keys.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @fileoverview Rule to flag use of duplicate keys in an object. - * @author Ian Christian Myers - * @copyright 2013 Ian Christian Myers. All rights reserved. - * @copyright 2013 Nicholas C. Zakas. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "ObjectExpression": function(node) { - - // Object that will be a map of properties--safe because we will - // prefix all of the keys. - var nodeProps = Object.create(null); - - node.properties.forEach(function(property) { - - if (property.type !== "Property") { - return; - } - - var keyName = property.key.name || property.key.value, - key = property.kind + "-" + keyName, - checkProperty = (!property.computed || property.key.type === "Literal"); - - if (checkProperty) { - if (nodeProps[key]) { - context.report(node, property.loc.start, "Duplicate key '{{key}}'.", { key: keyName }); - } else { - nodeProps[key] = true; - } - } - }); - - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-duplicate-case.js b/node_modules/eslint/lib/rules/no-duplicate-case.js deleted file mode 100644 index 72677f4..0000000 --- a/node_modules/eslint/lib/rules/no-duplicate-case.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @fileoverview Rule to disallow a duplicate case label. - * @author Dieter Oberkofler - * @author Burak Yigit Kaya - * @copyright 2015 Dieter Oberkofler. All rights reserved. - * @copyright 2015 Burak Yigit Kaya. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - "SwitchStatement": function(node) { - var mapping = {}; - - node.cases.forEach(function(switchCase) { - var key = context.getSource(switchCase.test); - if (mapping[key]) { - context.report(switchCase, "Duplicate case label."); - } else { - mapping[key] = switchCase; - } - }); - } - }; -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-else-return.js b/node_modules/eslint/lib/rules/no-else-return.js deleted file mode 100644 index 29b5384..0000000 --- a/node_modules/eslint/lib/rules/no-else-return.js +++ /dev/null @@ -1,144 +0,0 @@ -/** - * @fileoverview Rule to flag `else` after a `return` in `if` - * @author Ian Christian Myers - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Display the context report if rule is violated - * - * @param {Node} node The 'else' node - * @returns {void} - */ - function displayReport(node) { - context.report(node, "Unexpected 'else' after 'return'."); - } - - /** - * Check to see if the node is a ReturnStatement - * - * @param {Node} node The node being evaluated - * @returns {boolean} True if node is a return - */ - function checkForReturn(node) { - return node.type === "ReturnStatement"; - } - - /** - * Naive return checking, does not iterate through the whole - * BlockStatement because we make the assumption that the ReturnStatement - * will be the last node in the body of the BlockStatement. - * - * @param {Node} node The consequent/alternate node - * @returns {boolean} True if it has a return - */ - function naiveHasReturn(node) { - if (node.type === "BlockStatement") { - var body = node.body, - lastChildNode = body[body.length - 1]; - - return lastChildNode && checkForReturn(lastChildNode); - } - return checkForReturn(node); - } - - /** - * Check to see if the node is valid for evaluation, - * meaning it has an else and not an else-if - * - * @param {Node} node The node being evaluated - * @returns {boolean} True if the node is valid - */ - function hasElse(node) { - return node.alternate && node.consequent && node.alternate.type !== "IfStatement"; - } - - /** - * If the consequent is an IfStatement, check to see if it has an else - * and both its consequent and alternate path return, meaning this is - * a nested case of rule violation. If-Else not considered currently. - * - * @param {Node} node The consequent node - * @returns {boolean} True if this is a nested rule violation - */ - function checkForIf(node) { - return node.type === "IfStatement" && hasElse(node) && - naiveHasReturn(node.alternate) && naiveHasReturn(node.consequent); - } - - /** - * Check the consequent/body node to make sure it is not - * a ReturnStatement or an IfStatement that returns on both - * code paths. - * - * @param {Node} node The consequent or body node - * @param {Node} alternate The alternate node - * @returns {boolean} `true` if it is a Return/If node that always returns. - */ - function checkForReturnOrIf(node) { - return checkForReturn(node) || checkForIf(node); - } - - - /** - * Check whether a node returns in every codepath. - * @param {Node} node The node to be checked - * @returns {boolean} `true` if it returns on every codepath. - */ - function alwaysReturns(node) { - // If we have a BlockStatement, check each consequent body node. - if (node.type === "BlockStatement") { - return node.body.some(checkForReturnOrIf); - // If not a block statement, make sure the consequent isn't a ReturnStatement - // or an IfStatement with returns on both paths - } else { - return checkForReturnOrIf(node); - } - } - - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- - - return { - - "IfStatement": function(node) { - var parent = context.getAncestors().pop(), - consequents, - alternate; - - // Only "top-level" if statements are checked, meaning the first `if` - // in a `if-else-if-...` chain. - if (parent.type === "IfStatement" && parent.alternate === node) { - return; - } - - for (consequents = []; node.type === "IfStatement"; node = node.alternate) { - if (!node.alternate) { - return; - } - consequents.push(node.consequent); - alternate = node.alternate; - } - - if (consequents.every(alwaysReturns)) { - displayReport(alternate); - } - } - - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-empty-character-class.js b/node_modules/eslint/lib/rules/no-empty-character-class.js deleted file mode 100644 index b201da4..0000000 --- a/node_modules/eslint/lib/rules/no-empty-character-class.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @fileoverview Rule to flag the use of empty character classes in regular expressions - * @author Ian Christian Myers - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/* -plain-English description of the following regexp: -0. `^` fix the match at the beginning of the string -1. `\/`: the `/` that begins the regexp -2. `([^\\[]|\\.|\[([^\\\]]|\\.)+\])*`: regexp contents; 0 or more of the following - 2.0. `[^\\[]`: any character that's not a `\` or a `[` (anything but escape sequences and character classes) - 2.1. `\\.`: an escape sequence - 2.2. `\[([^\\\]]|\\.)+\]`: a character class that isn't empty -3. `\/` the `/` that ends the regexp -4. `[gimuy]*`: optional regexp flags -5. `$`: fix the match at the end of the string -*/ -var regex = /^\/([^\\[]|\\.|\[([^\\\]]|\\.)+\])*\/[gimuy]*$/; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "Literal": function(node) { - var token = context.getFirstToken(node); - if (token.type === "RegularExpression" && !regex.test(token.value)) { - context.report(node, "Empty class."); - } - } - - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-empty-label.js b/node_modules/eslint/lib/rules/no-empty-label.js deleted file mode 100644 index 1265600..0000000 --- a/node_modules/eslint/lib/rules/no-empty-label.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @fileoverview Rule to flag when label is not used for a loop or switch - * @author Ilya Volodin - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "LabeledStatement": function(node) { - var type = node.body.type; - - if (type !== "ForStatement" && type !== "WhileStatement" && type !== "DoWhileStatement" && type !== "SwitchStatement" && type !== "ForInStatement" && type !== "ForOfStatement") { - context.report(node, "Unexpected label \"{{l}}\"", {l: node.label.name}); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-empty-pattern.js b/node_modules/eslint/lib/rules/no-empty-pattern.js deleted file mode 100644 index aa8515a..0000000 --- a/node_modules/eslint/lib/rules/no-empty-pattern.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @fileoverview Rule to disallow an empty pattern - * @author Alberto Rodríguez - * @copyright 2015 Alberto Rodríguez. All rights reserved. - * See LICENSE file in root directory for full license. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - return { - "ObjectPattern": function(node) { - if (node.properties.length === 0) { - context.report(node, "Unexpected empty object pattern."); - } - }, - "ArrayPattern": function(node) { - if (node.elements.length === 0) { - context.report(node, "Unexpected empty array pattern."); - } - } - }; -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-empty.js b/node_modules/eslint/lib/rules/no-empty.js deleted file mode 100644 index 7f1adf5..0000000 --- a/node_modules/eslint/lib/rules/no-empty.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @fileoverview Rule to flag use of an empty block statement - * @author Nicholas C. Zakas - * @copyright Nicholas C. Zakas. All rights reserved. - * @copyright 2015 Dieter Oberkofler. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "BlockStatement": function(node) { - var parent = node.parent, - parentType = parent.type; - - // if the body is not empty, we can just return immediately - if (node.body.length !== 0) { - return; - } - - // a function is generally allowed to be empty - if (parentType === "FunctionDeclaration" || parentType === "FunctionExpression" || parentType === "ArrowFunctionExpression") { - return; - } - - // any other block is only allowed to be empty, if it contains a comment - if (context.getComments(node).trailing.length > 0) { - return; - } - - context.report(node, "Empty block statement."); - }, - - "SwitchStatement": function(node) { - - if (typeof node.cases === "undefined" || node.cases.length === 0) { - context.report(node, "Empty switch statement."); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-eq-null.js b/node_modules/eslint/lib/rules/no-eq-null.js deleted file mode 100644 index 92d8892..0000000 --- a/node_modules/eslint/lib/rules/no-eq-null.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @fileoverview Rule to flag comparisons to null without a type-checking - * operator. - * @author Ian Christian Myers - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "BinaryExpression": function(node) { - var badOperator = node.operator === "==" || node.operator === "!="; - - if (node.right.type === "Literal" && node.right.raw === "null" && badOperator || - node.left.type === "Literal" && node.left.raw === "null" && badOperator) { - context.report(node, "Use ‘===’ to compare with ‘null’."); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-eval.js b/node_modules/eslint/lib/rules/no-eval.js deleted file mode 100644 index 2347abf..0000000 --- a/node_modules/eslint/lib/rules/no-eval.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @fileoverview Rule to flag use of eval() statement - * @author Nicholas C. Zakas - * @copyright 2015 Mathias Schreck. All rights reserved. - * @copyright 2013 Nicholas C. Zakas. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - "CallExpression": function(node) { - if (node.callee.name === "eval") { - context.report(node, "eval can be harmful."); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-ex-assign.js b/node_modules/eslint/lib/rules/no-ex-assign.js deleted file mode 100644 index e658e47..0000000 --- a/node_modules/eslint/lib/rules/no-ex-assign.js +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @fileoverview Rule to flag assignment of the exception parameter - * @author Stephen Murray - */ - -"use strict"; - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Finds and reports references that are non initializer and writable. - * @param {Variable} variable - A variable to check. - * @returns {void} - */ - function checkVariable(variable) { - astUtils.getModifyingReferences(variable.references).forEach(function(reference) { - context.report( - reference.identifier, - "Do not assign to the exception parameter."); - }); - } - - return { - "CatchClause": function(node) { - context.getDeclaredVariables(node).forEach(checkVariable); - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-extend-native.js b/node_modules/eslint/lib/rules/no-extend-native.js deleted file mode 100644 index 49e139a..0000000 --- a/node_modules/eslint/lib/rules/no-extend-native.js +++ /dev/null @@ -1,100 +0,0 @@ -/** - * @fileoverview Rule to flag adding properties to native object's prototypes. - * @author David Nelson - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var globals = require("globals"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var config = context.options[0] || {}; - var exceptions = config.exceptions || []; - var modifiedBuiltins = Object.keys(globals.builtin).filter(function(builtin) { - return builtin[0].toUpperCase() === builtin[0]; - }); - - if (exceptions.length) { - modifiedBuiltins = modifiedBuiltins.filter(function(builtIn) { - return exceptions.indexOf(builtIn) === -1; - }); - } - - return { - - // handle the Array.prototype.extra style case - "AssignmentExpression": function(node) { - var lhs = node.left, affectsProto; - - if (lhs.type !== "MemberExpression" || lhs.object.type !== "MemberExpression") { - return; - } - - affectsProto = lhs.object.computed ? - lhs.object.property.type === "Literal" && lhs.object.property.value === "prototype" : - lhs.object.property.name === "prototype"; - - if (!affectsProto) { - return; - } - - modifiedBuiltins.forEach(function(builtin) { - if (lhs.object.object.name === builtin) { - context.report(node, builtin + " prototype is read only, properties should not be added."); - } - }); - }, - - // handle the Object.definePropert[y|ies](Array.prototype) case - "CallExpression": function(node) { - - var callee = node.callee, - subject, - object; - - // only worry about Object.definePropert[y|ies] - if (callee.type === "MemberExpression" && - callee.object.name === "Object" && - (callee.property.name === "defineProperty" || callee.property.name === "defineProperties")) { - - // verify the object being added to is a native prototype - subject = node.arguments[0]; - object = subject && subject.object; - if (object && - object.type === "Identifier" && - (modifiedBuiltins.indexOf(object.name) > -1) && - subject.property.name === "prototype") { - - context.report(node, object.name + " prototype is read only, properties should not be added."); - } - } - - } - }; - -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "exceptions": { - "type": "array", - "items": { - "type": "string" - }, - "uniqueItems": true - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/no-extra-bind.js b/node_modules/eslint/lib/rules/no-extra-bind.js deleted file mode 100644 index 6e16a53..0000000 --- a/node_modules/eslint/lib/rules/no-extra-bind.js +++ /dev/null @@ -1,84 +0,0 @@ -/** - * @fileoverview Rule to flag unnecessary bind calls - * @author Bence Dányi - * @copyright 2014 Bence Dányi. All rights reserved. - * See LICENSE in root directory for full license. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var scope = [{ - depth: -1, - found: 0 - }]; - - /** - * Get the topmost scope - * @returns {Object} The topmost scope - */ - function getTopScope() { - return scope[scope.length - 1]; - } - - /** - * Increment the depth of the top scope - * @returns {void} - */ - function incrementScopeDepth() { - var top = getTopScope(); - top.depth++; - } - - /** - * Decrement the depth of the top scope - * @returns {void} - */ - function decrementScopeDepth() { - var top = getTopScope(); - top.depth--; - } - - return { - "CallExpression": function(node) { - if (node.arguments.length === 1 && - node.callee.type === "MemberExpression" && - node.callee.property.name === "bind" && - /FunctionExpression$/.test(node.callee.object.type)) { - scope.push({ - call: node, - depth: -1, - found: 0 - }); - } - }, - "CallExpression:exit": function(node) { - var top = getTopScope(), - isArrowFunction = node.callee.type === "MemberExpression" && node.callee.object.type === "ArrowFunctionExpression"; - - if (top.call === node && (top.found === 0 || isArrowFunction)) { - context.report(node, "The function binding is unnecessary."); - scope.pop(); - } - }, - "ArrowFunctionExpression": incrementScopeDepth, - "ArrowFunctionExpression:exit": decrementScopeDepth, - "FunctionExpression": incrementScopeDepth, - "FunctionExpression:exit": decrementScopeDepth, - "FunctionDeclaration": incrementScopeDepth, - "FunctionDeclaration:exit": decrementScopeDepth, - "ThisExpression": function() { - var top = getTopScope(); - if (top.depth === 0) { - top.found++; - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-extra-boolean-cast.js b/node_modules/eslint/lib/rules/no-extra-boolean-cast.js deleted file mode 100644 index 68c39fb..0000000 --- a/node_modules/eslint/lib/rules/no-extra-boolean-cast.js +++ /dev/null @@ -1,71 +0,0 @@ -/** - * @fileoverview Rule to flag unnecessary double negation in Boolean contexts - * @author Brandon Mills - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - "UnaryExpression": function(node) { - var ancestors = context.getAncestors(), - parent = ancestors.pop(), - grandparent = ancestors.pop(); - - // Exit early if it's guaranteed not to match - if (node.operator !== "!" || - parent.type !== "UnaryExpression" || - parent.operator !== "!") { - return; - } - - // if () ... - if (grandparent.type === "IfStatement") { - context.report(node, "Redundant double negation in an if statement condition."); - - // do ... while () - } else if (grandparent.type === "DoWhileStatement") { - context.report(node, "Redundant double negation in a do while loop condition."); - - // while () ... - } else if (grandparent.type === "WhileStatement") { - context.report(node, "Redundant double negation in a while loop condition."); - - // ? ... : ... - } else if ((grandparent.type === "ConditionalExpression" && - parent === grandparent.test)) { - context.report(node, "Redundant double negation in a ternary condition."); - - // for (...; ; ...) ... - } else if ((grandparent.type === "ForStatement" && - parent === grandparent.test)) { - context.report(node, "Redundant double negation in a for loop condition."); - - // ! - } else if ((grandparent.type === "UnaryExpression" && - grandparent.operator === "!")) { - context.report(node, "Redundant multiple negation."); - - // Boolean() - } else if ((grandparent.type === "CallExpression" && - grandparent.callee.type === "Identifier" && - grandparent.callee.name === "Boolean")) { - context.report(node, "Redundant double negation in call to Boolean()."); - - // new Boolean() - } else if ((grandparent.type === "NewExpression" && - grandparent.callee.type === "Identifier" && - grandparent.callee.name === "Boolean")) { - context.report(node, "Redundant double negation in Boolean constructor call."); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-extra-parens.js b/node_modules/eslint/lib/rules/no-extra-parens.js deleted file mode 100644 index 29a716d..0000000 --- a/node_modules/eslint/lib/rules/no-extra-parens.js +++ /dev/null @@ -1,481 +0,0 @@ -/** - * @fileoverview Disallow parenthesising higher precedence subexpressions. - * @author Michael Ficarra - * @copyright 2014 Michael Ficarra. All rights reserved. - * See LICENSE file in root directory for full license. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var ALL_NODES = context.options[0] !== "functions"; - - /** - * Determines if this rule should be enforced for a node given the current configuration. - * @param {ASTNode} node - The node to be checked. - * @returns {boolean} True if the rule should be enforced for this node. - * @private - */ - function ruleApplies(node) { - return ALL_NODES || node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression"; - } - - /** - * Determines if a node is surrounded by parentheses. - * @param {ASTNode} node - The node to be checked. - * @returns {boolean} True if the node is parenthesised. - * @private - */ - function isParenthesised(node) { - var previousToken = context.getTokenBefore(node), - nextToken = context.getTokenAfter(node); - - return previousToken && nextToken && - previousToken.value === "(" && previousToken.range[1] <= node.range[0] && - nextToken.value === ")" && nextToken.range[0] >= node.range[1]; - } - - /** - * Determines if a node is surrounded by parentheses twice. - * @param {ASTNode} node - The node to be checked. - * @returns {boolean} True if the node is doubly parenthesised. - * @private - */ - function isParenthesisedTwice(node) { - var previousToken = context.getTokenBefore(node, 1), - nextToken = context.getTokenAfter(node, 1); - - return isParenthesised(node) && previousToken && nextToken && - previousToken.value === "(" && previousToken.range[1] <= node.range[0] && - nextToken.value === ")" && nextToken.range[0] >= node.range[1]; - } - - /** - * Determines if a node is surrounded by (potentially) invalid parentheses. - * @param {ASTNode} node - The node to be checked. - * @returns {boolean} True if the node is incorrectly parenthesised. - * @private - */ - function hasExcessParens(node) { - return ruleApplies(node) && isParenthesised(node); - } - - /** - * Determines if a node that is expected to be parenthesised is surrounded by - * (potentially) invalid extra parentheses. - * @param {ASTNode} node - The node to be checked. - * @returns {boolean} True if the node is has an unexpected extra pair of parentheses. - * @private - */ - function hasDoubleExcessParens(node) { - return ruleApplies(node) && isParenthesisedTwice(node); - } - - /** - * Checks whether or not a given node is located at the head of ExpressionStatement. - * @param {ASTNode} node - A node to check. - * @returns {boolean} `true` if the node is located at the head of ExpressionStatement. - */ - function isHeadOfExpressionStatement(node) { - var parent = node.parent; - while (parent) { - switch (parent.type) { - case "SequenceExpression": - if (parent.expressions[0] !== node || isParenthesised(node)) { - return false; - } - break; - - case "UnaryExpression": - case "UpdateExpression": - if (parent.prefix || isParenthesised(node)) { - return false; - } - break; - - case "BinaryExpression": - case "LogicalExpression": - if (parent.left !== node || isParenthesised(node)) { - return false; - } - break; - - case "ConditionalExpression": - if (parent.test !== node || isParenthesised(node)) { - return false; - } - break; - - case "CallExpression": - if (parent.callee !== node || isParenthesised(node)) { - return false; - } - break; - - case "MemberExpression": - if (parent.object !== node || isParenthesised(node)) { - return false; - } - break; - - case "ExpressionStatement": - return true; - - default: - return false; - } - - node = parent; - parent = parent.parent; - } - - /* istanbul ignore next */ - throw new Error("unreachable"); - } - - /** - * Get the precedence level based on the node type - * @param {ASTNode} node node to evaluate - * @returns {int} precedence level - * @private - */ - function precedence(node) { - - switch (node.type) { - case "SequenceExpression": - return 0; - - case "AssignmentExpression": - case "ArrowFunctionExpression": - case "YieldExpression": - return 1; - - case "ConditionalExpression": - return 3; - - case "LogicalExpression": - switch (node.operator) { - case "||": - return 4; - case "&&": - return 5; - // no default - } - - /* falls through */ - case "BinaryExpression": - switch (node.operator) { - case "|": - return 6; - case "^": - return 7; - case "&": - return 8; - case "==": - case "!=": - case "===": - case "!==": - return 9; - case "<": - case "<=": - case ">": - case ">=": - case "in": - case "instanceof": - return 10; - case "<<": - case ">>": - case ">>>": - return 11; - case "+": - case "-": - return 12; - case "*": - case "/": - case "%": - return 13; - // no default - } - /* falls through */ - case "UnaryExpression": - return 14; - case "UpdateExpression": - return 15; - case "CallExpression": - // IIFE is allowed to have parens in any position (#655) - if (node.callee.type === "FunctionExpression") { - return -1; - } - return 16; - case "NewExpression": - return 17; - // no default - } - return 18; - } - - /** - * Report the node - * @param {ASTNode} node node to evaluate - * @returns {void} - * @private - */ - function report(node) { - var previousToken = context.getTokenBefore(node); - context.report(node, previousToken.loc.start, "Gratuitous parentheses around expression."); - } - - /** - * Evaluate Unary update - * @param {ASTNode} node node to evaluate - * @returns {void} - * @private - */ - function dryUnaryUpdate(node) { - if (hasExcessParens(node.argument) && precedence(node.argument) >= precedence(node)) { - report(node.argument); - } - } - - /** - * Evaluate a new call - * @param {ASTNode} node node to evaluate - * @returns {void} - * @private - */ - function dryCallNew(node) { - if (hasExcessParens(node.callee) && precedence(node.callee) >= precedence(node) && !( - node.type === "CallExpression" && - node.callee.type === "FunctionExpression" && - // One set of parentheses are allowed for a function expression - !hasDoubleExcessParens(node.callee) - )) { - report(node.callee); - } - if (node.arguments.length === 1) { - if (hasDoubleExcessParens(node.arguments[0]) && precedence(node.arguments[0]) >= precedence({type: "AssignmentExpression"})) { - report(node.arguments[0]); - } - } else { - [].forEach.call(node.arguments, function(arg) { - if (hasExcessParens(arg) && precedence(arg) >= precedence({type: "AssignmentExpression"})) { - report(arg); - } - }); - } - } - - /** - * Evaluate binary logicals - * @param {ASTNode} node node to evaluate - * @returns {void} - * @private - */ - function dryBinaryLogical(node) { - var prec = precedence(node); - if (hasExcessParens(node.left) && precedence(node.left) >= prec) { - report(node.left); - } - if (hasExcessParens(node.right) && precedence(node.right) > prec) { - report(node.right); - } - } - - return { - "ArrayExpression": function(node) { - [].forEach.call(node.elements, function(e) { - if (e && hasExcessParens(e) && precedence(e) >= precedence({type: "AssignmentExpression"})) { - report(e); - } - }); - }, - "ArrowFunctionExpression": function(node) { - if (node.body.type !== "BlockStatement") { - if (node.body.type !== "ObjectExpression" && hasExcessParens(node.body) && precedence(node.body) >= precedence({type: "AssignmentExpression"})) { - report(node.body); - return; - } - - // Object literals *must* be parenthesized - if (node.body.type === "ObjectExpression" && hasDoubleExcessParens(node.body)) { - report(node.body); - return; - } - } - }, - "AssignmentExpression": function(node) { - if (hasExcessParens(node.right) && precedence(node.right) >= precedence(node)) { - report(node.right); - } - }, - "BinaryExpression": dryBinaryLogical, - "CallExpression": dryCallNew, - "ConditionalExpression": function(node) { - if (hasExcessParens(node.test) && precedence(node.test) >= precedence({type: "LogicalExpression", operator: "||"})) { - report(node.test); - } - if (hasExcessParens(node.consequent) && precedence(node.consequent) >= precedence({type: "AssignmentExpression"})) { - report(node.consequent); - } - if (hasExcessParens(node.alternate) && precedence(node.alternate) >= precedence({type: "AssignmentExpression"})) { - report(node.alternate); - } - }, - "DoWhileStatement": function(node) { - if (hasDoubleExcessParens(node.test)) { - report(node.test); - } - }, - "ExpressionStatement": function(node) { - var firstToken; - if (hasExcessParens(node.expression)) { - firstToken = context.getFirstToken(node.expression); - - // Pure object literals ({}) do not need parentheses but - // member expressions do ({}.toString()) - if (( - firstToken.value !== "{" || - node.expression.type === "ObjectExpression" - ) && - // For such as `(function(){}.foo.bar)` - ( - firstToken.value !== "function" || - node.expression.type === "FunctionExpression" - ) && - // For such as `(class{}.foo.bar)` - ( - firstToken.value !== "class" || - node.expression.type === "ClassExpression" - ) - ) { - report(node.expression); - } - } - }, - "ForInStatement": function(node) { - if (hasExcessParens(node.right)) { - report(node.right); - } - }, - "ForOfStatement": function(node) { - if (hasExcessParens(node.right)) { - report(node.right); - } - }, - "ForStatement": function(node) { - if (node.init && hasExcessParens(node.init)) { - report(node.init); - } - - if (node.test && hasExcessParens(node.test)) { - report(node.test); - } - - if (node.update && hasExcessParens(node.update)) { - report(node.update); - } - }, - "IfStatement": function(node) { - if (hasDoubleExcessParens(node.test)) { - report(node.test); - } - }, - "LogicalExpression": dryBinaryLogical, - "MemberExpression": function(node) { - if ( - hasExcessParens(node.object) && - precedence(node.object) >= precedence(node) && - ( - node.computed || - !( - (node.object.type === "Literal" && - typeof node.object.value === "number" && - /^[0-9]+$/.test(context.getFirstToken(node.object).value)) - || - // RegExp literal is allowed to have parens (#1589) - (node.object.type === "Literal" && node.object.regex) - ) - ) && - !( - (node.object.type === "FunctionExpression" || node.object.type === "ClassExpression") && - isHeadOfExpressionStatement(node) && - !hasDoubleExcessParens(node.object) - ) - ) { - report(node.object); - } - if (node.computed && hasExcessParens(node.property)) { - report(node.property); - } - }, - "NewExpression": dryCallNew, - "ObjectExpression": function(node) { - [].forEach.call(node.properties, function(e) { - var v = e.value; - if (v && hasExcessParens(v) && precedence(v) >= precedence({type: "AssignmentExpression"})) { - report(v); - } - }); - }, - "ReturnStatement": function(node) { - if (node.argument && hasExcessParens(node.argument) && - // RegExp literal is allowed to have parens (#1589) - !(node.argument.type === "Literal" && node.argument.regex)) { - report(node.argument); - } - }, - "SequenceExpression": function(node) { - [].forEach.call(node.expressions, function(e) { - if (hasExcessParens(e) && precedence(e) >= precedence(node)) { - report(e); - } - }); - }, - "SwitchCase": function(node) { - if (node.test && hasExcessParens(node.test)) { - report(node.test); - } - }, - "SwitchStatement": function(node) { - if (hasDoubleExcessParens(node.discriminant)) { - report(node.discriminant); - } - }, - "ThrowStatement": function(node) { - if (hasExcessParens(node.argument)) { - report(node.argument); - } - }, - "UnaryExpression": dryUnaryUpdate, - "UpdateExpression": dryUnaryUpdate, - "VariableDeclarator": function(node) { - if (node.init && hasExcessParens(node.init) && - precedence(node.init) >= precedence({type: "AssignmentExpression"}) && - // RegExp literal is allowed to have parens (#1589) - !(node.init.type === "Literal" && node.init.regex)) { - report(node.init); - } - }, - "WhileStatement": function(node) { - if (hasDoubleExcessParens(node.test)) { - report(node.test); - } - }, - "WithStatement": function(node) { - if (hasDoubleExcessParens(node.object)) { - report(node.object); - } - } - }; - -}; - -module.exports.schema = [ - { - "enum": ["all", "functions"] - } -]; diff --git a/node_modules/eslint/lib/rules/no-extra-semi.js b/node_modules/eslint/lib/rules/no-extra-semi.js deleted file mode 100644 index 04c1eca..0000000 --- a/node_modules/eslint/lib/rules/no-extra-semi.js +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @fileoverview Rule to flag use of unnecessary semicolons - * @author Nicholas C. Zakas - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Reports an unnecessary semicolon error. - * @param {Node|Token} nodeOrToken - A node or a token to be reported. - * @returns {void} - */ - function report(nodeOrToken) { - context.report({ - node: nodeOrToken, - message: "Unnecessary semicolon.", - fix: function(fixer) { - return fixer.remove(nodeOrToken); - } - }); - } - - /** - * Checks for a part of a class body. - * This checks tokens from a specified token to a next MethodDefinition or the end of class body. - * - * @param {Token} firstToken - The first token to check. - * @returns {void} - */ - function checkForPartOfClassBody(firstToken) { - for (var token = firstToken; - token.type === "Punctuator" && token.value !== "}"; - token = context.getTokenAfter(token) - ) { - if (token.value === ";") { - report(token); - } - } - } - - return { - /** - * Reports this empty statement, except if the parent node is a loop. - * @param {Node} node - A EmptyStatement node to be reported. - * @returns {void} - */ - "EmptyStatement": function(node) { - var parent = node.parent, - allowedParentTypes = ["ForStatement", "ForInStatement", "ForOfStatement", "WhileStatement", "DoWhileStatement"]; - - if (allowedParentTypes.indexOf(parent.type) === -1) { - report(node); - } - }, - - /** - * Checks tokens from the head of this class body to the first MethodDefinition or the end of this class body. - * @param {Node} node - A ClassBody node to check. - * @returns {void} - */ - "ClassBody": function(node) { - checkForPartOfClassBody(context.getFirstToken(node, 1)); // 0 is `{`. - }, - - /** - * Checks tokens from this MethodDefinition to the next MethodDefinition or the end of this class body. - * @param {Node} node - A MethodDefinition node of the start point. - * @returns {void} - */ - "MethodDefinition": function(node) { - checkForPartOfClassBody(context.getTokenAfter(node)); - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-fallthrough.js b/node_modules/eslint/lib/rules/no-fallthrough.js deleted file mode 100644 index 98334e3..0000000 --- a/node_modules/eslint/lib/rules/no-fallthrough.js +++ /dev/null @@ -1,96 +0,0 @@ -/** - * @fileoverview Rule to flag fall-through cases in switch statements. - * @author Matt DuVall - */ -"use strict"; - - -var FALLTHROUGH_COMMENT = /falls?\s?through/i; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var switches = []; - - return { - - "SwitchCase": function(node) { - - var consequent = node.consequent, - switchData = switches[switches.length - 1], - i, - comments, - comment; - - /* - * Some developers wrap case bodies in blocks, so if there is just one - * node and it's a block statement, check inside. - */ - if (consequent.length === 1 && consequent[0].type === "BlockStatement") { - consequent = consequent[0]; - } - - // checking on previous case - if (!switchData.lastCaseClosed) { - - // a fall through comment will be the last trailing comment of the last case - comments = context.getComments(switchData.lastCase).trailing; - comment = comments[comments.length - 1]; - - // unless the user doesn't like semicolons, in which case it's first leading comment of this case - if (!comment) { - comments = context.getComments(node).leading; - comment = comments[comments.length - 1]; - } - - // check for comment - if (!comment || !FALLTHROUGH_COMMENT.test(comment.value)) { - context.report(node, - "Expected a \"break\" statement before \"{{code}}\".", - { code: node.test ? "case" : "default" }); - } - } - - // now dealing with the current case - switchData.lastCaseClosed = false; - switchData.lastCase = node; - - // try to verify using statements - go backwards as a fast path for the search - if (consequent.length) { - for (i = consequent.length - 1; i >= 0; i--) { - if (/(?:Break|Continue|Return|Throw)Statement/.test(consequent[i].type)) { - switchData.lastCaseClosed = true; - break; - } - } - } else { - // the case statement has no statements, so it must logically fall through - switchData.lastCaseClosed = true; - } - - /* - * Any warnings are triggered when the next SwitchCase occurs. - * There is no need to warn on the last SwitchCase, since it can't - * fall through to anything. - */ - }, - - "SwitchStatement": function(node) { - switches.push({ - node: node, - lastCaseClosed: true, - lastCase: null - }); - }, - - "SwitchStatement:exit": function() { - switches.pop(); - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-floating-decimal.js b/node_modules/eslint/lib/rules/no-floating-decimal.js deleted file mode 100644 index 61a84f5..0000000 --- a/node_modules/eslint/lib/rules/no-floating-decimal.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @fileoverview Rule to flag use of a leading/trailing decimal point in a numeric literal - * @author James Allardice - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - "Literal": function(node) { - - if (typeof node.value === "number") { - if (node.raw.indexOf(".") === 0) { - context.report(node, "A leading decimal point can be confused with a dot."); - } - if (node.raw.indexOf(".") === node.raw.length - 1) { - context.report(node, "A trailing decimal point can be confused with a dot."); - } - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-func-assign.js b/node_modules/eslint/lib/rules/no-func-assign.js deleted file mode 100644 index 642d287..0000000 --- a/node_modules/eslint/lib/rules/no-func-assign.js +++ /dev/null @@ -1,87 +0,0 @@ -/** - * @fileoverview Rule to flag use of function declaration identifiers as variables. - * @author Ian Christian Myers - * @copyright 2013 Ian Christian Myers. All rights reserved. - */ - -"use strict"; - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var unresolved = Object.create(null); - - /** - * Collects unresolved references from the global scope, then creates a map to references from its name. - * Usage of the map is explained at `checkVariable(variable)`. - * @returns {void} - */ - function collectUnresolvedReferences() { - unresolved = Object.create(null); - - var references = context.getScope().through; - for (var i = 0; i < references.length; ++i) { - var reference = references[i]; - var name = reference.identifier.name; - - if (name in unresolved === false) { - unresolved[name] = []; - } - unresolved[name].push(reference); - } - } - - /** - * Reports a reference if is non initializer and writable. - * @param {References} references - Collection of reference to check. - * @returns {void} - */ - function checkReference(references) { - astUtils.getModifyingReferences(references).forEach(function(reference) { - context.report( - reference.identifier, - "'{{name}}' is a function.", - {name: reference.identifier.name}); - }); - } - - /** - * Finds and reports references that are non initializer and writable. - * @param {Variable} variable - A variable to check. - * @returns {void} - */ - function checkVariable(variable) { - if (variable.defs[0].type === "FunctionName") { - // If the function is in global scope, its references are not resolved (by escope's design). - // So when references of the function are nothing, this checks in unresolved. - if (variable.references.length > 0) { - checkReference(variable.references); - } else if (unresolved[variable.name]) { - checkReference(unresolved[variable.name]); - } - } - } - - /** - * Checks parameters of a given function node. - * @param {ASTNode} node - A function node to check. - * @returns {void} - */ - function checkForFunction(node) { - context.getDeclaredVariables(node).forEach(checkVariable); - } - - return { - "Program": collectUnresolvedReferences, - "FunctionDeclaration": checkForFunction, - "FunctionExpression": checkForFunction - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-implicit-coercion.js b/node_modules/eslint/lib/rules/no-implicit-coercion.js deleted file mode 100644 index 595412b..0000000 --- a/node_modules/eslint/lib/rules/no-implicit-coercion.js +++ /dev/null @@ -1,220 +0,0 @@ -/** - * @fileoverview A rule to disallow the type conversions with shorter notations. - * @author Toru Nagashima - * @copyright 2015 Toru Nagashima. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -var INDEX_OF_PATTERN = /^(?:i|lastI)ndexOf$/; - -/** - * Parses and normalizes an option object. - * @param {object} options - An option object to parse. - * @returns {object} The parsed and normalized option object. - */ -function parseOptions(options) { - options = options || {}; - return { - boolean: "boolean" in options ? Boolean(options.boolean) : true, - number: "number" in options ? Boolean(options.number) : true, - string: "string" in options ? Boolean(options.string) : true - }; -} - -/** - * Checks whether or not a node is a double logical nigating. - * @param {ASTNode} node - An UnaryExpression node to check. - * @returns {boolean} Whether or not the node is a double logical nigating. - */ -function isDoubleLogicalNegating(node) { - return ( - node.operator === "!" && - node.argument.type === "UnaryExpression" && - node.argument.operator === "!" - ); -} - -/** - * Checks whether or not a node is a binary negating of `.indexOf()` method calling. - * @param {ASTNode} node - An UnaryExpression node to check. - * @returns {boolean} Whether or not the node is a binary negating of `.indexOf()` method calling. - */ -function isBinaryNegatingOfIndexOf(node) { - return ( - node.operator === "~" && - node.argument.type === "CallExpression" && - node.argument.callee.type === "MemberExpression" && - node.argument.callee.property.type === "Identifier" && - INDEX_OF_PATTERN.test(node.argument.callee.property.name) - ); -} - -/** - * Checks whether or not a node is a multiplying by one. - * @param {BinaryExpression} node - A BinaryExpression node to check. - * @returns {boolean} Whether or not the node is a multiplying by one. - */ -function isMultiplyByOne(node) { - return node.operator === "*" && ( - node.left.type === "Literal" && node.left.value === 1 || - node.right.type === "Literal" && node.right.value === 1 - ); -} - -/** - * Checks whether the result of a node is numeric or not - * @param {ASTNode} node The node to test - * @returns {boolean} true if the node is a number literal or a `Number()`, `parseInt` or `parseFloat` call - */ -function isNumeric(node) { - return ( - node.type === "Literal" && typeof node.value === "number" || - node.type === "CallExpression" && ( - node.callee.name === "Number" || - node.callee.name === "parseInt" || - node.callee.name === "parseFloat" - ) - ); -} - -/** - * Returns the first non-numeric operand in a BinaryExpression. Designed to be - * used from bottom to up since it walks up the BinaryExpression trees using - * node.parent to find the result. - * @param {BinaryExpression} node The BinaryExpression node to be walked up on - * @returns {ASTNode|undefined} The first non-numeric item in the BinaryExpression tree or undefined - */ -function getNonNumericOperand(node) { - var left = node.left, right = node.right; - - if (right.type !== "BinaryExpression" && !isNumeric(right)) { - return right; - } - - if (left.type !== "BinaryExpression" && !isNumeric(left)) { - return left; - } -} - -/** - * Checks whether or not a node is a concatenating with an empty string. - * @param {ASTNode} node - A BinaryExpression node to check. - * @returns {boolean} Whether or not the node is a concatenating with an empty string. - */ -function isConcatWithEmptyString(node) { - return node.operator === "+" && ( - (node.left.type === "Literal" && node.left.value === "") || - (node.right.type === "Literal" && node.right.value === "") - ); -} - -/** - * Checks whether or not a node is appended with an empty string. - * @param {ASTNode} node - An AssignmentExpression node to check. - * @returns {boolean} Whether or not the node is appended with an empty string. - */ -function isAppendEmptyString(node) { - return node.operator === "+=" && node.right.type === "Literal" && node.right.value === ""; -} - -/** - * Gets a node that is the left or right operand of a node, is not the specified literal. - * @param {ASTNode} node - A BinaryExpression node to get. - * @param {any} value - A literal value to check. - * @returns {ASTNode} A node that is the left or right operand of the node, is not the specified literal. - */ -function getOtherOperand(node, value) { - if (node.left.type === "Literal" && node.left.value === value) { - return node.right; - } - return node.left; -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var options = parseOptions(context.options[0]); - - return { - "UnaryExpression": function(node) { - // !!foo - if (options.boolean && isDoubleLogicalNegating(node)) { - context.report( - node, - "use `Boolean({{code}})` instead.", - {code: context.getSource(node.argument.argument)}); - } - - // ~foo.indexOf(bar) - if (options.boolean && isBinaryNegatingOfIndexOf(node)) { - context.report( - node, - "use `{{code}} !== -1` instead.", - {code: context.getSource(node.argument)}); - } - - // +foo - if (options.number && node.operator === "+" && !isNumeric(node.argument)) { - context.report( - node, - "use `Number({{code}})` instead.", - {code: context.getSource(node.argument)}); - } - }, - - // Use `:exit` to prevent double reporting - "BinaryExpression:exit": function(node) { - // 1 * foo - var nonNumericOperand = options.number && isMultiplyByOne(node) && getNonNumericOperand(node); - if (nonNumericOperand) { - context.report( - node, - "use `Number({{code}})` instead.", - {code: context.getSource(nonNumericOperand)}); - } - - // "" + foo - if (options.string && isConcatWithEmptyString(node)) { - context.report( - node, - "use `String({{code}})` instead.", - {code: context.getSource(getOtherOperand(node, ""))}); - } - }, - - "AssignmentExpression": function(node) { - // foo += "" - if (options.string && isAppendEmptyString(node)) { - context.report( - node, - "use `{{code}} = String({{code}})` instead.", - {code: context.getSource(getOtherOperand(node, ""))}); - } - } - }; -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "boolean": { - "type": "boolean" - }, - "number": { - "type": "boolean" - }, - "string": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/no-implied-eval.js b/node_modules/eslint/lib/rules/no-implied-eval.js deleted file mode 100644 index 971b7b4..0000000 --- a/node_modules/eslint/lib/rules/no-implied-eval.js +++ /dev/null @@ -1,143 +0,0 @@ -/** - * @fileoverview Rule to flag use of implied eval via setTimeout and setInterval - * @author James Allardice - * @copyright 2015 Mathias Schreck. All rights reserved. - * @copyright 2013 James Allardice. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var CALLEE_RE = /set(?:Timeout|Interval)|execScript/; - - // Figures out if we should inspect a given binary expression. Is a stack of - // stacks, where the first element in each substack is a CallExpression. - var impliedEvalAncestorsStack = []; - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Get the last element of an array, without modifying arr, like pop(), but non-destructive. - * @param {array} arr What to inspect - * @returns {*} The last element of arr - * @private - */ - function last(arr) { - return arr ? arr[arr.length - 1] : null; - } - - /** - * Checks if the given MemberExpression node is a potentially implied eval identifier on window. - * @param {ASTNode} node The MemberExpression node to check. - * @returns {boolean} Whether or not the given node is potentially an implied eval. - * @private - */ - function isImpliedEvalMemberExpression(node) { - var object = node.object, - property = node.property, - hasImpliedEvalName = CALLEE_RE.test(property.name) || CALLEE_RE.test(property.value); - - return object.name === "window" && hasImpliedEvalName; - } - - /** - * Determines if a node represents a call to a potentially implied eval. - * - * This checks the callee name and that there's an argument, but not the type of the argument. - * - * @param {ASTNode} node The CallExpression to check. - * @returns {boolean} True if the node matches, false if not. - * @private - */ - function isImpliedEvalCallExpression(node) { - var isMemberExpression = (node.callee.type === "MemberExpression"), - isIdentifier = (node.callee.type === "Identifier"), - isImpliedEvalCallee = - (isIdentifier && CALLEE_RE.test(node.callee.name)) || - (isMemberExpression && isImpliedEvalMemberExpression(node.callee)); - - return isImpliedEvalCallee && node.arguments.length; - } - - /** - * Checks that the parent is a direct descendent of an potential implied eval CallExpression, and if the parent is a CallExpression, that we're the first argument. - * @param {ASTNode} node The node to inspect the parent of. - * @returns {boolean} Was the parent a direct descendent, and is the child therefore potentially part of a dangerous argument? - * @private - */ - function hasImpliedEvalParent(node) { - // make sure our parent is marked - return node.parent === last(last(impliedEvalAncestorsStack)) && - // if our parent is a CallExpression, make sure we're the first argument - (node.parent.type !== "CallExpression" || node === node.parent.arguments[0]); - } - - /** - * Checks if our parent is marked as part of an implied eval argument. If - * so, collapses the top of impliedEvalAncestorsStack and reports on the - * original CallExpression. - * @param {ASTNode} node The CallExpression to check. - * @returns {boolean} True if the node matches, false if not. - * @private - */ - function checkString(node) { - if (hasImpliedEvalParent(node)) { - // remove the entire substack, to avoid duplicate reports - var substack = impliedEvalAncestorsStack.pop(); - context.report(substack[0], "Implied eval. Consider passing a function instead of a string."); - } - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - "CallExpression": function(node) { - if (isImpliedEvalCallExpression(node)) { - // call expressions create a new substack - impliedEvalAncestorsStack.push([node]); - } - }, - - "CallExpression:exit": function(node) { - if (node === last(last(impliedEvalAncestorsStack))) { - // destroys the entire sub-stack, rather than just using - // last(impliedEvalAncestorsStack).pop(), as a CallExpression is - // always the bottom of a impliedEvalAncestorsStack substack. - impliedEvalAncestorsStack.pop(); - } - }, - - "BinaryExpression": function(node) { - if (node.operator === "+" && hasImpliedEvalParent(node)) { - last(impliedEvalAncestorsStack).push(node); - } - }, - - "BinaryExpression:exit": function(node) { - if (node === last(last(impliedEvalAncestorsStack))) { - last(impliedEvalAncestorsStack).pop(); - } - }, - - "Literal": function(node) { - if (typeof node.value === "string") { - checkString(node); - } - }, - - "TemplateLiteral": function(node) { - checkString(node); - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-inline-comments.js b/node_modules/eslint/lib/rules/no-inline-comments.js deleted file mode 100644 index 4048802..0000000 --- a/node_modules/eslint/lib/rules/no-inline-comments.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @fileoverview Enforces or disallows inline comments. - * @author Greg Cochard - * @copyright 2014 Greg Cochard. All rights reserved. - */ -"use strict"; - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Will check that comments are not on lines starting with or ending with code - * @param {ASTNode} node The comment node to check - * @private - * @returns {void} - */ - function testCodeAroundComment(node) { - - // Get the whole line and cut it off at the start of the comment - var startLine = String(context.getSourceLines()[node.loc.start.line - 1]); - var endLine = String(context.getSourceLines()[node.loc.end.line - 1]); - - var preamble = startLine.slice(0, node.loc.start.column).trim(); - - // Also check after the comment - var postamble = endLine.slice(node.loc.end.column).trim(); - - // Check that this comment isn't an ESLint directive - var isDirective = astUtils.isDirectiveComment(node); - - // Should be empty if there was only whitespace around the comment - if (!isDirective && (preamble || postamble)) { - context.report(node, "Unexpected comment inline with code."); - } - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - - "LineComment": testCodeAroundComment, - "BlockComment": testCodeAroundComment - - }; -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-inner-declarations.js b/node_modules/eslint/lib/rules/no-inner-declarations.js deleted file mode 100644 index f5503ee..0000000 --- a/node_modules/eslint/lib/rules/no-inner-declarations.js +++ /dev/null @@ -1,78 +0,0 @@ -/** - * @fileoverview Rule to enforce declarations in program or function body root. - * @author Brandon Mills - * @copyright 2014 Brandon Mills. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Find the nearest Program or Function ancestor node. - * @returns {Object} Ancestor's type and distance from node. - */ - function nearestBody() { - var ancestors = context.getAncestors(), - ancestor = ancestors.pop(), - generation = 1; - - while (ancestor && ["Program", "FunctionDeclaration", - "FunctionExpression", "ArrowFunctionExpression" - ].indexOf(ancestor.type) < 0) { - generation += 1; - ancestor = ancestors.pop(); - } - - return { - // Type of containing ancestor - type: ancestor.type, - // Separation between ancestor and node - distance: generation - }; - } - - /** - * Ensure that a given node is at a program or function body's root. - * @param {ASTNode} node Declaration node to check. - * @returns {void} - */ - function check(node) { - var body = nearestBody(node), - valid = ((body.type === "Program" && body.distance === 1) || - body.distance === 2); - - if (!valid) { - context.report(node, "Move {{type}} declaration to {{body}} root.", - { - type: (node.type === "FunctionDeclaration" ? - "function" : "variable"), - body: (body.type === "Program" ? - "program" : "function body") - } - ); - } - } - - return { - - "FunctionDeclaration": check, - "VariableDeclaration": function(node) { - if (context.options[0] === "both" && node.kind === "var") { - check(node); - } - } - - }; - -}; - -module.exports.schema = [ - { - "enum": ["functions", "both"] - } -]; diff --git a/node_modules/eslint/lib/rules/no-invalid-regexp.js b/node_modules/eslint/lib/rules/no-invalid-regexp.js deleted file mode 100644 index d46f9cb..0000000 --- a/node_modules/eslint/lib/rules/no-invalid-regexp.js +++ /dev/null @@ -1,65 +0,0 @@ -/** - * @fileoverview Validate strings passed to the RegExp constructor - * @author Michael Ficarra - * @copyright 2014 Michael Ficarra. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var espree = require("espree"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Check if node is a string - * @param {ASTNode} node node to evaluate - * @returns {boolean} True if its a string - * @private - */ - function isString(node) { - return node && node.type === "Literal" && typeof node.value === "string"; - } - - /** - * Validate strings passed to the RegExp constructor - * @param {ASTNode} node node to evaluate - * @returns {void} - * @private - */ - function check(node) { - if (node.callee.type === "Identifier" && node.callee.name === "RegExp" && isString(node.arguments[0])) { - var flags = isString(node.arguments[1]) ? node.arguments[1].value : ""; - - try { - void new RegExp(node.arguments[0].value); - } catch (e) { - context.report(node, e.message); - } - - if (flags) { - - try { - espree.parse("/./" + flags, { ecmaFeatures: context.ecmaFeatures }); - } catch (ex) { - context.report(node, "Invalid flags supplied to RegExp constructor '" + flags + "'"); - } - } - - } - } - - return { - "CallExpression": check, - "NewExpression": check - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-invalid-this.js b/node_modules/eslint/lib/rules/no-invalid-this.js deleted file mode 100644 index 37c67de..0000000 --- a/node_modules/eslint/lib/rules/no-invalid-this.js +++ /dev/null @@ -1,350 +0,0 @@ -/** - * @fileoverview A rule to disallow `this` keywords outside of classes or class-like objects. - * @author Toru Nagashima - * @copyright 2015 Toru Nagashima. All rights reserved. - * See LICENSE file in root directory for full license. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -var thisTagPattern = /^[\s\*]*@this/m; -var anyFunctionPattern = /^(?:Function(?:Declaration|Expression)|ArrowFunctionExpression)$/; -var bindOrCallOrApplyPattern = /^(?:bind|call|apply)$/; -var arrayOrTypedArrayPattern = /Array$/; -var arrayMethodPattern = /^(?:every|filter|find|findIndex|forEach|map|some)$/; - -/** - * Checks whether or not a node is a constructor. - * @param {ASTNode} node - A function node to check. - * @returns {boolean} Wehether or not a node is a constructor. - */ -function isES5Constructor(node) { - return ( - node.id && - node.id.name[0] === node.id.name[0].toLocaleUpperCase() - ); -} - -/** - * Finds a function node from ancestors of a node. - * @param {ASTNode} node - A start node to find. - * @returns {Node|null} A found function node. - */ -function getUpperFunction(node) { - while (node) { - if (anyFunctionPattern.test(node.type)) { - return node; - } - node = node.parent; - } - return null; -} - -/** - * Checks whether or not a node is callee. - * @param {ASTNode} node - A node to check. - * @returns {boolean} Whether or not the node is callee. - */ -function isCallee(node) { - return node.parent.type === "CallExpression" && node.parent.callee === node; -} - -/** - * Checks whether or not a node is `Reclect.apply`. - * @param {ASTNode} node - A node to check. - * @returns {boolean} Whether or not the node is a `Reclect.apply`. - */ -function isReflectApply(node) { - return ( - node.type === "MemberExpression" && - node.object.type === "Identifier" && - node.object.name === "Reflect" && - node.property.type === "Identifier" && - node.property.name === "apply" && - node.computed === false - ); -} - -/** - * Checks whether or not a node is `Array.from`. - * @param {ASTNode} node - A node to check. - * @returns {boolean} Whether or not the node is a `Array.from`. - */ -function isArrayFrom(node) { - return ( - node.type === "MemberExpression" && - node.object.type === "Identifier" && - arrayOrTypedArrayPattern.test(node.object.name) && - node.property.type === "Identifier" && - node.property.name === "from" && - node.computed === false - ); -} - -/** - * Checks whether or not a node is a method which has `thisArg`. - * @param {ASTNode} node - A node to check. - * @returns {boolean} Whether or not the node is a method which has `thisArg`. - */ -function isMethodWhichHasThisArg(node) { - while (node) { - if (node.type === "Identifier") { - return arrayMethodPattern.test(node.name); - } - if (node.type === "MemberExpression" && !node.computed) { - node = node.property; - continue; - } - - break; - } - - return false; -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var stack = [], - sourceCode = context.getSourceCode(); - - - /** - * Checks whether or not a node has a `@this` tag in its comments. - * @param {ASTNode} node - A node to check. - * @returns {boolean} Whether or not the node has a `@this` tag in its comments. - */ - function hasJSDocThisTag(node) { - var jsdocComment = sourceCode.getJSDocComment(node); - if (jsdocComment && thisTagPattern.test(jsdocComment.value)) { - return true; - } - - // Checks `@this` in its leading comments for callbacks, - // because callbacks don't have its JSDoc comment. - // e.g. - // sinon.test(/* @this sinon.Sandbox */function() { this.spy(); }); - return sourceCode.getComments(node).leading.some(function(comment) { - return thisTagPattern.test(comment.value); - }); - } - - /** - * Checks whether or not a node has valid `this`. - * - * First, this checks the node: - * - * - The function name starts with uppercase (it's a constructor). - * - The function has a JSDoc comment that has a @this tag. - * - * Next, this checks the location of the node. - * If the location is below, this judges `this` is valid. - * - * - The location is on an object literal. - * - The location assigns to a property. - * - The location is on an ES2015 class. - * - The location calls its `bind`/`call`/`apply` method directly. - * - The function is a callback of array methods (such as `.forEach()`) if `thisArg` is given. - * - * @param {ASTNode} node - A node to check. - * @returns {boolean} A found function node. - */ - function hasValidThis(node) { - if (isES5Constructor(node) || hasJSDocThisTag(node)) { - return true; - } - - while (node) { - var parent = node.parent; - switch (parent.type) { - // Looks up the destination. - // e.g. - // obj.foo = nativeFoo || function foo() { ... }; - case "LogicalExpression": - case "ConditionalExpression": - node = parent; - break; - - // If the upper function is IIFE, checks the destination of the return value. - // e.g. - // obj.foo = (function() { - // // setup... - // return function foo() { ... }; - // })(); - case "ReturnStatement": - var func = getUpperFunction(parent); - if (func === null || !isCallee(func)) { - return false; - } - node = func.parent; - break; - - // e.g. - // var obj = { foo() { ... } }; - // var obj = { foo: function() { ... } }; - case "Property": - return true; - - // e.g. - // obj.foo = foo() { ... }; - case "AssignmentExpression": - return ( - parent.right === node && - parent.left.type === "MemberExpression" - ); - - // e.g. - // class A { constructor() { ... } } - // class A { foo() { ... } } - // class A { get foo() { ... } } - // class A { set foo() { ... } } - // class A { static foo() { ... } } - case "MethodDefinition": - return !parent.static; - - // e.g. - // var foo = function foo() { ... }.bind(obj); - // (function foo() { ... }).call(obj); - // (function foo() { ... }).apply(obj, []); - case "MemberExpression": - return ( - parent.object === node && - parent.property.type === "Identifier" && - bindOrCallOrApplyPattern.test(parent.property.name) && - isCallee(parent) && - parent.parent.arguments.length > 0 && - !astUtils.isNullOrUndefined(parent.parent.arguments[0]) - ); - - // e.g. - // Reflect.apply(function() {}, obj, []); - // Array.from([], function() {}, obj); - // list.forEach(function() {}, obj); - case "CallExpression": - if (isReflectApply(parent.callee)) { - return ( - parent.arguments.length === 3 && - parent.arguments[0] === node && - !astUtils.isNullOrUndefined(parent.arguments[1]) - ); - } - if (isArrayFrom(parent.callee)) { - return ( - parent.arguments.length === 3 && - parent.arguments[1] === node && - !astUtils.isNullOrUndefined(parent.arguments[2]) - ); - } - if (isMethodWhichHasThisArg(parent.callee)) { - return ( - parent.arguments.length === 2 && - parent.arguments[0] === node && - !astUtils.isNullOrUndefined(parent.arguments[1]) - ); - } - return false; - - // Otherwise `this` is invalid. - default: - return false; - } - } - - /* istanbul ignore next */ - throw new Error("unreachable"); - } - - /** - * Gets the current checking context. - * - * The return value has a flag that whether or not `this` keyword is valid. - * The flag is initialized when got at the first time. - * - * @returns {{valid: boolean}} - * an object which has a flag that whether or not `this` keyword is valid. - */ - stack.getCurrent = function() { - var current = this[this.length - 1]; - if (!current.init) { - current.init = true; - current.valid = hasValidThis(current.node); - } - return current; - }; - - /** - * Pushs new checking context into the stack. - * - * The checking context is not initialized yet. - * Because most functions don't have `this` keyword. - * When `this` keyword was found, the checking context is initialized. - * - * @param {ASTNode} node - A function node that was entered. - * @returns {void} - */ - function enterFunction(node) { - // `this` can be invalid only under strict mode. - stack.push({ - init: !context.getScope().isStrict, - node: node, - valid: true - }); - } - - /** - * Pops the current checking context from the stack. - * @returns {void} - */ - function exitFunction() { - stack.pop(); - } - - return { - // `this` is invalid only under strict mode. - // Modules is always strict mode. - "Program": function(node) { - var scope = context.getScope(); - var features = context.ecmaFeatures; - - stack.push({ - init: true, - node: node, - valid: !( - scope.isStrict || - features.modules || - (features.globalReturn && scope.childScopes[0].isStrict) - ) - }); - }, - "Program:exit": function() { - stack.pop(); - }, - - "FunctionDeclaration": enterFunction, - "FunctionDeclaration:exit": exitFunction, - "FunctionExpression": enterFunction, - "FunctionExpression:exit": exitFunction, - - // Reports if `this` of the current context is invalid. - "ThisExpression": function(node) { - var current = stack.getCurrent(); - if (current && !current.valid) { - context.report(node, "Unexpected `this`."); - } - } - }; -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-irregular-whitespace.js b/node_modules/eslint/lib/rules/no-irregular-whitespace.js deleted file mode 100644 index b49f747..0000000 --- a/node_modules/eslint/lib/rules/no-irregular-whitespace.js +++ /dev/null @@ -1,135 +0,0 @@ -/** - * @fileoverview Rule to disalow whitespace that is not a tab or space, whitespace inside strings and comments are allowed - * @author Jonathan Kingston - * @copyright 2014 Jonathan Kingston. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var irregularWhitespace = /[\u0085\u00A0\ufeff\f\v\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000]+/mg, - irregularLineTerminators = /[\u2028\u2029]/mg; - - // Module store of errors that we have found - var errors = []; - - /** - * Removes errors that occur inside a string node - * @param {ASTNode} node to check for matching errors. - * @returns {void} - * @private - */ - function removeStringError(node) { - var locStart = node.loc.start; - var locEnd = node.loc.end; - - errors = errors.filter(function(error) { - var errorLoc = error[1]; - if (errorLoc.line >= locStart.line && errorLoc.line <= locEnd.line) { - if (errorLoc.column >= locStart.column && (errorLoc.column <= locEnd.column || errorLoc.line < locEnd.line)) { - return false; - } - } - return true; - }); - } - - /** - * Checks nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors - * @param {ASTNode} node to check for matching errors. - * @returns {void} - * @private - */ - function removeInvalidNodeErrors(node) { - if (typeof node.value === "string") { - // If we have irregular characters remove them from the errors list - if (node.raw.match(irregularWhitespace) || node.raw.match(irregularLineTerminators)) { - removeStringError(node); - } - } - } - - /** - * Checks the program source for irregular whitespace - * @param {ASTNode} node The program node - * @returns {void} - * @private - */ - function checkForIrregularWhitespace(node) { - var sourceLines = context.getSourceLines(); - - sourceLines.forEach(function(sourceLine, lineIndex) { - var lineNumber = lineIndex + 1, - location, - match; - - while ((match = irregularWhitespace.exec(sourceLine)) !== null) { - location = { - line: lineNumber, - column: match.index - }; - - errors.push([node, location, "Irregular whitespace not allowed"]); - } - }); - } - - /** - * Checks the program source for irregular line terminators - * @param {ASTNode} node The program node - * @returns {void} - * @private - */ - function checkForIrregularLineTerminators(node) { - var source = context.getSource(), - sourceLines = context.getSourceLines(), - linebreaks = source.match(/\r\n|\r|\n|\u2028|\u2029/g), - lastLineIndex = -1, - lineIndex, - location, - match; - - while ((match = irregularLineTerminators.exec(source)) !== null) { - lineIndex = linebreaks.indexOf(match[0], lastLineIndex + 1) || 0; - - location = { - line: lineIndex + 1, - column: sourceLines[lineIndex].length - }; - - errors.push([node, location, "Irregular whitespace not allowed"]); - lastLineIndex = lineIndex; - } - } - - return { - "Program": function(node) { - /** - * As we can easily fire warnings for all white space issues with all the source its simpler to fire them here - * This means we can check all the application code without having to worry about issues caused in the parser tokens - * When writing this code also evaluating per node was missing out connecting tokens in some cases - * We can later filter the errors when they are found to be not an issue in nodes we don't care about - */ - - checkForIrregularWhitespace(node); - checkForIrregularLineTerminators(node); - }, - - "Identifier": removeInvalidNodeErrors, - "Literal": removeInvalidNodeErrors, - "Program:exit": function() { - - // If we have any errors remaining report on them - errors.forEach(function(error) { - context.report.apply(context, error); - }); - } - }; -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-iterator.js b/node_modules/eslint/lib/rules/no-iterator.js deleted file mode 100644 index 817980c..0000000 --- a/node_modules/eslint/lib/rules/no-iterator.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @fileoverview Rule to flag usage of __iterator__ property - * @author Ian Christian Myers - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "MemberExpression": function(node) { - - if (node.property && - (node.property.type === "Identifier" && node.property.name === "__iterator__" && !node.computed) || - (node.property.type === "Literal" && node.property.value === "__iterator__")) { - context.report(node, "Reserved name '__iterator__'."); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-label-var.js b/node_modules/eslint/lib/rules/no-label-var.js deleted file mode 100644 index 20fbfc1..0000000 --- a/node_modules/eslint/lib/rules/no-label-var.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * @fileoverview Rule to flag labels that are the same as an identifier - * @author Ian Christian Myers - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Check if the identifier is present inside current scope - * @param {object} scope current scope - * @param {string} name To evaluate - * @returns {boolean} True if its present - * @private - */ - function findIdentifier(scope, name) { - return astUtils.getVariableByName(scope, name) !== null; - } - - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- - - return { - - "LabeledStatement": function(node) { - - // Fetch the innermost scope. - var scope = context.getScope(); - - // Recursively find the identifier walking up the scope, starting - // with the innermost scope. - if (findIdentifier(scope, node.label.name)) { - context.report(node, "Found identifier with same name as label."); - } - } - - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-labels.js b/node_modules/eslint/lib/rules/no-labels.js deleted file mode 100644 index c083f03..0000000 --- a/node_modules/eslint/lib/rules/no-labels.js +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @fileoverview Disallow Labeled Statements - * @author Nicholas C. Zakas - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - - "LabeledStatement": function(node) { - context.report(node, "Unexpected labeled statement."); - }, - - "BreakStatement": function(node) { - - if (node.label) { - context.report(node, "Unexpected label in break statement."); - } - - }, - - "ContinueStatement": function(node) { - - if (node.label) { - context.report(node, "Unexpected label in continue statement."); - } - - } - - - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-lone-blocks.js b/node_modules/eslint/lib/rules/no-lone-blocks.js deleted file mode 100644 index 22fd1ec..0000000 --- a/node_modules/eslint/lib/rules/no-lone-blocks.js +++ /dev/null @@ -1,106 +0,0 @@ -/** - * @fileoverview Rule to flag blocks with no reason to exist - * @author Brandon Mills - * @copyright 2015 Roberto Vidal. All rights reserved. - * @copyright 2014 Brandon Mills. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - // A stack of lone blocks to be checked for block-level bindings - var loneBlocks = [], - ruleDef; - - /** - * Reports a node as invalid. - * @param {ASTNode} node - The node to be reported. - * @returns {void} - */ - function report(node) { - var parent = context.getAncestors().pop(); - context.report(node, parent.type === "Program" ? - "Block is redundant." : - "Nested block is redundant." - ); - } - - /** - * Checks for any ocurrence of BlockStatement > BlockStatement or Program > BlockStatement - * @returns {boolean} True if the current node is a lone block. - */ - function isLoneBlock() { - var parent = context.getAncestors().pop(); - return parent.type === "BlockStatement" || parent.type === "Program"; - } - - /** - * Checks the enclosing block of the current node for block-level bindings, - * and "marks it" as valid if any. - * @returns {void} - */ - function markLoneBlock() { - if (loneBlocks.length === 0) { - return; - } - - var block = context.getAncestors().pop(); - - if (loneBlocks[loneBlocks.length - 1] === block) { - loneBlocks.pop(); - } - } - - // Default rule definition: report all lone blocks - ruleDef = { - BlockStatement: function(node) { - if (isLoneBlock(node)) { - report(node); - } - } - }; - - // ES6: report blocks without block-level bindings - if (context.ecmaFeatures.blockBindings || context.ecmaFeatures.classes) { - ruleDef = { - "BlockStatement": function(node) { - if (isLoneBlock(node)) { - loneBlocks.push(node); - } - }, - "BlockStatement:exit": function(node) { - if (loneBlocks.length > 0 && loneBlocks[loneBlocks.length - 1] === node) { - loneBlocks.pop(); - report(node); - } - } - }; - } - - if (context.ecmaFeatures.blockBindings) { - ruleDef.VariableDeclaration = function(node) { - if (node.kind === "let" || node.kind === "const") { - markLoneBlock(node); - } - }; - - ruleDef.FunctionDeclaration = function(node) { - if (context.getScope().isStrict) { - markLoneBlock(node); - } - }; - } - - if (context.ecmaFeatures.classes) { - ruleDef.ClassDeclaration = markLoneBlock; - } - - return ruleDef; -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-lonely-if.js b/node_modules/eslint/lib/rules/no-lonely-if.js deleted file mode 100644 index 0d8ab91..0000000 --- a/node_modules/eslint/lib/rules/no-lonely-if.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @fileoverview Rule to disallow if as the only statmenet in an else block - * @author Brandon Mills - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - "IfStatement": function(node) { - var ancestors = context.getAncestors(), - parent = ancestors.pop(), - grandparent = ancestors.pop(); - - if (parent && parent.type === "BlockStatement" && - parent.body.length === 1 && grandparent && - grandparent.type === "IfStatement" && - parent === grandparent.alternate) { - context.report(node, "Unexpected if as the only statement in an else block."); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-loop-func.js b/node_modules/eslint/lib/rules/no-loop-func.js deleted file mode 100644 index d82d6d7..0000000 --- a/node_modules/eslint/lib/rules/no-loop-func.js +++ /dev/null @@ -1,118 +0,0 @@ -/** - * @fileoverview Rule to flag creation of function inside a loop - * @author Ilya Volodin - * @copyright 2013 Ilya Volodin. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Gets the containing loop node of a specified node. - * - * We don't need to check nested functions, so this ignores those. - * `Scope.through` contains references of nested functions. - * - * @param {ASTNode} node - An AST node to get. - * @returns {ASTNode|null} The containing loop node of the specified node, or `null`. - */ -function getContainingLoopNode(node) { - var parent = node.parent; - while (parent) { - switch (parent.type) { - case "WhileStatement": - case "DoWhileStatement": - return parent; - - case "ForStatement": - // `init` is outside of the loop. - if (parent.init !== node) { - return parent; - } - break; - - case "ForInStatement": - case "ForOfStatement": - // `right` is outside of the loop. - if (parent.right !== node) { - return parent; - } - break; - - case "ArrowFunctionExpression": - case "FunctionExpression": - case "FunctionDeclaration": - // We don't need to check nested functions. - return null; - - default: - break; - } - - node = parent; - parent = node.parent; - } - - return null; -} - -/** - * Checks whether or not a reference refers to a variable that is block-binding in the loop. - * @param {ASTNode} loopNode - A containing loop node. - * @param {escope.Reference} reference - A reference to check. - * @returns {boolean} Whether or not a reference refers to a variable that is block-binding in the loop. - */ -function isBlockBindingsInLoop(loopNode, reference) { - // A reference to a `let`/`const` variable always has a resolved variable. - var variable = reference.resolved; - var definition = variable && variable.defs[0]; - var declaration = definition && definition.parent; - - return ( - // Checks whether this is `let`/`const`. - declaration && - declaration.type === "VariableDeclaration" && - (declaration.kind === "let" || declaration.kind === "const") && - // Checks whether this is in the loop. - declaration.range[0] > loopNode.range[0] && - declaration.range[1] < loopNode.range[1] - ); -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - /** - * Reports such functions: - * - * - has an ancestor node which is a loop. - * - has a reference that refers to a variable that is block-binding in the loop. - * - * @param {ASTNode} node The AST node to check. - * @returns {boolean} Whether or not the node is within a loop. - */ - function checkForLoops(node) { - var loopNode = getContainingLoopNode(node); - if (!loopNode) { - return; - } - - var references = context.getScope().through; - if (references.length > 0 && !references.every(isBlockBindingsInLoop.bind(null, loopNode))) { - context.report(node, "Don't make functions within a loop"); - } - } - - return { - "ArrowFunctionExpression": checkForLoops, - "FunctionExpression": checkForLoops, - "FunctionDeclaration": checkForLoops - }; -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-magic-numbers.js b/node_modules/eslint/lib/rules/no-magic-numbers.js deleted file mode 100644 index a88b087..0000000 --- a/node_modules/eslint/lib/rules/no-magic-numbers.js +++ /dev/null @@ -1,130 +0,0 @@ -/** - * @fileoverview Rule to flag statements that use magic numbers (adapted from https://github.com/danielstjules/buddy.js) - * @author Vincent Lemeunier - * @copyright 2015 Vincent Lemeunier. All rights reserved. - * - * This rule was adapted from danielstjules/buddy.js - * The MIT License (MIT) - * - * Copyright (c) 2014 Daniel St. Jules - * - * 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. - * - * See LICENSE file in root directory for full license. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var config = context.options[0] || {}, - ignore = config.ignore || [0, 1, 2], - detectObjects = !!config.detectObjects, - enforceConst = !!config.enforceConst; - - /** - * Returns whether the node is number literal - * @param {Node} node - the node literal being evaluated - * @returns {boolean} true if the node is a number literal - */ - function isNumber(node) { - return typeof node.value === "number"; - } - - /** - * Returns whether the number should be ignored - * @param {number} num - the number - * @returns {boolean} true if the number should be ignored - */ - function shouldIgnoreNumber(num) { - return ignore.indexOf(num) !== -1; - } - - - return { - "Literal": function(node) { - var parent = node.parent, - value = node.value, - raw = node.raw, - okTypes = detectObjects ? [] : ["ObjectExpression", "Property", "AssignmentExpression"]; - - if (!isNumber(node)) { - return; - } - - if (parent.type === "UnaryExpression" && parent.operator === "-") { - node = parent; - parent = node.parent; - value = -value; - raw = "-" + raw; - } - - if (shouldIgnoreNumber(value)) { - return; - } - - // don't warn on parseInt() or Number.parseInt() radix - if (parent.type === "CallExpression" && node === parent.arguments[1] && - (parent.callee.name === "parseInt" || - parent.callee.type === "MemberExpression" && - parent.callee.object.name === "Number" && - parent.callee.property.name === "parseInt") - ) { - return; - } - - if (parent.type === "VariableDeclarator") { - if (enforceConst && parent.parent.kind !== "const") { - context.report({ - node: node, - message: "Number constants declarations must use 'const'" - }); - } - } else if (okTypes.indexOf(parent.type) === -1) { - context.report({ - node: node, - message: "No magic number: " + raw - }); - } - } - }; -}; - -module.exports.schema = [{ - "type": "object", - "properties": { - "detectObjects": { - "type": "boolean" - }, - "enforceConst": { - "type": "boolean" - }, - "ignore": { - "type": "array", - "items": { - "type": "number" - }, - "uniqueItems": true - } - }, - "additionalProperties": false -}]; diff --git a/node_modules/eslint/lib/rules/no-mixed-requires.js b/node_modules/eslint/lib/rules/no-mixed-requires.js deleted file mode 100644 index eca480f..0000000 --- a/node_modules/eslint/lib/rules/no-mixed-requires.js +++ /dev/null @@ -1,184 +0,0 @@ -/** - * @fileoverview Rule to enforce grouped require statements for Node.JS - * @author Raphael Pigulla - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Returns the list of built-in modules. - * - * @returns {string[]} An array of built-in Node.js modules. - */ - function getBuiltinModules() { - // This list is generated using `require("repl")._builtinLibs.concat('repl').sort()` - // This particular list is as per nodejs v0.12.2 and iojs v0.7.1 - return [ - "assert", "buffer", "child_process", "cluster", "crypto", - "dgram", "dns", "domain", "events", "fs", "http", "https", - "net", "os", "path", "punycode", "querystring", "readline", - "repl", "smalloc", "stream", "string_decoder", "tls", "tty", - "url", "util", "v8", "vm", "zlib" - ]; - } - - var BUILTIN_MODULES = getBuiltinModules(); - - var DECL_REQUIRE = "require", - DECL_UNINITIALIZED = "uninitialized", - DECL_OTHER = "other"; - - var REQ_CORE = "core", - REQ_FILE = "file", - REQ_MODULE = "module", - REQ_COMPUTED = "computed"; - - /** - * Determines the type of a declaration statement. - * @param {ASTNode} initExpression The init node of the VariableDeclarator. - * @returns {string} The type of declaration represented by the expression. - */ - function getDeclarationType(initExpression) { - if (!initExpression) { - // "var x;" - return DECL_UNINITIALIZED; - } - - if (initExpression.type === "CallExpression" && - initExpression.callee.type === "Identifier" && - initExpression.callee.name === "require" - ) { - // "var x = require('util');" - return DECL_REQUIRE; - } else if (initExpression.type === "MemberExpression") { - // "var x = require('glob').Glob;" - return getDeclarationType(initExpression.object); - } - - // "var x = 42;" - return DECL_OTHER; - } - - /** - * Determines the type of module that is loaded via require. - * @param {ASTNode} initExpression The init node of the VariableDeclarator. - * @returns {string} The module type. - */ - function inferModuleType(initExpression) { - if (initExpression.type === "MemberExpression") { - // "var x = require('glob').Glob;" - return inferModuleType(initExpression.object); - } else if (initExpression.arguments.length === 0) { - // "var x = require();" - return REQ_COMPUTED; - } - - var arg = initExpression.arguments[0]; - - if (arg.type !== "Literal" || typeof arg.value !== "string") { - // "var x = require(42);" - return REQ_COMPUTED; - } - - if (BUILTIN_MODULES.indexOf(arg.value) !== -1) { - // "var fs = require('fs');" - return REQ_CORE; - } else if (/^\.{0,2}\//.test(arg.value)) { - // "var utils = require('./utils');" - return REQ_FILE; - } else { - // "var async = require('async');" - return REQ_MODULE; - } - } - - /** - * Check if the list of variable declarations is mixed, i.e. whether it - * contains both require and other declarations. - * @param {ASTNode} declarations The list of VariableDeclarators. - * @returns {boolean} True if the declarations are mixed, false if not. - */ - function isMixed(declarations) { - var contains = {}; - - declarations.forEach(function(declaration) { - var type = getDeclarationType(declaration.init); - contains[type] = true; - }); - - return !!( - contains[DECL_REQUIRE] && - (contains[DECL_UNINITIALIZED] || contains[DECL_OTHER]) - ); - } - - /** - * Check if all require declarations in the given list are of the same - * type. - * @param {ASTNode} declarations The list of VariableDeclarators. - * @returns {boolean} True if the declarations are grouped, false if not. - */ - function isGrouped(declarations) { - var found = {}; - - declarations.forEach(function(declaration) { - if (getDeclarationType(declaration.init) === DECL_REQUIRE) { - found[inferModuleType(declaration.init)] = true; - } - }); - - return Object.keys(found).length <= 1; - } - - - return { - - "VariableDeclaration": function(node) { - var grouping = false; - - if (typeof context.options[0] === "object") { - grouping = context.options[0].grouping; - } else { - grouping = !!context.options[0]; - } - - if (isMixed(node.declarations)) { - context.report( - node, - "Do not mix 'require' and other declarations." - ); - } else if (grouping && !isGrouped(node.declarations)) { - context.report( - node, - "Do not mix core, module, file and computed requires." - ); - } - } - }; - -}; - -module.exports.schema = [ - { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "object", - "properties": { - "grouping": { - "type": "boolean" - } - }, - "additionalProperties": false - } - ] - } -]; diff --git a/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js b/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js deleted file mode 100644 index 6ce27da..0000000 --- a/node_modules/eslint/lib/rules/no-mixed-spaces-and-tabs.js +++ /dev/null @@ -1,134 +0,0 @@ -/** - * @fileoverview Disallow mixed spaces and tabs for indentation - * @author Jary Niebur - * @copyright 2014 Nicholas C. Zakas. All rights reserved. - * @copyright 2014 Jary Niebur. All rights reserved. - * See LICENSE in root directory for full license. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var smartTabs, - ignoredLocs = []; - - switch (context.options[0]) { - case true: // Support old syntax, maybe add deprecation warning here - case "smart-tabs": - smartTabs = true; - break; - default: - smartTabs = false; - } - - /** - * Determines if a given line and column are before a location. - * @param {Location} loc The location object from an AST node. - * @param {int} line The line to check. - * @param {int} column The column to check. - * @returns {boolean} True if the line and column are before the location, false if not. - * @private - */ - function beforeLoc(loc, line, column) { - if (line < loc.start.line) { - return true; - } - return line === loc.start.line && column < loc.start.column; - } - - /** - * Determines if a given line and column are after a location. - * @param {Location} loc The location object from an AST node. - * @param {int} line The line to check. - * @param {int} column The column to check. - * @returns {boolean} True if the line and column are after the location, false if not. - * @private - */ - function afterLoc(loc, line, column) { - if (line > loc.end.line) { - return true; - } - return line === loc.end.line && column > loc.end.column; - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - - "TemplateElement": function(node) { - ignoredLocs.push(node.loc); - }, - - "Program:exit": function(node) { - /* - * At least one space followed by a tab - * or the reverse before non-tab/-space - * characters begin. - */ - var regex = /^(?=[\t ]*(\t | \t))/, - match, - lines = context.getSourceLines(), - comments = context.getAllComments(); - - comments.forEach(function(comment) { - ignoredLocs.push(comment.loc); - }); - - ignoredLocs.sort(function(first, second) { - if (beforeLoc(first, second.start.line, second.start.column)) { - return 1; - } - - if (beforeLoc(second, first.start.line, second.start.column)) { - return -1; - } - - return 0; - }); - - if (smartTabs) { - /* - * At least one space followed by a tab - * before non-tab/-space characters begin. - */ - regex = /^(?=[\t ]* \t)/; - } - - lines.forEach(function(line, i) { - match = regex.exec(line); - - if (match) { - var lineNumber = i + 1, - column = match.index + 1; - - for (var j = 0; j < ignoredLocs.length; j++) { - if (beforeLoc(ignoredLocs[j], lineNumber, column)) { - continue; - } - if (afterLoc(ignoredLocs[j], lineNumber, column)) { - continue; - } - - return; - } - - context.report(node, { line: lineNumber, column: column }, "Mixed spaces and tabs."); - } - }); - } - - }; - -}; - -module.exports.schema = [ - { - "enum": ["smart-tabs", true, false] - } -]; diff --git a/node_modules/eslint/lib/rules/no-multi-spaces.js b/node_modules/eslint/lib/rules/no-multi-spaces.js deleted file mode 100644 index c6177e3..0000000 --- a/node_modules/eslint/lib/rules/no-multi-spaces.js +++ /dev/null @@ -1,139 +0,0 @@ -/** - * @fileoverview Disallow use of multiple spaces. - * @author Nicholas C. Zakas - * @copyright 2015 Brandon Mills. All rights reserved. - * @copyright 2015 Nicholas C. Zakas. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - // the index of the last comment that was checked - var exceptions = { "Property": true }, - hasExceptions = true, - options = context.options[0], - lastCommentIndex = 0; - - if (options && options.exceptions) { - Object.keys(options.exceptions).forEach(function(key) { - if (options.exceptions[key]) { - exceptions[key] = true; - } else { - delete exceptions[key]; - } - }); - hasExceptions = Object.keys(exceptions).length > 0; - } - - /** - * Determines if a given source index is in a comment or not by checking - * the index against the comment range. Since the check goes straight - * through the file, once an index is passed a certain comment, we can - * go to the next comment to check that. - * @param {int} index The source index to check. - * @param {ASTNode[]} comments An array of comment nodes. - * @returns {boolean} True if the index is within a comment, false if not. - * @private - */ - function isIndexInComment(index, comments) { - - var comment; - - while (lastCommentIndex < comments.length) { - - comment = comments[lastCommentIndex]; - - if (comment.range[0] <= index && index < comment.range[1]) { - return true; - } else if (index > comment.range[1]) { - lastCommentIndex++; - } else { - break; - } - - } - - return false; - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - "Program": function() { - - var source = context.getSource(), - allComments = context.getAllComments(), - pattern = /[^\n\r\u2028\u2029 ] {2,}/g, // note: repeating space - token, - previousToken, - parent; - - - /** - * Creates a fix function that removes the multiple spaces between the two tokens - * @param {RuleFixer} leftToken left token - * @param {RuleFixer} rightToken right token - * @returns {function} fix function - * @private - */ - function createFix(leftToken, rightToken) { - return function(fixer) { - return fixer.replaceTextRange([leftToken.range[1], rightToken.range[0]], " "); - }; - } - - while (pattern.test(source)) { - - // do not flag anything inside of comments - if (!isIndexInComment(pattern.lastIndex, allComments)) { - - token = context.getTokenByRangeStart(pattern.lastIndex); - if (token) { - previousToken = context.getTokenBefore(token); - - if (hasExceptions) { - parent = context.getNodeByRangeIndex(pattern.lastIndex - 1); - } - - if (!parent || !exceptions[parent.type]) { - context.report({ - node: token, - loc: token.loc.start, - message: "Multiple spaces found before '{{value}}'.", - data: { value: token.value }, - fix: createFix(previousToken, token) - }); - } - } - - } - } - } - }; - -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "exceptions": { - "type": "object", - "patternProperties": { - "^([A-Z][a-z]*)+$": { - "type": "boolean" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/no-multi-str.js b/node_modules/eslint/lib/rules/no-multi-str.js deleted file mode 100644 index 470c658..0000000 --- a/node_modules/eslint/lib/rules/no-multi-str.js +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @fileoverview Rule to flag when using multiline strings - * @author Ilya Volodin - * @copyright 2014 Nicholas C. Zakas. All rights reserved. - * @copyright 2013 Ilya Volodin. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Determines if a given node is part of JSX syntax. - * @param {ASTNode} node The node to check. - * @returns {boolean} True if the node is a JSX node, false if not. - * @private - */ - function isJSXElement(node) { - return node.type.indexOf("JSX") === 0; - } - - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- - - return { - - "Literal": function(node) { - var lineBreak = /\n/; - - if (lineBreak.test(node.raw) && !isJSXElement(node.parent)) { - context.report(node, "Multiline support is limited to browsers supporting ES5 only."); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-multiple-empty-lines.js b/node_modules/eslint/lib/rules/no-multiple-empty-lines.js deleted file mode 100644 index 4608027..0000000 --- a/node_modules/eslint/lib/rules/no-multiple-empty-lines.js +++ /dev/null @@ -1,124 +0,0 @@ -/** - * @fileoverview Disallows multiple blank lines. - * implementation adapted from the no-trailing-spaces rule. - * @author Greg Cochard - * @copyright 2014 Greg Cochard. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - // Use options.max or 2 as default - var max = 2, - maxEOF; - - // store lines that appear empty but really aren't - var notEmpty = []; - - if (context.options.length) { - max = context.options[0].max; - maxEOF = context.options[0].maxEOF; - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - - "TemplateLiteral": function(node) { - var start = node.loc.start.line; - var end = node.loc.end.line; - while (start <= end) { - notEmpty.push(start); - start++; - } - }, - - "Program:exit": function checkBlankLines(node) { - var lines = context.getSourceLines(), - currentLocation = -1, - lastLocation, - blankCounter = 0, - location, - trimmedLines = lines.map(function(str) { - return str.trim(); - }), - firstOfEndingBlankLines; - - // add the notEmpty lines in there with a placeholder - notEmpty.forEach(function(x, i) { - trimmedLines[i] = x; - }); - - if (typeof maxEOF === "undefined") { - // swallow the final newline, as some editors add it - // automatically and we don't want it to cause an issue - if (trimmedLines[trimmedLines.length - 1] === "") { - trimmedLines = trimmedLines.slice(0, -1); - } - firstOfEndingBlankLines = trimmedLines.length; - } else { - // save the number of the first of the last blank lines - firstOfEndingBlankLines = trimmedLines.length; - while (trimmedLines[firstOfEndingBlankLines - 1] === "" - && firstOfEndingBlankLines > 0) { - firstOfEndingBlankLines--; - } - } - - // Aggregate and count blank lines - lastLocation = currentLocation; - currentLocation = trimmedLines.indexOf("", currentLocation + 1); - while (currentLocation !== -1) { - lastLocation = currentLocation; - currentLocation = trimmedLines.indexOf("", currentLocation + 1); - if (lastLocation === currentLocation - 1) { - blankCounter++; - } else { - location = { - line: lastLocation + 1, - column: 1 - }; - if (lastLocation < firstOfEndingBlankLines) { - // within the file, not at the end - if (blankCounter >= max) { - context.report(node, location, - "More than " + max + " blank " + (max === 1 ? "line" : "lines") + " not allowed."); - } - } else { - // inside the last blank lines - if (blankCounter >= maxEOF) { - context.report(node, location, - "Too many blank lines at the end of file. Max of " + maxEOF + " allowed."); - } - } - - // Finally, reset the blank counter - blankCounter = 0; - } - } - } - }; - -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "max": { - "type": "integer" - }, - "maxEOF": { - "type": "integer" - } - }, - "required": ["max"], - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/no-native-reassign.js b/node_modules/eslint/lib/rules/no-native-reassign.js deleted file mode 100644 index 78d8c97..0000000 --- a/node_modules/eslint/lib/rules/no-native-reassign.js +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @fileoverview Rule to flag when re-assigning native objects - * @author Ilya Volodin - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var config = context.options[0]; - var exceptions = (config && config.exceptions) || []; - - /** - * Gets the names of writeable built-in variables. - * @param {escope.Scope} scope - A scope to get. - * @returns {object} A map that its key is variable names. - */ - function getBuiltinGlobals(scope) { - return scope.variables.reduce(function(retv, variable) { - if (variable.writeable === false && variable.name !== "__proto__") { - retv[variable.name] = true; - } - return retv; - }, Object.create(null)); - } - - /** - * Reports if a given reference's name is same as native object's. - * @param {object} builtins - A map that its key is a variable name. - * @param {Reference} reference - A reference to check. - * @param {int} index - The index of the reference in the references. - * @param {Reference[]} references - The array that the reference belongs to. - * @returns {void} - */ - function checkThroughReference(builtins, reference, index, references) { - var identifier = reference.identifier; - - if (identifier && - builtins[identifier.name] && - exceptions.indexOf(identifier.name) === -1 && - reference.init === false && - reference.isWrite() && - // Destructuring assignments can have multiple default value, - // so possibly there are multiple writeable references for the same identifier. - (index === 0 || references[index - 1].identifier !== identifier) - ) { - context.report( - identifier, - "{{name}} is a read-only native object.", - {name: identifier.name}); - } - } - - return { - // Checks assignments of global variables. - // References to implicit global variables are not resolved, - // so those are in the `through` of the global scope. - "Program": function() { - var globalScope = context.getScope(); - var builtins = getBuiltinGlobals(globalScope); - globalScope.through.forEach(checkThroughReference.bind(null, builtins)); - } - }; - -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "exceptions": { - "type": "array", - "items": {"type": "string"}, - "uniqueItems": true - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/no-negated-condition.js b/node_modules/eslint/lib/rules/no-negated-condition.js deleted file mode 100644 index 0d5b283..0000000 --- a/node_modules/eslint/lib/rules/no-negated-condition.js +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @fileoverview Rule to disallow a negated condition - * @author Alberto Rodríguez - * @copyright 2015 Alberto Rodríguez. All rights reserved. - * See LICENSE file in root directory for full license. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Determines if a given node is an if-else without a condition on the else - * @param {ASTNode} node The node to check. - * @returns {boolean} True if the node has an else without an if. - * @private - */ - function hasElseWithoutCondition(node) { - return node.alternate && node.alternate.type !== "IfStatement"; - } - - /** - * Determines if a given node is a negated unary expression - * @param {Object} test The test object to check. - * @returns {boolean} True if the node is a negated unary expression. - * @private - */ - function isNegatedUnaryExpression(test) { - return test.type === "UnaryExpression" && test.operator === "!"; - } - - /** - * Determines if a given node is a negated binary expression - * @param {Test} test The test to check. - * @returns {boolean} True if the node is a negated binary expression. - * @private - */ - function isNegatedBinaryExpression(test) { - return test.type === "BinaryExpression" && - (test.operator === "!=" || test.operator === "!=="); - } - - /** - * Determines if a given node has a negated if expression - * @param {ASTNode} node The node to check. - * @returns {boolean} True if the node has a negated if expression. - * @private - */ - function isNegatedIf(node) { - return isNegatedUnaryExpression(node.test) || isNegatedBinaryExpression(node.test); - } - - return { - "IfStatement": function(node) { - if (!hasElseWithoutCondition(node)) { - return; - } - - if (isNegatedIf(node)) { - context.report(node, "Unexpected negated condition."); - } - }, - "ConditionalExpression": function(node) { - if (isNegatedIf(node)) { - context.report(node, "Unexpected negated condition."); - } - } - }; -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-negated-in-lhs.js b/node_modules/eslint/lib/rules/no-negated-in-lhs.js deleted file mode 100644 index 7d476a5..0000000 --- a/node_modules/eslint/lib/rules/no-negated-in-lhs.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @fileoverview A rule to disallow negated left operands of the `in` operator - * @author Michael Ficarra - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "BinaryExpression": function(node) { - if (node.operator === "in" && node.left.type === "UnaryExpression" && node.left.operator === "!") { - context.report(node, "The `in` expression's left operand is negated"); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-nested-ternary.js b/node_modules/eslint/lib/rules/no-nested-ternary.js deleted file mode 100644 index 2686ebd..0000000 --- a/node_modules/eslint/lib/rules/no-nested-ternary.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @fileoverview Rule to flag nested ternary expressions - * @author Ian Christian Myers - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - "ConditionalExpression": function(node) { - if (node.alternate.type === "ConditionalExpression" || - node.consequent.type === "ConditionalExpression") { - context.report(node, "Do not nest ternary expressions"); - } - } - }; -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-new-func.js b/node_modules/eslint/lib/rules/no-new-func.js deleted file mode 100644 index dee7ec7..0000000 --- a/node_modules/eslint/lib/rules/no-new-func.js +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @fileoverview Rule to flag when using new Function - * @author Ilya Volodin - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Checks if the callee if the Function constructor, and if so, reports an issue. - * @param {ASTNode} node The node to check and report on - * @returns {void} - * @private - */ - function validateCallee(node) { - if (node.callee.name === "Function") { - context.report(node, "The Function constructor is eval."); - } - } - - return { - "NewExpression": validateCallee, - "CallExpression": validateCallee - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-new-object.js b/node_modules/eslint/lib/rules/no-new-object.js deleted file mode 100644 index dd1cd10..0000000 --- a/node_modules/eslint/lib/rules/no-new-object.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @fileoverview A rule to disallow calls to the Object constructor - * @author Matt DuVall - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "NewExpression": function(node) { - if (node.callee.name === "Object") { - context.report(node, "The object literal notation {} is preferrable."); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-new-require.js b/node_modules/eslint/lib/rules/no-new-require.js deleted file mode 100644 index cd2eec5..0000000 --- a/node_modules/eslint/lib/rules/no-new-require.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @fileoverview Rule to disallow use of new operator with the `require` function - * @author Wil Moore III - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "NewExpression": function(node) { - if (node.callee.type === "Identifier" && node.callee.name === "require") { - context.report(node, "Unexpected use of new with require."); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-new-wrappers.js b/node_modules/eslint/lib/rules/no-new-wrappers.js deleted file mode 100644 index da60957..0000000 --- a/node_modules/eslint/lib/rules/no-new-wrappers.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @fileoverview Rule to flag when using constructor for wrapper objects - * @author Ilya Volodin - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "NewExpression": function(node) { - var wrapperObjects = ["String", "Number", "Boolean", "Math", "JSON"]; - if (wrapperObjects.indexOf(node.callee.name) > -1) { - context.report(node, "Do not use {{fn}} as a constructor.", { fn: node.callee.name }); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-new.js b/node_modules/eslint/lib/rules/no-new.js deleted file mode 100644 index e431d4f..0000000 --- a/node_modules/eslint/lib/rules/no-new.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @fileoverview Rule to flag statements with function invocation preceded by - * "new" and not part of assignment - * @author Ilya Volodin - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "ExpressionStatement": function(node) { - - if (node.expression.type === "NewExpression") { - context.report(node, "Do not use 'new' for side effects."); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-obj-calls.js b/node_modules/eslint/lib/rules/no-obj-calls.js deleted file mode 100644 index f3845c5..0000000 --- a/node_modules/eslint/lib/rules/no-obj-calls.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @fileoverview Rule to flag use of an object property of the global object (Math and JSON) as a function - * @author James Allardice - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - "CallExpression": function(node) { - - if (node.callee.type === "Identifier") { - var name = node.callee.name; - if (name === "Math" || name === "JSON") { - context.report(node, "'{{name}}' is not a function.", { name: name }); - } - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-octal-escape.js b/node_modules/eslint/lib/rules/no-octal-escape.js deleted file mode 100644 index 16e5831..0000000 --- a/node_modules/eslint/lib/rules/no-octal-escape.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @fileoverview Rule to flag octal escape sequences in string literals. - * @author Ian Christian Myers - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "Literal": function(node) { - if (typeof node.value !== "string") { - return; - } - - var match = node.raw.match(/^([^\\]|\\[^0-7])*\\([0-3][0-7]{1,2}|[4-7][0-7]|[0-7])/), - octalDigit; - - if (match) { - octalDigit = match[2]; - - // \0 is actually not considered an octal - if (match[2] !== "0" || typeof match[3] !== "undefined") { - context.report(node, "Don't use octal: '\\{{octalDigit}}'. Use '\\u....' instead.", - { octalDigit: octalDigit }); - } - } - } - - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-octal.js b/node_modules/eslint/lib/rules/no-octal.js deleted file mode 100644 index 5a00c95..0000000 --- a/node_modules/eslint/lib/rules/no-octal.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @fileoverview Rule to flag when initializing octal literal - * @author Ilya Volodin - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "Literal": function(node) { - if (typeof node.value === "number" && /^0[0-7]/.test(node.raw)) { - context.report(node, "Octal literals should not be used."); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-param-reassign.js b/node_modules/eslint/lib/rules/no-param-reassign.js deleted file mode 100644 index 6bfa681..0000000 --- a/node_modules/eslint/lib/rules/no-param-reassign.js +++ /dev/null @@ -1,136 +0,0 @@ -/** - * @fileoverview Disallow reassignment of function parameters. - * @author Nat Burns - * @copyright 2014 Nat Burns. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -var stopNodePattern = /(?:Statement|Declaration|Function(?:Expression)?|Program)$/; - -module.exports = function(context) { - var props = context.options[0] && Boolean(context.options[0].props); - - /** - * Checks whether or not a reference modifies its variable. - * If the `props` option is `true`, this checks whether or not the reference modifies properties of its variable also. - * @param {Reference} reference - A reference to check. - * @returns {boolean} Whether or not the reference modifies its variable. - */ - function isModifying(reference) { - if (reference.isWrite()) { - return true; - } - - // Checks whether its property is modified. - if (props) { - var node = reference.identifier; - var parent = node.parent; - while (parent && !stopNodePattern.test(parent.type)) { - switch (parent.type) { - // e.g. foo.a = 0; - case "AssignmentExpression": - return parent.left === node; - - // e.g. ++foo.a; - case "UpdateExpression": - return true; - - // e.g. delete foo.a; - case "UnaryExpression": - if (parent.operator === "delete") { - return true; - } - break; - - // EXCLUDES: e.g. cache.get(foo.a).b = 0; - case "CallExpression": - if (parent.callee !== node) { - return false; - } - break; - - // EXCLUDES: e.g. cache[foo.a] = 0; - case "MemberExpression": - if (parent.property === node) { - return false; - } - break; - - default: - break; - } - - node = parent; - parent = parent.parent; - } - } - - return false; - } - - /** - * Reports a reference if is non initializer and writable. - * @param {Reference} reference - A reference to check. - * @param {int} index - The index of the reference in the references. - * @param {Reference[]} references - The array that the reference belongs to. - * @returns {void} - */ - function checkReference(reference, index, references) { - var identifier = reference.identifier; - - if (identifier && - !reference.init && - isModifying(reference) && - // Destructuring assignments can have multiple default value, - // so possibly there are multiple writeable references for the same identifier. - (index === 0 || references[index - 1].identifier !== identifier) - ) { - context.report( - identifier, - "Assignment to function parameter '{{name}}'.", - {name: identifier.name}); - } - } - - /** - * Finds and reports references that are non initializer and writable. - * @param {Variable} variable - A variable to check. - * @returns {void} - */ - function checkVariable(variable) { - if (variable.defs[0].type === "Parameter") { - variable.references.forEach(checkReference); - } - } - - /** - * Checks parameters of a given function node. - * @param {ASTNode} node - A function node to check. - * @returns {void} - */ - function checkForFunction(node) { - context.getDeclaredVariables(node).forEach(checkVariable); - } - - return { - // `:exit` is needed for the `node.parent` property of identifier nodes. - "FunctionDeclaration:exit": checkForFunction, - "FunctionExpression:exit": checkForFunction, - "ArrowFunctionExpression:exit": checkForFunction - }; - -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "props": {"type": "boolean"} - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/no-path-concat.js b/node_modules/eslint/lib/rules/no-path-concat.js deleted file mode 100644 index c6d512b..0000000 --- a/node_modules/eslint/lib/rules/no-path-concat.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @fileoverview Disallow string concatenation when using __dirname and __filename - * @author Nicholas C. Zakas - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var MATCHER = /^__(?:dir|file)name$/; - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - - "BinaryExpression": function(node) { - - var left = node.left, - right = node.right; - - if (node.operator === "+" && - ((left.type === "Identifier" && MATCHER.test(left.name)) || - (right.type === "Identifier" && MATCHER.test(right.name))) - ) { - - context.report(node, "Use path.join() or path.resolve() instead of + to create paths."); - } - } - - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-plusplus.js b/node_modules/eslint/lib/rules/no-plusplus.js deleted file mode 100644 index 42df6a5..0000000 --- a/node_modules/eslint/lib/rules/no-plusplus.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @fileoverview Rule to flag use of unary increment and decrement operators. - * @author Ian Christian Myers - * @author Brody McKee (github.com/mrmckeb) - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var config = context.options[0], - allowInForAfterthought = false; - - if (typeof config === "object") { - allowInForAfterthought = config.allowForLoopAfterthoughts === true; - } - - return { - - "UpdateExpression": function(node) { - if (allowInForAfterthought && node.parent.type === "ForStatement") { - return; - } - context.report(node, "Unary operator '" + node.operator + "' used."); - } - - }; - -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "allowForLoopAfterthoughts": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/no-process-env.js b/node_modules/eslint/lib/rules/no-process-env.js deleted file mode 100644 index 6a5395e..0000000 --- a/node_modules/eslint/lib/rules/no-process-env.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @fileoverview Disallow the use of process.env() - * @author Vignesh Anand - * @copyright 2014 Vignesh Anand. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "MemberExpression": function(node) { - var objectName = node.object.name, - propertyName = node.property.name; - - if (objectName === "process" && !node.computed && propertyName && propertyName === "env") { - context.report(node, "Unexpected use of process.env."); - } - - } - - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-process-exit.js b/node_modules/eslint/lib/rules/no-process-exit.js deleted file mode 100644 index a1fa3b2..0000000 --- a/node_modules/eslint/lib/rules/no-process-exit.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @fileoverview Disallow the use of process.exit() - * @author Nicholas C. Zakas - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - - "CallExpression": function(node) { - var callee = node.callee; - - if (callee.type === "MemberExpression" && callee.object.name === "process" && - callee.property.name === "exit" - ) { - context.report(node, "Don't use process.exit(); throw an error instead."); - } - } - - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-proto.js b/node_modules/eslint/lib/rules/no-proto.js deleted file mode 100644 index f91a46a..0000000 --- a/node_modules/eslint/lib/rules/no-proto.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @fileoverview Rule to flag usage of __proto__ property - * @author Ilya Volodin - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "MemberExpression": function(node) { - - if (node.property && - (node.property.type === "Identifier" && node.property.name === "__proto__" && !node.computed) || - (node.property.type === "Literal" && node.property.value === "__proto__")) { - context.report(node, "The '__proto__' property is deprecated."); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-redeclare.js b/node_modules/eslint/lib/rules/no-redeclare.js deleted file mode 100644 index 2911ecb..0000000 --- a/node_modules/eslint/lib/rules/no-redeclare.js +++ /dev/null @@ -1,93 +0,0 @@ -/** - * @fileoverview Rule to flag when the same variable is declared more then once. - * @author Ilya Volodin - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var options = { - builtinGlobals: Boolean(context.options[0] && context.options[0].builtinGlobals) - }; - - /** - * Find variables in a given scope and flag redeclared ones. - * @param {Scope} scope - An escope scope object. - * @returns {void} - * @private - */ - function findVariablesInScope(scope) { - scope.variables.forEach(function(variable) { - var hasBuiltin = options.builtinGlobals && "writeable" in variable; - var count = (hasBuiltin ? 1 : 0) + variable.identifiers.length; - - if (count >= 2) { - variable.identifiers.sort(function(a, b) { - return a.range[1] - b.range[1]; - }); - - for (var i = (hasBuiltin ? 0 : 1), l = variable.identifiers.length; i < l; i++) { - context.report( - variable.identifiers[i], - "\"{{a}}\" is already defined", - {a: variable.name}); - } - } - }); - - } - - /** - * Find variables in the current scope. - * @returns {void} - * @private - */ - function checkForGlobal() { - var scope = context.getScope(); - - // Nodejs env or modules has a special scope. - if (context.ecmaFeatures.globalReturn || context.ecmaFeatures.modules) { - findVariablesInScope(scope.childScopes[0]); - } else { - findVariablesInScope(scope); - } - } - - /** - * Find variables in the current scope. - * @returns {void} - * @private - */ - function checkForBlock() { - findVariablesInScope(context.getScope()); - } - - if (context.ecmaFeatures.blockBindings) { - return { - "Program": checkForGlobal, - "BlockStatement": checkForBlock, - "SwitchStatement": checkForBlock - }; - } else { - return { - "Program": checkForGlobal, - "FunctionDeclaration": checkForBlock, - "FunctionExpression": checkForBlock, - "ArrowFunctionExpression": checkForBlock - }; - } -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "builtinGlobals": {"type": "boolean"} - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/no-regex-spaces.js b/node_modules/eslint/lib/rules/no-regex-spaces.js deleted file mode 100644 index 0de9a49..0000000 --- a/node_modules/eslint/lib/rules/no-regex-spaces.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @fileoverview Rule to count multiple spaces in regular expressions - * @author Matt DuVall - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "Literal": function(node) { - var token = context.getFirstToken(node), - nodeType = token.type, - nodeValue = token.value, - multipleSpacesRegex = /( {2,})+?/, - regexResults; - - if (nodeType === "RegularExpression") { - regexResults = multipleSpacesRegex.exec(nodeValue); - - if (regexResults !== null) { - context.report(node, "Spaces are hard to count. Use {" + regexResults[0].length + "}."); - } - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-restricted-modules.js b/node_modules/eslint/lib/rules/no-restricted-modules.js deleted file mode 100644 index 3266c75..0000000 --- a/node_modules/eslint/lib/rules/no-restricted-modules.js +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @fileoverview Restrict usage of specified node modules. - * @author Christian Schulz - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - // trim restricted module names - var restrictedModules = context.options; - - // if no modules are restricted we don't need to check the CallExpressions - if (restrictedModules.length === 0) { - return {}; - } - - /** - * Function to check if a node is a string literal. - * @param {ASTNode} node The node to check. - * @returns {boolean} If the node is a string literal. - */ - function isString(node) { - return node && node.type === "Literal" && typeof node.value === "string"; - } - - /** - * Function to check if a node is a require call. - * @param {ASTNode} node The node to check. - * @returns {boolean} If the node is a require call. - */ - function isRequireCall(node) { - return node.callee.type === "Identifier" && node.callee.name === "require"; - } - - /** - * Function to check if a node has an argument that is an restricted module and return its name. - * @param {ASTNode} node The node to check - * @returns {undefined|String} restricted module name or undefined if node argument isn't restricted. - */ - function getRestrictedModuleName(node) { - var moduleName; - - // node has arguments and first argument is string - if (node.arguments.length && isString(node.arguments[0])) { - var argumentValue = node.arguments[0].value.trim(); - - // check if argument value is in restricted modules array - if (restrictedModules.indexOf(argumentValue) !== -1) { - moduleName = argumentValue; - } - } - - return moduleName; - } - - return { - "CallExpression": function(node) { - if (isRequireCall(node)) { - var restrictedModuleName = getRestrictedModuleName(node); - - if (restrictedModuleName) { - context.report(node, "'{{moduleName}}' module is restricted from being used.", { - moduleName: restrictedModuleName - }); - } - } - } - }; -}; - -module.exports.schema = { - "type": "array", - "items": [ - { - "enum": [0, 1, 2] - } - ], - "additionalItems": { - "type": "string" - }, - "uniqueItems": true -}; diff --git a/node_modules/eslint/lib/rules/no-restricted-syntax.js b/node_modules/eslint/lib/rules/no-restricted-syntax.js deleted file mode 100644 index 67eb741..0000000 --- a/node_modules/eslint/lib/rules/no-restricted-syntax.js +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @fileoverview Rule to flag use of certain node types - * @author Burak Yigit Kaya - * @copyright 2015 Burak Yigit Kaya. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -var nodeTypes = require("espree").Syntax; - -module.exports = function(context) { - /** - * Generates a warning from the provided node, saying that node type is not allowed. - * @param {ASTNode} node The node to warn on - * @returns {void} - */ - function warn(node) { - context.report(node, "Using \"{{type}}\" is not allowed.", node); - } - - return context.options.reduce(function(result, nodeType) { - result[nodeType] = warn; - - return result; - }, {}); - -}; - -module.exports.schema = { - "type": "array", - "items": [ - { - "enum": [0, 1, 2] - }, - { - "enum": Object.keys(nodeTypes).map(function(k) { - return nodeTypes[k]; - }) - } - ], - "uniqueItems": true, - "minItems": 1 -}; diff --git a/node_modules/eslint/lib/rules/no-return-assign.js b/node_modules/eslint/lib/rules/no-return-assign.js deleted file mode 100644 index 767414c..0000000 --- a/node_modules/eslint/lib/rules/no-return-assign.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @fileoverview Rule to flag when return statement contains assignment - * @author Ilya Volodin - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Checks whether or not a node is an `AssignmentExpression`. - * @param {Node|null} node - A node to check. - * @returns {boolean} Whether or not the node is an `AssignmentExpression`. - */ -function isAssignment(node) { - return node && node.type === "AssignmentExpression"; -} - -/** - * Checks whether or not a node is enclosed in parentheses. - * @param {Node|null} node - A node to check. - * @param {RuleContext} context - The current context. - * @returns {boolean} Whether or not the node is enclosed in parentheses. - */ -function isEnclosedInParens(node, context) { - var prevToken = context.getTokenBefore(node); - var nextToken = context.getTokenAfter(node); - - return prevToken.value === "(" && nextToken.value === ")"; -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var always = (context.options[0] || "except-parens") !== "except-parens"; - - return { - "ReturnStatement": function(node) { - if (isAssignment(node.argument) && (always || !isEnclosedInParens(node.argument, context))) { - context.report(node, "Return statement should not contain assignment."); - } - } - }; -}; - -module.exports.schema = [ - { - "enum": ["except-parens", "always"] - } -]; diff --git a/node_modules/eslint/lib/rules/no-script-url.js b/node_modules/eslint/lib/rules/no-script-url.js deleted file mode 100644 index 9526061..0000000 --- a/node_modules/eslint/lib/rules/no-script-url.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @fileoverview Rule to flag when using javascript: urls - * @author Ilya Volodin - */ -/* jshint scripturl: true */ -/* eslint no-script-url: 0 */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "Literal": function(node) { - - var value; - - if (node.value && typeof node.value === "string") { - value = node.value.toLowerCase(); - - if (value.indexOf("javascript:") === 0) { - context.report(node, "Script URL is a form of eval."); - } - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-self-compare.js b/node_modules/eslint/lib/rules/no-self-compare.js deleted file mode 100644 index 6d8e11a..0000000 --- a/node_modules/eslint/lib/rules/no-self-compare.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * @fileoverview Rule to flag comparison where left part is the same as the right - * part. - * @author Ilya Volodin - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "BinaryExpression": function(node) { - var operators = ["===", "==", "!==", "!=", ">", "<", ">=", "<="]; - if (operators.indexOf(node.operator) > -1 && - (node.left.type === "Identifier" && node.right.type === "Identifier" && node.left.name === node.right.name || - node.left.type === "Literal" && node.right.type === "Literal" && node.left.value === node.right.value)) { - context.report(node, "Comparing to itself is potentially pointless."); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-sequences.js b/node_modules/eslint/lib/rules/no-sequences.js deleted file mode 100644 index 538e36a..0000000 --- a/node_modules/eslint/lib/rules/no-sequences.js +++ /dev/null @@ -1,95 +0,0 @@ -/** - * @fileoverview Rule to flag use of comma operator - * @author Brandon Mills - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Parts of the grammar that are required to have parens. - */ - var parenthesized = { - "DoWhileStatement": "test", - "IfStatement": "test", - "SwitchStatement": "discriminant", - "WhileStatement": "test", - "WithStatement": "object" - - // Omitting CallExpression - commas are parsed as argument separators - // Omitting NewExpression - commas are parsed as argument separators - // Omitting ForInStatement - parts aren't individually parenthesised - // Omitting ForStatement - parts aren't individually parenthesised - }; - - /** - * Determines whether a node is required by the grammar to be wrapped in - * parens, e.g. the test of an if statement. - * @param {ASTNode} node - The AST node - * @returns {boolean} True if parens around node belong to parent node. - */ - function requiresExtraParens(node) { - return node.parent && parenthesized[node.parent.type] && - node === node.parent[parenthesized[node.parent.type]]; - } - - /** - * Check if a node is wrapped in parens. - * @param {ASTNode} node - The AST node - * @returns {boolean} True if the node has a paren on each side. - */ - function isParenthesised(node) { - var previousToken = context.getTokenBefore(node), - nextToken = context.getTokenAfter(node); - - return previousToken && nextToken && - previousToken.value === "(" && previousToken.range[1] <= node.range[0] && - nextToken.value === ")" && nextToken.range[0] >= node.range[1]; - } - - /** - * Check if a node is wrapped in two levels of parens. - * @param {ASTNode} node - The AST node - * @returns {boolean} True if two parens surround the node on each side. - */ - function isParenthesisedTwice(node) { - var previousToken = context.getTokenBefore(node, 1), - nextToken = context.getTokenAfter(node, 1); - - return isParenthesised(node) && previousToken && nextToken && - previousToken.value === "(" && previousToken.range[1] <= node.range[0] && - nextToken.value === ")" && nextToken.range[0] >= node.range[1]; - } - - return { - "SequenceExpression": function(node) { - // Always allow sequences in for statement update - if (node.parent.type === "ForStatement" && - (node === node.parent.init || node === node.parent.update)) { - return; - } - - // Wrapping a sequence in extra parens indicates intent - if (requiresExtraParens(node)) { - if (isParenthesisedTwice(node)) { - return; - } - } else { - if (isParenthesised(node)) { - return; - } - } - - var child = context.getTokenAfter(node.expressions[0]); - context.report(node, child.loc.start, "Unexpected use of comma operator."); - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-shadow-restricted-names.js b/node_modules/eslint/lib/rules/no-shadow-restricted-names.js deleted file mode 100644 index 760c12c..0000000 --- a/node_modules/eslint/lib/rules/no-shadow-restricted-names.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * @fileoverview Disallow shadowing of NaN, undefined, and Infinity (ES5 section 15.1.1) - * @author Michael Ficarra - * @copyright 2013 Michael Ficarra. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var RESTRICTED = ["undefined", "NaN", "Infinity", "arguments", "eval"]; - - /** - * Check if the node name is present inside the restricted list - * @param {ASTNode} id id to evaluate - * @returns {void} - * @private - */ - function checkForViolation(id) { - if (RESTRICTED.indexOf(id.name) > -1) { - context.report(id, "Shadowing of global property \"" + id.name + "\"."); - } - } - - return { - "VariableDeclarator": function(node) { - checkForViolation(node.id); - }, - "ArrowFunctionExpression": function(node) { - if (node.id) { - checkForViolation(node.id); - } - [].map.call(node.params, checkForViolation); - }, - "FunctionExpression": function(node) { - if (node.id) { - checkForViolation(node.id); - } - [].map.call(node.params, checkForViolation); - }, - "FunctionDeclaration": function(node) { - if (node.id) { - checkForViolation(node.id); - [].map.call(node.params, checkForViolation); - } - }, - "CatchClause": function(node) { - checkForViolation(node.param); - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-shadow.js b/node_modules/eslint/lib/rules/no-shadow.js deleted file mode 100644 index 35c5a04..0000000 --- a/node_modules/eslint/lib/rules/no-shadow.js +++ /dev/null @@ -1,173 +0,0 @@ -/** - * @fileoverview Rule to flag on declaring variables already declared in the outer scope - * @author Ilya Volodin - * @copyright 2013 Ilya Volodin. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var options = { - builtinGlobals: Boolean(context.options[0] && context.options[0].builtinGlobals), - hoist: (context.options[0] && context.options[0].hoist) || "functions", - allow: (context.options[0] && context.options[0].allow) || [] - }; - - /** - * Check if variable name is allowed. - * - * @param {ASTNode} variable The variable to check. - * @returns {boolean} Whether or not the variable name is allowed. - */ - function isAllowed(variable) { - return options.allow.indexOf(variable.name) !== -1; - } - - /** - * Checks if a variable of the class name in the class scope of ClassDeclaration. - * - * ClassDeclaration creates two variables of its name into its outer scope and its class scope. - * So we should ignore the variable in the class scope. - * - * @param {Object} variable The variable to check. - * @returns {boolean} Whether or not the variable of the class name in the class scope of ClassDeclaration. - */ - function isDuplicatedClassNameVariable(variable) { - var block = variable.scope.block; - return block.type === "ClassDeclaration" && block.id === variable.identifiers[0]; - } - - /** - * Checks if a variable is inside the initializer of scopeVar. - * - * To avoid reporting at declarations such as `var a = function a() {};`. - * But it should report `var a = function(a) {};` or `var a = function() { function a() {} };`. - * - * @param {Object} variable The variable to check. - * @param {Object} scopeVar The scope variable to look for. - * @returns {boolean} Whether or not the variable is inside initializer of scopeVar. - */ - function isOnInitializer(variable, scopeVar) { - var outerScope = scopeVar.scope; - var outerDef = scopeVar.defs[0]; - var outer = outerDef && outerDef.parent && outerDef.parent.range; - var innerScope = variable.scope; - var innerDef = variable.defs[0]; - var inner = innerDef && innerDef.name.range; - - return ( - outer && - inner && - outer[0] < inner[0] && - inner[1] < outer[1] && - ((innerDef.type === "FunctionName" && innerDef.node.type === "FunctionExpression") || innerDef.node.type === "ClassExpression") && - outerScope === innerScope.upper - ); - } - - /** - * Get a range of a variable's identifier node. - * @param {Object} variable The variable to get. - * @returns {Array|undefined} The range of the variable's identifier node. - */ - function getNameRange(variable) { - var def = variable.defs[0]; - return def && def.name.range; - } - - /** - * Checks if a variable is in TDZ of scopeVar. - * @param {Object} variable The variable to check. - * @param {Object} scopeVar The variable of TDZ. - * @returns {boolean} Whether or not the variable is in TDZ of scopeVar. - */ - function isInTdz(variable, scopeVar) { - var outerDef = scopeVar.defs[0]; - var inner = getNameRange(variable); - var outer = getNameRange(scopeVar); - return ( - inner && - outer && - inner[1] < outer[0] && - // Excepts FunctionDeclaration if is {"hoist":"function"}. - (options.hoist !== "functions" || !outerDef || outerDef.node.type !== "FunctionDeclaration") - ); - } - - /** - * Checks the current context for shadowed variables. - * @param {Scope} scope - Fixme - * @returns {void} - */ - function checkForShadows(scope) { - var variables = scope.variables; - for (var i = 0; i < variables.length; ++i) { - var variable = variables[i]; - - // Skips "arguments" or variables of a class name in the class scope of ClassDeclaration. - if (variable.identifiers.length === 0 || - isDuplicatedClassNameVariable(variable) || - isAllowed(variable) - ) { - continue; - } - - // Gets shadowed variable. - var shadowed = astUtils.getVariableByName(scope.upper, variable.name); - if (shadowed && - (shadowed.identifiers.length > 0 || (options.builtinGlobals && "writeable" in shadowed)) && - !isOnInitializer(variable, shadowed) && - !(options.hoist !== "all" && isInTdz(variable, shadowed)) - ) { - context.report({ - node: variable.identifiers[0], - message: "\"{{name}}\" is already declared in the upper scope.", - data: variable - }); - } - } - } - - return { - "Program:exit": function() { - var globalScope = context.getScope(); - var stack = globalScope.childScopes.slice(); - var scope; - - while (stack.length) { - scope = stack.pop(); - stack.push.apply(stack, scope.childScopes); - checkForShadows(scope); - } - } - }; - -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "builtinGlobals": {"type": "boolean"}, - "hoist": {"enum": ["all", "functions", "never"]}, - "allow": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/no-spaced-func.js b/node_modules/eslint/lib/rules/no-spaced-func.js deleted file mode 100644 index 551a3c6..0000000 --- a/node_modules/eslint/lib/rules/no-spaced-func.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @fileoverview Rule to check that spaced function application - * @author Matt DuVall - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var sourceCode = context.getSourceCode(); - - /** - * Check if open space is present in a function name - * @param {ASTNode} node node to evaluate - * @returns {void} - * @private - */ - function detectOpenSpaces(node) { - var lastCalleeToken = sourceCode.getLastToken(node.callee), - prevToken = lastCalleeToken, - parenToken = sourceCode.getTokenAfter(lastCalleeToken); - - // advances to an open parenthesis. - while ( - parenToken && - parenToken.range[1] < node.range[1] && - parenToken.value !== "(" - ) { - prevToken = parenToken; - parenToken = sourceCode.getTokenAfter(parenToken); - } - - // look for a space between the callee and the open paren - if (parenToken && - parenToken.range[1] < node.range[1] && - sourceCode.isSpaceBetweenTokens(prevToken, parenToken) - ) { - context.report({ - node: node, - loc: lastCalleeToken.loc.start, - message: "Unexpected space between function name and paren.", - fix: function(fixer) { - return fixer.removeRange([prevToken.range[1], parenToken.range[0]]); - } - }); - } - } - - return { - "CallExpression": detectOpenSpaces, - "NewExpression": detectOpenSpaces - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-sparse-arrays.js b/node_modules/eslint/lib/rules/no-sparse-arrays.js deleted file mode 100644 index 808ec99..0000000 --- a/node_modules/eslint/lib/rules/no-sparse-arrays.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @fileoverview Disallow sparse arrays - * @author Nicholas C. Zakas - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - - "ArrayExpression": function(node) { - - var emptySpot = node.elements.indexOf(null) > -1; - - if (emptySpot) { - context.report(node, "Unexpected comma in middle of array."); - } - } - - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-sync.js b/node_modules/eslint/lib/rules/no-sync.js deleted file mode 100644 index 481514b..0000000 --- a/node_modules/eslint/lib/rules/no-sync.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @fileoverview Rule to check for properties whose identifier ends with the string Sync - * @author Matt DuVall - */ - -/* jshint node:true */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "MemberExpression": function(node) { - var propertyName = node.property.name, - syncRegex = /.*Sync$/; - - if (syncRegex.exec(propertyName) !== null) { - context.report(node, "Unexpected sync method: '" + propertyName + "'."); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-ternary.js b/node_modules/eslint/lib/rules/no-ternary.js deleted file mode 100644 index 79f8576..0000000 --- a/node_modules/eslint/lib/rules/no-ternary.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @fileoverview Rule to flag use of ternary operators. - * @author Ian Christian Myers - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "ConditionalExpression": function(node) { - context.report(node, "Ternary operator used."); - } - - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-this-before-super.js b/node_modules/eslint/lib/rules/no-this-before-super.js deleted file mode 100644 index 6f1225d..0000000 --- a/node_modules/eslint/lib/rules/no-this-before-super.js +++ /dev/null @@ -1,144 +0,0 @@ -/** - * @fileoverview A rule to disallow using `this`/`super` before `super()`. - * @author Toru Nagashima - * @copyright 2015 Toru Nagashima. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Searches a class node that a node is belonging to. - * @param {Node} node - A node to start searching. - * @returns {ClassDeclaration|ClassExpression|null} the found class node, or `null`. - */ - function getClassInAncestor(node) { - while (node) { - if (node.type === "ClassDeclaration" || node.type === "ClassExpression") { - return node; - } - node = node.parent; - } - /* istanbul ignore next */ - return null; - } - - /** - * Checks whether or not a node is the null literal. - * @param {Node} node - A node to check. - * @returns {boolean} whether or not a node is the null literal. - */ - function isNullLiteral(node) { - return node && node.type === "Literal" && node.value === null; - } - - /** - * Checks whether or not a node is the callee of a call expression. - * @param {Node} node - A node to check. - * @returns {boolean} whether or not a node is the callee of a call expression. - */ - function isCallee(node) { - return node && node.parent.type === "CallExpression" && node.parent.callee === node; - } - - /** - * Checks whether or not the current traversal context is before `super()`. - * @param {object} item - A checking context. - * @returns {boolean} whether or not the current traversal context is before `super()`. - */ - function isBeforeSuperCalling(item) { - return ( - item && - item.scope === context.getScope().variableScope.upper.variableScope && - item.superCalled === false - ); - } - - var stack = []; - - return { - /** - * Start checking. - * @param {MethodDefinition} node - A target node. - * @returns {void} - */ - "MethodDefinition": function(node) { - if (node.kind !== "constructor") { - return; - } - stack.push({ - thisOrSuperBeforeSuperCalled: [], - superCalled: false, - scope: context.getScope().variableScope - }); - }, - - /** - * Treats the result of checking and reports invalid `this`/`super`. - * @param {MethodDefinition} node - A target node. - * @returns {void} - */ - "MethodDefinition:exit": function(node) { - if (node.kind !== "constructor") { - return; - } - var result = stack.pop(); - - // Skip if it has no extends or `extends null`. - var classNode = getClassInAncestor(node); - if (!classNode || !classNode.superClass || isNullLiteral(classNode.superClass)) { - return; - } - - // Reports. - result.thisOrSuperBeforeSuperCalled.forEach(function(thisOrSuper) { - var type = (thisOrSuper.type === "Super" ? "super" : "this"); - context.report(thisOrSuper, "\"{{type}}\" is not allowed before super()", {type: type}); - }); - }, - - /** - * Marks the node if is before `super()`. - * @param {ThisExpression} node - A target node. - * @returns {void} - */ - "ThisExpression": function(node) { - var item = stack[stack.length - 1]; - if (isBeforeSuperCalling(item)) { - item.thisOrSuperBeforeSuperCalled.push(node); - } - }, - - /** - * Marks the node if is before `super()`. (exclude `super()` itself) - * @param {Super} node - A target node. - * @returns {void} - */ - "Super": function(node) { - var item = stack[stack.length - 1]; - if (isBeforeSuperCalling(item) && isCallee(node) === false) { - item.thisOrSuperBeforeSuperCalled.push(node); - } - }, - - /** - * Marks `super()` called. - * To catch `super(this.a);`, marks on `CallExpression:exit`. - * @param {CallExpression} node - A target node. - * @returns {void} - */ - "CallExpression:exit": function(node) { - var item = stack[stack.length - 1]; - if (isBeforeSuperCalling(item) && node.callee.type === "Super") { - item.superCalled = true; - } - } - }; -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-throw-literal.js b/node_modules/eslint/lib/rules/no-throw-literal.js deleted file mode 100644 index 1a0c01a..0000000 --- a/node_modules/eslint/lib/rules/no-throw-literal.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @fileoverview Rule to restrict what can be thrown as an exception. - * @author Dieter Oberkofler - * @copyright 2015 Ian VanSchooten. All rights reserved. - * @copyright 2015 Dieter Oberkofler. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Determine if a node has a possiblity to be an Error object - * @param {ASTNode} node ASTNode to check - * @returns {boolean} True if there is a chance it contains an Error obj - */ -function couldBeError(node) { - switch (node.type) { - case "Identifier": - case "CallExpression": - case "NewExpression": - case "MemberExpression": - case "TaggedTemplateExpression": - case "YieldExpression": - return true; // possibly an error object. - - case "AssignmentExpression": - return couldBeError(node.right); - - case "SequenceExpression": - var exprs = node.expressions; - return exprs.length !== 0 && couldBeError(exprs[exprs.length - 1]); - - case "LogicalExpression": - return couldBeError(node.left) || couldBeError(node.right); - - case "ConditionalExpression": - return couldBeError(node.consequent) || couldBeError(node.alternate); - - default: - return false; - } -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "ThrowStatement": function(node) { - if (!couldBeError(node.argument)) { - context.report(node, "Expected an object to be thrown."); - } else if (node.argument.type === "Identifier") { - if (node.argument.name === "undefined") { - context.report(node, "Do not throw undefined."); - } - } - - } - - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-trailing-spaces.js b/node_modules/eslint/lib/rules/no-trailing-spaces.js deleted file mode 100644 index ac3c975..0000000 --- a/node_modules/eslint/lib/rules/no-trailing-spaces.js +++ /dev/null @@ -1,106 +0,0 @@ -/** - * @fileoverview Disallow trailing spaces at the end of lines. - * @author Nodeca Team - * @copyright 2015 Greg Cochard - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var BLANK_CLASS = "[ \t\u00a0\u2000-\u200b\u2028\u2029\u3000]", - SKIP_BLANK = "^" + BLANK_CLASS + "*$", - NONBLANK = BLANK_CLASS + "+$"; - - var options = context.options[0] || {}, - skipBlankLines = options.skipBlankLines || false; - - /** - * Report the error message - * @param {ASTNode} node node to report - * @param {int[]} location range information - * @param {int[]} fixRange Range based on the whole program - * @returns {void} - */ - function report(node, location, fixRange) { - // Passing node is a bit dirty, because message data will contain - // big text in `source`. But... who cares :) ? - // One more kludge will not make worse the bloody wizardry of this plugin. - context.report({ - node: node, - loc: location, - message: "Trailing spaces not allowed.", - fix: function(fixer) { - return fixer.removeRange(fixRange); - } - }); - } - - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - - "Program": function checkTrailingSpaces(node) { - - // Let's hack. Since Espree does not return whitespace nodes, - // fetch the source code and do matching via regexps. - - var src = context.getSource(), - re = new RegExp(NONBLANK), - skipMatch = new RegExp(SKIP_BLANK), - matches, lines = src.split(/\r?\n/), - linebreaks = context.getSource().match(/\r\n|\r|\n|\u2028|\u2029/g), - location, - totalLength = 0, - fixRange = []; - - for (var i = 0, ii = lines.length; i < ii; i++) { - matches = re.exec(lines[i]); - - // Always add linebreak length to line length to accommodate for line break (\n or \r\n) - // Because during the fix time they also reserve one spot in the array. - // Usually linebreak length is 2 for \r\n (CRLF) and 1 for \n (LF) - var linebreakLength = linebreaks && linebreaks[i] ? linebreaks[i].length : 1; - var lineLength = lines[i].length + linebreakLength; - - if (matches) { - - // If the line has only whitespace, and skipBlankLines - // is true, don't report it - if (skipBlankLines && skipMatch.test(lines[i])) { - continue; - } - location = { - line: i + 1, - column: matches.index - }; - - fixRange = [totalLength + location.column, totalLength + lineLength - linebreakLength]; - - report(node, location, fixRange); - } - - totalLength += lineLength; - } - } - - }; -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "skipBlankLines": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/no-undef-init.js b/node_modules/eslint/lib/rules/no-undef-init.js deleted file mode 100644 index 1348c64..0000000 --- a/node_modules/eslint/lib/rules/no-undef-init.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @fileoverview Rule to flag when initializing to undefined - * @author Ilya Volodin - * @copyright 2013 Ilya Volodin. All rights reserved. - * See LICENSE in root directory for full license. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "VariableDeclarator": function(node) { - var name = node.id.name, - init = node.init && node.init.name; - - if (init === "undefined" && node.parent.kind !== "const") { - context.report(node, "It's not necessary to initialize '{{name}}' to undefined.", { name: name }); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-undef.js b/node_modules/eslint/lib/rules/no-undef.js deleted file mode 100644 index 988d677..0000000 --- a/node_modules/eslint/lib/rules/no-undef.js +++ /dev/null @@ -1,108 +0,0 @@ -/** - * @fileoverview Rule to flag references to undeclared variables. - * @author Mark Macdonald - * @copyright 2015 Nicholas C. Zakas. All rights reserved. - * @copyright 2013 Mark Macdonald. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -/** - * Check if a variable is an implicit declaration - * @param {ASTNode} variable node to evaluate - * @returns {boolean} True if its an implicit declaration - * @private - */ -function isImplicitGlobal(variable) { - return variable.defs.every(function(def) { - return def.type === "ImplicitGlobalVariable"; - }); -} - -/** - * Gets the declared variable, defined in `scope`, that `ref` refers to. - * @param {Scope} scope The scope in which to search. - * @param {Reference} ref The reference to find in the scope. - * @returns {Variable} The variable, or null if ref refers to an undeclared variable. - */ -function getDeclaredGlobalVariable(scope, ref) { - var variable = astUtils.getVariableByName(scope, ref.identifier.name); - - // If it's an implicit global, it must have a `writeable` field (indicating it was declared) - if (variable && (!isImplicitGlobal(variable) || hasOwnProperty.call(variable, "writeable"))) { - return variable; - } - return null; -} - -/** - * Checks if the given node is the argument of a typeof operator. - * @param {ASTNode} node The AST node being checked. - * @returns {boolean} Whether or not the node is the argument of a typeof operator. - */ -function hasTypeOfOperator(node) { - var parent = node.parent; - return parent.type === "UnaryExpression" && parent.operator === "typeof"; -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var NOT_DEFINED_MESSAGE = "\"{{name}}\" is not defined.", - READ_ONLY_MESSAGE = "\"{{name}}\" is read only."; - - var options = context.options[0]; - var considerTypeOf = options && options.typeof === true || false; - - return { - - "Program:exit": function(/* node */) { - - var globalScope = context.getScope(); - - globalScope.through.forEach(function(ref) { - var variable = getDeclaredGlobalVariable(globalScope, ref), - name = ref.identifier.name; - - if (hasTypeOfOperator(ref.identifier) && !considerTypeOf) { - return; - } - - if (!variable) { - context.report(ref.identifier, NOT_DEFINED_MESSAGE, { name: name }); - } else if (ref.isWrite() && variable.writeable === false) { - context.report(ref.identifier, READ_ONLY_MESSAGE, { name: name }); - } - }); - - } - - }; - -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "typeof": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/no-undefined.js b/node_modules/eslint/lib/rules/no-undefined.js deleted file mode 100644 index 222be57..0000000 --- a/node_modules/eslint/lib/rules/no-undefined.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @fileoverview Rule to flag references to the undefined variable. - * @author Michael Ficarra - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "Identifier": function(node) { - if (node.name === "undefined") { - var parent = context.getAncestors().pop(); - if (!parent || parent.type !== "MemberExpression" || node !== parent.property || parent.computed) { - context.report(node, "Unexpected use of undefined."); - } - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-underscore-dangle.js b/node_modules/eslint/lib/rules/no-underscore-dangle.js deleted file mode 100644 index 4c11ff0..0000000 --- a/node_modules/eslint/lib/rules/no-underscore-dangle.js +++ /dev/null @@ -1,136 +0,0 @@ -/** - * @fileoverview Rule to flag trailing underscores in variable declarations. - * @author Matt DuVall - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var ALLOWED_VARIABLES = context.options[0] && context.options[0].allow ? context.options[0].allow : []; - - //------------------------------------------------------------------------- - // Helpers - //------------------------------------------------------------------------- - - /** - * Check if identifier is present inside the allowed option - * @param {string} identifier name of the node - * @returns {boolean} true if its is present - * @private - */ - function isAllowed(identifier) { - return ALLOWED_VARIABLES.some(function(ident) { - return ident === identifier; - }); - } - - /** - * Check if identifier has a underscore at the end - * @param {ASTNode} identifier node to evaluate - * @returns {boolean} true if its is present - * @private - */ - function hasTrailingUnderscore(identifier) { - var len = identifier.length; - - return identifier !== "_" && (identifier[0] === "_" || identifier[len - 1] === "_"); - } - - /** - * Check if identifier is a special case member expression - * @param {ASTNode} identifier node to evaluate - * @returns {boolean} true if its is a special case - * @private - */ - function isSpecialCaseIdentifierForMemberExpression(identifier) { - return identifier === "__proto__"; - } - - /** - * Check if identifier is a special case variable expression - * @param {ASTNode} identifier node to evaluate - * @returns {boolean} true if its is a special case - * @private - */ - function isSpecialCaseIdentifierInVariableExpression(identifier) { - // Checks for the underscore library usage here - return identifier === "_"; - } - - /** - * Check if function has a underscore at the end - * @param {ASTNode} node node to evaluate - * @returns {void} - * @private - */ - function checkForTrailingUnderscoreInFunctionDeclaration(node) { - if (node.id) { - var identifier = node.id.name; - - if (typeof identifier !== "undefined" && hasTrailingUnderscore(identifier) && !isAllowed(identifier)) { - context.report(node, "Unexpected dangling \"_\" in \"" + identifier + "\"."); - } - } - } - - /** - * Check if variable expression has a underscore at the end - * @param {ASTNode} node node to evaluate - * @returns {void} - * @private - */ - function checkForTrailingUnderscoreInVariableExpression(node) { - var identifier = node.id.name; - - if (typeof identifier !== "undefined" && hasTrailingUnderscore(identifier) && - !isSpecialCaseIdentifierInVariableExpression(identifier) && !isAllowed(identifier)) { - context.report(node, "Unexpected dangling \"_\" in \"" + identifier + "\"."); - } - } - - /** - * Check if member expression has a underscore at the end - * @param {ASTNode} node node to evaluate - * @returns {void} - * @private - */ - function checkForTrailingUnderscoreInMemberExpression(node) { - var identifier = node.property.name; - - if (typeof identifier !== "undefined" && hasTrailingUnderscore(identifier) && - !isSpecialCaseIdentifierForMemberExpression(identifier) && !isAllowed(identifier)) { - context.report(node, "Unexpected dangling \"_\" in \"" + identifier + "\"."); - } - } - - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- - - return { - "FunctionDeclaration": checkForTrailingUnderscoreInFunctionDeclaration, - "VariableDeclarator": checkForTrailingUnderscoreInVariableExpression, - "MemberExpression": checkForTrailingUnderscoreInMemberExpression - }; - -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "allow": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/no-unexpected-multiline.js b/node_modules/eslint/lib/rules/no-unexpected-multiline.js deleted file mode 100644 index 202182c..0000000 --- a/node_modules/eslint/lib/rules/no-unexpected-multiline.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @fileoverview Rule to spot scenarios where a newline looks like it is ending a statement, but is not. - * @author Glen Mailer - * @copyright 2015 Glen Mailer - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ -module.exports = function(context) { - - var FUNCTION_MESSAGE = "Unexpected newline between function and ( of function call."; - var PROPERTY_MESSAGE = "Unexpected newline between object and [ of property access."; - - /** - * Check to see if the bracket prior to the node is continuing the previous - * line's expression - * @param {ASTNode} node The node to check. - * @param {string} msg The error message to use. - * @returns {void} - * @private - */ - function checkForBreakBefore(node, msg) { - var tokens = context.getTokensBefore(node, 2); - var paren = tokens[1]; - var before = tokens[0]; - if (paren.loc.start.line !== before.loc.end.line) { - context.report(node, paren.loc.start, msg, { char: paren.value }); - } - } - - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- - - return { - - "MemberExpression": function(node) { - if (!node.computed) { - return; - } - - checkForBreakBefore(node.property, PROPERTY_MESSAGE); - }, - - "CallExpression": function(node) { - if (node.arguments.length === 0) { - return; - } - - checkForBreakBefore(node.arguments[0], FUNCTION_MESSAGE); - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-unneeded-ternary.js b/node_modules/eslint/lib/rules/no-unneeded-ternary.js deleted file mode 100644 index fcbff26..0000000 --- a/node_modules/eslint/lib/rules/no-unneeded-ternary.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @fileoverview Rule to flag no-unneeded-ternary - * @author Gyandeep Singh - * @copyright 2015 Gyandeep Singh. All rights reserved. - * @copyright 2015 Michael Ficarra. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var options = context.options[0] || {}; - var defaultAssignment = options.defaultAssignment !== false; - - /** - * Test if the node is a boolean literal - * @param {ASTNode} node - The node to report. - * @returns {boolean} True if the its a boolean literal - * @private - */ - function isBooleanLiteral(node) { - return node.type === "Literal" && typeof node.value === "boolean"; - } - - /** - * Test if the node matches the pattern id ? id : expression - * @param {ASTNode} node - The ConditionalExpression to check. - * @returns {boolean} True if the pattern is matched, and false otherwise - * @private - */ - function matchesDefaultAssignment(node) { - return node.test.type === "Identifier" && - node.consequent.type === "Identifier" && - node.test.name === node.consequent.name; - } - - return { - - "ConditionalExpression": function(node) { - if (isBooleanLiteral(node.alternate) && isBooleanLiteral(node.consequent)) { - context.report(node, node.consequent.loc.start, "Unnecessary use of boolean literals in conditional expression"); - } else if (!defaultAssignment && matchesDefaultAssignment(node)) { - context.report(node, node.consequent.loc.start, "Unnecessary use of conditional expression for default assignment"); - } - } - }; -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "defaultAssignment": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/no-unreachable.js b/node_modules/eslint/lib/rules/no-unreachable.js deleted file mode 100644 index 5da0ecd..0000000 --- a/node_modules/eslint/lib/rules/no-unreachable.js +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @fileoverview Checks for unreachable code due to return, throws, break, and continue. - * @author Joel Feenstra - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Report the node - * @param {object} context Current context as passed to the rule - * @param {ASTNode} node node to evaluate - * @param {string} unreachableType Type of the statement - * @returns {void} - * @private - */ -function report(context, node, unreachableType) { - var keyword; - switch (unreachableType) { - case "BreakStatement": - keyword = "break"; - break; - case "ContinueStatement": - keyword = "continue"; - break; - case "ReturnStatement": - keyword = "return"; - break; - case "ThrowStatement": - keyword = "throw"; - break; - default: - return; - } - context.report(node, "Found unexpected statement after a {{type}}.", { type: keyword }); -} - - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Checks if a node is an exception for no-unreachable because of variable/function hoisting - * @param {ASTNode} node The AST node to check. - * @returns {boolean} if the node doesn't trigger unreachable - * @private - */ - function isUnreachableAllowed(node) { - return node.type === "FunctionDeclaration" || - node.type === "VariableDeclaration" && - node.declarations.every(function(declaration) { - return declaration.type === "VariableDeclarator" && declaration.init === null; - }); - } - - /** - * Verifies that the given node is the last node or followed exclusively by - * hoisted declarations - * @param {ASTNode} node Node that should be the last node - * @returns {void} - * @private - */ - function checkNode(node) { - var parent = context.getAncestors().pop(); - var field, i, sibling; - - switch (parent.type) { - case "SwitchCase": - field = "consequent"; - break; - case "Program": - case "BlockStatement": - field = "body"; - break; - default: - return; - } - - for (i = parent[field].length - 1; i >= 0; i--) { - sibling = parent[field][i]; - if (sibling === node) { - return; // Found the last reachable statement, all done - } - - if (!isUnreachableAllowed(sibling)) { - report(context, sibling, node.type); - } - } - } - - return { - "ReturnStatement": checkNode, - "ThrowStatement": checkNode, - "ContinueStatement": checkNode, - "BreakStatement": checkNode - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-unused-expressions.js b/node_modules/eslint/lib/rules/no-unused-expressions.js deleted file mode 100644 index 82e21c0..0000000 --- a/node_modules/eslint/lib/rules/no-unused-expressions.js +++ /dev/null @@ -1,106 +0,0 @@ -/** - * @fileoverview Flag expressions in statement position that do not side effect - * @author Michael Ficarra - * @copyright 2013 Michael Ficarra. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var config = context.options[0] || {}, - allowShortCircuit = config.allowShortCircuit || false, - allowTernary = config.allowTernary || false; - - /** - * @param {ASTNode} node - any node - * @returns {boolean} whether the given node structurally represents a directive - */ - function looksLikeDirective(node) { - return node.type === "ExpressionStatement" && - node.expression.type === "Literal" && typeof node.expression.value === "string"; - } - - /** - * @param {Function} predicate - ([a] -> Boolean) the function used to make the determination - * @param {a[]} list - the input list - * @returns {a[]} the leading sequence of members in the given list that pass the given predicate - */ - function takeWhile(predicate, list) { - for (var i = 0, l = list.length; i < l; ++i) { - if (!predicate(list[i])) { - break; - } - } - return [].slice.call(list, 0, i); - } - - /** - * @param {ASTNode} node - a Program or BlockStatement node - * @returns {ASTNode[]} the leading sequence of directive nodes in the given node's body - */ - function directives(node) { - return takeWhile(looksLikeDirective, node.body); - } - - /** - * @param {ASTNode} node - any node - * @param {ASTNode[]} ancestors - the given node's ancestors - * @returns {boolean} whether the given node is considered a directive in its current position - */ - function isDirective(node, ancestors) { - var parent = ancestors[ancestors.length - 1], - grandparent = ancestors[ancestors.length - 2]; - return (parent.type === "Program" || parent.type === "BlockStatement" && - (/Function/.test(grandparent.type))) && - directives(parent).indexOf(node) >= 0; - } - - /** - * Determines whether or not a given node is a valid expression. Recurses on short circuit eval and ternary nodes if enabled by flags. - * @param {ASTNode} node - any node - * @returns {boolean} whether the given node is a valid expression - */ - function isValidExpression(node) { - if (allowTernary) { - // Recursive check for ternary and logical expressions - if (node.type === "ConditionalExpression") { - return isValidExpression(node.consequent) && isValidExpression(node.alternate); - } - } - if (allowShortCircuit) { - if (node.type === "LogicalExpression") { - return isValidExpression(node.right); - } - } - - return /^(?:Assignment|Call|New|Update|Yield)Expression$/.test(node.type) || - (node.type === "UnaryExpression" && ["delete", "void"].indexOf(node.operator) >= 0); - } - - return { - "ExpressionStatement": function(node) { - if (!isValidExpression(node.expression) && !isDirective(node, context.getAncestors())) { - context.report(node, "Expected an assignment or function call and instead saw an expression."); - } - } - }; - -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "allowShortCircuit": { - "type": "boolean" - }, - "allowTernary": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/no-unused-vars.js b/node_modules/eslint/lib/rules/no-unused-vars.js deleted file mode 100644 index ec7274b..0000000 --- a/node_modules/eslint/lib/rules/no-unused-vars.js +++ /dev/null @@ -1,331 +0,0 @@ -/** - * @fileoverview Rule to flag declared but unused variables - * @author Ilya Volodin - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var escape = require("escape-string-regexp"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var MESSAGE = "\"{{name}}\" is defined but never used"; - - var config = { - vars: "all", - args: "after-used" - }; - - var firstOption = context.options[0]; - - if (firstOption) { - if (typeof firstOption === "string") { - config.vars = firstOption; - } else { - config.vars = firstOption.vars || config.vars; - config.args = firstOption.args || config.args; - - if (firstOption.varsIgnorePattern) { - config.varsIgnorePattern = new RegExp(firstOption.varsIgnorePattern); - } - - if (firstOption.argsIgnorePattern) { - config.argsIgnorePattern = new RegExp(firstOption.argsIgnorePattern); - } - } - } - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Determines if a given variable is being exported from a module. - * @param {Variable} variable - EScope variable object. - * @returns {boolean} True if the variable is exported, false if not. - * @private - */ - function isExported(variable) { - - var definition = variable.defs[0]; - - if (definition) { - - var node = definition.node; - if (node.type === "VariableDeclarator") { - node = node.parent; - } else if (definition.type === "Parameter") { - return false; - } - - return node.parent.type.indexOf("Export") === 0; - } else { - return false; - } - } - - /** - * Determines if a reference is a read operation. - * @param {Reference} ref - An escope Reference - * @returns {Boolean} whether the given reference represents a read operation - * @private - */ - function isReadRef(ref) { - return ref.isRead(); - } - - /** - * Determine if an identifier is referencing an enclosing function name. - * @param {Reference} ref - The reference to check. - * @param {ASTNode[]} nodes - The candidate function nodes. - * @returns {boolean} True if it's a self-reference, false if not. - * @private - */ - function isSelfReference(ref, nodes) { - var scope = ref.from; - - while (scope) { - if (nodes.indexOf(scope.block) >= 0) { - return true; - } - - scope = scope.upper; - } - - return false; - } - - /** - * Determines if the variable is used. - * @param {Variable} variable - The variable to check. - * @param {Reference[]} references - The variable references to check. - * @returns {boolean} True if the variable is used - */ - function isUsedVariable(variable, references) { - var functionNodes = variable.defs.filter(function(def) { - return def.type === "FunctionName"; - }).map(function(def) { - return def.node; - }), - isFunctionDefinition = functionNodes.length > 0; - - return references.some(function(ref) { - return isReadRef(ref) && !(isFunctionDefinition && isSelfReference(ref, functionNodes)); - }); - } - - /** - * Gets unresolved references. - * They contains var's, function's, and explicit global variable's. - * If `config.vars` is not "all", returns empty map. - * @param {Scope} scope - the global scope. - * @returns {object} Unresolved references. Keys of the object is its variable name. Values of the object is an array of its references. - * @private - */ - function collectUnresolvedReferences(scope) { - var unresolvedRefs = Object.create(null); - - if (config.vars === "all") { - for (var i = 0, l = scope.through.length; i < l; ++i) { - var ref = scope.through[i]; - var name = ref.identifier.name; - - if (isReadRef(ref)) { - if (!unresolvedRefs[name]) { - unresolvedRefs[name] = []; - } - unresolvedRefs[name].push(ref); - } - } - } - - return unresolvedRefs; - } - - /** - * Gets an array of variables without read references. - * @param {Scope} scope - an escope Scope object. - * @param {object} unresolvedRefs - a map of each variable name and its references. - * @param {Variable[]} unusedVars - an array that saving result. - * @returns {Variable[]} unused variables of the scope and descendant scopes. - * @private - */ - function collectUnusedVariables(scope, unresolvedRefs, unusedVars) { - var variables = scope.variables; - var childScopes = scope.childScopes; - var i, l; - - if (scope.type !== "TDZ" && (scope.type !== "global" || config.vars === "all")) { - for (i = 0, l = variables.length; i < l; ++i) { - var variable = variables[i]; - - // skip a variable of class itself name in the class scope - if (scope.type === "class" && scope.block.id === variable.identifiers[0]) { - continue; - } - // skip function expression names and variables marked with markVariableAsUsed() - if (scope.functionExpressionScope || variable.eslintUsed) { - continue; - } - // skip implicit "arguments" variable - if (scope.type === "function" && variable.name === "arguments" && variable.identifiers.length === 0) { - continue; - } - - // explicit global variables don't have definitions. - var def = variable.defs[0]; - if (def) { - var type = def.type; - - // skip catch variables - if (type === "CatchClause") { - continue; - } - - if (type === "Parameter") { - // skip any setter argument - if (def.node.parent.type === "Property" && def.node.parent.kind === "set") { - continue; - } - - // if "args" option is "none", skip any parameter - if (config.args === "none") { - continue; - } - - // skip ignored parameters - if (config.argsIgnorePattern && config.argsIgnorePattern.test(def.name.name)) { - continue; - } - - // if "args" option is "after-used", skip all but the last parameter - if (config.args === "after-used" && def.index < def.node.params.length - 1) { - continue; - } - } else { - // skip ignored variables - if (config.varsIgnorePattern && config.varsIgnorePattern.test(def.name.name)) { - continue; - } - } - } - - // On global, variables without let/const/class are unresolved. - var references = (scope.type === "global" ? unresolvedRefs[variable.name] : null) || variable.references; - if (!isUsedVariable(variable, references) && !isExported(variable)) { - unusedVars.push(variable); - } - } - } - - for (i = 0, l = childScopes.length; i < l; ++i) { - collectUnusedVariables(childScopes[i], unresolvedRefs, unusedVars); - } - - return unusedVars; - } - - /** - * Gets the index of a given variable name in a given comment. - * @param {escope.Variable} variable - A variable to get. - * @param {ASTNode} comment - A comment node which includes the variable name. - * @returns {number} The index of the variable name's location. - */ - function getColumnInComment(variable, comment) { - var namePattern = new RegExp("[\\s,]" + escape(variable.name) + "(?:$|[\\s,:])", "g"); - - // To ignore the first text "global". - namePattern.lastIndex = comment.value.indexOf("global") + 6; - - // Search a given variable name. - var match = namePattern.exec(comment.value); - return match ? match.index + 1 : 0; - } - - /** - * Creates the correct location of a given variables. - * The location is at its name string in a `/*global` comment. - * - * @param {escope.Variable} variable - A variable to get its location. - * @returns {{line: number, column: number}} The location object for the variable. - */ - function getLocation(variable) { - var comment = variable.eslintExplicitGlobalComment; - var baseLoc = comment.loc.start; - var column = getColumnInComment(variable, comment); - var prefix = comment.value.slice(0, column); - var lineInComment = (prefix.match(/\n/g) || []).length; - - if (lineInComment > 0) { - column -= 1 + prefix.lastIndexOf("\n"); - } else { - // 2 is for `/*` - column += baseLoc.column + 2; - } - - return { - line: baseLoc.line + lineInComment, - column: column - }; - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - "Program:exit": function(programNode) { - var globalScope = context.getScope(); - var unresolvedRefs = collectUnresolvedReferences(globalScope); - var unusedVars = collectUnusedVariables(globalScope, unresolvedRefs, []); - - for (var i = 0, l = unusedVars.length; i < l; ++i) { - var unusedVar = unusedVars[i]; - - if (unusedVar.eslintUsed) { - continue; // explicitly exported variables - } else if (unusedVar.eslintExplicitGlobal) { - context.report(programNode, getLocation(unusedVar), MESSAGE, unusedVar); - } else if (unusedVar.defs.length > 0) { - context.report(unusedVar.identifiers[0], MESSAGE, unusedVar); - } - } - } - }; - -}; - -module.exports.schema = [ - { - "oneOf": [ - { - "enum": ["all", "local"] - }, - { - "type": "object", - "properties": { - "vars": { - "enum": ["all", "local"] - }, - "varsIgnorePattern": { - "type": "string" - }, - "args": { - "enum": ["all", "after-used", "none"] - }, - "argsIgnorePattern": { - "type": "string" - } - } - } - ] - } -]; diff --git a/node_modules/eslint/lib/rules/no-use-before-define.js b/node_modules/eslint/lib/rules/no-use-before-define.js deleted file mode 100644 index 9518d9e..0000000 --- a/node_modules/eslint/lib/rules/no-use-before-define.js +++ /dev/null @@ -1,109 +0,0 @@ -/** - * @fileoverview Rule to flag use of variables before they are defined - * @author Ilya Volodin - * @copyright 2013 Ilya Volodin. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Constants -//------------------------------------------------------------------------------ - -var NO_FUNC = "nofunc"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Finds and validates all variables in a given scope. - * @param {Scope} scope The scope object. - * @returns {void} - * @private - */ - function findVariablesInScope(scope) { - var typeOption = context.options[0]; - - /** - * Report the node - * @param {object} reference reference object - * @param {ASTNode} declaration node to evaluate - * @returns {void} - * @private - */ - function checkLocationAndReport(reference, declaration) { - if (typeOption !== NO_FUNC || declaration.defs[0].type !== "FunctionName") { - if (declaration.identifiers[0].range[1] > reference.identifier.range[1]) { - context.report(reference.identifier, "\"{{a}}\" was used before it was defined", {a: reference.identifier.name}); - } - } - } - - scope.references.forEach(function(reference) { - // if the reference is resolved check for declaration location - // if not, it could be function invocation, try to find manually - if (reference.resolved && reference.resolved.identifiers.length > 0) { - checkLocationAndReport(reference, reference.resolved); - } else { - var declaration = astUtils.getVariableByName(scope, reference.identifier.name); - // if there're no identifiers, this is a global environment variable - if (declaration && declaration.identifiers.length !== 0) { - checkLocationAndReport(reference, declaration); - } - } - }); - } - - - /** - * Validates variables inside of a node's scope. - * @param {ASTNode} node The node to check. - * @returns {void} - * @private - */ - function findVariables() { - var scope = context.getScope(); - findVariablesInScope(scope); - } - - var ruleDefinition = { - "Program": function() { - var scope = context.getScope(); - findVariablesInScope(scope); - - // both Node.js and Modules have an extra scope - if (context.ecmaFeatures.globalReturn || context.ecmaFeatures.modules) { - findVariablesInScope(scope.childScopes[0]); - } - } - }; - - if (context.ecmaFeatures.blockBindings) { - ruleDefinition.BlockStatement = ruleDefinition.SwitchStatement = findVariables; - - ruleDefinition.ArrowFunctionExpression = function(node) { - if (node.body.type !== "BlockStatement") { - findVariables(node); - } - }; - } else { - ruleDefinition.FunctionExpression = ruleDefinition.FunctionDeclaration = ruleDefinition.ArrowFunctionExpression = findVariables; - } - - return ruleDefinition; -}; - -module.exports.schema = [ - { - "enum": ["nofunc"] - } -]; diff --git a/node_modules/eslint/lib/rules/no-useless-call.js b/node_modules/eslint/lib/rules/no-useless-call.js deleted file mode 100644 index 8af37d7..0000000 --- a/node_modules/eslint/lib/rules/no-useless-call.js +++ /dev/null @@ -1,96 +0,0 @@ -/** - * @fileoverview A rule to disallow unnecessary `.call()` and `.apply()`. - * @author Toru Nagashima - * @copyright 2015 Toru Nagashima. All rights reserved. - */ - -"use strict"; - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Checks whether or not a node is a `.call()`/`.apply()`. - * @param {ASTNode} node - A CallExpression node to check. - * @returns {boolean} Whether or not the node is a `.call()`/`.apply()`. - */ -function isCallOrNonVariadicApply(node) { - return ( - node.callee.type === "MemberExpression" && - node.callee.property.type === "Identifier" && - node.callee.computed === false && - ( - (node.callee.property.name === "call" && node.arguments.length >= 1) || - (node.callee.property.name === "apply" && node.arguments.length === 2 && node.arguments[1].type === "ArrayExpression") - ) - ); -} - -/** - * Checks whether or not the tokens of two given nodes are same. - * @param {ASTNode} left - A node 1 to compare. - * @param {ASTNode} right - A node 2 to compare. - * @param {RuleContext} context - The ESLint rule context object. - * @returns {boolean} the source code for the given node. - */ -function equalTokens(left, right, context) { - var tokensL = context.getTokens(left); - var tokensR = context.getTokens(right); - - if (tokensL.length !== tokensR.length) { - return false; - } - for (var i = 0; i < tokensL.length; ++i) { - if (tokensL[i].type !== tokensR[i].type || - tokensL[i].value !== tokensR[i].value - ) { - return false; - } - } - - return true; -} - -/** - * Checks whether or not `thisArg` is not changed by `.call()`/`.apply()`. - * @param {ASTNode|null} expectedThis - The node that is the owner of the applied function. - * @param {ASTNode} thisArg - The node that is given to the first argument of the `.call()`/`.apply()`. - * @param {RuleContext} context - The ESLint rule context object. - * @returns {boolean} Whether or not `thisArg` is not changed by `.call()`/`.apply()`. - */ -function isValidThisArg(expectedThis, thisArg, context) { - if (!expectedThis) { - return astUtils.isNullOrUndefined(thisArg); - } - return equalTokens(expectedThis, thisArg, context); -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - return { - "CallExpression": function(node) { - if (!isCallOrNonVariadicApply(node)) { - return; - } - - var applied = node.callee.object; - var expectedThis = (applied.type === "MemberExpression") ? applied.object : null; - var thisArg = node.arguments[0]; - - if (isValidThisArg(expectedThis, thisArg, context)) { - context.report( - node, - "unnecessary \".{{name}}()\".", - {name: node.callee.property.name}); - } - } - }; -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-useless-concat.js b/node_modules/eslint/lib/rules/no-useless-concat.js deleted file mode 100644 index 6f230a9..0000000 --- a/node_modules/eslint/lib/rules/no-useless-concat.js +++ /dev/null @@ -1,89 +0,0 @@ -/** - * @fileoverview disallow unncessary concatenation of template strings - * @author Henry Zhu - * @copyright 2015 Henry Zhu. All rights reserved. - * See LICENSE file in root directory for full license. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Checks whether or not a given node is a concatenation. - * @param {ASTNode} node - A node to check. - * @returns {boolean} `true` if the node is a concatenation. - */ -function isConcatenation(node) { - return node.type === "BinaryExpression" && node.operator === "+"; -} - -/** - * Get's the right most node on the left side of a BinaryExpression with + operator. - * @param {ASTNode} node - A BinaryExpression node to check. - * @returns {ASTNode} node - */ -function getLeft(node) { - var left = node.left; - while (isConcatenation(left)) { - left = left.right; - } - return left; -} - -/** - * Get's the left most node on the right side of a BinaryExpression with + operator. - * @param {ASTNode} node - A BinaryExpression node to check. - * @returns {ASTNode} node - */ -function getRight(node) { - var right = node.right; - while (isConcatenation(right)) { - right = right.left; - } - return right; -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - return { - BinaryExpression: function(node) { - // check if not concatenation - if (node.operator !== "+") { - return; - } - - // account for the `foo + "a" + "b"` case - var left = getLeft(node); - var right = getRight(node); - - if (astUtils.isStringLiteral(left) && - astUtils.isStringLiteral(right) && - astUtils.isTokenOnSameLine(left, right) - ) { - // move warning location to operator - var operatorToken = context.getTokenAfter(left); - while (operatorToken.value !== "+") { - operatorToken = context.getTokenAfter(operatorToken); - } - - context.report( - node, - operatorToken.loc.start, - "Unexpected string concatenation of literals."); - } - } - }; -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-var.js b/node_modules/eslint/lib/rules/no-var.js deleted file mode 100644 index 05cb6e9..0000000 --- a/node_modules/eslint/lib/rules/no-var.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @fileoverview Rule to check for the usage of var. - * @author Jamund Ferguson - * @copyright 2014 Jamund Ferguson. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - "VariableDeclaration": function(node) { - if (node.kind === "var") { - context.report(node, "Unexpected var, use let or const instead."); - } - } - - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-void.js b/node_modules/eslint/lib/rules/no-void.js deleted file mode 100644 index 858304d..0000000 --- a/node_modules/eslint/lib/rules/no-void.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @fileoverview Rule to disallow use of void operator. - * @author Mike Sidorov - * @copyright 2014 Mike Sidorov. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - "UnaryExpression": function(node) { - if (node.operator === "void") { - context.report(node, "Expected 'undefined' and instead saw 'void'."); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/no-warning-comments.js b/node_modules/eslint/lib/rules/no-warning-comments.js deleted file mode 100644 index 65768fe..0000000 --- a/node_modules/eslint/lib/rules/no-warning-comments.js +++ /dev/null @@ -1,109 +0,0 @@ -/** - * @fileoverview Rule that warns about used warning comments - * @author Alexander Schmidt - */ - -"use strict"; - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var configuration = context.options[0] || {}, - warningTerms = configuration.terms || ["todo", "fixme", "xxx"], - location = configuration.location || "start", - selfConfigRegEx = /\bno-warning-comments\b/, - warningRegExps; - - /** - * Convert a warning term into a RegExp which will match a comment containing that whole word in the specified - * location ("start" or "anywhere"). If the term starts or ends with non word characters, then the match will not - * require word boundaries on that side. - * - * @param {String} term A term to convert to a RegExp - * @returns {RegExp} The term converted to a RegExp - */ - function convertToRegExp(term) { - var escaped = term.replace(/[-\/\\$\^*+?.()|\[\]{}]/g, "\\$&"), - // If the term ends in a word character (a-z0-9_), ensure a word boundary at the end, so that substrings do - // not get falsely matched. eg "todo" in a string such as "mastodon". - // If the term ends in a non-word character, then \b won't match on the boundary to the next non-word - // character, which would likely be a space. For example `/\bFIX!\b/.test('FIX! blah') === false`. - // In these cases, use no bounding match. Same applies for the prefix, handled below. - suffix = /\w$/.test(term) ? "\\b" : "", - prefix; - - if (location === "start") { - // When matching at the start, ignore leading whitespace, and there's no need to worry about word boundaries - prefix = "^\\s*"; - } else if (/^\w/.test(term)) { - prefix = "\\b"; - } else { - prefix = ""; - } - - return new RegExp(prefix + escaped + suffix, "i"); - } - - /** - * Checks the specified comment for matches of the configured warning terms and returns the matches. - * @param {String} comment The comment which is checked. - * @returns {Array} All matched warning terms for this comment. - */ - function commentContainsWarningTerm(comment) { - var matches = []; - - warningRegExps.forEach(function(regex, index) { - if (regex.test(comment)) { - matches.push(warningTerms[index]); - } - }); - - return matches; - } - - /** - * Checks the specified node for matching warning comments and reports them. - * @param {ASTNode} node The AST node being checked. - * @returns {void} undefined. - */ - function checkComment(node) { - if (astUtils.isDirectiveComment(node) && selfConfigRegEx.test(node.value)) { - return; - } - - var matches = commentContainsWarningTerm(node.value); - - matches.forEach(function(matchedTerm) { - context.report(node, "Unexpected \"" + matchedTerm + "\" comment."); - }); - } - - warningRegExps = warningTerms.map(convertToRegExp); - return { - "BlockComment": checkComment, - "LineComment": checkComment - }; -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "terms": { - "type": "array", - "items": { - "type": "string" - } - }, - "location": { - "enum": ["start", "anywhere"] - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/no-with.js b/node_modules/eslint/lib/rules/no-with.js deleted file mode 100644 index beec255..0000000 --- a/node_modules/eslint/lib/rules/no-with.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * @fileoverview Rule to flag use of with statement - * @author Nicholas C. Zakas - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - "WithStatement": function(node) { - context.report(node, "Unexpected use of 'with' statement."); - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/object-curly-spacing.js b/node_modules/eslint/lib/rules/object-curly-spacing.js deleted file mode 100644 index a3c68c5..0000000 --- a/node_modules/eslint/lib/rules/object-curly-spacing.js +++ /dev/null @@ -1,265 +0,0 @@ -/** - * @fileoverview Disallows or enforces spaces inside of object literals. - * @author Jamund Ferguson - * @copyright 2014 Brandyn Bennett. All rights reserved. - * @copyright 2014 Michael Ficarra. No rights reserved. - * @copyright 2014 Vignesh Anand. All rights reserved. - * @copyright 2015 Jamund Ferguson. All rights reserved. - * @copyright 2015 Toru Nagashima. All rights reserved. - * See LICENSE file in root directory for full license. - */ -"use strict"; - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var spaced = context.options[0] === "always", - sourceCode = context.getSourceCode(); - - /** - * Determines whether an option is set, relative to the spacing option. - * If spaced is "always", then check whether option is set to false. - * If spaced is "never", then check whether option is set to true. - * @param {Object} option - The option to exclude. - * @returns {boolean} Whether or not the property is excluded. - */ - function isOptionSet(option) { - return context.options[1] ? context.options[1][option] === !spaced : false; - } - - var options = { - spaced: spaced, - arraysInObjectsException: isOptionSet("arraysInObjects"), - objectsInObjectsException: isOptionSet("objectsInObjects") - }; - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Reports that there shouldn't be a space after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportNoBeginningSpace(node, token) { - context.report({ - node: node, - loc: token.loc.end, - message: "There should be no space after '" + token.value + "'", - fix: function(fixer) { - var nextToken = context.getSourceCode().getTokenAfter(token); - return fixer.removeRange([token.range[1], nextToken.range[0]]); - } - }); - } - - /** - * Reports that there shouldn't be a space before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportNoEndingSpace(node, token) { - context.report({ - node: node, - loc: token.loc.start, - message: "There should be no space before '" + token.value + "'", - fix: function(fixer) { - var previousToken = context.getSourceCode().getTokenBefore(token); - return fixer.removeRange([previousToken.range[1], token.range[0]]); - } - }); - } - - /** - * Reports that there should be a space after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportRequiredBeginningSpace(node, token) { - context.report({ - node: node, - loc: token.loc.end, - message: "A space is required after '" + token.value + "'", - fix: function(fixer) { - return fixer.insertTextAfter(token, " "); - } - }); - } - - /** - * Reports that there should be a space before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportRequiredEndingSpace(node, token) { - context.report({ - node: node, - loc: token.loc.start, - message: "A space is required before '" + token.value + "'", - fix: function(fixer) { - return fixer.insertTextBefore(token, " "); - } - }); - } - - /** - * Determines if spacing in curly braces is valid. - * @param {ASTNode} node The AST node to check. - * @param {Token} first The first token to check (should be the opening brace) - * @param {Token} second The second token to check (should be first after the opening brace) - * @param {Token} penultimate The penultimate token to check (should be last before closing brace) - * @param {Token} last The last token to check (should be closing brace) - * @returns {void} - */ - function validateBraceSpacing(node, first, second, penultimate, last) { - var closingCurlyBraceMustBeSpaced = - options.arraysInObjectsException && penultimate.value === "]" || - options.objectsInObjectsException && penultimate.value === "}" - ? !options.spaced : options.spaced, - firstSpaced, lastSpaced; - - if (astUtils.isTokenOnSameLine(first, second)) { - firstSpaced = sourceCode.isSpaceBetweenTokens(first, second); - if (options.spaced && !firstSpaced) { - reportRequiredBeginningSpace(node, first); - } - if (!options.spaced && firstSpaced) { - reportNoBeginningSpace(node, first); - } - } - - if (astUtils.isTokenOnSameLine(penultimate, last)) { - lastSpaced = sourceCode.isSpaceBetweenTokens(penultimate, last); - if (closingCurlyBraceMustBeSpaced && !lastSpaced) { - reportRequiredEndingSpace(node, last); - } - if (!closingCurlyBraceMustBeSpaced && lastSpaced) { - reportNoEndingSpace(node, last); - } - } - } - - /** - * Reports a given object node if spacing in curly braces is invalid. - * @param {ASTNode} node - An ObjectExpression or ObjectPattern node to check. - * @returns {void} - */ - function checkForObject(node) { - if (node.properties.length === 0) { - return; - } - - var first = sourceCode.getFirstToken(node), - last = sourceCode.getLastToken(node), - second = sourceCode.getTokenAfter(first), - penultimate = sourceCode.getTokenBefore(last); - - validateBraceSpacing(node, first, second, penultimate, last); - } - - /** - * Reports a given import node if spacing in curly braces is invalid. - * @param {ASTNode} node - An ImportDeclaration node to check. - * @returns {void} - */ - function checkForImport(node) { - if (node.specifiers.length === 0) { - return; - } - - var firstSpecifier = node.specifiers[0], - lastSpecifier = node.specifiers[node.specifiers.length - 1]; - - if (lastSpecifier.type !== "ImportSpecifier") { - return; - } - if (firstSpecifier.type !== "ImportSpecifier") { - firstSpecifier = node.specifiers[1]; - } - - var first = sourceCode.getTokenBefore(firstSpecifier), - last = sourceCode.getTokenAfter(lastSpecifier); - - // to support a trailing comma. - if (last.value === ",") { - last = sourceCode.getTokenAfter(last); - } - - var second = sourceCode.getTokenAfter(first), - penultimate = sourceCode.getTokenBefore(last); - - validateBraceSpacing(node, first, second, penultimate, last); - } - - /** - * Reports a given export node if spacing in curly braces is invalid. - * @param {ASTNode} node - An ExportNamedDeclaration node to check. - * @returns {void} - */ - function checkForExport(node) { - if (node.specifiers.length === 0) { - return; - } - - var firstSpecifier = node.specifiers[0], - lastSpecifier = node.specifiers[node.specifiers.length - 1], - first = sourceCode.getTokenBefore(firstSpecifier), - last = sourceCode.getTokenAfter(lastSpecifier); - - // to support a trailing comma. - if (last.value === ",") { - last = sourceCode.getTokenAfter(last); - } - - var second = sourceCode.getTokenAfter(first), - penultimate = sourceCode.getTokenBefore(last); - - validateBraceSpacing(node, first, second, penultimate, last); - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - // var {x} = y; - ObjectPattern: checkForObject, - - // var y = {x: 'y'} - ObjectExpression: checkForObject, - - // import {y} from 'x'; - ImportDeclaration: checkForImport, - - // export {name} from 'yo'; - ExportNamedDeclaration: checkForExport - }; - -}; - -module.exports.schema = [ - { - "enum": ["always", "never"] - }, - { - "type": "object", - "properties": { - "arraysInObjects": { - "type": "boolean" - }, - "objectsInObjects": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/object-shorthand.js b/node_modules/eslint/lib/rules/object-shorthand.js deleted file mode 100644 index 078f842..0000000 --- a/node_modules/eslint/lib/rules/object-shorthand.js +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @fileoverview Rule to enforce concise object methods and properties. - * @author Jamund Ferguson - * @copyright 2015 Jamund Ferguson. All rights reserved. - */ - -"use strict"; - -var OPTIONS = { - always: "always", - never: "never", - methods: "methods", - properties: "properties" -}; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var APPLY = context.options[0] || OPTIONS.always; - var APPLY_TO_METHODS = APPLY === OPTIONS.methods || APPLY === OPTIONS.always; - var APPLY_TO_PROPS = APPLY === OPTIONS.properties || APPLY === OPTIONS.always; - var APPLY_NEVER = APPLY === OPTIONS.never; - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - "Property": function(node) { - var isConciseProperty = node.method || node.shorthand, - type; - - // if we're "never" and concise we should warn now - if (APPLY_NEVER && isConciseProperty) { - type = node.method ? "method" : "property"; - context.report(node, "Expected longform " + type + " syntax."); - } - - // at this point if we're concise or if we're "never" we can leave - if (APPLY_NEVER || isConciseProperty) { - return; - } - - // getters, setters and computed properties are ignored - if (node.kind === "get" || node.kind === "set" || node.computed) { - return; - } - - if (node.value.type === "FunctionExpression" && !node.value.id && APPLY_TO_METHODS) { - - // {x: function(){}} should be written as {x() {}} - context.report(node, "Expected method shorthand."); - } else if (node.value.type === "Identifier" && node.key.name === node.value.name && APPLY_TO_PROPS) { - - // {x: x} should be written as {x} - context.report(node, "Expected property shorthand."); - } else if (node.value.type === "Identifier" && node.key.type === "Literal" && node.key.value === node.value.name && APPLY_TO_PROPS) { - - // {"x": x} should be written as {x} - context.report(node, "Expected property shorthand."); - } - } - }; - -}; - -module.exports.schema = [ - { - "enum": ["always", "methods", "properties", "never"] - } -]; diff --git a/node_modules/eslint/lib/rules/one-var.js b/node_modules/eslint/lib/rules/one-var.js deleted file mode 100644 index 55c8114..0000000 --- a/node_modules/eslint/lib/rules/one-var.js +++ /dev/null @@ -1,315 +0,0 @@ -/** - * @fileoverview A rule to control the use of single variable declarations. - * @author Ian Christian Myers - * @copyright 2015 Ian VanSchooten. All rights reserved. - * @copyright 2015 Joey Baker. All rights reserved. - * @copyright 2015 Danny Fritz. All rights reserved. - * @copyright 2013 Ian Christian Myers. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var MODE_ALWAYS = "always", - MODE_NEVER = "never"; - - var mode = context.options[0] || MODE_ALWAYS; - - var options = { - }; - - if (typeof mode === "string") { // simple options configuration with just a string - options.var = { uninitialized: mode, initialized: mode}; - options.let = { uninitialized: mode, initialized: mode}; - options.const = { uninitialized: mode, initialized: mode}; - } else if (typeof mode === "object") { // options configuration is an object - if (mode.hasOwnProperty("var") && typeof mode.var === "string") { - options.var = { uninitialized: mode.var, initialized: mode.var}; - } - if (mode.hasOwnProperty("let") && typeof mode.let === "string") { - options.let = { uninitialized: mode.let, initialized: mode.let}; - } - if (mode.hasOwnProperty("const") && typeof mode.const === "string") { - options.const = { uninitialized: mode.const, initialized: mode.const}; - } - if (mode.hasOwnProperty("uninitialized")) { - if (!options.var) { - options.var = {}; - } - if (!options.let) { - options.let = {}; - } - if (!options.const) { - options.const = {}; - } - options.var.uninitialized = mode.uninitialized; - options.let.uninitialized = mode.uninitialized; - options.const.uninitialized = mode.uninitialized; - } - if (mode.hasOwnProperty("initialized")) { - if (!options.var) { - options.var = {}; - } - if (!options.let) { - options.let = {}; - } - if (!options.const) { - options.const = {}; - } - options.var.initialized = mode.initialized; - options.let.initialized = mode.initialized; - options.const.initialized = mode.initialized; - } - } - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - var functionStack = []; - var blockStack = []; - - /** - * Increments the blockStack counter. - * @returns {void} - * @private - */ - function startBlock() { - blockStack.push({ - let: {initialized: false, uninitialized: false}, - const: {initialized: false, uninitialized: false} - }); - } - - /** - * Increments the functionStack counter. - * @returns {void} - * @private - */ - function startFunction() { - functionStack.push({initialized: false, uninitialized: false}); - startBlock(); - } - - /** - * Decrements the blockStack counter. - * @returns {void} - * @private - */ - function endBlock() { - blockStack.pop(); - } - - /** - * Decrements the functionStack counter. - * @returns {void} - * @private - */ - function endFunction() { - functionStack.pop(); - endBlock(); - } - - /** - * Records whether initialized or uninitialized variables are defined in current scope. - * @param {string} statementType node.kind, one of: "var", "let", or "const" - * @param {ASTNode[]} declarations List of declarations - * @param {Object} currentScope The scope being investigated - * @returns {void} - * @private - */ - function recordTypes(statementType, declarations, currentScope) { - for (var i = 0; i < declarations.length; i++) { - if (declarations[i].init === null) { - if (options[statementType] && options[statementType].uninitialized === MODE_ALWAYS) { - currentScope.uninitialized = true; - } - } else { - if (options[statementType] && options[statementType].initialized === MODE_ALWAYS) { - currentScope.initialized = true; - } - } - } - } - - /** - * Determines the current scope (function or block) - * @param {string} statementType node.kind, one of: "var", "let", or "const" - * @returns {Object} The scope associated with statementType - */ - function getCurrentScope(statementType) { - var currentScope; - if (statementType === "var") { - currentScope = functionStack[functionStack.length - 1]; - } else if (statementType === "let") { - currentScope = blockStack[blockStack.length - 1].let; - } else if (statementType === "const") { - currentScope = blockStack[blockStack.length - 1].const; - } - return currentScope; - } - - /** - * Counts the number of initialized and uninitialized declarations in a list of declarations - * @param {ASTNode[]} declarations List of declarations - * @returns {Object} Counts of 'uninitialized' and 'initialized' declarations - * @private - */ - function countDeclarations(declarations) { - var counts = { uninitialized: 0, initialized: 0 }; - for (var i = 0; i < declarations.length; i++) { - if (declarations[i].init === null) { - counts.uninitialized++; - } else { - counts.initialized++; - } - } - return counts; - } - - /** - * Determines if there is more than one var statement in the current scope. - * @param {string} statementType node.kind, one of: "var", "let", or "const" - * @param {ASTNode[]} declarations List of declarations - * @returns {boolean} Returns true if it is the first var declaration, false if not. - * @private - */ - function hasOnlyOneStatement(statementType, declarations) { - - var declarationCounts = countDeclarations(declarations); - var currentOptions = options[statementType] || {}; - var currentScope = getCurrentScope(statementType); - - if (currentOptions.uninitialized === MODE_ALWAYS && currentOptions.initialized === MODE_ALWAYS) { - if (currentScope.uninitialized || currentScope.initialized) { - return false; - } - } - - if (declarationCounts.uninitialized > 0) { - if (currentOptions.uninitialized === MODE_ALWAYS && currentScope.uninitialized) { - return false; - } - } - if (declarationCounts.initialized > 0) { - if (currentOptions.initialized === MODE_ALWAYS && currentScope.initialized) { - return false; - } - } - recordTypes(statementType, declarations, currentScope); - return true; - } - - - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- - - return { - "Program": startFunction, - "FunctionDeclaration": startFunction, - "FunctionExpression": startFunction, - "ArrowFunctionExpression": startFunction, - "BlockStatement": startBlock, - "ForStatement": startBlock, - "ForInStatement": startBlock, - "ForOfStatement": startBlock, - "SwitchStatement": startBlock, - - "VariableDeclaration": function(node) { - var parent = node.parent, - type, declarations, declarationCounts; - - type = node.kind; - if (!options[type]) { - return; - } - - declarations = node.declarations; - declarationCounts = countDeclarations(declarations); - - // always - if (!hasOnlyOneStatement(type, declarations)) { - if (options[type].initialized === MODE_ALWAYS && options[type].uninitialized === MODE_ALWAYS) { - context.report(node, "Combine this with the previous '" + type + "' statement."); - } else { - if (options[type].initialized === MODE_ALWAYS) { - context.report(node, "Combine this with the previous '" + type + "' statement with initialized variables."); - } - if (options[type].uninitialized === MODE_ALWAYS) { - context.report(node, "Combine this with the previous '" + type + "' statement with uninitialized variables."); - } - } - } - // never - if (parent.type !== "ForStatement" || parent.init !== node) { - var totalDeclarations = declarationCounts.uninitialized + declarationCounts.initialized; - if (totalDeclarations > 1) { - // both initialized and uninitialized - if (options[type].initialized === MODE_NEVER && options[type].uninitialized === MODE_NEVER) { - context.report(node, "Split '" + type + "' declarations into multiple statements."); - // initialized - } else if (options[type].initialized === MODE_NEVER && declarationCounts.initialized > 0) { - context.report(node, "Split initialized '" + type + "' declarations into multiple statements."); - // uninitialized - } else if (options[type].uninitialized === MODE_NEVER && declarationCounts.uninitialized > 0) { - context.report(node, "Split uninitialized '" + type + "' declarations into multiple statements."); - } - } - } - }, - - "ForStatement:exit": endBlock, - "ForOfStatement:exit": endBlock, - "ForInStatement:exit": endBlock, - "SwitchStatement:exit": endBlock, - "BlockStatement:exit": endBlock, - "Program:exit": endFunction, - "FunctionDeclaration:exit": endFunction, - "FunctionExpression:exit": endFunction, - "ArrowFunctionExpression:exit": endFunction - }; - -}; - -module.exports.schema = [ - { - "oneOf": [ - { - "enum": ["always", "never"] - }, - { - "type": "object", - "properties": { - "var": { - "enum": ["always", "never"] - }, - "let": { - "enum": ["always", "never"] - }, - "const": { - "enum": ["always", "never"] - } - }, - "additionalProperties": false - }, - { - "type": "object", - "properties": { - "initialized": { - "enum": ["always", "never"] - }, - "uninitialized": { - "enum": ["always", "never"] - } - }, - "additionalProperties": false - } - ] - } -]; diff --git a/node_modules/eslint/lib/rules/operator-assignment.js b/node_modules/eslint/lib/rules/operator-assignment.js deleted file mode 100644 index aa9e032..0000000 --- a/node_modules/eslint/lib/rules/operator-assignment.js +++ /dev/null @@ -1,118 +0,0 @@ -/** - * @fileoverview Rule to replace assignment expressions with operator assignment - * @author Brandon Mills - * @copyright 2014 Brandon Mills. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Checks whether an operator is commutative and has an operator assignment - * shorthand form. - * @param {string} operator Operator to check. - * @returns {boolean} True if the operator is commutative and has a - * shorthand form. - */ -function isCommutativeOperatorWithShorthand(operator) { - return ["*", "&", "^", "|"].indexOf(operator) >= 0; -} - -/** - * Checks whether an operator is not commuatative and has an operator assignment - * shorthand form. - * @param {string} operator Operator to check. - * @returns {boolean} True if the operator is not commuatative and has - * a shorthand form. - */ -function isNonCommutativeOperatorWithShorthand(operator) { - return ["+", "-", "/", "%", "<<", ">>", ">>>"].indexOf(operator) >= 0; -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -/** - * Checks whether two expressions reference the same value. For example: - * a = a - * a.b = a.b - * a[0] = a[0] - * a['b'] = a['b'] - * @param {ASTNode} a Left side of the comparison. - * @param {ASTNode} b Right side of the comparison. - * @returns {boolean} True if both sides match and reference the same value. - */ -function same(a, b) { - if (a.type !== b.type) { - return false; - } - - switch (a.type) { - case "Identifier": - return a.name === b.name; - case "Literal": - return a.value === b.value; - case "MemberExpression": - // x[0] = x[0] - // x[y] = x[y] - // x.y = x.y - return same(a.object, b.object) && same(a.property, b.property); - default: - return false; - } -} - -module.exports = function(context) { - - /** - * Ensures that an assignment uses the shorthand form where possible. - * @param {ASTNode} node An AssignmentExpression node. - * @returns {void} - */ - function verify(node) { - var expr, left, operator; - - if (node.operator !== "=" || node.right.type !== "BinaryExpression") { - return; - } - - left = node.left; - expr = node.right; - operator = expr.operator; - - if (isCommutativeOperatorWithShorthand(operator)) { - if (same(left, expr.left) || same(left, expr.right)) { - context.report(node, "Assignment can be replaced with operator assignment."); - } - } else if (isNonCommutativeOperatorWithShorthand(operator)) { - if (same(left, expr.left)) { - context.report(node, "Assignment can be replaced with operator assignment."); - } - } - } - - /** - * Warns if an assignment expression uses operator assignment shorthand. - * @param {ASTNode} node An AssignmentExpression node. - * @returns {void} - */ - function prohibit(node) { - if (node.operator !== "=") { - context.report(node, "Unexpected operator assignment shorthand."); - } - } - - return { - "AssignmentExpression": context.options[0] !== "never" ? verify : prohibit - }; - -}; - -module.exports.schema = [ - { - "enum": ["always", "never"] - } -]; diff --git a/node_modules/eslint/lib/rules/operator-linebreak.js b/node_modules/eslint/lib/rules/operator-linebreak.js deleted file mode 100644 index d23032e..0000000 --- a/node_modules/eslint/lib/rules/operator-linebreak.js +++ /dev/null @@ -1,147 +0,0 @@ -/** - * @fileoverview Operator linebreak - enforces operator linebreak style of two types: after and before - * @author Benoît Zugmeyer - * @copyright 2015 Benoît Zugmeyer. All rights reserved. - */ - -"use strict"; - -var assign = require("object-assign"), - astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var usedDefaultGlobal = !context.options[0]; - var globalStyle = context.options[0] || "after"; - var options = context.options[1] || {}; - var styleOverrides = options.overrides ? assign({}, options.overrides) : {}; - - if (usedDefaultGlobal && !styleOverrides["?"]) { - styleOverrides["?"] = "before"; - } - - if (usedDefaultGlobal && !styleOverrides[":"]) { - styleOverrides[":"] = "before"; - } - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Checks the operator placement - * @param {ASTNode} node The node to check - * @param {ASTNode} leftSide The node that comes before the operator in `node` - * @private - * @returns {void} - */ - function validateNode(node, leftSide) { - var leftToken = context.getLastToken(leftSide); - var operatorToken = context.getTokenAfter(leftToken); - - // When the left part of a binary expression is a single expression wrapped in - // parentheses (ex: `(a) + b`), leftToken will be the last token of the expression - // and operatorToken will be the closing parenthesis. - // The leftToken should be the last closing parenthesis, and the operatorToken - // should be the token right after that. - while (operatorToken.value === ")") { - leftToken = operatorToken; - operatorToken = context.getTokenAfter(operatorToken); - } - - var rightToken = context.getTokenAfter(operatorToken); - var operator = operatorToken.value; - var style = styleOverrides[operator] || globalStyle; - - // if single line - if (astUtils.isTokenOnSameLine(leftToken, operatorToken) && - astUtils.isTokenOnSameLine(operatorToken, rightToken)) { - - return; - - } else if (!astUtils.isTokenOnSameLine(leftToken, operatorToken) && - !astUtils.isTokenOnSameLine(operatorToken, rightToken)) { - - // lone operator - context.report(node, { - line: operatorToken.loc.end.line, - column: operatorToken.loc.end.column - }, "Bad line breaking before and after '" + operator + "'."); - - } else if (style === "before" && astUtils.isTokenOnSameLine(leftToken, operatorToken)) { - - context.report(node, { - line: operatorToken.loc.end.line, - column: operatorToken.loc.end.column - }, "'" + operator + "' should be placed at the beginning of the line."); - - } else if (style === "after" && astUtils.isTokenOnSameLine(operatorToken, rightToken)) { - - context.report(node, { - line: operatorToken.loc.end.line, - column: operatorToken.loc.end.column - }, "'" + operator + "' should be placed at the end of the line."); - - } else if (style === "none") { - - context.report(node, { - line: operatorToken.loc.end.line, - column: operatorToken.loc.end.column - }, "There should be no line break before or after '" + operator + "'"); - - } - } - - /** - * Validates a binary expression using `validateNode` - * @param {BinaryExpression|LogicalExpression|AssignmentExpression} node node to be validated - * @returns {void} - */ - function validateBinaryExpression(node) { - validateNode(node, node.left); - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - "BinaryExpression": validateBinaryExpression, - "LogicalExpression": validateBinaryExpression, - "AssignmentExpression": validateBinaryExpression, - "VariableDeclarator": function(node) { - if (node.init) { - validateNode(node, node.id); - } - }, - "ConditionalExpression": function(node) { - validateNode(node, node.test); - validateNode(node, node.consequent); - } - }; -}; - -module.exports.schema = [ - { - "enum": ["after", "before", "none", null] - }, - { - "type": "object", - "properties": { - "overrides": { - "type": "object", - "properties": { - "anyOf": { - "type": "string", - "enum": ["after", "before", "none"] - } - } - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/padded-blocks.js b/node_modules/eslint/lib/rules/padded-blocks.js deleted file mode 100644 index 56e6a78..0000000 --- a/node_modules/eslint/lib/rules/padded-blocks.js +++ /dev/null @@ -1,125 +0,0 @@ -/** - * @fileoverview A rule to ensure blank lines within blocks. - * @author Mathias Schreck - * @copyright 2014 Mathias Schreck. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var requirePadding = context.options[0] !== "never"; - - var ALWAYS_MESSAGE = "Block must be padded by blank lines.", - NEVER_MESSAGE = "Block must not be padded by blank lines."; - - /** - * Retrieves an array of all comments defined inside the given node. - * @param {ASTNode} node The AST node. - * @returns {ASTNode[]} An array of comment nodes. - */ - function getCommentsInNode(node) { - var allComments = context.getAllComments(); - - return allComments.filter(function(comment) { - return node.range[0] < comment.range[0] && - node.range[1] > comment.range[1]; - }); - } - - /** - * Checks if the location of a node or token is before the location of another node or token - * @param {ASTNode|Token} a The node or token to check if its location is before b. - * @param {ASTNode|Token} b The node or token which will be compared with a. - * @returns {boolean} True if a is located before b. - */ - function isLocatedBefore(a, b) { - return a.range[1] < b.range[0]; - } - - /** - * Checks if the given non empty block node has a blank line before its first child node. - * @param {ASTNode} node The AST node of a BlockStatement. - * @returns {boolean} Whether or not the block starts with a blank line. - */ - function isBlockTopPadded(node) { - var blockStart = node.loc.start.line, - first = node.body[0], - firstLine = first.loc.start.line, - expectedFirstLine = blockStart + 2, - comments = getCommentsInNode(node), - firstComment = comments[0]; - - if (firstComment && isLocatedBefore(firstComment, first)) { - firstLine = firstComment.loc.start.line; - } - - return expectedFirstLine <= firstLine; - } - - /** - * Checks if the given non empty block node has a blank line after its last child node. - * @param {ASTNode} node The AST node of a BlockStatement. - * @returns {boolean} Whether or not the block ends with a blank line. - */ - function isBlockBottomPadded(node) { - var blockEnd = node.loc.end.line, - last = node.body[node.body.length - 1], - lastToken = context.getLastToken(last), - lastLine = lastToken.loc.end.line, - expectedLastLine = blockEnd - 2, - comments = getCommentsInNode(node), - lastComment = comments[comments.length - 1]; - - if (lastComment && isLocatedBefore(lastToken, lastComment)) { - lastLine = lastComment.loc.end.line; - } - - return lastLine <= expectedLastLine; - } - - /** - * Checks the given BlockStatement node to be padded if the block is not empty. - * @param {ASTNode} node The AST node of a BlockStatement. - * @returns {void} undefined. - */ - function checkPadding(node) { - if (node.body.length > 0) { - - var blockHasTopPadding = isBlockTopPadded(node), - blockHasBottomPadding = isBlockBottomPadded(node); - - if (requirePadding) { - if (!blockHasTopPadding) { - context.report(node, ALWAYS_MESSAGE); - } - - if (!blockHasBottomPadding) { - context.report(node, node.loc.end, ALWAYS_MESSAGE); - } - } else { - if (blockHasTopPadding) { - context.report(node, NEVER_MESSAGE); - } - - if (blockHasBottomPadding) { - context.report(node, node.loc.end, NEVER_MESSAGE); - } - } - } - } - - return { - "BlockStatement": checkPadding - }; - -}; - -module.exports.schema = [ - { - "enum": ["always", "never"] - } -]; diff --git a/node_modules/eslint/lib/rules/prefer-arrow-callback.js b/node_modules/eslint/lib/rules/prefer-arrow-callback.js deleted file mode 100644 index f7f26ca..0000000 --- a/node_modules/eslint/lib/rules/prefer-arrow-callback.js +++ /dev/null @@ -1,206 +0,0 @@ -/** - * @fileoverview A rule to suggest using arrow functions as callbacks. - * @author Toru Nagashima - * @copyright 2015 Toru Nagashima. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Checks whether or not a given variable is a function name. - * @param {escope.Variable} variable - A variable to check. - * @returns {boolean} `true` if the variable is a function name. - */ -function isFunctionName(variable) { - return variable && variable.defs[0].type === "FunctionName"; -} - -/** - * Checks whether or not a given MetaProperty node equals to a given value. - * @param {ASTNode} node - A MetaProperty node to check. - * @param {string} metaName - The name of `MetaProperty.meta`. - * @param {string} propertyName - The name of `MetaProperty.property`. - * @returns {boolean} `true` if the node is the specific value. - */ -function checkMetaProperty(node, metaName, propertyName) { - // TODO: Remove this if block after https://github.com/eslint/espree/issues/206 was fixed. - if (typeof node.meta === "string") { - return node.meta === metaName && node.property === propertyName; - } - return node.meta.name === metaName && node.property.name === propertyName; -} - -/** - * Gets the variable object of `arguments` which is defined implicitly. - * @param {escope.Scope} scope - A scope to get. - * @returns {escope.Variable} The found variable object. - */ -function getVariableOfArguments(scope) { - var variables = scope.variables; - for (var i = 0; i < variables.length; ++i) { - var variable = variables[i]; - if (variable.name === "arguments") { - // If there was a parameter which is named "arguments", the implicit "arguments" is not defined. - // So does fast return with null. - return (variable.identifiers.length === 0) ? variable : null; - } - } - - /* istanbul ignore next */ - return null; -} - -/** - * Checkes whether or not a given node is a callback. - * @param {ASTNode} node - A node to check. - * @returns {object} - * {boolean} retv.isCallback - `true` if the node is a callback. - * {boolean} retv.isLexicalThis - `true` if the node is with `.bind(this)`. - */ -function getCallbackInfo(node) { - var retv = {isCallback: false, isLexicalThis: false}; - var parent = node.parent; - while (node) { - switch (parent.type) { - // Checks parents recursively. - case "LogicalExpression": - case "ConditionalExpression": - break; - - // Checks whether the parent node is `.bind(this)` call. - case "MemberExpression": - if (parent.object === node && - !parent.property.computed && - parent.property.type === "Identifier" && - parent.property.name === "bind" && - parent.parent.type === "CallExpression" && - parent.parent.callee === parent - ) { - retv.isLexicalThis = ( - parent.parent.arguments.length === 1 && - parent.parent.arguments[0].type === "ThisExpression" - ); - node = parent; - parent = parent.parent; - } else { - return retv; - } - break; - - // Checks whether the node is a callback. - case "CallExpression": - case "NewExpression": - if (parent.callee !== node) { - retv.isCallback = true; - } - return retv; - - default: - return retv; - } - - node = parent; - parent = parent.parent; - } - - /* istanbul ignore next */ - throw new Error("unreachable"); -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - // {Array<{this: boolean, super: boolean, meta: boolean}>} - // - this - A flag which shows there are one or more ThisExpression. - // - super - A flag which shows there are one or more Super. - // - meta - A flag which shows there are one or more MethProperty. - var stack = []; - - /** - * Pushes new function scope with all `false` flags. - * @returns {void} - */ - function enterScope() { - stack.push({this: false, super: false, meta: false}); - } - - /** - * Pops a function scope from the stack. - * @returns {{this: boolean, super: boolean, meta: boolean}} The information of the last scope. - */ - function exitScope() { - return stack.pop(); - } - - return { - // Reset internal state. - Program: function() { - stack = []; - }, - - // If there are below, it cannot replace with arrow functions merely. - ThisExpression: function() { - var info = stack[stack.length - 1]; - if (info) { - info.this = true; - } - }, - Super: function() { - var info = stack[stack.length - 1]; - if (info) { - info.super = true; - } - }, - MetaProperty: function(node) { - var info = stack[stack.length - 1]; - if (info && checkMetaProperty(node, "new", "target")) { - info.meta = true; - } - }, - - // To skip nested scopes. - FunctionDeclaration: enterScope, - "FunctionDeclaration:exit": exitScope, - - // Main. - FunctionExpression: enterScope, - "FunctionExpression:exit": function(node) { - var scopeInfo = exitScope(); - - // Skip generators. - if (node.generator) { - return; - } - - // Skip recursive functions. - var nameVar = context.getDeclaredVariables(node)[0]; - if (isFunctionName(nameVar) && nameVar.references.length > 0) { - return; - } - - // Skip if it's using arguments. - var variable = getVariableOfArguments(context.getScope()); - if (variable && variable.references.length > 0) { - return; - } - - // Reports if it's a callback which can replace with arrows. - var callbackInfo = getCallbackInfo(node); - if (callbackInfo.isCallback && - (!scopeInfo.this || callbackInfo.isLexicalThis) && - !scopeInfo.super && - !scopeInfo.meta - ) { - context.report(node, "Unexpected function expression."); - } - } - }; -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/prefer-const.js b/node_modules/eslint/lib/rules/prefer-const.js deleted file mode 100644 index 64c2391..0000000 --- a/node_modules/eslint/lib/rules/prefer-const.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @fileoverview A rule to suggest using of const declaration for variables that are never modified after declared. - * @author Toru Nagashima - * @copyright 2015 Toru Nagashima. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Checks whether a reference is the initializer. - * @param {Reference} reference - A reference to check. - * @returns {boolean} Whether or not the reference is the initializer. - */ - function isInitializer(reference) { - return reference.init === true; - } - - /** - * Checks whether a reference is read-only or the initializer. - * @param {Reference} reference - A reference to check. - * @returns {boolean} Whether or not the reference is read-only or the initializer. - */ - function isReadOnlyOrInitializer(reference) { - return reference.isReadOnly() || reference.init === true; - } - - /** - * Searches and reports variables that are never modified after declared. - * @param {Scope} scope - A scope of the search domain. - * @returns {void} - */ - function checkForVariables(scope) { - // Skip the TDZ type. - if (scope.type === "TDZ") { - return; - } - - var variables = scope.variables; - for (var i = 0, end = variables.length; i < end; ++i) { - var variable = variables[i]; - var def = variable.defs[0]; - var declaration = def && def.parent; - var statement = declaration && declaration.parent; - var references = variable.references; - var identifier = variable.identifiers[0]; - - if (statement && - identifier && - declaration.type === "VariableDeclaration" && - declaration.kind === "let" && - (statement.type !== "ForStatement" || statement.init !== declaration) && - references.some(isInitializer) && - references.every(isReadOnlyOrInitializer) - ) { - context.report( - identifier, - "`{{name}}` is never modified, use `const` instead.", - {name: identifier.name}); - } - } - } - - /** - * Adds multiple items to the tail of an array. - * @param {any[]} array - A destination to add. - * @param {any[]} values - Items to be added. - * @returns {void} - */ - var pushAll = Function.apply.bind(Array.prototype.push); - - return { - "Program:exit": function() { - var stack = [context.getScope()]; - while (stack.length) { - var scope = stack.pop(); - pushAll(stack, scope.childScopes); - - checkForVariables(scope); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/prefer-reflect.js b/node_modules/eslint/lib/rules/prefer-reflect.js deleted file mode 100644 index 4d32061..0000000 --- a/node_modules/eslint/lib/rules/prefer-reflect.js +++ /dev/null @@ -1,100 +0,0 @@ -/** - * @fileoverview Rule to suggest using "Reflect" api over Function/Object methods - * @author Keith Cirkel - * @copyright 2015 Keith Cirkel. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var existingNames = { - "apply": "Function.prototype.apply", - "call": "Function.prototype.call", - "defineProperty": "Object.defineProperty", - "getOwnPropertyDescriptor": "Object.getOwnPropertyDescriptor", - "getPrototypeOf": "Object.getPrototypeOf", - "setPrototypeOf": "Object.setPrototypeOf", - "isExtensible": "Object.isExtensible", - "getOwnPropertyNames": "Object.getOwnPropertyNames", - "preventExtensions": "Object.preventExtensions" - }; - - var reflectSubsitutes = { - "apply": "Reflect.apply", - "call": "Reflect.apply", - "defineProperty": "Reflect.defineProperty", - "getOwnPropertyDescriptor": "Reflect.getOwnPropertyDescriptor", - "getPrototypeOf": "Reflect.getPrototypeOf", - "setPrototypeOf": "Reflect.setPrototypeOf", - "isExtensible": "Reflect.isExtensible", - "getOwnPropertyNames": "Reflect.getOwnPropertyNames", - "preventExtensions": "Reflect.preventExtensions" - }; - - var exceptions = (context.options[0] || {}).exceptions || []; - - /** - * Reports the Reflect violation based on the `existing` and `substitute` - * @param {Object} node The node that violates the rule. - * @param {string} existing The existing method name that has been used. - * @param {string} substitute The Reflect substitute that should be used. - * @returns {void} - */ - function report(node, existing, substitute) { - context.report(node, "Avoid using {{existing}}, instead use {{substitute}}", { - existing: existing, - substitute: substitute - }); - } - - return { - "CallExpression": function(node) { - var methodName = (node.callee.property || {}).name; - var isReflectCall = (node.callee.object || {}).name === "Reflect"; - var hasReflectSubsitute = reflectSubsitutes.hasOwnProperty(methodName); - var userConfiguredException = exceptions.indexOf(methodName) !== -1; - if (hasReflectSubsitute && !isReflectCall && !userConfiguredException) { - report(node, existingNames[methodName], reflectSubsitutes[methodName]); - } - }, - "UnaryExpression": function(node) { - var isDeleteOperator = node.operator === "delete"; - var targetsIdentifier = node.argument.type === "Identifier"; - var userConfiguredException = exceptions.indexOf("delete") !== -1; - if (isDeleteOperator && !targetsIdentifier && !userConfiguredException) { - report(node, "the delete keyword", "Reflect.deleteProperty"); - } - } - }; - -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "exceptions": { - "type": "array", - "items": { - "enum": [ - "apply", - "call", - "delete", - "defineProperty", - "getOwnPropertyDescriptor", - "getPrototypeOf", - "setPrototypeOf", - "isExtensible", - "getOwnPropertyNames", - "preventExtensions" - ] - }, - "uniqueItems": true - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/prefer-spread.js b/node_modules/eslint/lib/rules/prefer-spread.js deleted file mode 100644 index fe4e260..0000000 --- a/node_modules/eslint/lib/rules/prefer-spread.js +++ /dev/null @@ -1,92 +0,0 @@ -/** - * @fileoverview A rule to suggest using of the spread operator instead of `.apply()`. - * @author Toru Nagashima - * @copyright 2015 Toru Nagashima. All rights reserved. - */ - -"use strict"; - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Checks whether or not a node is a `.apply()` for variadic. - * @param {ASTNode} node - A CallExpression node to check. - * @returns {boolean} Whether or not the node is a `.apply()` for variadic. - */ -function isVariadicApplyCalling(node) { - return ( - node.callee.type === "MemberExpression" && - node.callee.property.type === "Identifier" && - node.callee.property.name === "apply" && - node.callee.computed === false && - node.arguments.length === 2 && - node.arguments[1].type !== "ArrayExpression" - ); -} - -/** - * Checks whether or not the tokens of two given nodes are same. - * @param {ASTNode} left - A node 1 to compare. - * @param {ASTNode} right - A node 2 to compare. - * @param {RuleContext} context - The ESLint rule context object. - * @returns {boolean} the source code for the given node. - */ -function equalTokens(left, right, context) { - var tokensL = context.getTokens(left); - var tokensR = context.getTokens(right); - - if (tokensL.length !== tokensR.length) { - return false; - } - for (var i = 0; i < tokensL.length; ++i) { - if (tokensL[i].type !== tokensR[i].type || - tokensL[i].value !== tokensR[i].value - ) { - return false; - } - } - - return true; -} - -/** - * Checks whether or not `thisArg` is not changed by `.apply()`. - * @param {ASTNode|null} expectedThis - The node that is the owner of the applied function. - * @param {ASTNode} thisArg - The node that is given to the first argument of the `.apply()`. - * @param {RuleContext} context - The ESLint rule context object. - * @returns {boolean} Whether or not `thisArg` is not changed by `.apply()`. - */ -function isValidThisArg(expectedThis, thisArg, context) { - if (!expectedThis) { - return astUtils.isNullOrUndefined(thisArg); - } - return equalTokens(expectedThis, thisArg, context); -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - return { - "CallExpression": function(node) { - if (!isVariadicApplyCalling(node)) { - return; - } - - var applied = node.callee.object; - var expectedThis = (applied.type === "MemberExpression") ? applied.object : null; - var thisArg = node.arguments[0]; - - if (isValidThisArg(expectedThis, thisArg, context)) { - context.report(node, "use the spread operator instead of the \".apply()\"."); - } - } - }; -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/prefer-template.js b/node_modules/eslint/lib/rules/prefer-template.js deleted file mode 100644 index 7cb4e03..0000000 --- a/node_modules/eslint/lib/rules/prefer-template.js +++ /dev/null @@ -1,96 +0,0 @@ -/** - * @fileoverview A rule to suggest using template literals instead of string concatenation. - * @author Toru Nagashima - * @copyright 2015 Toru Nagashima. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Checks whether or not a given node is a concatenation. - * @param {ASTNode} node - A node to check. - * @returns {boolean} `true` if the node is a concatenation. - */ -function isConcatenation(node) { - return node.type === "BinaryExpression" && node.operator === "+"; -} - -/** - * Gets the top binary expression node for concatenation in parents of a given node. - * @param {ASTNode} node - A node to get. - * @returns {ASTNode} the top binary expression node in parents of a given node. - */ -function getTopConcatBinaryExpression(node) { - while (isConcatenation(node.parent)) { - node = node.parent; - } - return node; -} - -/** - * Checks whether or not a given binary expression has non string literals. - * @param {ASTNode} node - A node to check. - * @returns {boolean} `true` if the node has non string literals. - */ -function hasNonStringLiteral(node) { - if (isConcatenation(node)) { - // `left` is deeper than `right` normally. - return hasNonStringLiteral(node.right) || hasNonStringLiteral(node.left); - } - return !astUtils.isStringLiteral(node); -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var done = Object.create(null); - - /** - * Reports if a given node is string concatenation with non string literals. - * - * @param {ASTNode} node - A node to check. - * @returns {void} - */ - function checkForStringConcat(node) { - if (!astUtils.isStringLiteral(node) || !isConcatenation(node.parent)) { - return; - } - - var topBinaryExpr = getTopConcatBinaryExpression(node.parent); - - // Checks whether or not this node had been checked already. - if (done[topBinaryExpr.range[0]]) { - return; - } - done[topBinaryExpr.range[0]] = true; - - if (hasNonStringLiteral(topBinaryExpr)) { - context.report( - topBinaryExpr, - "Unexpected string concatenation."); - } - } - - return { - Program: function() { - done = Object.create(null); - }, - - Literal: checkForStringConcat, - TemplateLiteral: checkForStringConcat - }; -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/quote-props.js b/node_modules/eslint/lib/rules/quote-props.js deleted file mode 100644 index 29ce237..0000000 --- a/node_modules/eslint/lib/rules/quote-props.js +++ /dev/null @@ -1,228 +0,0 @@ -/** - * @fileoverview Rule to flag non-quoted property names in object literals. - * @author Mathias Bynens - * @copyright 2014 Brandon Mills. All rights reserved. - * @copyright 2015 Tomasz Olędzki. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var espree = require("espree"), - keywords = require("../util/keywords"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var MODE = context.options[0], - KEYWORDS = context.options[1] && context.options[1].keywords, - CHECK_UNNECESSARY = !context.options[1] || context.options[1].unnecessary !== false, - NUMBERS = context.options[1] && context.options[1].numbers, - - MESSAGE_UNNECESSARY = "Unnecessarily quoted property `{{property}}` found.", - MESSAGE_UNQUOTED = "Unquoted property `{{property}}` found.", - MESSAGE_NUMERIC = "Unquoted number literal `{{property}}` used as key.", - MESSAGE_RESERVED = "Unquoted reserved word `{{property}}` used as key."; - - - /** - * Checks whether a certain string constitutes an ES3 token - * @param {string} tokenStr - The string to be checked. - * @returns {boolean} `true` if it is an ES3 token. - */ - function isKeyword(tokenStr) { - return keywords.indexOf(tokenStr) >= 0; - } - - /** - * Checks if an espree-tokenized key has redundant quotes (i.e. whether quotes are unnecessary) - * @param {espreeTokens} tokens The espree-tokenized node key - * @param {boolean} [skipNumberLiterals=false] Indicates whether number literals should be checked - * @returns {boolean} Whether or not a key has redundant quotes. - * @private - */ - function areQuotesRedundant(tokens, skipNumberLiterals) { - return tokens.length === 1 && - (["Identifier", "Keyword", "Null", "Boolean"].indexOf(tokens[0].type) >= 0 || - (tokens[0].type === "Numeric" && !skipNumberLiterals && "" + +tokens[0].value === tokens[0].value)); - } - - /** - * Ensures that a property's key is quoted only when necessary - * @param {ASTNode} node Property AST node - * @returns {void} - */ - function checkUnnecessaryQuotes(node) { - var key = node.key, - isKeywordToken, - tokens; - - if (node.method || node.computed || node.shorthand) { - return; - } - - if (key.type === "Literal" && typeof key.value === "string") { - try { - tokens = espree.tokenize(key.value); - } catch (e) { - return; - } - - if (tokens.length !== 1) { - return; - } - - isKeywordToken = isKeyword(tokens[0].value); - - if (isKeywordToken && KEYWORDS) { - return; - } - - if (CHECK_UNNECESSARY && areQuotesRedundant(tokens, NUMBERS)) { - context.report(node, MESSAGE_UNNECESSARY, {property: key.value}); - } - } else if (KEYWORDS && key.type === "Identifier" && isKeyword(key.name)) { - context.report(node, MESSAGE_RESERVED, {property: key.name}); - } else if (NUMBERS && key.type === "Literal" && typeof key.value === "number") { - context.report(node, MESSAGE_NUMERIC, {property: key.value}); - } - } - - /** - * Ensures that a property's key is quoted - * @param {ASTNode} node Property AST node - * @returns {void} - */ - function checkOmittedQuotes(node) { - var key = node.key; - - if (!node.method && !node.computed && !node.shorthand && !(key.type === "Literal" && typeof key.value === "string")) { - context.report(node, MESSAGE_UNQUOTED, { - property: key.name || key.value - }); - } - } - - /** - * Ensures that an object's keys are consistently quoted, optionally checks for redundancy of quotes - * @param {ASTNode} node Property AST node - * @param {boolean} checkQuotesRedundancy Whether to check quotes' redundancy - * @returns {void} - */ - function checkConsistency(node, checkQuotesRedundancy) { - var quotes = false, - lackOfQuotes = false, - necessaryQuotes = false; - - node.properties.forEach(function(property) { - var key = property.key, - tokens; - - if (!key || property.method || property.computed || property.shorthand) { - return; - } - - if (key.type === "Literal" && typeof key.value === "string") { - - quotes = true; - - if (checkQuotesRedundancy) { - try { - tokens = espree.tokenize(key.value); - } catch (e) { - necessaryQuotes = true; - return; - } - - necessaryQuotes = necessaryQuotes || !areQuotesRedundant(tokens) || KEYWORDS && isKeyword(tokens[0].value); - } - } else if (KEYWORDS && checkQuotesRedundancy && key.type === "Identifier" && isKeyword(key.name)) { - necessaryQuotes = true; - context.report(node, "Properties should be quoted as `{{property}}` is a reserved word.", {property: key.name}); - } else { - lackOfQuotes = true; - } - - if (quotes && lackOfQuotes) { - context.report(node, "Inconsistently quoted property `{{key}}` found.", { - key: key.name || key.value - }); - } - }); - - if (checkQuotesRedundancy && quotes && !necessaryQuotes) { - context.report(node, "Properties shouldn't be quoted as all quotes are redundant."); - } - } - - return { - "Property": function(node) { - if (MODE === "always" || !MODE) { - checkOmittedQuotes(node); - } - if (MODE === "as-needed") { - checkUnnecessaryQuotes(node); - } - }, - "ObjectExpression": function(node) { - if (MODE === "consistent") { - checkConsistency(node, false); - } - if (MODE === "consistent-as-needed") { - checkConsistency(node, true); - } - } - }; - -}; - -module.exports.schema = { - "anyOf": [ - { - "type": "array", - "items": [ - { - "enum": [0, 1, 2] - }, - { - "enum": ["always", "as-needed", "consistent", "consistent-as-needed"] - } - ], - "minItems": 1, - "maxItems": 2 - }, - { - "type": "array", - "items": [ - { - "enum": [0, 1, 2] - }, - { - "enum": ["always", "as-needed", "consistent", "consistent-as-needed"] - }, - { - "type": "object", - "properties": { - "keywords": { - "type": "boolean" - }, - "unnecessary": { - "type": "boolean" - }, - "numbers": { - "type": "boolean" - } - }, - "additionalProperties": false - } - ], - "minItems": 1, - "maxItems": 3 - } - ] -}; diff --git a/node_modules/eslint/lib/rules/quotes.js b/node_modules/eslint/lib/rules/quotes.js deleted file mode 100644 index 6f12add..0000000 --- a/node_modules/eslint/lib/rules/quotes.js +++ /dev/null @@ -1,198 +0,0 @@ -/** - * @fileoverview A rule to choose between single and double quote marks - * @author Matt DuVall , Brandon Payton - * @copyright 2013 Matt DuVall. All rights reserved. - * See LICENSE file in root directory for full license. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Constants -//------------------------------------------------------------------------------ - -var QUOTE_SETTINGS = { - "double": { - quote: "\"", - alternateQuote: "'", - description: "doublequote" - }, - "single": { - quote: "'", - alternateQuote: "\"", - description: "singlequote" - }, - "backtick": { - quote: "`", - alternateQuote: "\"", - description: "backtick" - } -}; -/** - * Switches quoting of javascript string between ' " and ` - * escaping and unescaping as necessary. - * Only escaping of the minimal set of characters is changed. - * Note: escaping of newlines when switching from backtick to other quotes is not handled. - * @param {string} str - A string to convert. - * @returns {string} The string with changed quotes. - * @private - */ -QUOTE_SETTINGS.double.convert = -QUOTE_SETTINGS.single.convert = -QUOTE_SETTINGS.backtick.convert = function(str) { - var newQuote = this.quote; - var oldQuote = str[0]; - if (newQuote === oldQuote) { - return str; - } - return newQuote + str.slice(1, -1).replace(/\\(\${|\r\n?|\n|.)|["'`]|\${|(\r\n?|\n)/g, function(match, escaped, newline) { - if (escaped === oldQuote || oldQuote === "`" && escaped === "${") { - return escaped; // unescape - } - if (match === newQuote || newQuote === "`" && match === "${") { - return "\\" + match; // escape - } - if (newline && oldQuote === "`") { - return "\\n"; // escape newlines - } - return match; - }) + newQuote; -}; - -var AVOID_ESCAPE = "avoid-escape", - FUNCTION_TYPE = /^(?:Arrow)?Function(?:Declaration|Expression)$/; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - /** - * Determines if a given node is part of JSX syntax. - * @param {ASTNode} node The node to check. - * @returns {boolean} True if the node is a JSX node, false if not. - * @private - */ - function isJSXElement(node) { - return node.type.indexOf("JSX") === 0; - } - - /** - * Checks whether or not a given node is a directive. - * The directive is a `ExpressionStatement` which has only a string literal. - * @param {ASTNode} node - A node to check. - * @returns {boolean} Whether or not the node is a directive. - * @private - */ - function isDirective(node) { - return ( - node.type === "ExpressionStatement" && - node.expression.type === "Literal" && - typeof node.expression.value === "string" - ); - } - - /** - * Checks whether or not a given node is a part of directive prologues. - * See also: http://www.ecma-international.org/ecma-262/6.0/#sec-directive-prologues-and-the-use-strict-directive - * @param {ASTNode} node - A node to check. - * @returns {boolean} Whether or not the node is a part of directive prologues. - * @private - */ - function isPartOfDirectivePrologue(node) { - var block = node.parent.parent; - if (block.type !== "Program" && (block.type !== "BlockStatement" || !FUNCTION_TYPE.test(block.parent.type))) { - return false; - } - - // Check the node is at a prologue. - for (var i = 0; i < block.body.length; ++i) { - var statement = block.body[i]; - - if (statement === node.parent) { - return true; - } - if (!isDirective(statement)) { - break; - } - } - - return false; - } - - /** - * Checks whether or not a given node is allowed as non backtick. - * @param {ASTNode} node - A node to check. - * @returns {boolean} Whether or not the node is allowed as non backtick. - * @private - */ - function isAllowedAsNonBacktick(node) { - var parent = node.parent; - - switch (parent.type) { - // Directive Prologues. - case "ExpressionStatement": - return isPartOfDirectivePrologue(node); - - // LiteralPropertyName. - case "Property": - return parent.key === node && !parent.computed; - - // ModuleSpecifier. - case "ImportDeclaration": - case "ExportNamedDeclaration": - case "ExportAllDeclaration": - return parent.source === node; - - // Others don't allow. - default: - return false; - } - } - - return { - - "Literal": function(node) { - var val = node.value, - rawVal = node.raw, - quoteOption = context.options[0], - settings = QUOTE_SETTINGS[quoteOption || "double"], - avoidEscape = context.options[1] === AVOID_ESCAPE, - isValid; - - if (settings && typeof val === "string") { - isValid = (quoteOption === "backtick" && isAllowedAsNonBacktick(node)) || isJSXElement(node.parent) || astUtils.isSurroundedBy(rawVal, settings.quote); - - if (!isValid && avoidEscape) { - isValid = astUtils.isSurroundedBy(rawVal, settings.alternateQuote) && rawVal.indexOf(settings.quote) >= 0; - } - - if (!isValid) { - context.report({ - node: node, - message: "Strings must use " + settings.description + ".", - fix: function(fixer) { - return fixer.replaceText(node, settings.convert(node.raw)); - } - }); - } - } - } - }; - -}; - -module.exports.schema = [ - { - "enum": ["single", "double", "backtick"] - }, - { - "enum": ["avoid-escape"] - } -]; diff --git a/node_modules/eslint/lib/rules/radix.js b/node_modules/eslint/lib/rules/radix.js deleted file mode 100644 index 493d647..0000000 --- a/node_modules/eslint/lib/rules/radix.js +++ /dev/null @@ -1,77 +0,0 @@ -/** - * @fileoverview Rule to flag use of parseInt without a radix argument - * @author James Allardice - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var MODE_ALWAYS = "always", - MODE_AS_NEEDED = "as-needed"; - - var mode = context.options[0] || MODE_ALWAYS; - - return { - "CallExpression": function(node) { - - var radix; - - if (!(node.callee.name === "parseInt" || ( - node.callee.type === "MemberExpression" && - node.callee.object.name === "Number" && - node.callee.property.name === "parseInt" - ) - )) { - return; - } - - if (node.arguments.length === 0) { - context.report({ - node: node, - message: "Missing parameters." - }); - } else if (node.arguments.length < 2 && mode === MODE_ALWAYS) { - context.report({ - node: node, - message: "Missing radix parameter." - }); - } else if (node.arguments.length > 1 && mode === MODE_AS_NEEDED && - (node.arguments[1] && node.arguments[1].type === "Literal" && - node.arguments[1].value === 10) - ) { - context.report({ - node: node, - message: "Redundant radix parameter." - }); - } else { - - radix = node.arguments[1]; - - // don't allow non-numeric literals or undefined - if (radix && - ((radix.type === "Literal" && typeof radix.value !== "number") || - (radix.type === "Identifier" && radix.name === "undefined")) - ) { - context.report({ - node: node, - message: "Invalid radix parameter." - }); - } - } - - } - }; - -}; - -module.exports.schema = [ - { - "enum": ["always", "as-needed"] - } -]; - diff --git a/node_modules/eslint/lib/rules/require-jsdoc.js b/node_modules/eslint/lib/rules/require-jsdoc.js deleted file mode 100644 index 7937914..0000000 --- a/node_modules/eslint/lib/rules/require-jsdoc.js +++ /dev/null @@ -1,97 +0,0 @@ -/** - * @fileoverview Rule to check for jsdoc presence. - * @author Gyandeep Singh - * @copyright 2015 Gyandeep Singh. All rights reserved. - */ -"use strict"; - -var assign = require("object-assign"); - -module.exports = function(context) { - var source = context.getSourceCode(); - var DEFAULT_OPTIONS = { - "FunctionDeclaration": true, - "MethodDefinition": false, - "ClassDeclaration": false - }; - var options = assign(DEFAULT_OPTIONS, context.options[0] && context.options[0].require || {}); - - /** - * Report the error message - * @param {ASTNode} node node to report - * @returns {void} - */ - function report(node) { - context.report(node, "Missing JSDoc comment."); - } - - /** - * Check if the jsdoc comment is present for class methods - * @param {ASTNode} node node to examine - * @returns {void} - */ - function checkClassMethodJsDoc(node) { - if (node.parent.type === "MethodDefinition") { - var jsdocComment = source.getJSDocComment(node); - - if (!jsdocComment) { - report(node); - } - } - } - - /** - * Check if the jsdoc comment is present or not. - * @param {ASTNode} node node to examine - * @returns {void} - */ - function checkJsDoc(node) { - var jsdocComment = source.getJSDocComment(node); - - if (!jsdocComment) { - report(node); - } - } - - return { - "FunctionDeclaration": function(node) { - if (options.FunctionDeclaration) { - checkJsDoc(node); - } - }, - "FunctionExpression": function(node) { - if (options.MethodDefinition) { - checkClassMethodJsDoc(node); - } - }, - "ClassDeclaration": function(node) { - if (options.ClassDeclaration) { - checkJsDoc(node); - } - } - }; -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "require": { - "type": "object", - "properties": { - "ClassDeclaration": { - "type": "boolean" - }, - "MethodDefinition": { - "type": "boolean" - }, - "FunctionDeclaration": { - "type": "boolean" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/require-yield.js b/node_modules/eslint/lib/rules/require-yield.js deleted file mode 100644 index f7a0d40..0000000 --- a/node_modules/eslint/lib/rules/require-yield.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * @fileoverview Rule to flag the generator functions that does not have yield. - * @author Toru Nagashima - * @copyright 2015 Toru Nagashima. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var stack = []; - - /** - * If the node is a generator function, start counting `yield` keywords. - * @param {Node} node - A function node to check. - * @returns {void} - */ - function beginChecking(node) { - if (node.generator) { - stack.push(0); - } - } - - /** - * If the node is a generator function, end counting `yield` keywords, then - * reports result. - * @param {Node} node - A function node to check. - * @returns {void} - */ - function endChecking(node) { - if (!node.generator) { - return; - } - - var countYield = stack.pop(); - if (countYield === 0 && node.body.body.length > 0) { - context.report( - node, - "This generator function does not have `yield`."); - } - } - - return { - "FunctionDeclaration": beginChecking, - "FunctionDeclaration:exit": endChecking, - "FunctionExpression": beginChecking, - "FunctionExpression:exit": endChecking, - - // Increases the count of `yield` keyword. - "YieldExpression": function() { - /* istanbul ignore else */ - if (stack.length > 0) { - stack[stack.length - 1] += 1; - } - } - }; -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/semi-spacing.js b/node_modules/eslint/lib/rules/semi-spacing.js deleted file mode 100644 index 7164d5b..0000000 --- a/node_modules/eslint/lib/rules/semi-spacing.js +++ /dev/null @@ -1,173 +0,0 @@ -/** - * @fileoverview Validates spacing before and after semicolon - * @author Mathias Schreck - * @copyright 2015 Mathias Schreck - */ - -"use strict"; - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var config = context.options[0], - requireSpaceBefore = false, - requireSpaceAfter = true, - sourceCode = context.getSourceCode(); - - if (typeof config === "object") { - if (config.hasOwnProperty("before")) { - requireSpaceBefore = config.before; - } - if (config.hasOwnProperty("after")) { - requireSpaceAfter = config.after; - } - } - - /** - * Checks if a given token has leading whitespace. - * @param {Object} token The token to check. - * @returns {boolean} True if the given token has leading space, false if not. - */ - function hasLeadingSpace(token) { - var tokenBefore = context.getTokenBefore(token); - return tokenBefore && astUtils.isTokenOnSameLine(tokenBefore, token) && sourceCode.isSpaceBetweenTokens(tokenBefore, token); - } - - /** - * Checks if a given token has trailing whitespace. - * @param {Object} token The token to check. - * @returns {boolean} True if the given token has trailing space, false if not. - */ - function hasTrailingSpace(token) { - var tokenAfter = context.getTokenAfter(token); - return tokenAfter && astUtils.isTokenOnSameLine(token, tokenAfter) && sourceCode.isSpaceBetweenTokens(token, tokenAfter); - } - - /** - * Checks if the given token is the last token in its line. - * @param {Token} token The token to check. - * @returns {boolean} Whether or not the token is the last in its line. - */ - function isLastTokenInCurrentLine(token) { - var tokenAfter = context.getTokenAfter(token); - return !(tokenAfter && astUtils.isTokenOnSameLine(token, tokenAfter)); - } - - /** - * Checks if the given token is the first token in its line - * @param {Token} token The token to check. - * @returns {boolean} Whether or not the token is the first in its line. - */ - function isFirstTokenInCurrentLine(token) { - var tokenBefore = context.getTokenBefore(token); - return !(tokenBefore && astUtils.isTokenOnSameLine(token, tokenBefore)); - } - - /** - * Checks if the next token of a given token is a closing parenthesis. - * @param {Token} token The token to check. - * @returns {boolean} Whether or not the next token of a given token is a closing parenthesis. - */ - function isBeforeClosingParen(token) { - var nextToken = context.getTokenAfter(token); - return ( - nextToken && - nextToken.type === "Punctuator" && - (nextToken.value === "}" || nextToken.value === ")") - ); - } - - /** - * Checks if the given token is a semicolon. - * @param {Token} token The token to check. - * @returns {boolean} Whether or not the given token is a semicolon. - */ - function isSemicolon(token) { - return token.type === "Punctuator" && token.value === ";"; - } - - /** - * Reports if the given token has invalid spacing. - * @param {Token} token The semicolon token to check. - * @param {ASTNode} node The corresponding node of the token. - * @returns {void} - */ - function checkSemicolonSpacing(token, node) { - var location; - - if (isSemicolon(token)) { - location = token.loc.start; - - if (hasLeadingSpace(token)) { - if (!requireSpaceBefore) { - context.report(node, location, "Unexpected whitespace before semicolon."); - } - } else { - if (requireSpaceBefore) { - context.report(node, location, "Missing whitespace before semicolon."); - } - } - - if (!isFirstTokenInCurrentLine(token) && !isLastTokenInCurrentLine(token) && !isBeforeClosingParen(token)) { - if (hasTrailingSpace(token)) { - if (!requireSpaceAfter) { - context.report(node, location, "Unexpected whitespace after semicolon."); - } - } else { - if (requireSpaceAfter) { - context.report(node, location, "Missing whitespace after semicolon."); - } - } - } - } - } - - /** - * Checks the spacing of the semicolon with the assumption that the last token is the semicolon. - * @param {ASTNode} node The node to check. - * @returns {void} - */ - function checkNode(node) { - var token = context.getLastToken(node); - checkSemicolonSpacing(token, node); - } - - return { - "VariableDeclaration": checkNode, - "ExpressionStatement": checkNode, - "BreakStatement": checkNode, - "ContinueStatement": checkNode, - "DebuggerStatement": checkNode, - "ReturnStatement": checkNode, - "ThrowStatement": checkNode, - "ForStatement": function(node) { - if (node.init) { - checkSemicolonSpacing(context.getTokenAfter(node.init), node); - } - - if (node.test) { - checkSemicolonSpacing(context.getTokenAfter(node.test), node); - } - } - }; -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "before": { - "type": "boolean" - }, - "after": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/semi.js b/node_modules/eslint/lib/rules/semi.js deleted file mode 100644 index f20902b..0000000 --- a/node_modules/eslint/lib/rules/semi.js +++ /dev/null @@ -1,165 +0,0 @@ -/** - * @fileoverview Rule to flag missing semicolons. - * @author Nicholas C. Zakas - * @copyright 2013 Nicholas C. Zakas. All rights reserved. - * See LICENSE file in root directory for full license. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var OPT_OUT_PATTERN = /[\[\(\/\+\-]/; // One of [(/+- - - var always = context.options[0] !== "never", - sourceCode = context.getSourceCode(); - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Reports a semicolon error with appropriate location and message. - * @param {ASTNode} node The node with an extra or missing semicolon. - * @returns {void} - */ - function report(node) { - var message, - fix, - lastToken = sourceCode.getLastToken(node), - loc = lastToken.loc; - - if (always) { - message = "Missing semicolon."; - loc = loc.end; - fix = function(fixer) { - return fixer.insertTextAfter(lastToken, ";"); - }; - } else { - message = "Extra semicolon."; - loc = loc.start; - fix = function(fixer) { - return fixer.remove(lastToken); - }; - } - - context.report({ - node: node, - loc: loc, - message: message, - fix: fix - }); - - } - - /** - * Checks whether a token is a semicolon punctuator. - * @param {Token} token The token. - * @returns {boolean} True if token is a semicolon punctuator. - */ - function isSemicolon(token) { - return (token.type === "Punctuator" && token.value === ";"); - } - - /** - * Check if a semicolon is unnecessary, only true if: - * - next token is on a new line and is not one of the opt-out tokens - * - next token is a valid statement divider - * @param {Token} lastToken last token of current node. - * @returns {boolean} whether the semicolon is unnecessary. - */ - function isUnnecessarySemicolon(lastToken) { - var isDivider, isOptOutToken, lastTokenLine, nextToken, nextTokenLine; - - if (!isSemicolon(lastToken)) { - return false; - } - - nextToken = context.getTokenAfter(lastToken); - - if (!nextToken) { - return true; - } - - lastTokenLine = lastToken.loc.end.line; - nextTokenLine = nextToken.loc.start.line; - isOptOutToken = OPT_OUT_PATTERN.test(nextToken.value); - isDivider = (nextToken.value === "}" || nextToken.value === ";"); - - return (lastTokenLine !== nextTokenLine && !isOptOutToken) || isDivider; - } - - /** - * Checks a node to see if it's followed by a semicolon. - * @param {ASTNode} node The node to check. - * @returns {void} - */ - function checkForSemicolon(node) { - var lastToken = context.getLastToken(node); - - if (always) { - if (!isSemicolon(lastToken)) { - report(node); - } - } else { - if (isUnnecessarySemicolon(lastToken)) { - report(node); - } - } - } - - /** - * Checks to see if there's a semicolon after a variable declaration. - * @param {ASTNode} node The node to check. - * @returns {void} - */ - function checkForSemicolonForVariableDeclaration(node) { - var ancestors = context.getAncestors(), - parentIndex = ancestors.length - 1, - parent = ancestors[parentIndex]; - - if ((parent.type !== "ForStatement" || parent.init !== node) && - (!/^For(?:In|Of)Statement/.test(parent.type) || parent.left !== node) - ) { - checkForSemicolon(node); - } - } - - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- - - return { - - "VariableDeclaration": checkForSemicolonForVariableDeclaration, - "ExpressionStatement": checkForSemicolon, - "ReturnStatement": checkForSemicolon, - "ThrowStatement": checkForSemicolon, - "DoWhileStatement": checkForSemicolon, - "DebuggerStatement": checkForSemicolon, - "BreakStatement": checkForSemicolon, - "ContinueStatement": checkForSemicolon, - "ImportDeclaration": checkForSemicolon, - "ExportAllDeclaration": checkForSemicolon, - "ExportNamedDeclaration": function(node) { - if (!node.declaration) { - checkForSemicolon(node); - } - }, - "ExportDefaultDeclaration": function(node) { - if (!/(?:Class|Function)Declaration/.test(node.declaration.type)) { - checkForSemicolon(node); - } - } - }; - -}; - -module.exports.schema = [ - { - "enum": ["always", "never"] - } -]; diff --git a/node_modules/eslint/lib/rules/sort-vars.js b/node_modules/eslint/lib/rules/sort-vars.js deleted file mode 100644 index 9aa85c8..0000000 --- a/node_modules/eslint/lib/rules/sort-vars.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @fileoverview Rule to require sorting of variables within a single Variable Declaration block - * @author Ilya Volodin - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var configuration = context.options[0] || {}, - ignoreCase = configuration.ignoreCase || false; - - return { - "VariableDeclaration": function(node) { - node.declarations.reduce(function(memo, decl) { - if (decl.id.type === "ObjectPattern" || decl.id.type === "ArrayPattern") { - return memo; - } - - var lastVariableName = memo.id.name, - currenVariableName = decl.id.name; - - if (ignoreCase) { - lastVariableName = lastVariableName.toLowerCase(); - currenVariableName = currenVariableName.toLowerCase(); - } - - if (currenVariableName < lastVariableName) { - context.report(decl, "Variables within the same declaration block should be sorted alphabetically"); - return memo; - } else { - return decl; - } - }, node.declarations[0]); - } - }; -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "ignoreCase": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/space-after-keywords.js b/node_modules/eslint/lib/rules/space-after-keywords.js deleted file mode 100644 index eeed6d2..0000000 --- a/node_modules/eslint/lib/rules/space-after-keywords.js +++ /dev/null @@ -1,114 +0,0 @@ -/** - * @fileoverview Rule to enforce the number of spaces after certain keywords - * @author Nick Fisher - * @copyright 2014 Nick Fisher. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - // unless the first option is `"never"`, then a space is required - var requiresSpace = context.options[0] !== "never"; - - /** - * Check if the separation of two adjacent tokens meets the spacing rules, and report a problem if not. - * - * @param {ASTNode} node The node to which the potential problem belongs. - * @param {Token} left The first token. - * @param {Token} right The second token - * @returns {void} - */ - function checkTokens(node, left, right) { - if (right.type !== "Punctuator") { - return; - } - - var hasSpace = left.range[1] < right.range[0], - value = left.value; - - if (hasSpace !== requiresSpace) { - context.report({ - node: node, - loc: left.loc.end, - message: "Keyword \"{{value}}\" must {{not}}be followed by whitespace.", - data: { - value: value, - not: requiresSpace ? "" : "not " - }, - fix: function(fixer) { - if (requiresSpace) { - return fixer.insertTextAfter(left, " "); - } else { - return fixer.removeRange([left.range[1], right.range[0]]); - } - } - }); - } else if (left.loc.end.line !== right.loc.start.line) { - context.report({ - node: node, - loc: left.loc.end, - message: "Keyword \"{{value}}\" must not be followed by a newline.", - data: { - value: value - }, - fix: function(fixer) { - var text = ""; - if (requiresSpace) { - text = " "; - } - return fixer.replaceTextRange([left.range[1], right.range[0]], text); - } - }); - } - } - - /** - * Check if the given node (`if`, `for`, `while`, etc), has the correct spacing after it. - * @param {ASTNode} node The node to check. - * @returns {void} - */ - function check(node) { - var tokens = context.getFirstTokens(node, 2); - checkTokens(node, tokens[0], tokens[1]); - } - - return { - "IfStatement": function(node) { - check(node); - // check the `else` - if (node.alternate && node.alternate.type !== "IfStatement") { - checkTokens(node.alternate, context.getTokenBefore(node.alternate), context.getFirstToken(node.alternate)); - } - }, - "ForStatement": check, - "ForOfStatement": check, - "ForInStatement": check, - "WhileStatement": check, - "DoWhileStatement": function(node) { - check(node); - // check the `while` - var whileTokens = context.getTokensAfter(node.body, 2); - checkTokens(node, whileTokens[0], whileTokens[1]); - }, - "SwitchStatement": check, - "TryStatement": function(node) { - check(node); - // check the `finally` - if (node.finalizer) { - checkTokens(node.finalizer, context.getTokenBefore(node.finalizer), context.getFirstToken(node.finalizer)); - } - }, - "CatchClause": check, - "WithStatement": check - }; -}; - -module.exports.schema = [ - { - "enum": ["always", "never"] - } -]; diff --git a/node_modules/eslint/lib/rules/space-before-blocks.js b/node_modules/eslint/lib/rules/space-before-blocks.js deleted file mode 100644 index 24c1d9b..0000000 --- a/node_modules/eslint/lib/rules/space-before-blocks.js +++ /dev/null @@ -1,131 +0,0 @@ -/** - * @fileoverview A rule to ensure whitespace before blocks. - * @author Mathias Schreck - * @copyright 2014 Mathias Schreck. All rights reserved. - */ - -"use strict"; - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var config = context.options[0], - sourceCode = context.getSourceCode(), - checkFunctions = true, - checkKeywords = true; - - if (typeof config === "object") { - checkFunctions = config.functions !== "never"; - checkKeywords = config.keywords !== "never"; - } else if (config === "never") { - checkFunctions = false; - checkKeywords = false; - } - - /** - * Checks whether or not a given token is an arrow operator (=>). - * - * @param {Token} token - A token to check. - * @returns {boolean} `true` if the token is an arrow operator. - */ - function isArrow(token) { - return token.type === "Punctuator" && token.value === "=>"; - } - - /** - * Checks the given BlockStatement node has a preceding space if it doesn’t start on a new line. - * @param {ASTNode|Token} node The AST node of a BlockStatement. - * @returns {void} undefined. - */ - function checkPrecedingSpace(node) { - var precedingToken = context.getTokenBefore(node), - hasSpace, - parent, - requireSpace; - - if (precedingToken && !isArrow(precedingToken) && astUtils.isTokenOnSameLine(precedingToken, node)) { - hasSpace = sourceCode.isSpaceBetweenTokens(precedingToken, node); - parent = context.getAncestors().pop(); - if (parent.type === "FunctionExpression" || parent.type === "FunctionDeclaration") { - requireSpace = checkFunctions; - } else { - requireSpace = checkKeywords; - } - - if (requireSpace) { - if (!hasSpace) { - context.report({ - node: node, - message: "Missing space before opening brace.", - fix: function(fixer) { - return fixer.insertTextBefore(node, " "); - } - }); - } - } else { - if (hasSpace) { - context.report({ - node: node, - message: "Unexpected space before opening brace.", - fix: function(fixer) { - return fixer.removeRange([precedingToken.range[1], node.range[0]]); - } - }); - } - } - } - } - - /** - * Checks if the CaseBlock of an given SwitchStatement node has a preceding space. - * @param {ASTNode} node The node of a SwitchStatement. - * @returns {void} undefined. - */ - function checkSpaceBeforeCaseBlock(node) { - var cases = node.cases, - firstCase, - openingBrace; - - if (cases.length > 0) { - firstCase = cases[0]; - openingBrace = context.getTokenBefore(firstCase); - } else { - openingBrace = context.getLastToken(node, 1); - } - - checkPrecedingSpace(openingBrace); - } - - return { - "BlockStatement": checkPrecedingSpace, - "ClassBody": checkPrecedingSpace, - "SwitchStatement": checkSpaceBeforeCaseBlock - }; - -}; - -module.exports.schema = [ - { - "oneOf": [ - { - "enum": ["always", "never"] - }, - { - "type": "object", - "properties": { - "keywords": { - "enum": ["always", "never"] - }, - "functions": { - "enum": ["always", "never"] - } - }, - "additionalProperties": false - } - ] - } -]; diff --git a/node_modules/eslint/lib/rules/space-before-function-paren.js b/node_modules/eslint/lib/rules/space-before-function-paren.js deleted file mode 100644 index b96acb6..0000000 --- a/node_modules/eslint/lib/rules/space-before-function-paren.js +++ /dev/null @@ -1,124 +0,0 @@ -/** - * @fileoverview Rule to validate spacing before function paren. - * @author Mathias Schreck - * @copyright 2015 Mathias Schreck - * See LICENSE in root directory for full license. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var configuration = context.options[0], - sourceCode = context.getSourceCode(), - requireAnonymousFunctionSpacing = true, - requireNamedFunctionSpacing = true; - - if (typeof configuration === "object") { - requireAnonymousFunctionSpacing = configuration.anonymous !== "never"; - requireNamedFunctionSpacing = configuration.named !== "never"; - } else if (configuration === "never") { - requireAnonymousFunctionSpacing = false; - requireNamedFunctionSpacing = false; - } - - /** - * Determines whether a function has a name. - * @param {ASTNode} node The function node. - * @returns {boolean} Whether the function has a name. - */ - function isNamedFunction(node) { - var parent; - - if (node.id) { - return true; - } - - parent = node.parent; - return parent.type === "MethodDefinition" || - (parent.type === "Property" && - ( - parent.kind === "get" || - parent.kind === "set" || - parent.method - ) - ); - } - - /** - * Validates the spacing before function parentheses. - * @param {ASTNode} node The node to be validated. - * @returns {void} - */ - function validateSpacingBeforeParentheses(node) { - var isNamed = isNamedFunction(node), - leftToken, - rightToken, - location; - - if (node.generator && !isNamed) { - return; - } - - rightToken = sourceCode.getFirstToken(node); - while (rightToken.value !== "(") { - rightToken = sourceCode.getTokenAfter(rightToken); - } - leftToken = context.getTokenBefore(rightToken); - location = leftToken.loc.end; - - if (sourceCode.isSpaceBetweenTokens(leftToken, rightToken)) { - if ((isNamed && !requireNamedFunctionSpacing) || (!isNamed && !requireAnonymousFunctionSpacing)) { - context.report({ - node: node, - loc: location, - message: "Unexpected space before function parentheses.", - fix: function(fixer) { - return fixer.removeRange([leftToken.range[1], rightToken.range[0]]); - } - }); - } - } else { - if ((isNamed && requireNamedFunctionSpacing) || (!isNamed && requireAnonymousFunctionSpacing)) { - context.report({ - node: node, - loc: location, - message: "Missing space before function parentheses.", - fix: function(fixer) { - return fixer.insertTextAfter(leftToken, " "); - } - }); - } - } - } - - return { - "FunctionDeclaration": validateSpacingBeforeParentheses, - "FunctionExpression": validateSpacingBeforeParentheses - }; -}; - -module.exports.schema = [ - { - "oneOf": [ - { - "enum": ["always", "never"] - }, - { - "type": "object", - "properties": { - "anonymous": { - "enum": ["always", "never"] - }, - "named": { - "enum": ["always", "never"] - } - }, - "additionalProperties": false - } - ] - } -]; diff --git a/node_modules/eslint/lib/rules/space-before-keywords.js b/node_modules/eslint/lib/rules/space-before-keywords.js deleted file mode 100644 index cba8cff..0000000 --- a/node_modules/eslint/lib/rules/space-before-keywords.js +++ /dev/null @@ -1,214 +0,0 @@ -/** - * @fileoverview Require or disallow spaces before keywords - * @author Marko Raatikka - * @copyright 2015 Marko Raatikka. All rights reserved. - * See LICENSE file in root directory for full license. - */ -"use strict"; - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -var ERROR_MSG_SPACE_EXPECTED = "Missing space before keyword \"{{keyword}}\"."; -var ERROR_MSG_NO_SPACE_EXPECTED = "Unexpected space before keyword \"{{keyword}}\"."; - -module.exports = function(context) { - - var sourceCode = context.getSourceCode(); - - var SPACE_REQUIRED = context.options[0] !== "never"; - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Report the error message - * @param {ASTNode} node node to report - * @param {string} message Error message to be displayed - * @param {object} data Data object for the rule message - * @returns {void} - */ - function report(node, message, data) { - context.report({ - node: node, - message: message, - data: data, - fix: function(fixer) { - if (SPACE_REQUIRED) { - return fixer.insertTextBefore(node, " "); - } else { - var tokenBefore = context.getTokenBefore(node); - return fixer.removeRange([tokenBefore.range[1], node.range[0]]); - } - } - }); - } - - /** - * Check if a token meets the criteria - * - * @param {ASTNode} node The node to check - * @param {Object} left The left-hand side token of the node - * @param {Object} right The right-hand side token of the node - * @param {Object} options See check() - * @returns {void} - */ - function checkTokens(node, left, right, options) { - - if (!left) { - return; - } - - if (left.type === "Keyword") { - return; - } - - if (!SPACE_REQUIRED && typeof options.requireSpace === "undefined") { - return; - } - - options = options || {}; - options.allowedPrecedingChars = options.allowedPrecedingChars || [ "{" ]; - options.requireSpace = typeof options.requireSpace === "undefined" ? SPACE_REQUIRED : options.requireSpace; - - var hasSpace = sourceCode.isSpaceBetweenTokens(left, right); - var spaceOk = hasSpace === options.requireSpace; - - if (spaceOk) { - return; - } - - if (!astUtils.isTokenOnSameLine(left, right)) { - if (!options.requireSpace) { - report(node, ERROR_MSG_NO_SPACE_EXPECTED, { keyword: right.value }); - } - return; - } - - if (!options.requireSpace) { - report(node, ERROR_MSG_NO_SPACE_EXPECTED, { keyword: right.value }); - return; - } - - if (options.allowedPrecedingChars.indexOf(left.value) !== -1) { - return; - } - - report(node, ERROR_MSG_SPACE_EXPECTED, { keyword: right.value }); - - } - - /** - * Get right and left tokens of a node and check to see if they meet the given criteria - * - * @param {ASTNode} node The node to check - * @param {Object} options Options to validate the node against - * @param {Array} options.allowedPrecedingChars Characters that can precede the right token - * @param {Boolean} options.requireSpace Whether or not the right token needs to be - * preceded by a space - * @returns {void} - */ - function check(node, options) { - - options = options || {}; - - var left = context.getTokenBefore(node); - var right = context.getFirstToken(node); - - checkTokens(node, left, right, options); - - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - - "IfStatement": function(node) { - // if - check(node); - // else - if (node.alternate) { - var tokens = context.getTokensBefore(node.alternate, 2); - if (tokens[0].value === "}") { - check(tokens[1], { requireSpace: SPACE_REQUIRED }); - } - } - }, - "ForStatement": check, - "ForInStatement": check, - "WhileStatement": check, - "DoWhileStatement": function(node) { - var whileNode = context.getTokenAfter(node.body); - // do - check(node); - // while - check(whileNode, { requireSpace: SPACE_REQUIRED }); - }, - "SwitchStatement": function(node) { - // switch - check(node); - // case/default - node.cases.forEach(function(caseNode) { - check(caseNode); - }); - }, - "ThrowStatement": check, - "TryStatement": function(node) { - // try - check(node); - // finally - if (node.finalizer) { - check(context.getTokenBefore(node.finalizer), { requireSpace: SPACE_REQUIRED }); - } - }, - "CatchClause": function(node) { - check(node, { requireSpace: SPACE_REQUIRED }); - }, - "WithStatement": check, - "VariableDeclaration": function(node) { - check(node, { allowedPrecedingChars: [ "(", "{" ] }); - }, - "ReturnStatement": check, - "BreakStatement": check, - "LabeledStatement": check, - "ContinueStatement": check, - "FunctionDeclaration": check, - "FunctionExpression": function(node) { - var left = context.getTokenBefore(node); - var right = context.getFirstToken(node); - - // If it's a method, a getter, or a setter, the first token is not the `function` keyword. - if (right.type !== "Keyword") { - return; - } - - checkTokens(node, left, right, { allowedPrecedingChars: [ "(", "{", "[" ] }); - }, - "YieldExpression": function(node) { - check(node, { allowedPrecedingChars: [ "(", "{" ] }); - }, - "ForOfStatement": check, - "ClassBody": function(node) { - - // Find the 'class' token - while (node.value !== "class") { - node = context.getTokenBefore(node); - } - - check(node); - } - }; - -}; - -module.exports.schema = [ - { - "enum": ["always", "never"] - } -]; diff --git a/node_modules/eslint/lib/rules/space-in-parens.js b/node_modules/eslint/lib/rules/space-in-parens.js deleted file mode 100644 index 789acdb..0000000 --- a/node_modules/eslint/lib/rules/space-in-parens.js +++ /dev/null @@ -1,239 +0,0 @@ -/** - * @fileoverview Disallows or enforces spaces inside of parentheses. - * @author Jonathan Rajavuori - * @copyright 2014 David Clark. All rights reserved. - * @copyright 2014 Jonathan Rajavuori. All rights reserved. - */ -"use strict"; - -var astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var MISSING_SPACE_MESSAGE = "There must be a space inside this paren.", - REJECTED_SPACE_MESSAGE = "There should be no spaces inside this paren.", - ALWAYS = context.options[0] === "always", - - exceptionsArrayOptions = (context.options.length === 2) ? context.options[1].exceptions : [], - options = {}, - exceptions; - - if (exceptionsArrayOptions.length) { - options.braceException = exceptionsArrayOptions.indexOf("{}") !== -1; - options.bracketException = exceptionsArrayOptions.indexOf("[]") !== -1; - options.parenException = exceptionsArrayOptions.indexOf("()") !== -1; - options.empty = exceptionsArrayOptions.indexOf("empty") !== -1; - } - - /** - * Produces an object with the opener and closer exception values - * @param {Object} opts The exception options - * @returns {Object} `openers` and `closers` exception values - * @private - */ - function getExceptions() { - var openers = [], - closers = []; - if (options.braceException) { - openers.push("{"); - closers.push("}"); - } - - if (options.bracketException) { - openers.push("["); - closers.push("]"); - } - - if (options.parenException) { - openers.push("("); - closers.push(")"); - } - - if (options.empty) { - openers.push(")"); - closers.push("("); - } - - return { - openers: openers, - closers: closers - }; - } - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - var sourceCode = context.getSourceCode(); - - /** - * Determines if a token is one of the exceptions for the opener paren - * @param {Object} token The token to check - * @returns {boolean} True if the token is one of the exceptions for the opener paren - */ - function isOpenerException(token) { - return token.type === "Punctuator" && exceptions.openers.indexOf(token.value) >= 0; - } - - /** - * Determines if a token is one of the exceptions for the closer paren - * @param {Object} token The token to check - * @returns {boolean} True if the token is one of the exceptions for the closer paren - */ - function isCloserException(token) { - return token.type === "Punctuator" && exceptions.closers.indexOf(token.value) >= 0; - } - - /** - * Determines if an opener paren should have a missing space after it - * @param {Object} left The paren token - * @param {Object} right The token after it - * @returns {boolean} True if the paren should have a space - */ - function shouldOpenerHaveSpace(left, right) { - if (sourceCode.isSpaceBetweenTokens(left, right)) { - return false; - } - - if (ALWAYS) { - if (right.type === "Punctuator" && right.value === ")") { - return false; - } - return !isOpenerException(right); - } else { - return isOpenerException(right); - } - } - - /** - * Determines if an closer paren should have a missing space after it - * @param {Object} left The token before the paren - * @param {Object} right The paren token - * @returns {boolean} True if the paren should have a space - */ - function shouldCloserHaveSpace(left, right) { - if (left.type === "Punctuator" && left.value === "(") { - return false; - } - - if (sourceCode.isSpaceBetweenTokens(left, right)) { - return false; - } - - if (ALWAYS) { - return !isCloserException(left); - } else { - return isCloserException(left); - } - } - - /** - * Determines if an opener paren should not have an existing space after it - * @param {Object} left The paren token - * @param {Object} right The token after it - * @returns {boolean} True if the paren should reject the space - */ - function shouldOpenerRejectSpace(left, right) { - if (right.type === "Line") { - return false; - } - - if (!astUtils.isTokenOnSameLine(left, right)) { - return false; - } - - if (!sourceCode.isSpaceBetweenTokens(left, right)) { - return false; - } - - if (ALWAYS) { - return isOpenerException(right); - } else { - return !isOpenerException(right); - } - } - - /** - * Determines if an closer paren should not have an existing space after it - * @param {Object} left The token before the paren - * @param {Object} right The paren token - * @returns {boolean} True if the paren should reject the space - */ - function shouldCloserRejectSpace(left, right) { - if (left.type === "Punctuator" && left.value === "(") { - return false; - } - - if (!astUtils.isTokenOnSameLine(left, right)) { - return false; - } - - if (!sourceCode.isSpaceBetweenTokens(left, right)) { - return false; - } - - if (ALWAYS) { - return isCloserException(left); - } else { - return !isCloserException(left); - } - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - "Program": function checkParenSpaces(node) { - var tokens, prevToken, nextToken; - exceptions = getExceptions(); - tokens = sourceCode.tokensAndComments; - - tokens.forEach(function(token, i) { - prevToken = tokens[i - 1]; - nextToken = tokens[i + 1]; - - if (token.type !== "Punctuator") { - return; - } - - if (token.value !== "(" && token.value !== ")") { - return; - } - - if (token.value === "(" && shouldOpenerHaveSpace(token, nextToken)) { - context.report(node, token.loc.end, MISSING_SPACE_MESSAGE); - } else if (token.value === "(" && shouldOpenerRejectSpace(token, nextToken)) { - context.report(node, token.loc.end, REJECTED_SPACE_MESSAGE); - } else if (token.value === ")" && shouldCloserHaveSpace(prevToken, token)) { - context.report(node, token.loc.end, MISSING_SPACE_MESSAGE); - } else if (token.value === ")" && shouldCloserRejectSpace(prevToken, token)) { - context.report(node, token.loc.end, REJECTED_SPACE_MESSAGE); - } - }); - } - }; - -}; - -module.exports.schema = [ - { - "enum": ["always", "never"] - }, - { - "type": "object", - "properties": { - "exceptions": { - "type": "array", - "items": { - "enum": ["{}", "[]", "()", "empty"] - }, - "uniqueItems": true - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/space-infix-ops.js b/node_modules/eslint/lib/rules/space-infix-ops.js deleted file mode 100644 index 8d696e6..0000000 --- a/node_modules/eslint/lib/rules/space-infix-ops.js +++ /dev/null @@ -1,146 +0,0 @@ -/** - * @fileoverview Require spaces around infix operators - * @author Michael Ficarra - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var int32Hint = context.options[0] ? context.options[0].int32Hint === true : false; - - var OPERATORS = [ - "*", "/", "%", "+", "-", "<<", ">>", ">>>", "<", "<=", ">", ">=", "in", - "instanceof", "==", "!=", "===", "!==", "&", "^", "|", "&&", "||", "=", - "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", "&=", "^=", "|=", - "?", ":", "," - ]; - - /** - * Returns the first token which violates the rule - * @param {ASTNode} left - The left node of the main node - * @param {ASTNode} right - The right node of the main node - * @returns {object} The violator token or null - * @private - */ - function getFirstNonSpacedToken(left, right) { - var op, tokens = context.getTokensBetween(left, right, 1); - for (var i = 1, l = tokens.length - 1; i < l; ++i) { - op = tokens[i]; - if ( - op.type === "Punctuator" && - OPERATORS.indexOf(op.value) >= 0 && - (tokens[i - 1].range[1] >= op.range[0] || op.range[1] >= tokens[i + 1].range[0]) - ) { - return op; - } - } - return null; - } - - /** - * Reports an AST node as a rule violation - * @param {ASTNode} mainNode - The node to report - * @param {object} culpritToken - The token which has a problem - * @returns {void} - * @private - */ - function report(mainNode, culpritToken) { - context.report({ - node: mainNode, - loc: culpritToken.loc.start, - message: "Infix operators must be spaced.", - fix: function(fixer) { - var previousToken = context.getTokenBefore(culpritToken); - var afterToken = context.getTokenAfter(culpritToken); - var fixString = ""; - - if (culpritToken.range[0] - previousToken.range[1] === 0) { - fixString = " "; - } - - fixString += culpritToken.value; - - if (afterToken.range[0] - culpritToken.range[1] === 0) { - fixString += " "; - } - - return fixer.replaceText(culpritToken, fixString); - } - }); - } - - /** - * Check if the node is binary then report - * @param {ASTNode} node node to evaluate - * @returns {void} - * @private - */ - function checkBinary(node) { - var nonSpacedNode = getFirstNonSpacedToken(node.left, node.right); - - if (nonSpacedNode) { - if (!(int32Hint && context.getSource(node).substr(-2) === "|0")) { - report(node, nonSpacedNode); - } - } - } - - /** - * Check if the node is conditional - * @param {ASTNode} node node to evaluate - * @returns {void} - * @private - */ - function checkConditional(node) { - var nonSpacedConsequesntNode = getFirstNonSpacedToken(node.test, node.consequent); - var nonSpacedAlternateNode = getFirstNonSpacedToken(node.consequent, node.alternate); - - if (nonSpacedConsequesntNode) { - report(node, nonSpacedConsequesntNode); - } else if (nonSpacedAlternateNode) { - report(node, nonSpacedAlternateNode); - } - } - - /** - * Check if the node is a variable - * @param {ASTNode} node node to evaluate - * @returns {void} - * @private - */ - function checkVar(node) { - var nonSpacedNode; - - if (node.init) { - nonSpacedNode = getFirstNonSpacedToken(node.id, node.init); - if (nonSpacedNode) { - report(node, nonSpacedNode); - } - } - } - - return { - "AssignmentExpression": checkBinary, - "AssignmentPattern": checkBinary, - "BinaryExpression": checkBinary, - "LogicalExpression": checkBinary, - "ConditionalExpression": checkConditional, - "VariableDeclarator": checkVar - }; - -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "int32Hint": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/space-return-throw-case.js b/node_modules/eslint/lib/rules/space-return-throw-case.js deleted file mode 100644 index 2c28160..0000000 --- a/node_modules/eslint/lib/rules/space-return-throw-case.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @fileoverview Require spaces following return, throw, and case - * @author Michael Ficarra - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Check if the node for spaces - * @param {ASTNode} node node to evaluate - * @returns {void} - * @private - */ - function check(node) { - var tokens = context.getFirstTokens(node, 2), - value = tokens[0].value; - - if (tokens[0].range[1] >= tokens[1].range[0]) { - context.report({ - node: node, - message: "Keyword \"" + value + "\" must be followed by whitespace.", - fix: function(fixer) { - return fixer.insertTextAfterRange(tokens[0].range, " "); - } - }); - } - } - - return { - "ReturnStatement": function(node) { - if (node.argument) { - check(node); - } - }, - "SwitchCase": function(node) { - if (node.test) { - check(node); - } - }, - "ThrowStatement": check - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/space-unary-ops.js b/node_modules/eslint/lib/rules/space-unary-ops.js deleted file mode 100644 index 5dfae95..0000000 --- a/node_modules/eslint/lib/rules/space-unary-ops.js +++ /dev/null @@ -1,179 +0,0 @@ -/** - * @fileoverview This rule shoud require or disallow spaces before or after unary operations. - * @author Marcin Kumorek - * @copyright 2014 Marcin Kumorek. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var options = context.options && Array.isArray(context.options) && context.options[0] || { words: true, nonwords: false }; - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Check if the node is the first "!" in a "!!" convert to Boolean expression - * @param {ASTnode} node AST node - * @returns {boolean} Whether or not the node is first "!" in "!!" - */ - function isFirstBangInBangBangExpression(node) { - return node && node.type === "UnaryExpression" && node.argument.operator === "!" && - node.argument && node.argument.type === "UnaryExpression" && node.argument.operator === "!"; - } - - /** - * Check if the node's child argument is an "ObjectExpression" - * @param {ASTnode} node AST node - * @returns {boolean} Whether or not the argument's type is "ObjectExpression" - */ - function isArgumentObjectExpression(node) { - return node.argument && node.argument.type && node.argument.type === "ObjectExpression"; - } - - /** - * Check Unary Word Operators for spaces after the word operator - * @param {ASTnode} node AST node - * @param {object} firstToken first token from the AST node - * @param {object} secondToken second token from the AST node - * @param {string} word The word to be used for reporting - * @returns {void} - */ - function checkUnaryWordOperatorForSpaces(node, firstToken, secondToken, word) { - word = word || firstToken.value; - - if (options.words) { - if (secondToken.range[0] === firstToken.range[1]) { - context.report({ - node: node, - message: "Unary word operator \"" + word + "\" must be followed by whitespace.", - fix: function(fixer) { - return fixer.insertTextAfter(firstToken, " "); - } - }); - } - } - - if (!options.words && isArgumentObjectExpression(node)) { - if (secondToken.range[0] > firstToken.range[1]) { - context.report({ - node: node, - message: "Unexpected space after unary word operator \"" + word + "\".", - fix: function(fixer) { - return fixer.removeRange([firstToken.range[1], secondToken.range[0]]); - } - }); - } - } - } - - /** - * Checks UnaryExpression, UpdateExpression and NewExpression for spaces before and after the operator - * @param {ASTnode} node AST node - * @returns {void} - */ - function checkForSpaces(node) { - var tokens = context.getFirstTokens(node, 2), - firstToken = tokens[0], - secondToken = tokens[1]; - - if ((node.type === "NewExpression" || node.prefix) && firstToken.type === "Keyword") { - checkUnaryWordOperatorForSpaces(node, firstToken, secondToken); - return void 0; - } - - if (options.nonwords) { - if (node.prefix) { - if (isFirstBangInBangBangExpression(node)) { - return void 0; - } - if (firstToken.range[1] === secondToken.range[0]) { - context.report({ - node: node, - message: "Unary operator \"" + firstToken.value + "\" must be followed by whitespace.", - fix: function(fixer) { - return fixer.insertTextAfter(firstToken, " "); - } - }); - } - } else { - if (firstToken.range[1] === secondToken.range[0]) { - context.report({ - node: node, - message: "Space is required before unary expressions \"" + secondToken.value + "\".", - fix: function(fixer) { - return fixer.insertTextBefore(secondToken, " "); - } - }); - } - } - } else { - if (node.prefix) { - if (secondToken.range[0] > firstToken.range[1]) { - context.report({ - node: node, - message: "Unexpected space after unary operator \"" + firstToken.value + "\".", - fix: function(fixer) { - return fixer.removeRange([firstToken.range[1], secondToken.range[0]]); - } - }); - } - } else { - if (secondToken.range[0] > firstToken.range[1]) { - context.report({ - node: node, - message: "Unexpected space before unary operator \"" + secondToken.value + "\".", - fix: function(fixer) { - return fixer.removeRange([firstToken.range[1], secondToken.range[0]]); - } - }); - } - } - } - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - "UnaryExpression": checkForSpaces, - "UpdateExpression": checkForSpaces, - "NewExpression": checkForSpaces, - "YieldExpression": function(node) { - var tokens = context.getFirstTokens(node, 3), - word = "yield"; - - if (!node.argument) { - return; - } - - if (node.delegate) { - word += "*"; - checkUnaryWordOperatorForSpaces(node, tokens[1], tokens[2], word); - } else { - checkUnaryWordOperatorForSpaces(node, tokens[0], tokens[1], word); - } - } - }; - -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "words": { - "type": "boolean" - }, - "nonwords": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/spaced-comment.js b/node_modules/eslint/lib/rules/spaced-comment.js deleted file mode 100644 index 585dc7a..0000000 --- a/node_modules/eslint/lib/rules/spaced-comment.js +++ /dev/null @@ -1,249 +0,0 @@ -/** - * @fileoverview Source code for spaced-comments rule - * @author Gyandeep Singh - * @copyright 2015 Toru Nagashima. All rights reserved. - * @copyright 2015 Gyandeep Singh. All rights reserved. - * @copyright 2014 Greg Cochard. All rights reserved. - */ -"use strict"; - -var escapeStringRegexp = require("escape-string-regexp"); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Escapes the control characters of a given string. - * @param {string} s - A string to escape. - * @returns {string} An escaped string. - */ -function escape(s) { - var isOneChar = s.length === 1; - s = escapeStringRegexp(s); - return isOneChar ? s : "(?:" + s + ")"; -} - -/** - * Escapes the control characters of a given string. - * And adds a repeat flag. - * @param {string} s - A string to escape. - * @returns {string} An escaped string. - */ -function escapeAndRepeat(s) { - return escape(s) + "+"; -} - -/** - * Parses `markers` option. - * If markers don't include `"*"`, this adds `"*"` to allow JSDoc comments. - * @param {string[]} [markers] - A marker list. - * @returns {string[]} A marker list. - */ -function parseMarkersOption(markers) { - markers = markers ? markers.slice(0) : []; - - // `*` is a marker for JSDoc comments. - if (markers.indexOf("*") === -1) { - markers.push("*"); - } - - return markers; -} - -/** - * Creates RegExp object for `always` mode. - * Generated pattern is below: - * - * 1. First, a marker or nothing. - * 2. Next, a space or an exception pattern sequence. - * - * @param {string[]} markers - A marker list. - * @param {string[]} exceptions - A exception pattern list. - * @returns {RegExp} A RegExp object for `always` mode. - */ -function createAlwaysStylePattern(markers, exceptions) { - var pattern = "^"; - - // A marker or nothing. - // ["*"] ==> "\*?" - // ["*", "!"] ==> "(?:\*|!)?" - // ["*", "/", "!<"] ==> "(?:\*|\/|(?:!<))?" ==> https://jex.im/regulex/#!embed=false&flags=&re=(%3F%3A%5C*%7C%5C%2F%7C(%3F%3A!%3C))%3F - if (markers.length === 1) { - // the marker. - pattern += escape(markers[0]); - } else { - // one of markers. - pattern += "(?:"; - pattern += markers.map(escape).join("|"); - pattern += ")"; - } - pattern += "?"; // or nothing. - - // A space or an exception pattern sequence. - // [] ==> "\s" - // ["-"] ==> "(?:\s|\-+$)" - // ["-", "="] ==> "(?:\s|(?:\-+|=+)$)" - // ["-", "=", "--=="] ==> "(?:\s|(?:\-+|=+|(?:\-\-==)+)$)" ==> https://jex.im/regulex/#!embed=false&flags=&re=(%3F%3A%5Cs%7C(%3F%3A%5C-%2B%7C%3D%2B%7C(%3F%3A%5C-%5C-%3D%3D)%2B)%24) - if (exceptions.length === 0) { - // a space. - pattern += "\\s"; - } else { - // a space or... - pattern += "(?:\\s|"; - if (exceptions.length === 1) { - // a sequence of the exception pattern. - pattern += escapeAndRepeat(exceptions[0]); - } else { - // a sequence of one of exception patterns. - pattern += "(?:"; - pattern += exceptions.map(escapeAndRepeat).join("|"); - pattern += ")"; - } - pattern += "(?:$|[\n\r]))"; // the sequence continues until the end. - } - return new RegExp(pattern); -} - -/** - * Creates RegExp object for `never` mode. - * Generated pattern is below: - * - * 1. First, a marker or nothing (captured). - * 2. Next, a space or a tab. - * - * @param {string[]} markers - A marker list. - * @returns {RegExp} A RegExp object for `never` mode. - */ -function createNeverStylePattern(markers) { - var pattern = "^(" + markers.map(escape).join("|") + ")?[ \t]"; - return new RegExp(pattern); -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - // Unless the first option is never, require a space - var requireSpace = context.options[0] !== "never"; - - // Parse the second options. - // If markers don't include `"*"`, it's added automatically for JSDoc comments. - var config = context.options[1] || {}; - var styleRules = ["block", "line"].reduce(function(rule, type) { - var markers = parseMarkersOption(config[type] && config[type].markers || config.markers); - var exceptions = config[type] && config[type].exceptions || config.exceptions || []; - - // Create RegExp object for valid patterns. - rule[type] = { - regex: requireSpace ? createAlwaysStylePattern(markers, exceptions) : createNeverStylePattern(markers), - hasExceptions: exceptions.length > 0 - }; - - return rule; - }, {}); - - /** - * Reports a given comment if it's invalid. - * @param {ASTNode} node - a comment node to check. - * @returns {void} - */ - function checkCommentForSpace(node) { - var type = node.type.toLowerCase(), - rule = styleRules[type], - commentIdentifier = type === "block" ? "/*" : "//"; - - // Ignores empty comments. - if (node.value.length === 0) { - return; - } - - // Checks. - if (requireSpace) { - if (!rule.regex.test(node.value)) { - if (rule.hasExceptions) { - context.report(node, "Expected exception block, space or tab after \"" + commentIdentifier + "\" in comment."); - } else { - context.report(node, "Expected space or tab after \"" + commentIdentifier + "\" in comment."); - } - } - } else { - var matched = rule.regex.exec(node.value); - if (matched) { - if (!matched[1]) { - context.report(node, "Unexpected space or tab after \"" + commentIdentifier + "\" in comment."); - } else { - context.report(node, "Unexpected space or tab after marker (" + matched[1] + ") in comment."); - } - } - } - } - - return { - - "LineComment": checkCommentForSpace, - "BlockComment": checkCommentForSpace - - }; -}; - -module.exports.schema = [ - { - "enum": ["always", "never"] - }, - { - "type": "object", - "properties": { - "exceptions": { - "type": "array", - "items": { - "type": "string" - } - }, - "markers": { - "type": "array", - "items": { - "type": "string" - } - }, - "line": { - "type": "object", - "properties": { - "exceptions": { - "type": "array", - "items": { - "type": "string" - } - }, - "markers": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false - }, - "block": { - "type": "object", - "properties": { - "exceptions": { - "type": "array", - "items": { - "type": "string" - } - }, - "markers": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/strict.js b/node_modules/eslint/lib/rules/strict.js deleted file mode 100644 index 3f3b56b..0000000 --- a/node_modules/eslint/lib/rules/strict.js +++ /dev/null @@ -1,224 +0,0 @@ -/** - * @fileoverview Rule to control usage of strict mode directives. - * @author Brandon Mills - * @copyright 2015 Brandon Mills. All rights reserved. - * @copyright 2013-2014 Nicholas C. Zakas. All rights reserved. - * @copyright 2013 Ian Christian Myers. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -var messages = { - function: "Use the function form of \"use strict\".", - global: "Use the global form of \"use strict\".", - multiple: "Multiple \"use strict\" directives.", - never: "Strict mode is not permitted.", - unnecessary: "Unnecessary \"use strict\" directive.", - unnecessaryInModules: "\"use strict\" is unnecessary inside of modules.", - unnecessaryInClasses: "\"use strict\" is unnecessary inside of classes." -}; - -/** - * Gets all of the Use Strict Directives in the Directive Prologue of a group of - * statements. - * @param {ASTNode[]} statements Statements in the program or function body. - * @returns {ASTNode[]} All of the Use Strict Directives. - */ -function getUseStrictDirectives(statements) { - var directives = [], - i, statement; - - for (i = 0; i < statements.length; i++) { - statement = statements[i]; - - if ( - statement.type === "ExpressionStatement" && - statement.expression.type === "Literal" && - statement.expression.value === "use strict" - ) { - directives[i] = statement; - } else { - break; - } - } - - return directives; -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var mode = context.options[0]; - - /** - * Report a node or array of nodes with a given message. - * @param {(ASTNode|ASTNode[])} nodes Node or nodes to report. - * @param {string} message Message to display. - * @returns {void} - */ - function report(nodes, message) { - var i; - - if (Array.isArray(nodes)) { - for (i = 0; i < nodes.length; i++) { - context.report(nodes[i], message); - } - } else { - context.report(nodes, message); - } - } - - //-------------------------------------------------------------------------- - // "never" mode - //-------------------------------------------------------------------------- - - if (mode === "never") { - return { - "Program": function(node) { - report(getUseStrictDirectives(node.body), messages.never); - }, - "FunctionDeclaration": function(node) { - report(getUseStrictDirectives(node.body.body), messages.never); - }, - "FunctionExpression": function(node) { - report(getUseStrictDirectives(node.body.body), messages.never); - }, - "ArrowFunctionExpression": function(node) { - if (node.body.type === "BlockStatement") { - report(getUseStrictDirectives(node.body.body), messages.never); - } - } - }; - } - - //-------------------------------------------------------------------------- - // If this is modules, all "use strict" directives are unnecessary. - //-------------------------------------------------------------------------- - - if (context.ecmaFeatures.modules) { - return { - "Program": function(node) { - report(getUseStrictDirectives(node.body), messages.unnecessaryInModules); - }, - "FunctionDeclaration": function(node) { - report(getUseStrictDirectives(node.body.body), messages.unnecessaryInModules); - }, - "FunctionExpression": function(node) { - report(getUseStrictDirectives(node.body.body), messages.unnecessaryInModules); - }, - "ArrowFunctionExpression": function(node) { - if (node.body.type === "BlockStatement") { - report(getUseStrictDirectives(node.body.body), messages.unnecessaryInModules); - } - } - }; - } - - //-------------------------------------------------------------------------- - // "global" mode - //-------------------------------------------------------------------------- - - if (mode === "global") { - return { - "Program": function(node) { - var useStrictDirectives = getUseStrictDirectives(node.body); - - if (node.body.length > 0 && useStrictDirectives.length === 0) { - report(node, messages.global); - } else { - report(useStrictDirectives.slice(1), messages.multiple); - } - }, - "FunctionDeclaration": function(node) { - report(getUseStrictDirectives(node.body.body), messages.global); - }, - "FunctionExpression": function(node) { - report(getUseStrictDirectives(node.body.body), messages.global); - }, - "ArrowFunctionExpression": function(node) { - if (node.body.type === "BlockStatement") { - report(getUseStrictDirectives(node.body.body), messages.global); - } - } - }; - } - - //-------------------------------------------------------------------------- - // "function" mode (Default) - //-------------------------------------------------------------------------- - - var scopes = [], - classScopes = []; - - /** - * Entering a function pushes a new nested scope onto the stack. The new - * scope is true if the nested function is strict mode code. - * @param {ASTNode} node The function declaration or expression. - * @returns {void} - */ - function enterFunction(node) { - var isInClass = classScopes.length > 0, - isParentGlobal = scopes.length === 0 && classScopes.length === 0, - isParentStrict = scopes.length > 0 && scopes[scopes.length - 1], - isNotBlock = node.body.type !== "BlockStatement", - useStrictDirectives = isNotBlock ? [] : getUseStrictDirectives(node.body.body), - isStrict = useStrictDirectives.length > 0; - - if (isStrict) { - if (isParentStrict) { - report(useStrictDirectives[0], messages.unnecessary); - } else if (isInClass) { - report(useStrictDirectives[0], messages.unnecessaryInClasses); - } - - report(useStrictDirectives.slice(1), messages.multiple); - } else if (isParentGlobal) { - report(node, messages.function); - } - - scopes.push(isParentStrict || isStrict); - } - - /** - * Exiting a function pops its scope off the stack. - * @returns {void} - */ - function exitFunction() { - scopes.pop(); - } - - return { - "Program": function(node) { - report(getUseStrictDirectives(node.body), messages.function); - }, - - // Inside of class bodies are always strict mode. - "ClassBody": function() { - classScopes.push(true); - }, - "ClassBody:exit": function() { - classScopes.pop(); - }, - - "FunctionDeclaration": enterFunction, - "FunctionExpression": enterFunction, - "ArrowFunctionExpression": enterFunction, - - "FunctionDeclaration:exit": exitFunction, - "FunctionExpression:exit": exitFunction, - "ArrowFunctionExpression:exit": exitFunction - }; -}; - -module.exports.schema = [ - { - "enum": ["never", "global", "function"] - } -]; diff --git a/node_modules/eslint/lib/rules/use-isnan.js b/node_modules/eslint/lib/rules/use-isnan.js deleted file mode 100644 index 7d65f9c..0000000 --- a/node_modules/eslint/lib/rules/use-isnan.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @fileoverview Rule to flag comparisons to the value NaN - * @author James Allardice - * @copyright 2014 Jordan Harband. All rights reserved. - * @copyright 2013 James Allardice. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - "BinaryExpression": function(node) { - if (/^(?:[<>]|[!=]=)=?$/.test(node.operator) && (node.left.name === "NaN" || node.right.name === "NaN")) { - context.report(node, "Use the isNaN function to compare with NaN."); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/valid-jsdoc.js b/node_modules/eslint/lib/rules/valid-jsdoc.js deleted file mode 100644 index 2832a8a..0000000 --- a/node_modules/eslint/lib/rules/valid-jsdoc.js +++ /dev/null @@ -1,269 +0,0 @@ -/** - * @fileoverview Validates JSDoc comments are syntactically correct - * @author Nicholas C. Zakas - * @copyright 2014 Nicholas C. Zakas. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var doctrine = require("doctrine"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var options = context.options[0] || {}, - prefer = options.prefer || {}, - sourceCode = context.getSourceCode(), - - // these both default to true, so you have to explicitly make them false - requireReturn = options.requireReturn !== false, - requireParamDescription = options.requireParamDescription !== false, - requireReturnDescription = options.requireReturnDescription !== false, - requireReturnType = options.requireReturnType !== false; - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - // Using a stack to store if a function returns or not (handling nested functions) - var fns = []; - - /** - * Check if node type is a Class - * @param {ASTNode} node node to check. - * @returns {boolean} True is its a class - * @private - */ - function isTypeClass(node) { - return node.type === "ClassExpression" || node.type === "ClassDeclaration"; - } - - /** - * When parsing a new function, store it in our function stack. - * @param {ASTNode} node A function node to check. - * @returns {void} - * @private - */ - function startFunction(node) { - fns.push({ - returnPresent: (node.type === "ArrowFunctionExpression" && node.body.type !== "BlockStatement") || - isTypeClass(node) - }); - } - - /** - * Indicate that return has been found in the current function. - * @param {ASTNode} node The return node. - * @returns {void} - * @private - */ - function addReturn(node) { - var functionState = fns[fns.length - 1]; - - if (functionState && node.argument !== null) { - functionState.returnPresent = true; - } - } - - /** - * Check if return tag type is void or undefined - * @param {Object} tag JSDoc tag - * @returns {boolean} True if its of type void or undefined - * @private - */ - function isValidReturnType(tag) { - return tag.type === null || tag.type.name === "void" || tag.type.type === "UndefinedLiteral"; - } - - /** - * Validate the JSDoc node and output warnings if anything is wrong. - * @param {ASTNode} node The AST node to check. - * @returns {void} - * @private - */ - function checkJSDoc(node) { - var jsdocNode = sourceCode.getJSDocComment(node), - functionData = fns.pop(), - hasReturns = false, - hasConstructor = false, - isOverride = false, - params = Object.create(null), - jsdoc; - - // make sure only to validate JSDoc comments - if (jsdocNode) { - - try { - jsdoc = doctrine.parse(jsdocNode.value, { - strict: true, - unwrap: true, - sloppy: true - }); - } catch (ex) { - - if (/braces/i.test(ex.message)) { - context.report(jsdocNode, "JSDoc type missing brace."); - } else { - context.report(jsdocNode, "JSDoc syntax error."); - } - - return; - } - - jsdoc.tags.forEach(function(tag) { - - switch (tag.title) { - - case "param": - case "arg": - case "argument": - if (!tag.type) { - context.report(jsdocNode, "Missing JSDoc parameter type for '{{name}}'.", { name: tag.name }); - } - - if (!tag.description && requireParamDescription) { - context.report(jsdocNode, "Missing JSDoc parameter description for '{{name}}'.", { name: tag.name }); - } - - if (params[tag.name]) { - context.report(jsdocNode, "Duplicate JSDoc parameter '{{name}}'.", { name: tag.name }); - } else if (tag.name.indexOf(".") === -1) { - params[tag.name] = 1; - } - break; - - case "return": - case "returns": - hasReturns = true; - - if (!requireReturn && !functionData.returnPresent && (tag.type === null || !isValidReturnType(tag))) { - context.report(jsdocNode, "Unexpected @" + tag.title + " tag; function has no return statement."); - } else { - if (requireReturnType && !tag.type) { - context.report(jsdocNode, "Missing JSDoc return type."); - } - - if (!isValidReturnType(tag) && !tag.description && requireReturnDescription) { - context.report(jsdocNode, "Missing JSDoc return description."); - } - } - - break; - - case "constructor": - case "class": - hasConstructor = true; - break; - - case "override": - case "inheritdoc": - isOverride = true; - break; - - // no default - } - - // check tag preferences - if (prefer.hasOwnProperty(tag.title) && tag.title !== prefer[tag.title]) { - context.report(jsdocNode, "Use @{{name}} instead.", { name: prefer[tag.title] }); - } - - }); - - // check for functions missing @returns - if (!isOverride && !hasReturns && !hasConstructor && node.parent.kind !== "get" && !isTypeClass(node)) { - if (requireReturn || functionData.returnPresent) { - context.report(jsdocNode, "Missing JSDoc @" + (prefer.returns || "returns") + " for function."); - } - } - - // check the parameters - var jsdocParams = Object.keys(params); - - if (node.params) { - node.params.forEach(function(param, i) { - var name = param.name; - - // TODO(nzakas): Figure out logical things to do with destructured, default, rest params - if (param.type === "Identifier") { - if (jsdocParams[i] && (name !== jsdocParams[i])) { - context.report(jsdocNode, "Expected JSDoc for '{{name}}' but found '{{jsdocName}}'.", { - name: name, - jsdocName: jsdocParams[i] - }); - } else if (!params[name] && !isOverride) { - context.report(jsdocNode, "Missing JSDoc for parameter '{{name}}'.", { - name: name - }); - } - } - }); - } - - if (options.matchDescription) { - var regex = new RegExp(options.matchDescription); - - if (!regex.test(jsdoc.description)) { - context.report(jsdocNode, "JSDoc description does not satisfy the regex pattern."); - } - } - - } - - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - "ArrowFunctionExpression": startFunction, - "FunctionExpression": startFunction, - "FunctionDeclaration": startFunction, - "ClassExpression": startFunction, - "ClassDeclaration": startFunction, - "ArrowFunctionExpression:exit": checkJSDoc, - "FunctionExpression:exit": checkJSDoc, - "FunctionDeclaration:exit": checkJSDoc, - "ClassExpression:exit": checkJSDoc, - "ClassDeclaration:exit": checkJSDoc, - "ReturnStatement": addReturn - }; - -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "prefer": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "requireReturn": { - "type": "boolean" - }, - "requireParamDescription": { - "type": "boolean" - }, - "requireReturnDescription": { - "type": "boolean" - }, - "matchDescription": { - "type": "string" - }, - "requireReturnType": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/rules/valid-typeof.js b/node_modules/eslint/lib/rules/valid-typeof.js deleted file mode 100644 index d67a46b..0000000 --- a/node_modules/eslint/lib/rules/valid-typeof.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @fileoverview Ensures that the results of typeof are compared against a valid string - * @author Ian Christian Myers - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var VALID_TYPES = ["symbol", "undefined", "object", "boolean", "number", "string", "function"], - OPERATORS = ["==", "===", "!=", "!=="]; - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - - "UnaryExpression": function(node) { - var parent, sibling; - - if (node.operator === "typeof") { - parent = context.getAncestors().pop(); - - if (parent.type === "BinaryExpression" && OPERATORS.indexOf(parent.operator) !== -1) { - sibling = parent.left === node ? parent.right : parent.left; - - if (sibling.type === "Literal" && VALID_TYPES.indexOf(sibling.value) === -1) { - context.report(sibling, "Invalid typeof comparison value"); - } - } - } - } - - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/vars-on-top.js b/node_modules/eslint/lib/rules/vars-on-top.js deleted file mode 100644 index 84af647..0000000 --- a/node_modules/eslint/lib/rules/vars-on-top.js +++ /dev/null @@ -1,115 +0,0 @@ -/** - * @fileoverview Rule to enforce var declarations are only at the top of a function. - * @author Danny Fritz - * @author Gyandeep Singh - * @copyright 2014 Danny Fritz. All rights reserved. - * @copyright 2014 Gyandeep Singh. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var errorMessage = "All \"var\" declarations must be at the top of the function scope."; - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * @param {ASTNode} node - any node - * @returns {Boolean} whether the given node structurally represents a directive - */ - function looksLikeDirective(node) { - return node.type === "ExpressionStatement" && - node.expression.type === "Literal" && typeof node.expression.value === "string"; - } - - /** - * Check to see if its a ES6 import declaration - * @param {ASTNode} node - any node - * @returns {Boolean} whether the given node represents a import declaration - */ - function looksLikeImport(node) { - return node.type === "ImportDeclaration" || node.type === "ImportSpecifier" || - node.type === "ImportDefaultSpecifier" || node.type === "ImportNamespaceSpecifier"; - } - - /** - * Checks whether this variable is on top of the block body - * @param {ASTNode} node - The node to check - * @param {ASTNode[]} statements - collection of ASTNodes for the parent node block - * @returns {Boolean} True if var is on top otherwise false - */ - function isVarOnTop(node, statements) { - var i = 0, l = statements.length; - - // skip over directives - for (; i < l; ++i) { - if (!looksLikeDirective(statements[i]) && !looksLikeImport(statements[i])) { - break; - } - } - - for (; i < l; ++i) { - if (statements[i].type !== "VariableDeclaration") { - return false; - } - if (statements[i] === node) { - return true; - } - } - } - - /** - * Checks whether variable is on top at the global level - * @param {ASTNode} node - The node to check - * @param {ASTNode} parent - Parent of the node - * @returns {void} - */ - function globalVarCheck(node, parent) { - if (!isVarOnTop(node, parent.body)) { - context.report(node, errorMessage); - } - } - - /** - * Checks whether variable is on top at functional block scope level - * @param {ASTNode} node - The node to check - * @param {ASTNode} parent - Parent of the node - * @param {ASTNode} grandParent - Parent of the node's parent - * @returns {void} - */ - function blockScopeVarCheck(node, parent, grandParent) { - if (!(/Function/.test(grandParent.type) && - parent.type === "BlockStatement" && - isVarOnTop(node, parent.body))) { - context.report(node, errorMessage); - } - } - - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- - - return { - "VariableDeclaration": function(node) { - var ancestors = context.getAncestors(); - var parent = ancestors.pop(); - var grandParent = ancestors.pop(); - - if (node.kind === "var") { // check variable is `var` type and not `let` or `const` - if (parent.type === "Program") { // That means its a global variable - globalVarCheck(node, parent); - } else { - blockScopeVarCheck(node, parent, grandParent); - } - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/wrap-iife.js b/node_modules/eslint/lib/rules/wrap-iife.js deleted file mode 100644 index 87d4d5e..0000000 --- a/node_modules/eslint/lib/rules/wrap-iife.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @fileoverview Rule to flag when IIFE is not wrapped in parens - * @author Ilya Volodin - * @copyright 2013 Ilya Volodin. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var style = context.options[0] || "outside"; - - /** - * Check if the node is wrapped in () - * @param {ASTNode} node node to evaluate - * @returns {boolean} True if it is wrapped - * @private - */ - function wrapped(node) { - var previousToken = context.getTokenBefore(node), - nextToken = context.getTokenAfter(node); - return previousToken && previousToken.value === "(" && - nextToken && nextToken.value === ")"; - } - - return { - - "CallExpression": function(node) { - if (node.callee.type === "FunctionExpression") { - var callExpressionWrapped = wrapped(node), - functionExpressionWrapped = wrapped(node.callee); - - if (!callExpressionWrapped && !functionExpressionWrapped) { - context.report(node, "Wrap an immediate function invocation in parentheses."); - } else if (style === "inside" && !functionExpressionWrapped) { - context.report(node, "Wrap only the function expression in parens."); - } else if (style === "outside" && !callExpressionWrapped) { - context.report(node, "Move the invocation into the parens that contain the function."); - } - } - } - }; - -}; - -module.exports.schema = [ - { - "enum": ["outside", "inside", "any"] - } -]; diff --git a/node_modules/eslint/lib/rules/wrap-regex.js b/node_modules/eslint/lib/rules/wrap-regex.js deleted file mode 100644 index f2625cc..0000000 --- a/node_modules/eslint/lib/rules/wrap-regex.js +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @fileoverview Rule to flag when regex literals are not wrapped in parens - * @author Matt DuVall - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "Literal": function(node) { - var token = context.getFirstToken(node), - nodeType = token.type, - source, - grandparent, - ancestors; - - if (nodeType === "RegularExpression") { - source = context.getTokenBefore(node); - ancestors = context.getAncestors(); - grandparent = ancestors[ancestors.length - 1]; - - if (grandparent.type === "MemberExpression" && grandparent.object === node && - (!source || source.value !== "(")) { - context.report(node, "Wrap the regexp literal in parens to disambiguate the slash."); - } - } - } - }; - -}; - -module.exports.schema = []; diff --git a/node_modules/eslint/lib/rules/yoda.js b/node_modules/eslint/lib/rules/yoda.js deleted file mode 100644 index 57ac261..0000000 --- a/node_modules/eslint/lib/rules/yoda.js +++ /dev/null @@ -1,242 +0,0 @@ -/** - * @fileoverview Rule to require or disallow yoda comparisons - * @author Nicholas C. Zakas - * @copyright 2014 Nicholas C. Zakas. All rights reserved. - * @copyright 2014 Brandon Mills. All rights reserved. - */ -"use strict"; - -//-------------------------------------------------------------------------- -// Helpers -//-------------------------------------------------------------------------- - -/** - * Determines whether an operator is a comparison operator. - * @param {String} operator The operator to check. - * @returns {boolean} Whether or not it is a comparison operator. - */ -function isComparisonOperator(operator) { - return (/^(==|===|!=|!==|<|>|<=|>=)$/).test(operator); -} - -/** - * Determines whether an operator is an equality operator. - * @param {String} operator The operator to check. - * @returns {boolean} Whether or not it is an equality operator. - */ -function isEqualityOperator(operator) { - return (/^(==|===)$/).test(operator); -} - -/** - * Determines whether an operator is one used in a range test. - * Allowed operators are `<` and `<=`. - * @param {String} operator The operator to check. - * @returns {boolean} Whether the operator is used in range tests. - */ -function isRangeTestOperator(operator) { - return ["<", "<="].indexOf(operator) >= 0; -} - -/** - * Determines whether a non-Literal node is a negative number that should be - * treated as if it were a single Literal node. - * @param {ASTNode} node Node to test. - * @returns {boolean} True if the node is a negative number that looks like a - * real literal and should be treated as such. - */ -function looksLikeLiteral(node) { - return (node.type === "UnaryExpression" && - node.operator === "-" && - node.prefix && - node.argument.type === "Literal" && - typeof node.argument.value === "number"); -} - -/** - * Attempts to derive a Literal node from nodes that are treated like literals. - * @param {ASTNode} node Node to normalize. - * @returns {ASTNode} The original node if the node is already a Literal, or a - * normalized Literal node with the negative number as the - * value if the node represents a negative number literal, - * otherwise null if the node cannot be converted to a - * normalized literal. - */ -function getNormalizedLiteral(node) { - if (node.type === "Literal") { - return node; - } - - if (looksLikeLiteral(node)) { - return { - type: "Literal", - value: -node.argument.value, - raw: "-" + node.argument.value - }; - } - - return null; -} - -/** - * Checks whether two expressions reference the same value. For example: - * a = a - * a.b = a.b - * a[0] = a[0] - * a['b'] = a['b'] - * @param {ASTNode} a Left side of the comparison. - * @param {ASTNode} b Right side of the comparison. - * @returns {boolean} True if both sides match and reference the same value. - */ -function same(a, b) { - if (a.type !== b.type) { - return false; - } - - switch (a.type) { - case "Identifier": - return a.name === b.name; - case "Literal": - return a.value === b.value; - case "MemberExpression": - // x[0] = x[0] - // x[y] = x[y] - // x.y = x.y - return same(a.object, b.object) && same(a.property, b.property); - case "ThisExpression": - return true; - default: - return false; - } -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - // Default to "never" (!always) if no option - var always = (context.options[0] === "always"); - var exceptRange = (context.options[1] && context.options[1].exceptRange); - var onlyEquality = (context.options[1] && context.options[1].onlyEquality); - - /** - * Determines whether node represents a range test. - * A range test is a "between" test like `(0 <= x && x < 1)` or an "outside" - * test like `(x < 0 || 1 <= x)`. It must be wrapped in parentheses, and - * both operators must be `<` or `<=`. Finally, the literal on the left side - * must be less than or equal to the literal on the right side so that the - * test makes any sense. - * @param {ASTNode} node LogicalExpression node to test. - * @returns {Boolean} Whether node is a range test. - */ - function isRangeTest(node) { - var left = node.left, - right = node.right; - - /** - * Determines whether node is of the form `0 <= x && x < 1`. - * @returns {Boolean} Whether node is a "between" range test. - */ - function isBetweenTest() { - var leftLiteral, rightLiteral; - - return (node.operator === "&&" && - (leftLiteral = getNormalizedLiteral(left.left)) && - (rightLiteral = getNormalizedLiteral(right.right)) && - leftLiteral.value <= rightLiteral.value && - same(left.right, right.left)); - } - - /** - * Determines whether node is of the form `x < 0 || 1 <= x`. - * @returns {Boolean} Whether node is an "outside" range test. - */ - function isOutsideTest() { - var leftLiteral, rightLiteral; - - return (node.operator === "||" && - (leftLiteral = getNormalizedLiteral(left.right)) && - (rightLiteral = getNormalizedLiteral(right.left)) && - leftLiteral.value <= rightLiteral.value && - same(left.left, right.right)); - } - - /** - * Determines whether node is wrapped in parentheses. - * @returns {Boolean} Whether node is preceded immediately by an open - * paren token and followed immediately by a close - * paren token. - */ - function isParenWrapped() { - var tokenBefore, tokenAfter; - - return ((tokenBefore = context.getTokenBefore(node)) && - tokenBefore.value === "(" && - (tokenAfter = context.getTokenAfter(node)) && - tokenAfter.value === ")"); - } - - return (node.type === "LogicalExpression" && - left.type === "BinaryExpression" && - right.type === "BinaryExpression" && - isRangeTestOperator(left.operator) && - isRangeTestOperator(right.operator) && - (isBetweenTest() || isOutsideTest()) && - isParenWrapped()); - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - "BinaryExpression": always ? function(node) { - - // Comparisons must always be yoda-style: if ("blue" === color) - if ( - (node.right.type === "Literal" || looksLikeLiteral(node.right)) && - !(node.left.type === "Literal" || looksLikeLiteral(node.left)) && - !(!isEqualityOperator(node.operator) && onlyEquality) && - isComparisonOperator(node.operator) && - !(exceptRange && isRangeTest(context.getAncestors().pop())) - ) { - context.report(node, "Expected literal to be on the left side of " + node.operator + "."); - } - - } : function(node) { - - // Comparisons must never be yoda-style (default) - if ( - (node.left.type === "Literal" || looksLikeLiteral(node.left)) && - !(node.right.type === "Literal" || looksLikeLiteral(node.right)) && - !(!isEqualityOperator(node.operator) && onlyEquality) && - isComparisonOperator(node.operator) && - !(exceptRange && isRangeTest(context.getAncestors().pop())) - ) { - context.report(node, "Expected literal to be on the right side of " + node.operator + "."); - } - - } - }; - -}; - -module.exports.schema = [ - { - "enum": ["always", "never"] - }, - { - "type": "object", - "properties": { - "exceptRange": { - "type": "boolean" - }, - "onlyEquality": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/node_modules/eslint/lib/testers/event-generator-tester.js b/node_modules/eslint/lib/testers/event-generator-tester.js deleted file mode 100644 index ce2f3c8..0000000 --- a/node_modules/eslint/lib/testers/event-generator-tester.js +++ /dev/null @@ -1,63 +0,0 @@ -/** - * @fileoverview Helpers to test EventGenerator interface. - * @author Toru Nagashima - * @copyright 2015 Toru Nagashima. All rights reserved. - * See LICENSE file in root directory for full license. - */ -"use strict"; - -/* global describe, it */ - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var assert = require("assert"); - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -module.exports = { - /** - * Overrideable `describe` function to test. - * @param {string} text - A description. - * @param {function} method - A test logic. - * @returns {any} The returned value with the test logic. - */ - describe: (typeof describe === "function") ? describe : function(text, method) { - return method.apply(this); - }, - - /** - * Overrideable `it` function to test. - * @param {string} text - A description. - * @param {function} method - A test logic. - * @returns {any} The returned value with the test logic. - */ - it: (typeof it === "function") ? it : function(text, method) { - return method.apply(this); - }, - - /** - * Does some tests to check a given object implements the EventGenerator interface. - * @param {object} instance - An object to check. - * @returns {void} - */ - testEventGeneratorInterface: function(instance) { - this.describe("should implement EventGenerator interface", function() { - this.it("should have `emitter` property.", function() { - assert.equal(typeof instance.emitter, "object"); - assert.equal(typeof instance.emitter.emit, "function"); - }); - - this.it("should have `enterNode` property.", function() { - assert.equal(typeof instance.enterNode, "function"); - }); - - this.it("should have `leaveNode` property.", function() { - assert.equal(typeof instance.leaveNode, "function"); - }); - }.bind(this)); - } -}; diff --git a/node_modules/eslint/lib/testers/rule-tester.js b/node_modules/eslint/lib/testers/rule-tester.js deleted file mode 100644 index 5a8b8a4..0000000 --- a/node_modules/eslint/lib/testers/rule-tester.js +++ /dev/null @@ -1,421 +0,0 @@ -/** - * @fileoverview Mocha test wrapper - * @author Ilya Volodin - * @copyright 2015 Kevin Partington. All rights reserved. - * @copyright 2015 Nicholas C. Zakas. All rights reserved. - * @copyright 2014 Ilya Volodin. All rights reserved. - * See LICENSE file in root directory for full license. - */ -"use strict"; - -/* global describe, it */ - -/* - * This is a wrapper around mocha to allow for DRY unittests for eslint - * Format: - * RuleTester.add("{ruleName}", { - * valid: [ - * "{code}", - * { code: "{code}", options: {options}, global: {globals}, globals: {globals}, parser: "{parser}", settings: {settings} } - * ], - * invalid: [ - * { code: "{code}", errors: {numErrors} }, - * { code: "{code}", errors: ["{errorMessage}"] }, - * { code: "{code}", options: {options}, global: {globals}, parser: "{parser}", settings: {settings}, errors: [{ message: "{errorMessage}", type: "{errorNodeType}"}] } - * ] - * }); - * - * Variables: - * {code} - String that represents the code to be tested - * {options} - Arguments that are passed to the configurable rules. - * {globals} - An object representing a list of variables that are - * registered as globals - * {parser} - String representing the parser to use - * {settings} - An object representing global settings for all rules - * {numErrors} - If failing case doesn't need to check error message, - * this integer will specify how many errors should be - * received - * {errorMessage} - Message that is returned by the rule on failure - * {errorNodeType} - AST node type that is returned by they rule as - * a cause of the failure. - * - * Requirements: - * Each rule has to have at least one invalid and at least one valid check. - * If one of them is missing, the test will be marked as failed. - */ - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var assert = require("assert"), - util = require("util"), - merge = require("lodash.merge"), - omit = require("lodash.omit"), - clone = require("lodash.clonedeep"), - validator = require("../config/config-validator"), - validate = require("is-my-json-valid"), - eslint = require("../eslint"), - rules = require("../rules"), - metaSchema = require("../../conf/json-schema-schema.json"), - SourceCodeFixer = require("../util/source-code-fixer"); - -//------------------------------------------------------------------------------ -// Private Members -//------------------------------------------------------------------------------ -// testerDefaultConfig must not be modified as it allows to reset the tester to -// the initial default configuration -var testerDefaultConfig = { rules: {} }; -var defaultConfig = { rules: {} }; -// List every parameters possible on a test case that are not related to eslint -// configuration -var RuleTesterParameters = [ - "code", - "filename", - "options", - "args", - "errors" -]; - -var validateSchema = validate(metaSchema, { verbose: true }); - -var hasOwnProperty = Function.call.bind(Object.hasOwnProperty); - -/** - * Clones a given value deeply. - * Note: This ignores `parent` property. - * - * @param {any} x - A value to clone. - * @returns {any} A cloned value. - */ -function cloneDeeplyExcludesParent(x) { - if (typeof x === "object" && x !== null) { - if (Array.isArray(x)) { - return x.map(cloneDeeplyExcludesParent); - } - - var retv = {}; - for (var key in x) { - if (key !== "parent" && hasOwnProperty(x, key)) { - retv[key] = cloneDeeplyExcludesParent(x[key]); - } - } - - return retv; - } - - return x; -} - -/** - * Freezes a given value deeply. - * - * @param {any} x - A value to freeze. - * @returns {void} - */ -function freezeDeeply(x) { - if (typeof x === "object" && x !== null) { - if (Array.isArray(x)) { - x.forEach(freezeDeeply); - } else { - for (var key in x) { - if (key !== "parent" && hasOwnProperty(x, key)) { - freezeDeeply(x[key]); - } - } - } - Object.freeze(x); - } -} - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -/** - * Creates a new instance of RuleTester. - * @param {Object} [testerConfig] Optional, extra configuration for the tester - * @constructor - */ -function RuleTester(testerConfig) { - - /** - * The configuration to use for this tester. Combination of the tester - * configuration and the default configuration. - * @type {Object} - */ - this.testerConfig = merge( - // we have to clone because merge uses the object on the left for - // recipient - clone(defaultConfig), - testerConfig - ); -} - -/** - * Set the configuration to use for all future tests - * @param {Object} config the configuration to use. - * @returns {void} - */ -RuleTester.setDefaultConfig = function(config) { - if (typeof config !== "object") { - throw new Error("RuleTester.setDefaultConfig: config must be an object"); - } - defaultConfig = config; - - // Make sure the rules object exists since it is assumed to exist later - defaultConfig.rules = defaultConfig.rules || {}; -}; - -/** - * Get the current configuration used for all tests - * @returns {Object} the current configuration - */ -RuleTester.getDefaultConfig = function() { - return defaultConfig; -}; - -/** - * Reset the configuration to the initial configuration of the tester removing - * any changes made until now. - * @returns {void} - */ -RuleTester.resetDefaultConfig = function() { - defaultConfig = clone(testerDefaultConfig); -}; - -// default separators for testing -RuleTester.describe = (typeof describe === "function") ? describe : function(text, method) { - return method.apply(this); -}; - -RuleTester.it = (typeof it === "function") ? it : function(text, method) { - return method.apply(this); -}; - -RuleTester.prototype = { - - /** - * Define a rule for one particular run of tests. - * @param {string} name The name of the rule to define. - * @param {Function} rule The rule definition. - * @returns {void} - */ - defineRule: function(name, rule) { - eslint.defineRule(name, rule); - }, - - /** - * Adds a new rule test to execute. - * @param {string} ruleName The name of the rule to run. - * @param {Function} rule The rule to test. - * @param {Object} test The collection of tests to run. - * @returns {void} - */ - run: function(ruleName, rule, test) { - - var testerConfig = this.testerConfig, - result = {}; - - /* eslint-disable no-shadow */ - - /** - * Run the rule for the given item - * @param {string} ruleName name of the rule - * @param {string|object} item Item to run the rule against - * @returns {object} Eslint run result - * @private - */ - function runRuleForItem(ruleName, item) { - var config = clone(testerConfig), - code, filename, schema, beforeAST, afterAST; - - if (typeof item === "string") { - code = item; - } else { - code = item.code; - // Assumes everything on the item is a config except for the - // parameters used by this tester - var itemConfig = omit(item, RuleTesterParameters); - // Create the config object from the tester config and this item - // specific configurations. - config = merge( - config, - itemConfig - ); - } - - if (item.filename) { - filename = item.filename; - } - - if (item.options) { - var options = item.options.concat(); - options.unshift(1); - config.rules[ruleName] = options; - } else { - config.rules[ruleName] = 1; - } - - eslint.defineRule(ruleName, rule); - - schema = validator.getRuleOptionsSchema(ruleName); - - validateSchema(schema); - - if (validateSchema.errors) { - throw new Error([ - "Schema for rule " + ruleName + " is invalid:" - ].concat(validateSchema.errors.map(function(error) { - return "\t" + error.field + ": " + error.message; - })).join("\n")); - } - - validator.validate(config, "rule-tester"); - - // Setup AST getters. - // To check whether or not AST was not modified in verify. - eslint.reset(); - eslint.on("Program", function(node) { - beforeAST = cloneDeeplyExcludesParent(node); - - eslint.on("Program:exit", function(node) { - afterAST = cloneDeeplyExcludesParent(node); - }); - }); - - // Freezes rule-context properties. - var originalGet = rules.get; - try { - rules.get = function(ruleId) { - var rule = originalGet(ruleId); - return function(context) { - Object.freeze(context); - freezeDeeply(context.options); - freezeDeeply(context.settings); - freezeDeeply(context.ecmaFeatures); - - return rule(context); - }; - }; - - return { - messages: eslint.verify(code, config, filename, true), - beforeAST: beforeAST, - afterAST: afterAST - }; - } finally { - rules.get = originalGet; - } - } - - /** - * Check if the template is valid or not - * all valid cases go through this - * @param {string} ruleName name of the rule - * @param {string|object} item Item to run the rule against - * @returns {void} - * @private - */ - function testValidTemplate(ruleName, item) { - var result = runRuleForItem(ruleName, item); - var messages = result.messages; - - assert.equal(messages.length, 0, util.format("Should have no errors but had %d: %s", - messages.length, util.inspect(messages))); - - assert.deepEqual( - result.beforeAST, - result.afterAST, - "Rule should not modify AST." - ); - } - - /** - * Check if the template is invalid or not - * all invalid cases go through this. - * @param {string} ruleName name of the rule - * @param {string|object} item Item to run the rule against - * @returns {void} - * @private - */ - function testInvalidTemplate(ruleName, item) { - var result = runRuleForItem(ruleName, item); - var messages = result.messages; - - if (typeof item.errors === "number") { - assert.equal(messages.length, item.errors, util.format("Should have %d errors but had %d: %s", - item.errors, messages.length, util.inspect(messages))); - } else { - assert.equal(messages.length, item.errors.length, - util.format("Should have %d errors but had %d: %s", - item.errors.length, messages.length, util.inspect(messages))); - - if (item.hasOwnProperty("output")) { - var fixResult = SourceCodeFixer.applyFixes(eslint.getSourceCode(), messages); - assert.equal(fixResult.output, item.output, "Output is incorrect."); - } - - for (var i = 0, l = item.errors.length; i < l; i++) { - assert.ok(!("fatal" in messages[i]), "A fatal parsing error occurred: " + messages[i].message); - assert.equal(messages[i].ruleId, ruleName, "Error rule name should be the same as the name of the rule being tested"); - - if (typeof item.errors[i] === "string") { - // Just an error message. - - assert.equal(messages[i].message, item.errors[i], "Error message should be " + item.errors[i]); - } else if (typeof item.errors[i] === "object") { - // Error object. This may have a message, node type, - // line, and/or column. - - if (item.errors[i].message) { - assert.equal(messages[i].message, item.errors[i].message, "Error message should be " + item.errors[i].message); - } - - if (item.errors[i].type) { - assert.equal(messages[i].nodeType, item.errors[i].type, "Error type should be " + item.errors[i].type); - } - - if (item.errors[i].hasOwnProperty("line")) { - assert.equal(messages[i].line, item.errors[i].line, "Error line should be " + item.errors[i].line); - } - - if (item.errors[i].hasOwnProperty("column")) { - assert.equal(messages[i].column, item.errors[i].column, "Error column should be " + item.errors[i].column); - } - } else { - // Only string or object errors are valid. - assert.fail(messages[i], null, "Error should be a string or object."); - } - } - } - - assert.deepEqual( - result.beforeAST, - result.afterAST, - "Rule should not modify AST." - ); - } - - // this creates a mocha test suite and pipes all supplied info - // through one of the templates above. - RuleTester.describe(ruleName, function() { - test.valid.forEach(function(valid) { - RuleTester.it(valid.code || valid, function() { - testValidTemplate(ruleName, valid); - }); - }); - - test.invalid.forEach(function(invalid) { - RuleTester.it(invalid.code, function() { - testInvalidTemplate(ruleName, invalid); - }); - }); - }); - - return result.suite; - } -}; - - -module.exports = RuleTester; diff --git a/node_modules/eslint/lib/timing.js b/node_modules/eslint/lib/timing.js deleted file mode 100644 index 3af3a43..0000000 --- a/node_modules/eslint/lib/timing.js +++ /dev/null @@ -1,138 +0,0 @@ -/** - * @fileoverview Tracks performance of individual rules. - * @author Brandon Mills - * @copyright 2014 Brandon Mills. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/* istanbul ignore next */ -/** - * Align the string to left - * @param {string} str string to evaluate - * @param {int} len length of the string - * @param {string} ch delimiter character - * @returns {string} modified string - * @private - */ -function alignLeft(str, len, ch) { - return str + new Array(len - str.length + 1).join(ch || " "); -} - -/* istanbul ignore next */ -/** - * Align the string to right - * @param {string} str string to evaluate - * @param {int} len length of the string - * @param {string} ch delimiter character - * @returns {string} modified string - * @private - */ -function alignRight(str, len, ch) { - return new Array(len - str.length + 1).join(ch || " ") + str; -} - -//------------------------------------------------------------------------------ -// Module definition -//------------------------------------------------------------------------------ - -var enabled = !!process.env.TIMING; - -var HEADERS = ["Rule", "Time (ms)", "Relative"]; -var ALIGN = [alignLeft, alignRight, alignRight]; - -/* istanbul ignore next */ -/** - * display the data - * @param {object} data Data object to be displayed - * @returns {string} modified string - * @private - */ -function display(data) { - var total = 0; - var rows = Object.keys(data) - .map(function(key) { - var time = data[key]; - total += time; - return [key, time]; - }) - .sort(function(a, b) { - return b[1] - a[1]; - }) - .slice(0, 10); - - rows.forEach(function(row) { - row.push((row[1] * 100 / total).toFixed(1) + "%"); - row[1] = row[1].toFixed(3); - }); - - rows.unshift(HEADERS); - - var widths = []; - rows.forEach(function(row) { - var len = row.length, i, n; - for (i = 0; i < len; i++) { - n = row[i].length; - if (!widths[i] || n > widths[i]) { - widths[i] = n; - } - } - }); - - var table = rows.map(function(row) { - return row.map(function(cell, index) { - return ALIGN[index](cell, widths[index]); - }).join(" | "); - }); - table.splice(1, 0, widths.map(function(w, index) { - if (index !== 0 && index !== widths.length - 1) { - w++; - } - - return ALIGN[index](":", w + 1, "-"); - }).join("|")); - - console.log(table.join("\n")); -} - -/* istanbul ignore next */ -module.exports = (function() { - - var data = Object.create(null); - - /** - * Time the run - * @param {*} key key from the data object - * @param {Function} fn function to be called - * @returns {Function} function to be executed - * @private - */ - function time(key, fn) { - if (typeof data[key] === "undefined") { - data[key] = 0; - } - - return function() { - var t = process.hrtime(); - fn.apply(null, Array.prototype.slice.call(arguments)); - t = process.hrtime(t); - data[key] += t[0] * 1e3 + t[1] / 1e6; - }; - } - - if (enabled) { - process.on("exit", function() { - display(data); - }); - } - - return { - time: time, - enabled: enabled - }; - -}()); diff --git a/node_modules/eslint/lib/token-store.js b/node_modules/eslint/lib/token-store.js deleted file mode 100644 index 6a01494..0000000 --- a/node_modules/eslint/lib/token-store.js +++ /dev/null @@ -1,201 +0,0 @@ -/** - * @fileoverview Object to handle access and retrieval of tokens. - * @author Brandon Mills - * @copyright 2014 Nicholas C. Zakas. All rights reserved. - * @copyright 2014 Brandon Mills. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Implementation -//------------------------------------------------------------------------------ - -module.exports = function(tokens) { - var api = {}, - starts = Object.create(null), - ends = Object.create(null), - index, length, range; - - /** - * Gets tokens in a given interval. - * @param {int} start Inclusive index of the first token. 0 if negative. - * @param {int} end Exclusive index of the last token. - * @returns {Token[]} Tokens in the interval. - */ - function get(start, end) { - var result = [], - i; - - for (i = Math.max(0, start); i < end && i < length; i++) { - result.push(tokens[i]); - } - - return result; - } - - /** - * Gets the index in the tokens array of the last token belonging to a node. - * Usually a node ends exactly at a token, but due to ASI, sometimes a - * node's range extends beyond its last token. - * @param {ASTNode} node The node for which to find the last token's index. - * @returns {int} Index in the tokens array of the node's last token. - */ - function lastTokenIndex(node) { - var end = node.range[1], - cursor = ends[end]; - - // If the node extends beyond its last token, get the token before the - // next token - if (typeof cursor === "undefined") { - cursor = starts[end] - 1; - } - - // If there isn't a next token, the desired token is the last one in the - // array - if (isNaN(cursor)) { - cursor = length - 1; - } - - return cursor; - } - - // Map tokens' start and end range to the index in the tokens array - for (index = 0, length = tokens.length; index < length; index++) { - range = tokens[index].range; - starts[range[0]] = index; - ends[range[1]] = index; - } - - /** - * Gets a number of tokens that precede a given node or token in the token - * stream. - * @param {(ASTNode|Token)} node The AST node or token. - * @param {int} [beforeCount=0] The number of tokens before the node or - * token to retrieve. - * @returns {Token[]} Array of objects representing tokens. - */ - api.getTokensBefore = function(node, beforeCount) { - var first = starts[node.range[0]]; - return get(first - (beforeCount || 0), first); - }; - - /** - * Gets the token that precedes a given node or token in the token stream. - * @param {(ASTNode|Token)} node The AST node or token. - * @param {int} [skip=0] A number of tokens to skip before the given node or - * token. - * @returns {Token} An object representing the token. - */ - api.getTokenBefore = function(node, skip) { - return tokens[starts[node.range[0]] - (skip || 0) - 1]; - }; - - /** - * Gets a number of tokens that follow a given node or token in the token - * stream. - * @param {(ASTNode|Token)} node The AST node or token. - * @param {int} [afterCount=0] The number of tokens after the node or token - * to retrieve. - * @returns {Token[]} Array of objects representing tokens. - */ - api.getTokensAfter = function(node, afterCount) { - var start = lastTokenIndex(node) + 1; - return get(start, start + (afterCount || 0)); - }; - - /** - * Gets the token that follows a given node or token in the token stream. - * @param {(ASTNode|Token)} node The AST node or token. - * @param {int} [skip=0] A number of tokens to skip after the given node or - * token. - * @returns {Token} An object representing the token. - */ - api.getTokenAfter = function(node, skip) { - return tokens[lastTokenIndex(node) + (skip || 0) + 1]; - }; - - /** - * Gets all tokens that are related to the given node. - * @param {ASTNode} node The AST node. - * @param {int} [beforeCount=0] The number of tokens before the node to retrieve. - * @param {int} [afterCount=0] The number of tokens after the node to retrieve. - * @returns {Token[]} Array of objects representing tokens. - */ - api.getTokens = function(node, beforeCount, afterCount) { - return get( - starts[node.range[0]] - (beforeCount || 0), - lastTokenIndex(node) + (afterCount || 0) + 1 - ); - }; - - /** - * Gets the first `count` tokens of the given node's token stream. - * @param {ASTNode} node The AST node. - * @param {int} [count=0] The number of tokens of the node to retrieve. - * @returns {Token[]} Array of objects representing tokens. - */ - api.getFirstTokens = function(node, count) { - var first = starts[node.range[0]]; - return get( - first, - Math.min(lastTokenIndex(node) + 1, first + (count || 0)) - ); - }; - - /** - * Gets the first token of the given node's token stream. - * @param {ASTNode} node The AST node. - * @param {int} [skip=0] A number of tokens to skip. - * @returns {Token} An object representing the token. - */ - api.getFirstToken = function(node, skip) { - return tokens[starts[node.range[0]] + (skip || 0)]; - }; - - /** - * Gets the last `count` tokens of the given node. - * @param {ASTNode} node The AST node. - * @param {int} [count=0] The number of tokens of the node to retrieve. - * @returns {Token[]} Array of objects representing tokens. - */ - api.getLastTokens = function(node, count) { - var last = lastTokenIndex(node) + 1; - return get(Math.max(starts[node.range[0]], last - (count || 0)), last); - }; - - /** - * Gets the last token of the given node's token stream. - * @param {ASTNode} node The AST node. - * @param {int} [skip=0] A number of tokens to skip. - * @returns {Token} An object representing the token. - */ - api.getLastToken = function(node, skip) { - return tokens[lastTokenIndex(node) - (skip || 0)]; - }; - - /** - * Gets all of the tokens between two non-overlapping nodes. - * @param {ASTNode} left Node before the desired token range. - * @param {ASTNode} right Node after the desired token range. - * @param {int} [padding=0] Number of extra tokens on either side of center. - * @returns {Token[]} Tokens between left and right plus padding. - */ - api.getTokensBetween = function(left, right, padding) { - padding = padding || 0; - return get( - lastTokenIndex(left) + 1 - padding, - starts[right.range[0]] + padding - ); - }; - - /** - * Gets the token starting at the specified index. - * @param {int} startIndex Index of the start of the token's range. - * @returns {Token} The token starting at index, or null if no such token. - */ - api.getTokenByRangeStart = function(startIndex) { - return (tokens[starts[startIndex]] || null); - }; - - return api; -}; diff --git a/node_modules/eslint/lib/util.js b/node_modules/eslint/lib/util.js deleted file mode 100644 index fb1a7a3..0000000 --- a/node_modules/eslint/lib/util.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @fileoverview Common utilities. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Constants -//------------------------------------------------------------------------------ - -var PLUGIN_NAME_PREFIX = "eslint-plugin-", - NAMESPACE_REGEX = /^@.*\//i; - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - - -/** - * Removes the prefix `eslint-plugin-` from a plugin name. - * @param {string} pluginName The name of the plugin which may have the prefix. - * @returns {string} The name of the plugin without prefix. - */ -function removePluginPrefix(pluginName) { - return pluginName.indexOf(PLUGIN_NAME_PREFIX) === 0 ? pluginName.substring(PLUGIN_NAME_PREFIX.length) : pluginName; -} - -/** - * @param {string} pluginName The name of the plugin which may have the prefix. - * @returns {string} The name of the plugins namepace if it has one. - */ -function getNamespace(pluginName) { - return pluginName.match(NAMESPACE_REGEX) ? pluginName.match(NAMESPACE_REGEX)[0] : ""; -} - -/** - * Removes the namespace from a plugin name. - * @param {string} pluginName The name of the plugin which may have the prefix. - * @returns {string} The name of the plugin without the namespace. - */ -function removeNameSpace(pluginName) { - return pluginName.replace(NAMESPACE_REGEX, ""); -} - -module.exports = { - removePluginPrefix: removePluginPrefix, - getNamespace: getNamespace, - removeNameSpace: removeNameSpace, - "PLUGIN_NAME_PREFIX": PLUGIN_NAME_PREFIX -}; diff --git a/node_modules/eslint/lib/util/comment-event-generator.js b/node_modules/eslint/lib/util/comment-event-generator.js deleted file mode 100644 index fb56ee1..0000000 --- a/node_modules/eslint/lib/util/comment-event-generator.js +++ /dev/null @@ -1,116 +0,0 @@ -/** - * @fileoverview The event generator for comments. - * @author Toru Nagashima - * @copyright 2015 Toru Nagashima. All rights reserved. - * See LICENSE file in root directory for full license. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Check collection of comments to prevent double event for comment as - * leading and trailing, then emit event if passing - * @param {ASTNode[]} comments - Collection of comment nodes - * @param {EventEmitter} emitter - The event emitter which is the destination of events. - * @param {Object[]} locs - List of locations of previous comment nodes - * @param {string} eventName - Event name postfix - * @returns {void} - */ -function emitComments(comments, emitter, locs, eventName) { - if (comments.length > 0) { - comments.forEach(function(node) { - var index = locs.indexOf(node.loc); - if (index >= 0) { - locs.splice(index, 1); - } else { - locs.push(node.loc); - emitter.emit(node.type + eventName, node); - } - }); - } -} - -/** - * Shortcut to check and emit enter of comment nodes - * @param {CommentEventGenerator} generator - A generator to emit. - * @param {ASTNode[]} comments - Collection of comment nodes - * @returns {void} - */ -function emitCommentsEnter(generator, comments) { - emitComments( - comments, - generator.emitter, - generator.commentLocsEnter, - "Comment"); -} - -/** - * Shortcut to check and emit exit of comment nodes - * @param {CommentEventGenerator} generator - A generator to emit. - * @param {ASTNode[]} comments Collection of comment nodes - * @returns {void} - */ -function emitCommentsExit(generator, comments) { - emitComments( - comments, - generator.emitter, - generator.commentLocsExit, - "Comment:exit"); -} - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -/** - * The event generator for comments. - * This is the decorator pattern. - * This generates events of comments before/after events which are generated the original generator. - * - * @param {EventGenerator} originalEventGenerator - An event generator which is the decoration target. - * @param {SourceCode} sourceCode - A source code which has comments. - * @returns {CommentEventGenerator} new instance. - */ -function CommentEventGenerator(originalEventGenerator, sourceCode) { - this.original = originalEventGenerator; - this.emitter = originalEventGenerator.emitter; - this.sourceCode = sourceCode; - this.commentLocsEnter = []; - this.commentLocsExit = []; -} - -CommentEventGenerator.prototype = { - constructor: CommentEventGenerator, - - /** - * Emits an event of entering comments. - * @param {ASTNode} node - A node which was entered. - * @returns {void} - */ - enterNode: function enterNode(node) { - var comments = this.sourceCode.getComments(node); - - emitCommentsEnter(this, comments.leading); - this.original.enterNode(node); - emitCommentsEnter(this, comments.trailing); - }, - - /** - * Emits an event of leaving comments. - * @param {ASTNode} node - A node which was left. - * @returns {void} - */ - leaveNode: function leaveNode(node) { - var comments = this.sourceCode.getComments(node); - - emitCommentsExit(this, comments.trailing); - this.original.leaveNode(node); - emitCommentsExit(this, comments.leading); - } -}; - -module.exports = CommentEventGenerator; diff --git a/node_modules/eslint/lib/util/estraverse.js b/node_modules/eslint/lib/util/estraverse.js deleted file mode 100644 index 53015fe..0000000 --- a/node_modules/eslint/lib/util/estraverse.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @fileoverview Patch for estraverse - * @author Toru Nagashima - * @copyright 2015 Toru Nagashima. All rights reserved. - * See LICENSE file in root directory for full license. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var estraverse = require("estraverse"), - jsxKeys = require("estraverse-fb/keys"); - -//------------------------------------------------------------------------------ -// Helers -//------------------------------------------------------------------------------ - -var experimentalKeys = { - ExperimentalRestProperty: ["argument"], - ExperimentalSpreadProperty: ["argument"] -}; - -/** - * Adds a given keys to Syntax and VisitorKeys of estraverse. - * - * @param {object} keys - Key definitions to add. - * This is an object as map. - * Keys are the node type. - * Values are an array of property names to visit. - * @returns {void} - */ -function installKeys(keys) { - for (var key in keys) { - if (keys.hasOwnProperty(key)) { - estraverse.Syntax[key] = key; - if (keys[key]) { - estraverse.VisitorKeys[key] = keys[key]; - } - } - } -} - -// Add JSX node types. -installKeys(jsxKeys); -// Add Experimental node types. -installKeys(experimentalKeys); - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -module.exports = estraverse; diff --git a/node_modules/eslint/lib/util/glob-util.js b/node_modules/eslint/lib/util/glob-util.js deleted file mode 100644 index 2a28604..0000000 --- a/node_modules/eslint/lib/util/glob-util.js +++ /dev/null @@ -1,149 +0,0 @@ -/** - * @fileoverview Utilities for working with globs and the filesystem. - * @author Ian VanSchooten - * @copyright 2015 Ian VanSchooten. All rights reserved. - * See LICENSE in root directory for full license. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var debug = require("debug"), - fs = require("fs"), - glob = require("glob"), - shell = require("shelljs"), - - IgnoredPaths = require("../ignored-paths"); - -debug = debug("eslint:glob-util"); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Checks if a provided path is a directory and returns a glob string matching - * all files under that directory if so, the path itself otherwise. - * - * Reason for this is that `glob` needs `/**` to collect all the files under a - * directory where as our previous implementation without `glob` simply walked - * a directory that is passed. So this is to maintain backwards compatibility. - * - * Also makes sure all path separators are POSIX style for `glob` compatibility. - * - * @param {string[]} [extensions] An array of accepted extensions - * @returns {Function} A function that takes a pathname and returns a glob that - * matches all files with the provided extensions if - * pathname is a directory. - */ -function processPath(extensions) { - var suffix = "/**"; - - if (extensions) { - if (extensions.length === 1) { - suffix += "/*." + extensions[0]; - } else { - suffix += "/*.{" + extensions.join(",") + "}"; - } - } - - /** - * A function that converts a directory name to a glob pattern - * - * @param {string} pathname The directory path to be modified - * @returns {string} The glob path or the file path itself - * @private - */ - return function(pathname) { - var newPath = pathname; - - if (shell.test("-d", pathname)) { - newPath = pathname.replace(/[\/\\]$/, "") + suffix; - } - - return newPath.replace(/\\/g, "/").replace(/^\.\//, ""); - }; -} - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -/** - * Resolves the patterns into glob-based patterns for easier handling. - * @param {string[]} patterns File patterns (such as passed on the command line). - * @param {string[]} extensions List of valid file extensions. - * @returns {string[]} The equivalent glob patterns. - */ -function resolveFileGlobPatterns(patterns, extensions) { - extensions = extensions || [".js"]; - - extensions = extensions.map(function(ext) { - return ext.charAt(0) === "." ? ext.substr(1) : ext; - }); - - return patterns.map(processPath(extensions)); -} - -/** - * Build a list of absolute filesnames on which ESLint will act. - * Ignored files are excluded from the results, as are duplicates. - * - * @param {string[]} globPatterns Glob patterns. - * @param {Object} [options] An options object. - * @param {boolean} [options.ignore] False disables use of .eslintignore. - * @param {string} [options.ignorePath] The ignore file to use instead of .eslintignore. - * @param {string} [options.ignorePattern] A pattern of files to ignore. - * @returns {string[]} Resolved absolute filenames. - */ -function listFilesToProcess(globPatterns, options) { - var ignoredPaths, - ignoredPathsList, - files = [], - added = {}, - globOptions; - - /** - * Executes the linter on a file defined by the `filename`. Skips - * unsupported file extensions and any files that are already linted. - * @param {string} filename The file to be processed - * @returns {void} - */ - function addFile(filename) { - if (ignoredPaths.contains(filename)) { - return; - } - filename = fs.realpathSync(filename); - if (added[filename]) { - return; - } - files.push(filename); - added[filename] = true; - } - - options = options || { ignore: true }; - ignoredPaths = IgnoredPaths.load(options); - ignoredPathsList = ignoredPaths.patterns || []; - globOptions = { - nodir: true, - ignore: ignoredPathsList - }; - - debug("Creating list of files to process."); - globPatterns.forEach(function(pattern) { - if (shell.test("-f", pattern)) { - addFile(pattern); - } else { - glob.sync(pattern, globOptions).forEach(addFile); - } - }); - - return files; -} - -module.exports = { - resolveFileGlobPatterns: resolveFileGlobPatterns, - listFilesToProcess: listFilesToProcess -}; diff --git a/node_modules/eslint/lib/util/keywords.js b/node_modules/eslint/lib/util/keywords.js deleted file mode 100644 index dde29c6..0000000 --- a/node_modules/eslint/lib/util/keywords.js +++ /dev/null @@ -1,68 +0,0 @@ -/** - * @fileoverview A shared list of ES3 keywords. - * @author Josh Perez - * @copyright 2015 Jose Roberto Vidal. All rights reserved. - */ -"use strict"; - -module.exports = [ - "abstract", - "boolean", - "break", - "byte", - "case", - "catch", - "char", - "class", - "const", - "continue", - "debugger", - "default", - "delete", - "do", - "double", - "else", - "enum", - "export", - "extends", - "false", - "final", - "finally", - "float", - "for", - "function", - "goto", - "if", - "implements", - "import", - "in", - "instanceof", - "int", - "interface", - "long", - "native", - "new", - "null", - "package", - "private", - "protected", - "public", - "return", - "short", - "static", - "super", - "switch", - "synchronized", - "this", - "throw", - "throws", - "transient", - "true", - "try", - "typeof", - "var", - "void", - "volatile", - "while", - "with" -]; diff --git a/node_modules/eslint/lib/util/node-event-generator.js b/node_modules/eslint/lib/util/node-event-generator.js deleted file mode 100644 index 002bd29..0000000 --- a/node_modules/eslint/lib/util/node-event-generator.js +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @fileoverview The event generator for AST nodes. - * @author Toru Nagashima - * @copyright 2015 Toru Nagashima. All rights reserved. - * See LICENSE file in root directory for full license. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -/** - * The event generator for AST nodes. - * This implements below interface. - * - * ```ts - * interface EventGenerator { - * emitter: EventEmitter; - * enterNode(node: ASTNode): void; - * leaveNode(node: ASTNode): void; - * } - * ``` - * - * @param {EventEmitter} emitter - An event emitter which is the destination of events. - * @returns {NodeEventGenerator} new instance. - */ -function NodeEventGenerator(emitter) { - this.emitter = emitter; -} - -NodeEventGenerator.prototype = { - constructor: NodeEventGenerator, - - /** - * Emits an event of entering AST node. - * @param {ASTNode} node - A node which was entered. - * @returns {void} - */ - enterNode: function enterNode(node) { - this.emitter.emit(node.type, node); - }, - - /** - * Emits an event of leaving AST node. - * @param {ASTNode} node - A node which was left. - * @returns {void} - */ - leaveNode: function leaveNode(node) { - this.emitter.emit(node.type + ":exit", node); - } -}; - -module.exports = NodeEventGenerator; diff --git a/node_modules/eslint/lib/util/rule-fixer.js b/node_modules/eslint/lib/util/rule-fixer.js deleted file mode 100644 index 0f9ef9a..0000000 --- a/node_modules/eslint/lib/util/rule-fixer.js +++ /dev/null @@ -1,147 +0,0 @@ -/** - * @fileoverview An object that creates fix commands for rules. - * @author Nicholas C. Zakas - * @copyright 2015 Nicholas C. Zakas. All rights reserved. - * See LICENSE file in root directory for full license. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -// none! - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Creates a fix command that inserts text at the specified index in the source text. - * @param {int} index The 0-based index at which to insert the new text. - * @param {string} text The text to insert. - * @returns {Object} The fix command. - * @private - */ -function insertTextAt(index, text) { - return { - range: [index, index], - text: text - }; -} - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -/** - * Creates code fixing commands for rules. - * @constructor - */ -function RuleFixer() { - Object.freeze(this); -} - -RuleFixer.prototype = { - constructor: RuleFixer, - - /** - * Creates a fix command that inserts text after the given node or token. - * The fix is not applied until applyFixes() is called. - * @param {ASTNode|Token} nodeOrToken The node or token to insert after. - * @param {string} text The text to insert. - * @returns {Object} The fix command. - */ - insertTextAfter: function(nodeOrToken, text) { - return this.insertTextAfterRange(nodeOrToken.range, text); - }, - - /** - * Creates a fix command that inserts text after the specified range in the source text. - * The fix is not applied until applyFixes() is called. - * @param {int[]} range The range to replace, first item is start of range, second - * is end of range. - * @param {string} text The text to insert. - * @returns {Object} The fix command. - */ - insertTextAfterRange: function(range, text) { - return insertTextAt(range[1], text); - }, - - /** - * Creates a fix command that inserts text before the given node or token. - * The fix is not applied until applyFixes() is called. - * @param {ASTNode|Token} nodeOrToken The node or token to insert before. - * @param {string} text The text to insert. - * @returns {Object} The fix command. - */ - insertTextBefore: function(nodeOrToken, text) { - return this.insertTextBeforeRange(nodeOrToken.range, text); - }, - - /** - * Creates a fix command that inserts text before the specified range in the source text. - * The fix is not applied until applyFixes() is called. - * @param {int[]} range The range to replace, first item is start of range, second - * is end of range. - * @param {string} text The text to insert. - * @returns {Object} The fix command. - */ - insertTextBeforeRange: function(range, text) { - return insertTextAt(range[0], text); - }, - - /** - * Creates a fix command that replaces text at the node or token. - * The fix is not applied until applyFixes() is called. - * @param {ASTNode|Token} nodeOrToken The node or token to remove. - * @param {string} text The text to insert. - * @returns {Object} The fix command. - */ - replaceText: function(nodeOrToken, text) { - return this.replaceTextRange(nodeOrToken.range, text); - }, - - /** - * Creates a fix command that replaces text at the specified range in the source text. - * The fix is not applied until applyFixes() is called. - * @param {int[]} range The range to replace, first item is start of range, second - * is end of range. - * @param {string} text The text to insert. - * @returns {Object} The fix command. - */ - replaceTextRange: function(range, text) { - return { - range: range, - text: text - }; - }, - - /** - * Creates a fix command that removes the node or token from the source. - * The fix is not applied until applyFixes() is called. - * @param {ASTNode|Token} nodeOrToken The node or token to remove. - * @returns {Object} The fix command. - */ - remove: function(nodeOrToken) { - return this.removeRange(nodeOrToken.range); - }, - - /** - * Creates a fix command that removes the specified range of text from the source. - * The fix is not applied until applyFixes() is called. - * @param {int[]} range The range to remove, first item is start of range, second - * is end of range. - * @returns {Object} The fix command. - */ - removeRange: function(range) { - return { - range: range, - text: "" - }; - } - -}; - - -module.exports = RuleFixer; diff --git a/node_modules/eslint/lib/util/source-code-fixer.js b/node_modules/eslint/lib/util/source-code-fixer.js deleted file mode 100644 index 8a8d99e..0000000 --- a/node_modules/eslint/lib/util/source-code-fixer.js +++ /dev/null @@ -1,123 +0,0 @@ -/** - * @fileoverview An object that caches and applies source code fixes. - * @author Nicholas C. Zakas - * @copyright 2015 Nicholas C. Zakas. All rights reserved. - * See LICENSE file in root directory for full license. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var debug = require("debug")("eslint:text-fixer"); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/** - * Compares items in a messages array by line and column. - * @param {Message} a The first message. - * @param {Message} b The second message. - * @returns {int} -1 if a comes before b, 1 if a comes after b, 0 if equal. - * @private - */ -function compareMessagesByLocation(a, b) { - var lineDiff = a.line - b.line; - - if (lineDiff === 0) { - return a.column - b.column; - } else { - return lineDiff; - } -} - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -/** - * Utility for apply fixes to source code. - * @constructor - */ -function SourceCodeFixer() { - Object.freeze(this); -} - -/** - * Applies the fixes specified by the messages to the given text. Tries to be - * smart about the fixes and won't apply fixes over the same area in the text. - * @param {SourceCode} sourceCode The source code to apply the changes to. - * @param {Message[]} messages The array of messages reported by ESLint. - * @returns {Object} An object containing the fixed text and any unfixed messages. - */ -SourceCodeFixer.applyFixes = function(sourceCode, messages) { - - debug("Applying fixes"); - - if (!sourceCode) { - debug("No source code to fix"); - return { - fixed: false, - messages: messages, - output: "" - }; - } - - // clone the array - var remainingMessages = [], - fixes = [], - text = sourceCode.text, - lastFixPos = text.length + 1; - - messages.forEach(function(problem) { - if (problem.hasOwnProperty("fix")) { - fixes.push(problem); - } else { - remainingMessages.push(problem); - } - }); - - if (fixes.length) { - debug("Found fixes to apply"); - - // sort in reverse order of occurrence - fixes.sort(function(a, b) { - if (a.fix.range[1] <= b.fix.range[0]) { - return 1; - } else { - return -1; - } - }); - - // split into array of characters for easier manipulation - var chars = text.split(""); - - fixes.forEach(function(problem) { - var fix = problem.fix; - - if (fix.range[1] < lastFixPos) { - chars.splice(fix.range[0], fix.range[1] - fix.range[0], fix.text); - lastFixPos = fix.range[0]; - } else { - remainingMessages.push(problem); - } - }); - - return { - fixed: true, - messages: remainingMessages.sort(compareMessagesByLocation), - output: chars.join("") - }; - } else { - debug("No fixes to apply"); - return { - fixed: false, - messages: messages, - output: text - }; - } -}; - -module.exports = SourceCodeFixer; diff --git a/node_modules/eslint/lib/util/source-code.js b/node_modules/eslint/lib/util/source-code.js deleted file mode 100644 index 6ef0f91..0000000 --- a/node_modules/eslint/lib/util/source-code.js +++ /dev/null @@ -1,288 +0,0 @@ -/** - * @fileoverview Abstraction of JavaScript source code. - * @author Nicholas C. Zakas - * @copyright 2015 Nicholas C. Zakas. All rights reserved. - * See LICENSE file in root directory for full license. - */ -"use strict"; -/* eslint no-underscore-dangle: 0*/ - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var createTokenStore = require("../token-store.js"), - estraverse = require("./estraverse"), - assign = require("object-assign"); - -//------------------------------------------------------------------------------ -// Private -//------------------------------------------------------------------------------ - -/** - * Validates that the given AST has the required information. - * @param {ASTNode} ast The Program node of the AST to check. - * @throws {Error} If the AST doesn't contain the correct information. - * @returns {void} - * @private - */ -function validate(ast) { - - if (!ast.tokens) { - throw new Error("AST is missing the tokens array."); - } - - if (!ast.comments) { - throw new Error("AST is missing the comments array."); - } - - if (!ast.loc) { - throw new Error("AST is missing location information."); - } - - if (!ast.range) { - throw new Error("AST is missing range information"); - } -} - -/** - * Finds a JSDoc comment node in an array of comment nodes. - * @param {ASTNode[]} comments The array of comment nodes to search. - * @param {int} line Line number to look around - * @returns {ASTNode} The node if found, null if not. - * @private - */ -function findJSDocComment(comments, line) { - - if (comments) { - for (var i = comments.length - 1; i >= 0; i--) { - if (comments[i].type === "Block" && comments[i].value.charAt(0) === "*") { - - if (line - comments[i].loc.end.line <= 1) { - return comments[i]; - } else { - break; - } - } - } - } - - return null; -} - -/** - * Check to see if its a ES6 export declaration - * @param {ASTNode} astNode - any node - * @returns {boolean} whether the given node represents a export declaration - * @private - */ -function looksLikeExport(astNode) { - return astNode.type === "ExportDefaultDeclaration" || astNode.type === "ExportNamedDeclaration" || - astNode.type === "ExportAllDeclaration" || astNode.type === "ExportSpecifier"; -} - - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -/** - * Represents parsed source code. - * @param {string} text The source code text. - * @param {ASTNode} ast The Program node of the AST representing the code. - * @constructor - */ -function SourceCode(text, ast) { - - validate(ast); - - /** - * The original text source code. - * @type string - */ - this.text = text; - - /** - * The parsed AST for the source code. - * @type ASTNode - */ - this.ast = ast; - - /** - * The source code split into lines according to ECMA-262 specification. - * This is done to avoid each rule needing to do so separately. - * @type string[] - */ - this.lines = text.split(/\r\n|\r|\n|\u2028|\u2029/g); - - this.tokensAndComments = ast.tokens.concat(ast.comments).sort(function(left, right) { - return left.range[0] - right.range[0]; - }); - - // create token store methods - var tokenStore = createTokenStore(ast.tokens); - Object.keys(tokenStore).forEach(function(methodName) { - this[methodName] = tokenStore[methodName]; - }, this); - - var tokensAndCommentsStore = createTokenStore(this.tokensAndComments); - this.getTokenOrCommentBefore = tokensAndCommentsStore.getTokenBefore; - this.getTokenOrCommentAfter = tokensAndCommentsStore.getTokenAfter; - - // don't allow modification of this object - Object.freeze(this); - Object.freeze(this.lines); -} - -SourceCode.prototype = { - constructor: SourceCode, - - /** - * Gets the source code for the given node. - * @param {ASTNode=} node The AST node to get the text for. - * @param {int=} beforeCount The number of characters before the node to retrieve. - * @param {int=} afterCount The number of characters after the node to retrieve. - * @returns {string} The text representing the AST node. - */ - getText: function(node, beforeCount, afterCount) { - if (node) { - return (this.text !== null) ? this.text.slice(Math.max(node.range[0] - (beforeCount || 0), 0), - node.range[1] + (afterCount || 0)) : null; - } else { - return this.text; - } - - }, - - /** - * Gets the entire source text split into an array of lines. - * @returns {Array} The source text as an array of lines. - */ - getLines: function() { - return this.lines; - }, - - /** - * Retrieves an array containing all comments in the source code. - * @returns {ASTNode[]} An array of comment nodes. - */ - getAllComments: function() { - return this.ast.comments; - }, - - /** - * Gets all comments for the given node. - * @param {ASTNode} node The AST node to get the comments for. - * @returns {Object} The list of comments indexed by their position. - * @public - */ - getComments: function(node) { - - var leadingComments = node.leadingComments || [], - trailingComments = node.trailingComments || []; - - /* - * espree adds a "comments" array on Program nodes rather than - * leadingComments/trailingComments. Comments are only left in the - * Program node comments array if there is no executable code. - */ - if (node.type === "Program") { - if (node.body.length === 0) { - leadingComments = node.comments; - } - } - - return { - leading: leadingComments, - trailing: trailingComments - }; - }, - - /** - * Retrieves the JSDoc comment for a given node. - * @param {ASTNode} node The AST node to get the comment for. - * @returns {ASTNode} The BlockComment node containing the JSDoc for the - * given node or null if not found. - * @public - */ - getJSDocComment: function(node) { - - var parent = node.parent, - line = node.loc.start.line; - - switch (node.type) { - case "FunctionDeclaration": - if (looksLikeExport(parent)) { - return findJSDocComment(parent.leadingComments, line); - } else { - return findJSDocComment(node.leadingComments, line); - } - break; - - case "ClassDeclaration": - return findJSDocComment(node.leadingComments, line); - - case "ClassExpression": - return findJSDocComment(parent.parent.leadingComments, line); - - case "ArrowFunctionExpression": - case "FunctionExpression": - - if (parent.type !== "CallExpression" && parent.type !== "NewExpression") { - while (parent && !parent.leadingComments && !/Function/.test(parent.type)) { - parent = parent.parent; - } - - return parent && (parent.type !== "FunctionDeclaration") ? findJSDocComment(parent.leadingComments, line) : null; - } - - // falls through - - default: - return null; - } - }, - - /** - * Gets the deepest node containing a range index. - * @param {int} index Range index of the desired node. - * @returns {ASTNode} The node if found or null if not found. - */ - getNodeByRangeIndex: function(index) { - var result = null; - - estraverse.traverse(this.ast, { - enter: function(node, parent) { - if (node.range[0] <= index && index < node.range[1]) { - result = assign({ parent: parent }, node); - } else { - this.skip(); - } - }, - leave: function(node) { - if (node === result) { - this.break(); - } - } - }); - - return result; - }, - - /** - * Determines if two tokens have at least one whitespace character - * between them. This completely disregards comments in making the - * determination, so comments count as zero-length substrings. - * @param {Token} first The token to check after. - * @param {Token} second The token to check before. - * @returns {boolean} True if there is only space between tokens, false - * if there is anything other than whitespace between tokens. - */ - isSpaceBetweenTokens: function(first, second) { - var text = this.text.slice(first.range[1], second.range[0]); - return /\s/.test(text.replace(/\/\*.*?\*\//g, "")); - } -}; - - -module.exports = SourceCode; diff --git a/node_modules/eslint/node_modules/.bin/esparse b/node_modules/eslint/node_modules/.bin/esparse deleted file mode 120000 index 409161d..0000000 --- a/node_modules/eslint/node_modules/.bin/esparse +++ /dev/null @@ -1 +0,0 @@ -../espree/bin/esparse.js \ No newline at end of file diff --git a/node_modules/eslint/node_modules/.bin/esvalidate b/node_modules/eslint/node_modules/.bin/esvalidate deleted file mode 120000 index 939b663..0000000 --- a/node_modules/eslint/node_modules/.bin/esvalidate +++ /dev/null @@ -1 +0,0 @@ -../espree/bin/esvalidate.js \ No newline at end of file diff --git a/node_modules/eslint/node_modules/.bin/handlebars b/node_modules/eslint/node_modules/.bin/handlebars deleted file mode 120000 index fb7d090..0000000 --- a/node_modules/eslint/node_modules/.bin/handlebars +++ /dev/null @@ -1 +0,0 @@ -../handlebars/bin/handlebars \ No newline at end of file diff --git a/node_modules/eslint/node_modules/.bin/js-yaml b/node_modules/eslint/node_modules/.bin/js-yaml deleted file mode 120000 index 9dbd010..0000000 --- a/node_modules/eslint/node_modules/.bin/js-yaml +++ /dev/null @@ -1 +0,0 @@ -../js-yaml/bin/js-yaml.js \ No newline at end of file diff --git a/node_modules/eslint/node_modules/.bin/mkdirp b/node_modules/eslint/node_modules/.bin/mkdirp deleted file mode 120000 index 017896c..0000000 --- a/node_modules/eslint/node_modules/.bin/mkdirp +++ /dev/null @@ -1 +0,0 @@ -../mkdirp/bin/cmd.js \ No newline at end of file diff --git a/node_modules/eslint/node_modules/.bin/shjs b/node_modules/eslint/node_modules/.bin/shjs deleted file mode 120000 index a044997..0000000 --- a/node_modules/eslint/node_modules/.bin/shjs +++ /dev/null @@ -1 +0,0 @@ -../shelljs/bin/shjs \ No newline at end of file diff --git a/node_modules/eslint/node_modules/.bin/strip-json-comments b/node_modules/eslint/node_modules/.bin/strip-json-comments deleted file mode 120000 index 63d549f..0000000 --- a/node_modules/eslint/node_modules/.bin/strip-json-comments +++ /dev/null @@ -1 +0,0 @@ -../strip-json-comments/cli.js \ No newline at end of file diff --git a/node_modules/eslint/node_modules/chalk/index.js b/node_modules/eslint/node_modules/chalk/index.js deleted file mode 100644 index 2d85a91..0000000 --- a/node_modules/eslint/node_modules/chalk/index.js +++ /dev/null @@ -1,116 +0,0 @@ -'use strict'; -var escapeStringRegexp = require('escape-string-regexp'); -var ansiStyles = require('ansi-styles'); -var stripAnsi = require('strip-ansi'); -var hasAnsi = require('has-ansi'); -var supportsColor = require('supports-color'); -var defineProps = Object.defineProperties; -var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(process.env.TERM); - -function Chalk(options) { - // detect mode if not set manually - this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled; -} - -// use bright blue on Windows as the normal blue color is illegible -if (isSimpleWindowsTerm) { - ansiStyles.blue.open = '\u001b[94m'; -} - -var styles = (function () { - var ret = {}; - - Object.keys(ansiStyles).forEach(function (key) { - ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); - - ret[key] = { - get: function () { - return build.call(this, this._styles.concat(key)); - } - }; - }); - - return ret; -})(); - -var proto = defineProps(function chalk() {}, styles); - -function build(_styles) { - var builder = function () { - return applyStyle.apply(builder, arguments); - }; - - builder._styles = _styles; - builder.enabled = this.enabled; - // __proto__ is used because we must return a function, but there is - // no way to create a function with a different prototype. - /* eslint-disable no-proto */ - builder.__proto__ = proto; - - return builder; -} - -function applyStyle() { - // support varags, but simply cast to string in case there's only one arg - var args = arguments; - var argsLen = args.length; - var str = argsLen !== 0 && String(arguments[0]); - - if (argsLen > 1) { - // don't slice `arguments`, it prevents v8 optimizations - for (var a = 1; a < argsLen; a++) { - str += ' ' + args[a]; - } - } - - if (!this.enabled || !str) { - return str; - } - - var nestedStyles = this._styles; - var i = nestedStyles.length; - - // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, - // see https://github.com/chalk/chalk/issues/58 - // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. - var originalDim = ansiStyles.dim.open; - if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) { - ansiStyles.dim.open = ''; - } - - while (i--) { - var code = ansiStyles[nestedStyles[i]]; - - // Replace any instances already present with a re-opening code - // otherwise only the part of the string until said closing code - // will be colored, and the rest will simply be 'plain'. - str = code.open + str.replace(code.closeRe, code.open) + code.close; - } - - // Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue. - ansiStyles.dim.open = originalDim; - - return str; -} - -function init() { - var ret = {}; - - Object.keys(styles).forEach(function (name) { - ret[name] = { - get: function () { - return build.call(this, [name]); - } - }; - }); - - return ret; -} - -defineProps(Chalk.prototype, init()); - -module.exports = new Chalk(); -module.exports.styles = ansiStyles; -module.exports.hasColor = hasAnsi; -module.exports.stripColor = stripAnsi; -module.exports.supportsColor = supportsColor; diff --git a/node_modules/eslint/node_modules/chalk/license b/node_modules/eslint/node_modules/chalk/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/eslint/node_modules/chalk/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/index.js b/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/index.js deleted file mode 100644 index 7894527..0000000 --- a/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/index.js +++ /dev/null @@ -1,65 +0,0 @@ -'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 -}); diff --git a/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/license b/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/package.json b/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/package.json deleted file mode 100644 index b6a9cea..0000000 --- a/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "name": "ansi-styles", - "version": "2.1.0", - "description": "ANSI escape codes for styling strings in the terminal", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/ansi-styles.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - } - ], - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha" - }, - "files": [ - "index.js" - ], - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "devDependencies": { - "mocha": "*" - }, - "gitHead": "18421cbe4a2d93359ec2599a894f704be126d066", - "bugs": { - "url": "https://github.com/chalk/ansi-styles/issues" - }, - "homepage": "https://github.com/chalk/ansi-styles", - "_id": "ansi-styles@2.1.0", - "_shasum": "990f747146927b559a932bf92959163d60c0d0e2", - "_from": "ansi-styles@>=2.1.0 <3.0.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "0.12.4", - "_npmUser": { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - }, - "dist": { - "shasum": "990f747146927b559a932bf92959163d60c0d0e2", - "tarball": "http://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/readme.md b/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/readme.md deleted file mode 100644 index 3f933f6..0000000 --- a/node_modules/eslint/node_modules/chalk/node_modules/ansi-styles/readme.md +++ /dev/null @@ -1,86 +0,0 @@ -# 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) diff --git a/node_modules/eslint/node_modules/chalk/node_modules/has-ansi/index.js b/node_modules/eslint/node_modules/chalk/node_modules/has-ansi/index.js deleted file mode 100644 index 98fae06..0000000 --- a/node_modules/eslint/node_modules/chalk/node_modules/has-ansi/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -var ansiRegex = require('ansi-regex'); -var re = new RegExp(ansiRegex().source); // remove the `g` flag -module.exports = re.test.bind(re); diff --git a/node_modules/eslint/node_modules/chalk/node_modules/has-ansi/license b/node_modules/eslint/node_modules/chalk/node_modules/has-ansi/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/eslint/node_modules/chalk/node_modules/has-ansi/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/eslint/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/index.js b/node_modules/eslint/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/index.js deleted file mode 100644 index 4906755..0000000 --- a/node_modules/eslint/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -module.exports = function () { - return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; -}; diff --git a/node_modules/eslint/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/license b/node_modules/eslint/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/eslint/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/eslint/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json b/node_modules/eslint/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json deleted file mode 100644 index 7fc0767..0000000 --- a/node_modules/eslint/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "name": "ansi-regex", - "version": "2.0.0", - "description": "Regular expression for matching ANSI escape codes", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/ansi-regex.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - } - ], - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha test/test.js", - "view-supported": "node test/viewCodes.js" - }, - "files": [ - "index.js" - ], - "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" - ], - "devDependencies": { - "mocha": "*" - }, - "gitHead": "57c3f2941a73079fa8b081e02a522e3d29913e2f", - "bugs": { - "url": "https://github.com/sindresorhus/ansi-regex/issues" - }, - "homepage": "https://github.com/sindresorhus/ansi-regex", - "_id": "ansi-regex@2.0.0", - "_shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", - "_from": "ansi-regex@>=2.0.0 <3.0.0", - "_npmVersion": "2.11.2", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", - "tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/readme.md b/node_modules/eslint/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/readme.md deleted file mode 100644 index 1a4894e..0000000 --- a/node_modules/eslint/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/readme.md +++ /dev/null @@ -1,31 +0,0 @@ -# ansi-regex [![Build Status](https://travis-ci.org/sindresorhus/ansi-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/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 -var 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'] -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/eslint/node_modules/chalk/node_modules/has-ansi/package.json b/node_modules/eslint/node_modules/chalk/node_modules/has-ansi/package.json deleted file mode 100644 index d39a62e..0000000 --- a/node_modules/eslint/node_modules/chalk/node_modules/has-ansi/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "name": "has-ansi", - "version": "2.0.0", - "description": "Check if a string has ANSI escape codes", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/has-ansi.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - } - ], - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "node test.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "string", - "tty", - "escape", - "shell", - "xterm", - "command-line", - "text", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "pattern", - "has" - ], - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "devDependencies": { - "ava": "0.0.4" - }, - "gitHead": "0722275e1bef139fcd09137da6e5550c3cd368b9", - "bugs": { - "url": "https://github.com/sindresorhus/has-ansi/issues" - }, - "homepage": "https://github.com/sindresorhus/has-ansi", - "_id": "has-ansi@2.0.0", - "_shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", - "_from": "has-ansi@>=2.0.0 <3.0.0", - "_npmVersion": "2.11.2", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", - "tarball": "http://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/chalk/node_modules/has-ansi/readme.md b/node_modules/eslint/node_modules/chalk/node_modules/has-ansi/readme.md deleted file mode 100644 index 02bc7c2..0000000 --- a/node_modules/eslint/node_modules/chalk/node_modules/has-ansi/readme.md +++ /dev/null @@ -1,36 +0,0 @@ -# has-ansi [![Build Status](https://travis-ci.org/sindresorhus/has-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi) - -> Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) - - -## Install - -``` -$ npm install --save has-ansi -``` - - -## Usage - -```js -var hasAnsi = require('has-ansi'); - -hasAnsi('\u001b[4mcake\u001b[0m'); -//=> true - -hasAnsi('cake'); -//=> false -``` - - -## Related - -- [has-ansi-cli](https://github.com/sindresorhus/has-ansi-cli) - CLI for this module -- [strip-ansi](https://github.com/sindresorhus/strip-ansi) - Strip ANSI escape codes -- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes -- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/eslint/node_modules/chalk/node_modules/strip-ansi/index.js b/node_modules/eslint/node_modules/chalk/node_modules/strip-ansi/index.js deleted file mode 100644 index 099480f..0000000 --- a/node_modules/eslint/node_modules/chalk/node_modules/strip-ansi/index.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; -var ansiRegex = require('ansi-regex')(); - -module.exports = function (str) { - return typeof str === 'string' ? str.replace(ansiRegex, '') : str; -}; diff --git a/node_modules/eslint/node_modules/chalk/node_modules/strip-ansi/license b/node_modules/eslint/node_modules/chalk/node_modules/strip-ansi/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/eslint/node_modules/chalk/node_modules/strip-ansi/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/eslint/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/index.js b/node_modules/eslint/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/index.js deleted file mode 100644 index 4906755..0000000 --- a/node_modules/eslint/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -module.exports = function () { - return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; -}; diff --git a/node_modules/eslint/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/license b/node_modules/eslint/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/eslint/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/eslint/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json b/node_modules/eslint/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json deleted file mode 100644 index 7fc0767..0000000 --- a/node_modules/eslint/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "name": "ansi-regex", - "version": "2.0.0", - "description": "Regular expression for matching ANSI escape codes", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/ansi-regex.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - } - ], - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha test/test.js", - "view-supported": "node test/viewCodes.js" - }, - "files": [ - "index.js" - ], - "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" - ], - "devDependencies": { - "mocha": "*" - }, - "gitHead": "57c3f2941a73079fa8b081e02a522e3d29913e2f", - "bugs": { - "url": "https://github.com/sindresorhus/ansi-regex/issues" - }, - "homepage": "https://github.com/sindresorhus/ansi-regex", - "_id": "ansi-regex@2.0.0", - "_shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", - "_from": "ansi-regex@>=2.0.0 <3.0.0", - "_npmVersion": "2.11.2", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", - "tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/readme.md b/node_modules/eslint/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/readme.md deleted file mode 100644 index 1a4894e..0000000 --- a/node_modules/eslint/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/readme.md +++ /dev/null @@ -1,31 +0,0 @@ -# ansi-regex [![Build Status](https://travis-ci.org/sindresorhus/ansi-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/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 -var 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'] -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/eslint/node_modules/chalk/node_modules/strip-ansi/package.json b/node_modules/eslint/node_modules/chalk/node_modules/strip-ansi/package.json deleted file mode 100644 index 2871d03..0000000 --- a/node_modules/eslint/node_modules/chalk/node_modules/strip-ansi/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "name": "strip-ansi", - "version": "3.0.0", - "description": "Strip ANSI escape codes", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/strip-ansi.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - } - ], - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "node test.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "strip", - "trim", - "remove", - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "devDependencies": { - "ava": "0.0.4" - }, - "gitHead": "3f05b9810e1438f946e2eb84ee854cc00b972e9e", - "bugs": { - "url": "https://github.com/sindresorhus/strip-ansi/issues" - }, - "homepage": "https://github.com/sindresorhus/strip-ansi", - "_id": "strip-ansi@3.0.0", - "_shasum": "7510b665567ca914ccb5d7e072763ac968be3724", - "_from": "strip-ansi@>=3.0.0 <4.0.0", - "_npmVersion": "2.11.2", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "7510b665567ca914ccb5d7e072763ac968be3724", - "tarball": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/chalk/node_modules/strip-ansi/readme.md b/node_modules/eslint/node_modules/chalk/node_modules/strip-ansi/readme.md deleted file mode 100644 index 7609151..0000000 --- a/node_modules/eslint/node_modules/chalk/node_modules/strip-ansi/readme.md +++ /dev/null @@ -1,33 +0,0 @@ -# strip-ansi [![Build Status](https://travis-ci.org/sindresorhus/strip-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-ansi) - -> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) - - -## Install - -``` -$ npm install --save strip-ansi -``` - - -## Usage - -```js -var stripAnsi = require('strip-ansi'); - -stripAnsi('\u001b[4mcake\u001b[0m'); -//=> 'cake' -``` - - -## Related - -- [strip-ansi-cli](https://github.com/sindresorhus/strip-ansi-cli) - CLI for this module -- [has-ansi](https://github.com/sindresorhus/has-ansi) - Check if a string has ANSI escape codes -- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes -- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/eslint/node_modules/chalk/node_modules/supports-color/index.js b/node_modules/eslint/node_modules/chalk/node_modules/supports-color/index.js deleted file mode 100644 index 4346e27..0000000 --- a/node_modules/eslint/node_modules/chalk/node_modules/supports-color/index.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict'; -var argv = process.argv; - -var terminator = argv.indexOf('--'); -var hasFlag = function (flag) { - flag = '--' + flag; - var pos = argv.indexOf(flag); - return pos !== -1 && (terminator !== -1 ? pos < terminator : true); -}; - -module.exports = (function () { - if ('FORCE_COLOR' in process.env) { - return true; - } - - if (hasFlag('no-color') || - hasFlag('no-colors') || - hasFlag('color=false')) { - return false; - } - - if (hasFlag('color') || - hasFlag('colors') || - hasFlag('color=true') || - hasFlag('color=always')) { - return true; - } - - if (process.stdout && !process.stdout.isTTY) { - return false; - } - - if (process.platform === 'win32') { - return true; - } - - if ('COLORTERM' in process.env) { - return true; - } - - if (process.env.TERM === 'dumb') { - return false; - } - - if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { - return true; - } - - return false; -})(); diff --git a/node_modules/eslint/node_modules/chalk/node_modules/supports-color/license b/node_modules/eslint/node_modules/chalk/node_modules/supports-color/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/eslint/node_modules/chalk/node_modules/supports-color/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/eslint/node_modules/chalk/node_modules/supports-color/package.json b/node_modules/eslint/node_modules/chalk/node_modules/supports-color/package.json deleted file mode 100644 index 38a1ecb..0000000 --- a/node_modules/eslint/node_modules/chalk/node_modules/supports-color/package.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "name": "supports-color", - "version": "2.0.0", - "description": "Detect whether a terminal supports color", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/supports-color.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - } - ], - "engines": { - "node": ">=0.8.0" - }, - "scripts": { - "test": "mocha" - }, - "files": [ - "index.js" - ], - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "ansi", - "styles", - "tty", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "support", - "supports", - "capability", - "detect" - ], - "devDependencies": { - "mocha": "*", - "require-uncached": "^1.0.2" - }, - "gitHead": "8400d98ade32b2adffd50902c06d9e725a5c6588", - "bugs": { - "url": "https://github.com/chalk/supports-color/issues" - }, - "homepage": "https://github.com/chalk/supports-color", - "_id": "supports-color@2.0.0", - "_shasum": "535d045ce6b6363fa40117084629995e9df324c7", - "_from": "supports-color@>=2.0.0 <3.0.0", - "_npmVersion": "2.11.2", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "535d045ce6b6363fa40117084629995e9df324c7", - "tarball": "http://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/chalk/node_modules/supports-color/readme.md b/node_modules/eslint/node_modules/chalk/node_modules/supports-color/readme.md deleted file mode 100644 index b4761f1..0000000 --- a/node_modules/eslint/node_modules/chalk/node_modules/supports-color/readme.md +++ /dev/null @@ -1,36 +0,0 @@ -# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color) - -> Detect whether a terminal supports color - - -## Install - -``` -$ npm install --save supports-color -``` - - -## Usage - -```js -var supportsColor = require('supports-color'); - -if (supportsColor) { - console.log('Terminal supports color'); -} -``` - -It obeys the `--color` and `--no-color` CLI flags. - -For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`. - - -## Related - -- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module -- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/eslint/node_modules/chalk/package.json b/node_modules/eslint/node_modules/chalk/package.json deleted file mode 100644 index a6120d2..0000000 --- a/node_modules/eslint/node_modules/chalk/package.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "name": "chalk", - "version": "1.1.1", - "description": "Terminal string styling done right. Much color.", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/chalk.git" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - }, - { - "name": "unicorn", - "email": "sindresorhus+unicorn@gmail.com" - } - ], - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "xo && mocha", - "bench": "matcha benchmark.js", - "coverage": "nyc npm test && nyc report", - "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls" - }, - "files": [ - "index.js" - ], - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "str", - "ansi", - "style", - "styles", - "tty", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "ansi-styles": "^2.1.0", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "devDependencies": { - "coveralls": "^2.11.2", - "matcha": "^0.6.0", - "mocha": "*", - "nyc": "^3.0.0", - "require-uncached": "^1.0.2", - "resolve-from": "^1.0.0", - "semver": "^4.3.3", - "xo": "*" - }, - "xo": { - "envs": [ - "node", - "mocha" - ] - }, - "gitHead": "8b554e254e89c85c1fd04dcc444beeb15824e1a5", - "bugs": { - "url": "https://github.com/chalk/chalk/issues" - }, - "homepage": "https://github.com/chalk/chalk#readme", - "_id": "chalk@1.1.1", - "_shasum": "509afb67066e7499f7eb3535c77445772ae2d019", - "_from": "chalk@>=1.0.0 <2.0.0", - "_npmVersion": "2.13.5", - "_nodeVersion": "0.12.7", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "509afb67066e7499f7eb3535c77445772ae2d019", - "tarball": "http://registry.npmjs.org/chalk/-/chalk-1.1.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/chalk/readme.md b/node_modules/eslint/node_modules/chalk/readme.md deleted file mode 100644 index 5cf111e..0000000 --- a/node_modules/eslint/node_modules/chalk/readme.md +++ /dev/null @@ -1,213 +0,0 @@ -

-
-
- chalk -
-
-
-

- -> Terminal string styling done right - -[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) -[![Coverage Status](https://coveralls.io/repos/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/r/chalk/chalk?branch=master) -[![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) - - -[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough. - -**Chalk is a clean and focused alternative.** - -![](https://github.com/chalk/ansi-styles/raw/master/screenshot.png) - - -## Why - -- Highly performant -- Doesn't extend `String.prototype` -- Expressive API -- Ability to nest styles -- Clean and focused -- Auto-detects color support -- Actively maintained -- [Used by ~4500 modules](https://www.npmjs.com/browse/depended/chalk) as of July 15, 2015 - - -## Install - -``` -$ npm install --save chalk -``` - - -## Usage - -Chalk comes with an easy to use composable API where you just chain and nest the styles you want. - -```js -var chalk = require('chalk'); - -// style a string -chalk.blue('Hello world!'); - -// combine styled and normal strings -chalk.blue('Hello') + 'World' + chalk.red('!'); - -// compose multiple styles using the chainable API -chalk.blue.bgRed.bold('Hello world!'); - -// pass in multiple arguments -chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'); - -// nest styles -chalk.red('Hello', chalk.underline.bgBlue('world') + '!'); - -// nest styles of the same type even (color, underline, background) -chalk.green( - 'I am a green line ' + - chalk.blue.underline.bold('with a blue substring') + - ' that becomes green again!' -); -``` - -Easily define your own themes. - -```js -var chalk = require('chalk'); -var error = chalk.bold.red; -console.log(error('Error!')); -``` - -Take advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data). - -```js -var name = 'Sindre'; -console.log(chalk.green('Hello %s'), name); -//=> Hello Sindre -``` - - -## API - -### chalk.` - - -
-

Code coverage report for cli-width/

-

- Statements: 100% (13 / 13)      - Branches: 100% (8 / 8)      - Functions: 100% (1 / 1)      - Lines: 100% (13 / 13)      - Ignored: none      -

-
All files » cli-width/
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
index.js100%(13 / 13)100%(8 / 8)100%(1 / 1)100%(13 / 13)
-
-
- - - - - - diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/cli-width/coverage/lcov-report/cli-width/index.js.html b/node_modules/eslint/node_modules/inquirer/node_modules/cli-width/coverage/lcov-report/cli-width/index.js.html deleted file mode 100644 index ab53a68..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/cli-width/coverage/lcov-report/cli-width/index.js.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - Code coverage report for cli-width/index.js - - - - - - -
-

Code coverage report for cli-width/index.js

-

- Statements: 100% (13 / 13)      - Branches: 100% (8 / 8)      - Functions: 100% (1 / 1)      - Lines: 100% (13 / 13)      - Ignored: none      -

-
All files » cli-width/ » index.js
-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29  -  -1 -1 -  -1 -6 -1 -  -  -5 -  -5 -1 -  -  -4 -2 -  -2 -1 -  -  -  -3 -  -  -  - 
'use strict';
- 
-exports = module.exports = cliWidth;
-exports.defaultWidth = 0;
- 
-function cliWidth() {
-  if (process.stdout.getWindowSize) {
-    return process.stdout.getWindowSize()[0];
-  }
-  else {
-    var tty = require('tty');
- 
-    if (tty.getWindowSize) {
-      return tty.getWindowSize()[1];
-    }
-    else {
-      if (process.env.CLI_WIDTH) {
-        var width = parseInt(process.env.CLI_WIDTH, 10);
- 
-        if (!isNaN(width)) {
-          return width;
-        }
-      }
- 
-      return exports.defaultWidth;
-    }
-  }
-};
- 
- -
- - - - - - diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/cli-width/coverage/lcov-report/index.html b/node_modules/eslint/node_modules/inquirer/node_modules/cli-width/coverage/lcov-report/index.html deleted file mode 100644 index 1fcbfbb..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/cli-width/coverage/lcov-report/index.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - Code coverage report for All files - - - - - - -
-

Code coverage report for All files

-

- Statements: 100% (13 / 13)      - Branches: 100% (8 / 8)      - Functions: 100% (1 / 1)      - Lines: 100% (13 / 13)      - Ignored: none      -

-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
cli-width/100%(13 / 13)100%(8 / 8)100%(1 / 1)100%(13 / 13)
-
-
- - - - - - diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/cli-width/coverage/lcov-report/prettify.css b/node_modules/eslint/node_modules/inquirer/node_modules/cli-width/coverage/lcov-report/prettify.css deleted file mode 100644 index b317a7c..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/cli-width/coverage/lcov-report/prettify.css +++ /dev/null @@ -1 +0,0 @@ -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/cli-width/coverage/lcov-report/prettify.js b/node_modules/eslint/node_modules/inquirer/node_modules/cli-width/coverage/lcov-report/prettify.js deleted file mode 100644 index ef51e03..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/cli-width/coverage/lcov-report/prettify.js +++ /dev/null @@ -1 +0,0 @@ -window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/cli-width/coverage/lcov-report/sort-arrow-sprite.png b/node_modules/eslint/node_modules/inquirer/node_modules/cli-width/coverage/lcov-report/sort-arrow-sprite.png deleted file mode 100644 index 03f704a609c6fd0dbfdac63466a7d7c958b5cbf3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^>_9Bd!3HEZxJ@+%Qj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>Jii$m5978H@?Fn+^JD|Y9yzj{W`447Gxa{7*dM7nnnD-Lb z6^}Hx2)'; - } - } - return cols; - } - // attaches a data attribute to every tr element with an object - // of data values keyed by column name - function loadRowData(tableRow) { - var tableCols = tableRow.querySelectorAll('td'), - colNode, - col, - data = {}, - i, - val; - for (i = 0; i < tableCols.length; i += 1) { - colNode = tableCols[i]; - col = cols[i]; - val = colNode.getAttribute('data-value'); - if (col.type === 'number') { - val = Number(val); - } - data[col.key] = val; - } - return data; - } - // loads all row data - function loadData() { - var rows = getTableBody().querySelectorAll('tr'), - i; - - for (i = 0; i < rows.length; i += 1) { - rows[i].data = loadRowData(rows[i]); - } - } - // sorts the table using the data for the ith column - function sortByIndex(index, desc) { - var key = cols[index].key, - sorter = function (a, b) { - a = a.data[key]; - b = b.data[key]; - return a < b ? -1 : a > b ? 1 : 0; - }, - finalSorter = sorter, - tableBody = document.querySelector('.coverage-summary tbody'), - rowNodes = tableBody.querySelectorAll('tr'), - rows = [], - i; - - if (desc) { - finalSorter = function (a, b) { - return -1 * sorter(a, b); - }; - } - - for (i = 0; i < rowNodes.length; i += 1) { - rows.push(rowNodes[i]); - tableBody.removeChild(rowNodes[i]); - } - - rows.sort(finalSorter); - - for (i = 0; i < rows.length; i += 1) { - tableBody.appendChild(rows[i]); - } - } - // removes sort indicators for current column being sorted - function removeSortIndicators() { - var col = getNthColumn(currentSort.index), - cls = col.className; - - cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); - col.className = cls; - } - // adds sort indicators for current column being sorted - function addSortIndicators() { - getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; - } - // adds event listeners for all sorter widgets - function enableUI() { - var i, - el, - ithSorter = function ithSorter(i) { - var col = cols[i]; - - return function () { - var desc = col.defaultDescSort; - - if (currentSort.index === i) { - desc = !currentSort.desc; - } - sortByIndex(i, desc); - removeSortIndicators(); - currentSort.index = i; - currentSort.desc = desc; - addSortIndicators(); - }; - }; - for (i =0 ; i < cols.length; i += 1) { - if (cols[i].sortable) { - el = getNthColumn(i).querySelector('.sorter'); - if (el.addEventListener) { - el.addEventListener('click', ithSorter(i)); - } else { - el.attachEvent('onclick', ithSorter(i)); - } - } - } - } - // adds sorting functionality to the UI - return function () { - if (!getTable()) { - return; - } - cols = loadColumns(); - loadData(cols); - addSortIndicators(); - enableUI(); - }; -})(); - -window.addEventListener('load', addSorting); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/cli-width/coverage/lcov.info b/node_modules/eslint/node_modules/inquirer/node_modules/cli-width/coverage/lcov.info deleted file mode 100644 index 5ec1cb2..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/cli-width/coverage/lcov.info +++ /dev/null @@ -1,32 +0,0 @@ -TN: -SF:/Users/iradchenko/sandbox/cli-width/index.js -FN:6,cliWidth -FNF:1 -FNH:1 -FNDA:6,cliWidth -DA:3,1 -DA:4,1 -DA:6,1 -DA:7,6 -DA:8,1 -DA:11,5 -DA:13,5 -DA:14,1 -DA:17,4 -DA:18,2 -DA:20,2 -DA:21,1 -DA:25,3 -LF:13 -LH:13 -BRDA:7,1,0,1 -BRDA:7,1,1,5 -BRDA:12,2,0,1 -BRDA:12,2,1,4 -BRDA:15,3,0,2 -BRDA:15,3,1,2 -BRDA:18,4,0,1 -BRDA:18,4,1,1 -BRF:8 -BRH:8 -end_of_record diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/cli-width/index.js b/node_modules/eslint/node_modules/inquirer/node_modules/cli-width/index.js deleted file mode 100644 index 76aa5ff..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/cli-width/index.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -exports = module.exports = cliWidth; -exports.defaultWidth = 0; - -function cliWidth() { - if (process.stdout.getWindowSize) { - return process.stdout.getWindowSize()[0] || exports.defaultWidth; - } - else { - var tty = require('tty'); - - if (tty.getWindowSize) { - return tty.getWindowSize()[1] || exports.defaultWidth; - } - else { - if (process.env.CLI_WIDTH) { - var width = parseInt(process.env.CLI_WIDTH, 10); - - if (!isNaN(width)) { - return width; - } - } - - return exports.defaultWidth; - } - } -}; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/cli-width/package.json b/node_modules/eslint/node_modules/inquirer/node_modules/cli-width/package.json deleted file mode 100644 index b5fbceb..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/cli-width/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "cli-width", - "version": "1.1.1", - "description": "Get stdout window width, with two fallbacks, tty and then a default.", - "main": "index.js", - "scripts": { - "test": "node test | tspec", - "coverage": "isparta cover test/*.js | tspec", - "coveralls": "npm run coverage -s && coveralls < coverage/lcov.info", - "postcoveralls": "rimraf ./coverage" - }, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/knownasilya/cli-width.git" - }, - "author": { - "name": "Ilya Radchenko", - "email": "ilya@burstcreations.com" - }, - "license": "ISC", - "bugs": { - "url": "https://github.com/knownasilya/cli-width/issues" - }, - "homepage": "https://github.com/knownasilya/cli-width", - "devDependencies": { - "tap-spec": "^4.1.0", - "tape": "^3.4.0", - "coveralls": "^2.11.4", - "isparta": "^3.0.4", - "rimraf": "^2.4.3" - }, - "gitHead": "353b24e4ebd754a748dbb07695cf1a02caf1d012", - "_id": "cli-width@1.1.1", - "_shasum": "a4d293ef67ebb7b88d4a4d42c0ccf00c4d1e366d", - "_from": "cli-width@>=1.0.1 <2.0.0", - "_npmVersion": "2.14.7", - "_nodeVersion": "4.2.1", - "_npmUser": { - "name": "knownasilya", - "email": "ilya@burstcreations.com" - }, - "maintainers": [ - { - "name": "knownasilya", - "email": "ilya@burstcreations.com" - } - ], - "dist": { - "shasum": "a4d293ef67ebb7b88d4a4d42c0ccf00c4d1e366d", - "tarball": "http://registry.npmjs.org/cli-width/-/cli-width-1.1.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/cli-width/-/cli-width-1.1.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/figures/index.js b/node_modules/eslint/node_modules/inquirer/node_modules/figures/index.js deleted file mode 100644 index aabd817..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/figures/index.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict'; -var platform = process.platform; - -var main = { - tick: '✔', - cross: '✖', - star: '★', - square: '▇', - squareSmall: '◻', - squareSmallFilled: '◼', - circle: '◯', - circleFilled: '◉', - circleDotted: '◌', - circleDouble: '◎', - circleCircle: 'ⓞ', - circleCross: 'ⓧ', - circlePipe: 'Ⓘ', - circleQuestionMark: '?⃝', - bullet: '●', - dot: '․', - line: '─', - ellipsis: '…', - pointer: '❯', - pointerSmall: '›', - info: 'ℹ', - warning: '⚠', - hamburger: '☰', - smiley: '㋡', - mustache: '෴', - heart: '♥', - arrowUp: '↑', - arrowDown: '↓', - arrowLeft: '←', - arrowRight: '→', - radioOn: '◉', - radioOff: '◯', - checkboxOn: '☒', - checkboxOff: '☐', - checkboxCircleOn: 'ⓧ', - checkboxCircleOff: 'Ⓘ', - questionMarkPrefix: '?⃝' -}; - -var win = { - tick: '√', - cross: '×', - star: '*', - square: '█', - squareSmall: '[ ]', - squareSmallFilled: '[█]', - circle: '( )', - circleFilled: '(*)', - circleDotted: '( )', - circleDouble: '( )', - circleCircle: '(○)', - circleCross: '(×)', - circlePipe: '(│)', - circleQuestionMark: '(?)', - bullet: '*', - dot: '.', - line: '─', - ellipsis: '...', - pointer: '>', - pointerSmall: '»', - info: 'i', - warning: '‼', - hamburger: '≡', - smiley: '☺', - mustache: '┌─┐', - heart: main.heart, - arrowUp: main.arrowUp, - arrowDown: main.arrowDown, - arrowLeft: main.arrowLeft, - arrowRight: main.arrowRight, - radioOn: '(*)', - radioOff: '( )', - checkboxOn: '[×]', - checkboxOff: '[ ]', - checkboxCircleOn: '(×)', - checkboxCircleOff: '( )', - questionMarkPrefix: '?' -}; - -if (platform === 'linux') { - // the main one doesn't look that good on Ubuntu - main.questionMarkPrefix = '?'; -} - -module.exports = platform === 'win32' ? win : main; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/figures/license b/node_modules/eslint/node_modules/inquirer/node_modules/figures/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/figures/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/figures/package.json b/node_modules/eslint/node_modules/inquirer/node_modules/figures/package.json deleted file mode 100644 index 7b99c08..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/figures/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "figures", - "version": "1.4.0", - "description": "Unicode symbols with Windows CMD fallbacks", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/figures.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "node test.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "unicode", - "cli", - "cmd", - "command-line", - "characters", - "char", - "symbol", - "symbols", - "figure", - "figures", - "fallback" - ], - "devDependencies": { - "ava": "0.0.4" - }, - "gitHead": "6b8b7482290192d6eeb3e80508f59ad33bc012f7", - "bugs": { - "url": "https://github.com/sindresorhus/figures/issues" - }, - "homepage": "https://github.com/sindresorhus/figures#readme", - "_id": "figures@1.4.0", - "_shasum": "eb8f56390dbe3081044a5c2a9d9089075a48432f", - "_from": "figures@>=1.3.5 <2.0.0", - "_npmVersion": "2.14.3", - "_nodeVersion": "4.1.0", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "eb8f56390dbe3081044a5c2a9d9089075a48432f", - "tarball": "http://registry.npmjs.org/figures/-/figures-1.4.0.tgz" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/figures/-/figures-1.4.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/figures/readme.md b/node_modules/eslint/node_modules/inquirer/node_modules/figures/readme.md deleted file mode 100644 index bb7ddf0..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/figures/readme.md +++ /dev/null @@ -1,34 +0,0 @@ -# figures [![Build Status](https://travis-ci.org/sindresorhus/figures.svg?branch=master)](https://travis-ci.org/sindresorhus/figures) - -> Unicode symbols with Windows CMD fallbacks - -[![](screenshot.png)](index.js) - -[*and more...*](index.js) - -Windows CMD only supports a [limited character set](http://en.wikipedia.org/wiki/Code_page_437). - - -## Install - -``` -$ npm install --save figures -``` - - -## Usage - -See the [source](index.js) for supported symbols. - -```js -var figures = require('figures'); - -console.log(figures.tick); -// On real OSes: ✔︎ -// On Windows: √ -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/LICENSE b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/LICENSE deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/README.md b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/README.md deleted file mode 100644 index fd98e5c..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/README.md +++ /dev/null @@ -1,121 +0,0 @@ -# lodash v3.10.1 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash](https://lodash.com/) exported as [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) modules. - -Generated using [lodash-cli](https://www.npmjs.com/package/lodash-cli): -```bash -$ lodash modularize modern exports=node -o ./ -$ lodash modern -d -o ./index.js -``` - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash -``` - -In Node.js/io.js: - -```js -// load the modern build -var _ = require('lodash'); -// or a method category -var array = require('lodash/array'); -// or a method (great for smaller builds with browserify/webpack) -var chunk = require('lodash/array/chunk'); -``` - -See the [package source](https://github.com/lodash/lodash/tree/3.10.1-npm) for more details. - -**Note:**
-Don’t assign values to the [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL.
-Install [n_](https://www.npmjs.com/package/n_) for a REPL that includes lodash by default. - -## Module formats - -lodash is also available in a variety of other builds & module formats. - - * npm packages for [modern](https://www.npmjs.com/package/lodash), [compatibility](https://www.npmjs.com/package/lodash-compat), & [per method](https://www.npmjs.com/browse/keyword/lodash-modularized) builds - * AMD modules for [modern](https://github.com/lodash/lodash/tree/3.10.1-amd) & [compatibility](https://github.com/lodash/lodash-compat/tree/3.10.1-amd) builds - * ES modules for the [modern](https://github.com/lodash/lodash/tree/3.10.1-es) build - -## Further Reading - - * [API Documentation](https://lodash.com/docs) - * [Build Differences](https://github.com/lodash/lodash/wiki/Build-Differences) - * [Changelog](https://github.com/lodash/lodash/wiki/Changelog) - * [Roadmap](https://github.com/lodash/lodash/wiki/Roadmap) - * [More Resources](https://github.com/lodash/lodash/wiki/Resources) - -## Features - - * ~100% [code coverage](https://coveralls.io/r/lodash) - * Follows [semantic versioning](http://semver.org/) for releases - * [Lazily evaluated](http://filimanjaro.com/blog/2014/introducing-lazy-evaluation/) chaining - * [_(…)](https://lodash.com/docs#_) supports implicit chaining - * [_.ary](https://lodash.com/docs#ary) & [_.rearg](https://lodash.com/docs#rearg) to change function argument limits & order - * [_.at](https://lodash.com/docs#at) for cherry-picking collection values - * [_.attempt](https://lodash.com/docs#attempt) to execute functions which may error without a try-catch - * [_.before](https://lodash.com/docs#before) to complement [_.after](https://lodash.com/docs#after) - * [_.bindKey](https://lodash.com/docs#bindKey) for binding [*“lazy”*](http://michaux.ca/articles/lazy-function-definition-pattern) defined methods - * [_.chunk](https://lodash.com/docs#chunk) for splitting an array into chunks of a given size - * [_.clone](https://lodash.com/docs#clone) supports shallow cloning of `Date` & `RegExp` objects - * [_.cloneDeep](https://lodash.com/docs#cloneDeep) for deep cloning arrays & objects - * [_.curry](https://lodash.com/docs#curry) & [_.curryRight](https://lodash.com/docs#curryRight) for creating [curried](http://hughfdjackson.com/javascript/why-curry-helps/) functions - * [_.debounce](https://lodash.com/docs#debounce) & [_.throttle](https://lodash.com/docs#throttle) are cancelable & accept options for more control - * [_.defaultsDeep](https://lodash.com/docs#defaultsDeep) for recursively assigning default properties - * [_.fill](https://lodash.com/docs#fill) to fill arrays with values - * [_.findKey](https://lodash.com/docs#findKey) for finding keys - * [_.flow](https://lodash.com/docs#flow) to complement [_.flowRight](https://lodash.com/docs#flowRight) (a.k.a `_.compose`) - * [_.forEach](https://lodash.com/docs#forEach) supports exiting early - * [_.forIn](https://lodash.com/docs#forIn) for iterating all enumerable properties - * [_.forOwn](https://lodash.com/docs#forOwn) for iterating own properties - * [_.get](https://lodash.com/docs#get) & [_.set](https://lodash.com/docs#set) for deep property getting & setting - * [_.gt](https://lodash.com/docs#gt), [_.gte](https://lodash.com/docs#gte), [_.lt](https://lodash.com/docs#lt), & [_.lte](https://lodash.com/docs#lte) relational methods - * [_.inRange](https://lodash.com/docs#inRange) for checking whether a number is within a given range - * [_.isNative](https://lodash.com/docs#isNative) to check for native functions - * [_.isPlainObject](https://lodash.com/docs#isPlainObject) & [_.toPlainObject](https://lodash.com/docs#toPlainObject) to check for & convert to `Object` objects - * [_.isTypedArray](https://lodash.com/docs#isTypedArray) to check for typed arrays - * [_.mapKeys](https://lodash.com/docs#mapKeys) for mapping keys to an object - * [_.matches](https://lodash.com/docs#matches) supports deep object comparisons - * [_.matchesProperty](https://lodash.com/docs#matchesProperty) to complement [_.matches](https://lodash.com/docs#matches) & [_.property](https://lodash.com/docs#property) - * [_.merge](https://lodash.com/docs#merge) for a deep [_.extend](https://lodash.com/docs#extend) - * [_.method](https://lodash.com/docs#method) & [_.methodOf](https://lodash.com/docs#methodOf) to create functions that invoke methods - * [_.modArgs](https://lodash.com/docs#modArgs) for more advanced functional composition - * [_.parseInt](https://lodash.com/docs#parseInt) for consistent cross-environment behavior - * [_.pull](https://lodash.com/docs#pull), [_.pullAt](https://lodash.com/docs#pullAt), & [_.remove](https://lodash.com/docs#remove) for mutating arrays - * [_.random](https://lodash.com/docs#random) supports returning floating-point numbers - * [_.restParam](https://lodash.com/docs#restParam) & [_.spread](https://lodash.com/docs#spread) for applying rest parameters & spreading arguments to functions - * [_.runInContext](https://lodash.com/docs#runInContext) for collisionless mixins & easier mocking - * [_.slice](https://lodash.com/docs#slice) for creating subsets of array-like values - * [_.sortByAll](https://lodash.com/docs#sortByAll) & [_.sortByOrder](https://lodash.com/docs#sortByOrder) for sorting by multiple properties & orders - * [_.support](https://lodash.com/docs#support) for flagging environment features - * [_.template](https://lodash.com/docs#template) supports [*“imports”*](https://lodash.com/docs#templateSettings-imports) options & [ES template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-template-literal-lexical-components) - * [_.transform](https://lodash.com/docs#transform) as a powerful alternative to [_.reduce](https://lodash.com/docs#reduce) for transforming objects - * [_.unzipWith](https://lodash.com/docs#unzipWith) & [_.zipWith](https://lodash.com/docs#zipWith) to specify how grouped values should be combined - * [_.valuesIn](https://lodash.com/docs#valuesIn) for getting values of all enumerable properties - * [_.xor](https://lodash.com/docs#xor) to complement [_.difference](https://lodash.com/docs#difference), [_.intersection](https://lodash.com/docs#intersection), & [_.union](https://lodash.com/docs#union) - * [_.add](https://lodash.com/docs#add), [_.round](https://lodash.com/docs#round), [_.sum](https://lodash.com/docs#sum), & - [more](https://lodash.com/docs "_.ceil & _.floor") math methods - * [_.bind](https://lodash.com/docs#bind), [_.curry](https://lodash.com/docs#curry), [_.partial](https://lodash.com/docs#partial), & - [more](https://lodash.com/docs "_.bindKey, _.curryRight, _.partialRight") support customizable argument placeholders - * [_.capitalize](https://lodash.com/docs#capitalize), [_.trim](https://lodash.com/docs#trim), & - [more](https://lodash.com/docs "_.camelCase, _.deburr, _.endsWith, _.escapeRegExp, _.kebabCase, _.pad, _.padLeft, _.padRight, _.repeat, _.snakeCase, _.startCase, _.startsWith, _.trimLeft, _.trimRight, _.trunc, _.words") string methods - * [_.clone](https://lodash.com/docs#clone), [_.isEqual](https://lodash.com/docs#isEqual), & - [more](https://lodash.com/docs "_.assign, _.cloneDeep, _.merge") accept customizer callbacks - * [_.dropWhile](https://lodash.com/docs#dropWhile), [_.takeWhile](https://lodash.com/docs#takeWhile), & - [more](https://lodash.com/docs "_.drop, _.dropRight, _.dropRightWhile, _.take, _.takeRight, _.takeRightWhile") to complement [_.first](https://lodash.com/docs#first), [_.initial](https://lodash.com/docs#initial), [_.last](https://lodash.com/docs#last), & [_.rest](https://lodash.com/docs#rest) - * [_.findLast](https://lodash.com/docs#findLast), [_.findLastKey](https://lodash.com/docs#findLastKey), & - [more](https://lodash.com/docs "_.curryRight, _.dropRight, _.dropRightWhile, _.flowRight, _.forEachRight, _.forInRight, _.forOwnRight, _.padRight, partialRight, _.takeRight, _.trimRight, _.takeRightWhile") right-associative methods - * [_.includes](https://lodash.com/docs#includes), [_.toArray](https://lodash.com/docs#toArray), & - [more](https://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.findLast, _.findWhere, _.forEach, _.forEachRight, _.groupBy, _.indexBy, _.invoke, _.map, _.max, _.min, _.partition, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.size, _.some, _.sortBy, _.sortByAll, _.sortByOrder, _.sum, _.where") accept strings - * [_#commit](https://lodash.com/docs#prototype-commit) & [_#plant](https://lodash.com/docs#prototype-plant) for working with chain sequences - * [_#thru](https://lodash.com/docs#thru) to pass values thru a chain sequence - -## Support - -Tested in Chrome 43-44, Firefox 38-39, IE 6-11, MS Edge, Safari 5-8, ChakraNode 0.12.2, io.js 2.5.0, Node.js 0.8.28, 0.10.40, & 0.12.7, PhantomJS 1.9.8, RingoJS 0.11, & Rhino 1.7.6. -Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available. Special thanks to [Sauce Labs](https://saucelabs.com/) for providing automated browser testing. diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array.js deleted file mode 100644 index e5121fa..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array.js +++ /dev/null @@ -1,44 +0,0 @@ -module.exports = { - 'chunk': require('./array/chunk'), - 'compact': require('./array/compact'), - 'difference': require('./array/difference'), - 'drop': require('./array/drop'), - 'dropRight': require('./array/dropRight'), - 'dropRightWhile': require('./array/dropRightWhile'), - 'dropWhile': require('./array/dropWhile'), - 'fill': require('./array/fill'), - 'findIndex': require('./array/findIndex'), - 'findLastIndex': require('./array/findLastIndex'), - 'first': require('./array/first'), - 'flatten': require('./array/flatten'), - 'flattenDeep': require('./array/flattenDeep'), - 'head': require('./array/head'), - 'indexOf': require('./array/indexOf'), - 'initial': require('./array/initial'), - 'intersection': require('./array/intersection'), - 'last': require('./array/last'), - 'lastIndexOf': require('./array/lastIndexOf'), - 'object': require('./array/object'), - 'pull': require('./array/pull'), - 'pullAt': require('./array/pullAt'), - 'remove': require('./array/remove'), - 'rest': require('./array/rest'), - 'slice': require('./array/slice'), - 'sortedIndex': require('./array/sortedIndex'), - 'sortedLastIndex': require('./array/sortedLastIndex'), - 'tail': require('./array/tail'), - 'take': require('./array/take'), - 'takeRight': require('./array/takeRight'), - 'takeRightWhile': require('./array/takeRightWhile'), - 'takeWhile': require('./array/takeWhile'), - 'union': require('./array/union'), - 'uniq': require('./array/uniq'), - 'unique': require('./array/unique'), - 'unzip': require('./array/unzip'), - 'unzipWith': require('./array/unzipWith'), - 'without': require('./array/without'), - 'xor': require('./array/xor'), - 'zip': require('./array/zip'), - 'zipObject': require('./array/zipObject'), - 'zipWith': require('./array/zipWith') -}; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/chunk.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/chunk.js deleted file mode 100644 index c8be1fb..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/chunk.js +++ /dev/null @@ -1,46 +0,0 @@ -var baseSlice = require('../internal/baseSlice'), - isIterateeCall = require('../internal/isIterateeCall'); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeCeil = Math.ceil, - nativeFloor = Math.floor, - nativeMax = Math.max; - -/** - * Creates an array of elements split into groups the length of `size`. - * If `collection` can't be split evenly, the final chunk will be the remaining - * elements. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to process. - * @param {number} [size=1] The length of each chunk. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the new array containing chunks. - * @example - * - * _.chunk(['a', 'b', 'c', 'd'], 2); - * // => [['a', 'b'], ['c', 'd']] - * - * _.chunk(['a', 'b', 'c', 'd'], 3); - * // => [['a', 'b', 'c'], ['d']] - */ -function chunk(array, size, guard) { - if (guard ? isIterateeCall(array, size, guard) : size == null) { - size = 1; - } else { - size = nativeMax(nativeFloor(size) || 1, 1); - } - var index = 0, - length = array ? array.length : 0, - resIndex = -1, - result = Array(nativeCeil(length / size)); - - while (index < length) { - result[++resIndex] = baseSlice(array, index, (index += size)); - } - return result; -} - -module.exports = chunk; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/compact.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/compact.js deleted file mode 100644 index 1dc1c55..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/compact.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Creates an array with all falsey values removed. The values `false`, `null`, - * `0`, `""`, `undefined`, and `NaN` are falsey. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to compact. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.compact([0, 1, false, 2, '', 3]); - * // => [1, 2, 3] - */ -function compact(array) { - var index = -1, - length = array ? array.length : 0, - resIndex = -1, - result = []; - - while (++index < length) { - var value = array[index]; - if (value) { - result[++resIndex] = value; - } - } - return result; -} - -module.exports = compact; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/difference.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/difference.js deleted file mode 100644 index 128932a..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/difference.js +++ /dev/null @@ -1,29 +0,0 @@ -var baseDifference = require('../internal/baseDifference'), - baseFlatten = require('../internal/baseFlatten'), - isArrayLike = require('../internal/isArrayLike'), - isObjectLike = require('../internal/isObjectLike'), - restParam = require('../function/restParam'); - -/** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The arrays of values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.difference([1, 2, 3], [4, 2]); - * // => [1, 3] - */ -var difference = restParam(function(array, values) { - return (isObjectLike(array) && isArrayLike(array)) - ? baseDifference(array, baseFlatten(values, false, true)) - : []; -}); - -module.exports = difference; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/drop.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/drop.js deleted file mode 100644 index 039a0b5..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/drop.js +++ /dev/null @@ -1,39 +0,0 @@ -var baseSlice = require('../internal/baseSlice'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Creates a slice of `array` with `n` elements dropped from the beginning. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.drop([1, 2, 3]); - * // => [2, 3] - * - * _.drop([1, 2, 3], 2); - * // => [3] - * - * _.drop([1, 2, 3], 5); - * // => [] - * - * _.drop([1, 2, 3], 0); - * // => [1, 2, 3] - */ -function drop(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - return baseSlice(array, n < 0 ? 0 : n); -} - -module.exports = drop; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/dropRight.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/dropRight.js deleted file mode 100644 index 14b5eb6..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/dropRight.js +++ /dev/null @@ -1,40 +0,0 @@ -var baseSlice = require('../internal/baseSlice'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Creates a slice of `array` with `n` elements dropped from the end. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropRight([1, 2, 3]); - * // => [1, 2] - * - * _.dropRight([1, 2, 3], 2); - * // => [1] - * - * _.dropRight([1, 2, 3], 5); - * // => [] - * - * _.dropRight([1, 2, 3], 0); - * // => [1, 2, 3] - */ -function dropRight(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - n = length - (+n || 0); - return baseSlice(array, 0, n < 0 ? 0 : n); -} - -module.exports = dropRight; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/dropRightWhile.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/dropRightWhile.js deleted file mode 100644 index be158bd..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/dropRightWhile.js +++ /dev/null @@ -1,59 +0,0 @@ -var baseCallback = require('../internal/baseCallback'), - baseWhile = require('../internal/baseWhile'); - -/** - * Creates a slice of `array` excluding elements dropped from the end. - * Elements are dropped until `predicate` returns falsey. The predicate is - * bound to `thisArg` and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that match the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropRightWhile([1, 2, 3], function(n) { - * return n > 1; - * }); - * // => [1] - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.dropRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user'); - * // => ['barney', 'fred'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.dropRightWhile(users, 'active', false), 'user'); - * // => ['barney'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.dropRightWhile(users, 'active'), 'user'); - * // => ['barney', 'fred', 'pebbles'] - */ -function dropRightWhile(array, predicate, thisArg) { - return (array && array.length) - ? baseWhile(array, baseCallback(predicate, thisArg, 3), true, true) - : []; -} - -module.exports = dropRightWhile; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/dropWhile.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/dropWhile.js deleted file mode 100644 index d9eabae..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/dropWhile.js +++ /dev/null @@ -1,59 +0,0 @@ -var baseCallback = require('../internal/baseCallback'), - baseWhile = require('../internal/baseWhile'); - -/** - * Creates a slice of `array` excluding elements dropped from the beginning. - * Elements are dropped until `predicate` returns falsey. The predicate is - * bound to `thisArg` and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropWhile([1, 2, 3], function(n) { - * return n < 3; - * }); - * // => [3] - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.dropWhile(users, { 'user': 'barney', 'active': false }), 'user'); - * // => ['fred', 'pebbles'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.dropWhile(users, 'active', false), 'user'); - * // => ['pebbles'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.dropWhile(users, 'active'), 'user'); - * // => ['barney', 'fred', 'pebbles'] - */ -function dropWhile(array, predicate, thisArg) { - return (array && array.length) - ? baseWhile(array, baseCallback(predicate, thisArg, 3), true) - : []; -} - -module.exports = dropWhile; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/fill.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/fill.js deleted file mode 100644 index 2c8f6da..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/fill.js +++ /dev/null @@ -1,44 +0,0 @@ -var baseFill = require('../internal/baseFill'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Fills elements of `array` with `value` from `start` up to, but not - * including, `end`. - * - * **Note:** This method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.fill(array, 'a'); - * console.log(array); - * // => ['a', 'a', 'a'] - * - * _.fill(Array(3), 2); - * // => [2, 2, 2] - * - * _.fill([4, 6, 8], '*', 1, 2); - * // => [4, '*', 8] - */ -function fill(array, value, start, end) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { - start = 0; - end = length; - } - return baseFill(array, value, start, end); -} - -module.exports = fill; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/findIndex.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/findIndex.js deleted file mode 100644 index 2a6b8e1..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/findIndex.js +++ /dev/null @@ -1,53 +0,0 @@ -var createFindIndex = require('../internal/createFindIndex'); - -/** - * This method is like `_.find` except that it returns the index of the first - * element `predicate` returns truthy for instead of the element itself. - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.findIndex(users, function(chr) { - * return chr.user == 'barney'; - * }); - * // => 0 - * - * // using the `_.matches` callback shorthand - * _.findIndex(users, { 'user': 'fred', 'active': false }); - * // => 1 - * - * // using the `_.matchesProperty` callback shorthand - * _.findIndex(users, 'active', false); - * // => 0 - * - * // using the `_.property` callback shorthand - * _.findIndex(users, 'active'); - * // => 2 - */ -var findIndex = createFindIndex(); - -module.exports = findIndex; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/findLastIndex.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/findLastIndex.js deleted file mode 100644 index d6d8eca..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/findLastIndex.js +++ /dev/null @@ -1,53 +0,0 @@ -var createFindIndex = require('../internal/createFindIndex'); - -/** - * This method is like `_.findIndex` except that it iterates over elements - * of `collection` from right to left. - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.findLastIndex(users, function(chr) { - * return chr.user == 'pebbles'; - * }); - * // => 2 - * - * // using the `_.matches` callback shorthand - * _.findLastIndex(users, { 'user': 'barney', 'active': true }); - * // => 0 - * - * // using the `_.matchesProperty` callback shorthand - * _.findLastIndex(users, 'active', false); - * // => 2 - * - * // using the `_.property` callback shorthand - * _.findLastIndex(users, 'active'); - * // => 0 - */ -var findLastIndex = createFindIndex(true); - -module.exports = findLastIndex; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/first.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/first.js deleted file mode 100644 index b3b9c79..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/first.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Gets the first element of `array`. - * - * @static - * @memberOf _ - * @alias head - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the first element of `array`. - * @example - * - * _.first([1, 2, 3]); - * // => 1 - * - * _.first([]); - * // => undefined - */ -function first(array) { - return array ? array[0] : undefined; -} - -module.exports = first; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/flatten.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/flatten.js deleted file mode 100644 index dc2eff8..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/flatten.js +++ /dev/null @@ -1,32 +0,0 @@ -var baseFlatten = require('../internal/baseFlatten'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Flattens a nested array. If `isDeep` is `true` the array is recursively - * flattened, otherwise it's only flattened a single level. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to flatten. - * @param {boolean} [isDeep] Specify a deep flatten. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flatten([1, [2, 3, [4]]]); - * // => [1, 2, 3, [4]] - * - * // using `isDeep` - * _.flatten([1, [2, 3, [4]]], true); - * // => [1, 2, 3, 4] - */ -function flatten(array, isDeep, guard) { - var length = array ? array.length : 0; - if (guard && isIterateeCall(array, isDeep, guard)) { - isDeep = false; - } - return length ? baseFlatten(array, isDeep) : []; -} - -module.exports = flatten; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/flattenDeep.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/flattenDeep.js deleted file mode 100644 index 9f775fe..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/flattenDeep.js +++ /dev/null @@ -1,21 +0,0 @@ -var baseFlatten = require('../internal/baseFlatten'); - -/** - * Recursively flattens a nested array. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to recursively flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flattenDeep([1, [2, 3, [4]]]); - * // => [1, 2, 3, 4] - */ -function flattenDeep(array) { - var length = array ? array.length : 0; - return length ? baseFlatten(array, true) : []; -} - -module.exports = flattenDeep; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/head.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/head.js deleted file mode 100644 index 1961b08..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/head.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./first'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/indexOf.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/indexOf.js deleted file mode 100644 index 4cfc682..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/indexOf.js +++ /dev/null @@ -1,53 +0,0 @@ -var baseIndexOf = require('../internal/baseIndexOf'), - binaryIndex = require('../internal/binaryIndex'); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. If `array` is sorted providing `true` for `fromIndex` - * performs a faster binary search. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {boolean|number} [fromIndex=0] The index to search from or `true` - * to perform a binary search on a sorted array. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - * - * // performing a binary search - * _.indexOf([1, 1, 2, 2], 2, true); - * // => 2 - */ -function indexOf(array, value, fromIndex) { - var length = array ? array.length : 0; - if (!length) { - return -1; - } - if (typeof fromIndex == 'number') { - fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex; - } else if (fromIndex) { - var index = binaryIndex(array, value); - if (index < length && - (value === value ? (value === array[index]) : (array[index] !== array[index]))) { - return index; - } - return -1; - } - return baseIndexOf(array, value, fromIndex || 0); -} - -module.exports = indexOf; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/initial.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/initial.js deleted file mode 100644 index 59b7a7d..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/initial.js +++ /dev/null @@ -1,20 +0,0 @@ -var dropRight = require('./dropRight'); - -/** - * Gets all but the last element of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.initial([1, 2, 3]); - * // => [1, 2] - */ -function initial(array) { - return dropRight(array, 1); -} - -module.exports = initial; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/intersection.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/intersection.js deleted file mode 100644 index f218432..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/intersection.js +++ /dev/null @@ -1,58 +0,0 @@ -var baseIndexOf = require('../internal/baseIndexOf'), - cacheIndexOf = require('../internal/cacheIndexOf'), - createCache = require('../internal/createCache'), - isArrayLike = require('../internal/isArrayLike'), - restParam = require('../function/restParam'); - -/** - * Creates an array of unique values that are included in all of the provided - * arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of shared values. - * @example - * _.intersection([1, 2], [4, 2], [2, 1]); - * // => [2] - */ -var intersection = restParam(function(arrays) { - var othLength = arrays.length, - othIndex = othLength, - caches = Array(length), - indexOf = baseIndexOf, - isCommon = true, - result = []; - - while (othIndex--) { - var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : []; - caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null; - } - var array = arrays[0], - index = -1, - length = array ? array.length : 0, - seen = caches[0]; - - outer: - while (++index < length) { - value = array[index]; - if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) { - var othIndex = othLength; - while (--othIndex) { - var cache = caches[othIndex]; - if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) { - continue outer; - } - } - if (seen) { - seen.push(value); - } - result.push(value); - } - } - return result; -}); - -module.exports = intersection; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/last.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/last.js deleted file mode 100644 index 299af31..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/last.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Gets the last element of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the last element of `array`. - * @example - * - * _.last([1, 2, 3]); - * // => 3 - */ -function last(array) { - var length = array ? array.length : 0; - return length ? array[length - 1] : undefined; -} - -module.exports = last; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/lastIndexOf.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/lastIndexOf.js deleted file mode 100644 index 02b8062..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/lastIndexOf.js +++ /dev/null @@ -1,60 +0,0 @@ -var binaryIndex = require('../internal/binaryIndex'), - indexOfNaN = require('../internal/indexOfNaN'); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max, - nativeMin = Math.min; - -/** - * This method is like `_.indexOf` except that it iterates over elements of - * `array` from right to left. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {boolean|number} [fromIndex=array.length-1] The index to search from - * or `true` to perform a binary search on a sorted array. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.lastIndexOf([1, 2, 1, 2], 2); - * // => 3 - * - * // using `fromIndex` - * _.lastIndexOf([1, 2, 1, 2], 2, 2); - * // => 1 - * - * // performing a binary search - * _.lastIndexOf([1, 1, 2, 2], 2, true); - * // => 3 - */ -function lastIndexOf(array, value, fromIndex) { - var length = array ? array.length : 0; - if (!length) { - return -1; - } - var index = length; - if (typeof fromIndex == 'number') { - index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1; - } else if (fromIndex) { - index = binaryIndex(array, value, true) - 1; - var other = array[index]; - if (value === value ? (value === other) : (other !== other)) { - return index; - } - return -1; - } - if (value !== value) { - return indexOfNaN(array, index, true); - } - while (index--) { - if (array[index] === value) { - return index; - } - } - return -1; -} - -module.exports = lastIndexOf; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/object.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/object.js deleted file mode 100644 index f4a3453..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/object.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./zipObject'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/pull.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/pull.js deleted file mode 100644 index 7bcbb4a..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/pull.js +++ /dev/null @@ -1,52 +0,0 @@ -var baseIndexOf = require('../internal/baseIndexOf'); - -/** Used for native method references. */ -var arrayProto = Array.prototype; - -/** Native method references. */ -var splice = arrayProto.splice; - -/** - * Removes all provided values from `array` using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * **Note:** Unlike `_.without`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {...*} [values] The values to remove. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, 2, 3); - * console.log(array); - * // => [1, 1] - */ -function pull() { - var args = arguments, - array = args[0]; - - if (!(array && array.length)) { - return array; - } - var index = 0, - indexOf = baseIndexOf, - length = args.length; - - while (++index < length) { - var fromIndex = 0, - value = args[index]; - - while ((fromIndex = indexOf(array, value, fromIndex)) > -1) { - splice.call(array, fromIndex, 1); - } - } - return array; -} - -module.exports = pull; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/pullAt.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/pullAt.js deleted file mode 100644 index 4ca2476..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/pullAt.js +++ /dev/null @@ -1,40 +0,0 @@ -var baseAt = require('../internal/baseAt'), - baseCompareAscending = require('../internal/baseCompareAscending'), - baseFlatten = require('../internal/baseFlatten'), - basePullAt = require('../internal/basePullAt'), - restParam = require('../function/restParam'); - -/** - * Removes elements from `array` corresponding to the given indexes and returns - * an array of the removed elements. Indexes may be specified as an array of - * indexes or as individual arguments. - * - * **Note:** Unlike `_.at`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {...(number|number[])} [indexes] The indexes of elements to remove, - * specified as individual indexes or arrays of indexes. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = [5, 10, 15, 20]; - * var evens = _.pullAt(array, 1, 3); - * - * console.log(array); - * // => [5, 15] - * - * console.log(evens); - * // => [10, 20] - */ -var pullAt = restParam(function(array, indexes) { - indexes = baseFlatten(indexes); - - var result = baseAt(array, indexes); - basePullAt(array, indexes.sort(baseCompareAscending)); - return result; -}); - -module.exports = pullAt; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/remove.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/remove.js deleted file mode 100644 index 0cf979b..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/remove.js +++ /dev/null @@ -1,64 +0,0 @@ -var baseCallback = require('../internal/baseCallback'), - basePullAt = require('../internal/basePullAt'); - -/** - * Removes all elements from `array` that `predicate` returns truthy for - * and returns an array of the removed elements. The predicate is bound to - * `thisArg` and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * **Note:** Unlike `_.filter`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = [1, 2, 3, 4]; - * var evens = _.remove(array, function(n) { - * return n % 2 == 0; - * }); - * - * console.log(array); - * // => [1, 3] - * - * console.log(evens); - * // => [2, 4] - */ -function remove(array, predicate, thisArg) { - var result = []; - if (!(array && array.length)) { - return result; - } - var index = -1, - indexes = [], - length = array.length; - - predicate = baseCallback(predicate, thisArg, 3); - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result.push(value); - indexes.push(index); - } - } - basePullAt(array, indexes); - return result; -} - -module.exports = remove; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/rest.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/rest.js deleted file mode 100644 index 9bfb734..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/rest.js +++ /dev/null @@ -1,21 +0,0 @@ -var drop = require('./drop'); - -/** - * Gets all but the first element of `array`. - * - * @static - * @memberOf _ - * @alias tail - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.rest([1, 2, 3]); - * // => [2, 3] - */ -function rest(array) { - return drop(array, 1); -} - -module.exports = rest; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/slice.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/slice.js deleted file mode 100644 index 48ef1a1..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/slice.js +++ /dev/null @@ -1,30 +0,0 @@ -var baseSlice = require('../internal/baseSlice'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Creates a slice of `array` from `start` up to, but not including, `end`. - * - * **Note:** This method is used instead of `Array#slice` to support node - * lists in IE < 9 and to ensure dense arrays are returned. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ -function slice(array, start, end) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { - start = 0; - end = length; - } - return baseSlice(array, start, end); -} - -module.exports = slice; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/sortedIndex.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/sortedIndex.js deleted file mode 100644 index 6903bca..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/sortedIndex.js +++ /dev/null @@ -1,53 +0,0 @@ -var createSortedIndex = require('../internal/createSortedIndex'); - -/** - * Uses a binary search to determine the lowest index at which `value` should - * be inserted into `array` in order to maintain its sort order. If an iteratee - * function is provided it's invoked for `value` and each element of `array` - * to compute their sort ranking. The iteratee is bound to `thisArg` and - * invoked with one argument; (value). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - * - * _.sortedIndex([4, 4, 5, 5], 5); - * // => 2 - * - * var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } }; - * - * // using an iteratee function - * _.sortedIndex(['thirty', 'fifty'], 'forty', function(word) { - * return this.data[word]; - * }, dict); - * // => 1 - * - * // using the `_.property` callback shorthand - * _.sortedIndex([{ 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); - * // => 1 - */ -var sortedIndex = createSortedIndex(); - -module.exports = sortedIndex; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/sortedLastIndex.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/sortedLastIndex.js deleted file mode 100644 index 81a4a86..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/sortedLastIndex.js +++ /dev/null @@ -1,25 +0,0 @@ -var createSortedIndex = require('../internal/createSortedIndex'); - -/** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedLastIndex([4, 4, 5, 5], 5); - * // => 4 - */ -var sortedLastIndex = createSortedIndex(true); - -module.exports = sortedLastIndex; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/tail.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/tail.js deleted file mode 100644 index c5dfe77..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/tail.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./rest'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/take.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/take.js deleted file mode 100644 index 875917a..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/take.js +++ /dev/null @@ -1,39 +0,0 @@ -var baseSlice = require('../internal/baseSlice'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Creates a slice of `array` with `n` elements taken from the beginning. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.take([1, 2, 3]); - * // => [1] - * - * _.take([1, 2, 3], 2); - * // => [1, 2] - * - * _.take([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.take([1, 2, 3], 0); - * // => [] - */ -function take(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - return baseSlice(array, 0, n < 0 ? 0 : n); -} - -module.exports = take; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/takeRight.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/takeRight.js deleted file mode 100644 index 6e89c87..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/takeRight.js +++ /dev/null @@ -1,40 +0,0 @@ -var baseSlice = require('../internal/baseSlice'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Creates a slice of `array` with `n` elements taken from the end. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeRight([1, 2, 3]); - * // => [3] - * - * _.takeRight([1, 2, 3], 2); - * // => [2, 3] - * - * _.takeRight([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.takeRight([1, 2, 3], 0); - * // => [] - */ -function takeRight(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - n = length - (+n || 0); - return baseSlice(array, n < 0 ? 0 : n); -} - -module.exports = takeRight; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/takeRightWhile.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/takeRightWhile.js deleted file mode 100644 index 5464d13..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/takeRightWhile.js +++ /dev/null @@ -1,59 +0,0 @@ -var baseCallback = require('../internal/baseCallback'), - baseWhile = require('../internal/baseWhile'); - -/** - * Creates a slice of `array` with elements taken from the end. Elements are - * taken until `predicate` returns falsey. The predicate is bound to `thisArg` - * and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeRightWhile([1, 2, 3], function(n) { - * return n > 1; - * }); - * // => [2, 3] - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user'); - * // => ['pebbles'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.takeRightWhile(users, 'active', false), 'user'); - * // => ['fred', 'pebbles'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.takeRightWhile(users, 'active'), 'user'); - * // => [] - */ -function takeRightWhile(array, predicate, thisArg) { - return (array && array.length) - ? baseWhile(array, baseCallback(predicate, thisArg, 3), false, true) - : []; -} - -module.exports = takeRightWhile; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/takeWhile.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/takeWhile.js deleted file mode 100644 index f7e28a1..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/takeWhile.js +++ /dev/null @@ -1,59 +0,0 @@ -var baseCallback = require('../internal/baseCallback'), - baseWhile = require('../internal/baseWhile'); - -/** - * Creates a slice of `array` with elements taken from the beginning. Elements - * are taken until `predicate` returns falsey. The predicate is bound to - * `thisArg` and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeWhile([1, 2, 3], function(n) { - * return n < 3; - * }); - * // => [1, 2] - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false}, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.takeWhile(users, { 'user': 'barney', 'active': false }), 'user'); - * // => ['barney'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.takeWhile(users, 'active', false), 'user'); - * // => ['barney', 'fred'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.takeWhile(users, 'active'), 'user'); - * // => [] - */ -function takeWhile(array, predicate, thisArg) { - return (array && array.length) - ? baseWhile(array, baseCallback(predicate, thisArg, 3)) - : []; -} - -module.exports = takeWhile; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/union.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/union.js deleted file mode 100644 index 53cefe4..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/union.js +++ /dev/null @@ -1,24 +0,0 @@ -var baseFlatten = require('../internal/baseFlatten'), - baseUniq = require('../internal/baseUniq'), - restParam = require('../function/restParam'); - -/** - * Creates an array of unique values, in order, from all of the provided arrays - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of combined values. - * @example - * - * _.union([1, 2], [4, 2], [2, 1]); - * // => [1, 2, 4] - */ -var union = restParam(function(arrays) { - return baseUniq(baseFlatten(arrays, false, true)); -}); - -module.exports = union; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/uniq.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/uniq.js deleted file mode 100644 index ae937ef..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/uniq.js +++ /dev/null @@ -1,71 +0,0 @@ -var baseCallback = require('../internal/baseCallback'), - baseUniq = require('../internal/baseUniq'), - isIterateeCall = require('../internal/isIterateeCall'), - sortedUniq = require('../internal/sortedUniq'); - -/** - * Creates a duplicate-free version of an array, using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons, in which only the first occurence of each element - * is kept. Providing `true` for `isSorted` performs a faster search algorithm - * for sorted arrays. If an iteratee function is provided it's invoked for - * each element in the array to generate the criterion by which uniqueness - * is computed. The `iteratee` is bound to `thisArg` and invoked with three - * arguments: (value, index, array). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias unique - * @category Array - * @param {Array} array The array to inspect. - * @param {boolean} [isSorted] Specify the array is sorted. - * @param {Function|Object|string} [iteratee] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new duplicate-value-free array. - * @example - * - * _.uniq([2, 1, 2]); - * // => [2, 1] - * - * // using `isSorted` - * _.uniq([1, 1, 2], true); - * // => [1, 2] - * - * // using an iteratee function - * _.uniq([1, 2.5, 1.5, 2], function(n) { - * return this.floor(n); - * }, Math); - * // => [1, 2.5] - * - * // using the `_.property` callback shorthand - * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ -function uniq(array, isSorted, iteratee, thisArg) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (isSorted != null && typeof isSorted != 'boolean') { - thisArg = iteratee; - iteratee = isIterateeCall(array, isSorted, thisArg) ? undefined : isSorted; - isSorted = false; - } - iteratee = iteratee == null ? iteratee : baseCallback(iteratee, thisArg, 3); - return (isSorted) - ? sortedUniq(array, iteratee) - : baseUniq(array, iteratee); -} - -module.exports = uniq; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/unique.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/unique.js deleted file mode 100644 index 396de1b..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/unique.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./uniq'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/unzip.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/unzip.js deleted file mode 100644 index 0a539fa..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/unzip.js +++ /dev/null @@ -1,47 +0,0 @@ -var arrayFilter = require('../internal/arrayFilter'), - arrayMap = require('../internal/arrayMap'), - baseProperty = require('../internal/baseProperty'), - isArrayLike = require('../internal/isArrayLike'); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * This method is like `_.zip` except that it accepts an array of grouped - * elements and creates an array regrouping the elements to their pre-zip - * configuration. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array of grouped elements to process. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]); - * // => [['fred', 30, true], ['barney', 40, false]] - * - * _.unzip(zipped); - * // => [['fred', 'barney'], [30, 40], [true, false]] - */ -function unzip(array) { - if (!(array && array.length)) { - return []; - } - var index = -1, - length = 0; - - array = arrayFilter(array, function(group) { - if (isArrayLike(group)) { - length = nativeMax(group.length, length); - return true; - } - }); - var result = Array(length); - while (++index < length) { - result[index] = arrayMap(array, baseProperty(index)); - } - return result; -} - -module.exports = unzip; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/unzipWith.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/unzipWith.js deleted file mode 100644 index 324a2b1..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/unzipWith.js +++ /dev/null @@ -1,41 +0,0 @@ -var arrayMap = require('../internal/arrayMap'), - arrayReduce = require('../internal/arrayReduce'), - bindCallback = require('../internal/bindCallback'), - unzip = require('./unzip'); - -/** - * This method is like `_.unzip` except that it accepts an iteratee to specify - * how regrouped values should be combined. The `iteratee` is bound to `thisArg` - * and invoked with four arguments: (accumulator, value, index, group). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array of grouped elements to process. - * @param {Function} [iteratee] The function to combine regrouped values. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip([1, 2], [10, 20], [100, 200]); - * // => [[1, 10, 100], [2, 20, 200]] - * - * _.unzipWith(zipped, _.add); - * // => [3, 30, 300] - */ -function unzipWith(array, iteratee, thisArg) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - var result = unzip(array); - if (iteratee == null) { - return result; - } - iteratee = bindCallback(iteratee, thisArg, 4); - return arrayMap(result, function(group) { - return arrayReduce(group, iteratee, undefined, true); - }); -} - -module.exports = unzipWith; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/without.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/without.js deleted file mode 100644 index 2ac3d11..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/without.js +++ /dev/null @@ -1,27 +0,0 @@ -var baseDifference = require('../internal/baseDifference'), - isArrayLike = require('../internal/isArrayLike'), - restParam = require('../function/restParam'); - -/** - * Creates an array excluding all provided values using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to filter. - * @param {...*} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.without([1, 2, 1, 3], 1, 2); - * // => [3] - */ -var without = restParam(function(array, values) { - return isArrayLike(array) - ? baseDifference(array, values) - : []; -}); - -module.exports = without; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/xor.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/xor.js deleted file mode 100644 index 04ef32a..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/xor.js +++ /dev/null @@ -1,35 +0,0 @@ -var arrayPush = require('../internal/arrayPush'), - baseDifference = require('../internal/baseDifference'), - baseUniq = require('../internal/baseUniq'), - isArrayLike = require('../internal/isArrayLike'); - -/** - * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) - * of the provided arrays. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of values. - * @example - * - * _.xor([1, 2], [4, 2]); - * // => [1, 4] - */ -function xor() { - var index = -1, - length = arguments.length; - - while (++index < length) { - var array = arguments[index]; - if (isArrayLike(array)) { - var result = result - ? arrayPush(baseDifference(result, array), baseDifference(array, result)) - : array; - } - } - return result ? baseUniq(result) : []; -} - -module.exports = xor; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/zip.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/zip.js deleted file mode 100644 index 53a6f69..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/zip.js +++ /dev/null @@ -1,21 +0,0 @@ -var restParam = require('../function/restParam'), - unzip = require('./unzip'); - -/** - * Creates an array of grouped elements, the first of which contains the first - * elements of the given arrays, the second of which contains the second elements - * of the given arrays, and so on. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zip(['fred', 'barney'], [30, 40], [true, false]); - * // => [['fred', 30, true], ['barney', 40, false]] - */ -var zip = restParam(unzip); - -module.exports = zip; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/zipObject.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/zipObject.js deleted file mode 100644 index dec7a21..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/zipObject.js +++ /dev/null @@ -1,43 +0,0 @@ -var isArray = require('../lang/isArray'); - -/** - * The inverse of `_.pairs`; this method returns an object composed from arrays - * of property names and values. Provide either a single two dimensional array, - * e.g. `[[key1, value1], [key2, value2]]` or two arrays, one of property names - * and one of corresponding values. - * - * @static - * @memberOf _ - * @alias object - * @category Array - * @param {Array} props The property names. - * @param {Array} [values=[]] The property values. - * @returns {Object} Returns the new object. - * @example - * - * _.zipObject([['fred', 30], ['barney', 40]]); - * // => { 'fred': 30, 'barney': 40 } - * - * _.zipObject(['fred', 'barney'], [30, 40]); - * // => { 'fred': 30, 'barney': 40 } - */ -function zipObject(props, values) { - var index = -1, - length = props ? props.length : 0, - result = {}; - - if (length && !values && !isArray(props[0])) { - values = []; - } - while (++index < length) { - var key = props[index]; - if (values) { - result[key] = values[index]; - } else if (key) { - result[key[0]] = key[1]; - } - } - return result; -} - -module.exports = zipObject; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/zipWith.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/zipWith.js deleted file mode 100644 index ad10374..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/array/zipWith.js +++ /dev/null @@ -1,36 +0,0 @@ -var restParam = require('../function/restParam'), - unzipWith = require('./unzipWith'); - -/** - * This method is like `_.zip` except that it accepts an iteratee to specify - * how grouped values should be combined. The `iteratee` is bound to `thisArg` - * and invoked with four arguments: (accumulator, value, index, group). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @param {Function} [iteratee] The function to combine grouped values. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zipWith([1, 2], [10, 20], [100, 200], _.add); - * // => [111, 222] - */ -var zipWith = restParam(function(arrays) { - var length = arrays.length, - iteratee = length > 2 ? arrays[length - 2] : undefined, - thisArg = length > 1 ? arrays[length - 1] : undefined; - - if (length > 2 && typeof iteratee == 'function') { - length -= 2; - } else { - iteratee = (length > 1 && typeof thisArg == 'function') ? (--length, thisArg) : undefined; - thisArg = undefined; - } - arrays.length = length; - return unzipWith(arrays, iteratee, thisArg); -}); - -module.exports = zipWith; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain.js deleted file mode 100644 index 6439627..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain.js +++ /dev/null @@ -1,16 +0,0 @@ -module.exports = { - 'chain': require('./chain/chain'), - 'commit': require('./chain/commit'), - 'concat': require('./chain/concat'), - 'lodash': require('./chain/lodash'), - 'plant': require('./chain/plant'), - 'reverse': require('./chain/reverse'), - 'run': require('./chain/run'), - 'tap': require('./chain/tap'), - 'thru': require('./chain/thru'), - 'toJSON': require('./chain/toJSON'), - 'toString': require('./chain/toString'), - 'value': require('./chain/value'), - 'valueOf': require('./chain/valueOf'), - 'wrapperChain': require('./chain/wrapperChain') -}; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/chain.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/chain.js deleted file mode 100644 index 453ba1e..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/chain.js +++ /dev/null @@ -1,35 +0,0 @@ -var lodash = require('./lodash'); - -/** - * Creates a `lodash` object that wraps `value` with explicit method - * chaining enabled. - * - * @static - * @memberOf _ - * @category Chain - * @param {*} value The value to wrap. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'pebbles', 'age': 1 } - * ]; - * - * var youngest = _.chain(users) - * .sortBy('age') - * .map(function(chr) { - * return chr.user + ' is ' + chr.age; - * }) - * .first() - * .value(); - * // => 'pebbles is 1' - */ -function chain(value) { - var result = lodash(value); - result.__chain__ = true; - return result; -} - -module.exports = chain; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/commit.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/commit.js deleted file mode 100644 index c732d1b..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/commit.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./wrapperCommit'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/concat.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/concat.js deleted file mode 100644 index 90607d1..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/concat.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./wrapperConcat'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/lodash.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/lodash.js deleted file mode 100644 index 1c3467e..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/lodash.js +++ /dev/null @@ -1,125 +0,0 @@ -var LazyWrapper = require('../internal/LazyWrapper'), - LodashWrapper = require('../internal/LodashWrapper'), - baseLodash = require('../internal/baseLodash'), - isArray = require('../lang/isArray'), - isObjectLike = require('../internal/isObjectLike'), - wrapperClone = require('../internal/wrapperClone'); - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Creates a `lodash` object which wraps `value` to enable implicit chaining. - * Methods that operate on and return arrays, collections, and functions can - * be chained together. Methods that retrieve a single value or may return a - * primitive value will automatically end the chain returning the unwrapped - * value. Explicit chaining may be enabled using `_.chain`. The execution of - * chained methods is lazy, that is, execution is deferred until `_#value` - * is implicitly or explicitly called. - * - * Lazy evaluation allows several methods to support shortcut fusion. Shortcut - * fusion is an optimization strategy which merge iteratee calls; this can help - * to avoid the creation of intermediate data structures and greatly reduce the - * number of iteratee executions. - * - * Chaining is supported in custom builds as long as the `_#value` method is - * directly or indirectly included in the build. - * - * In addition to lodash methods, wrappers have `Array` and `String` methods. - * - * The wrapper `Array` methods are: - * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, - * `splice`, and `unshift` - * - * The wrapper `String` methods are: - * `replace` and `split` - * - * The wrapper methods that support shortcut fusion are: - * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, - * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`, - * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`, - * and `where` - * - * The chainable wrapper methods are: - * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`, - * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`, - * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defaultsDeep`, - * `defer`, `delay`, `difference`, `drop`, `dropRight`, `dropRightWhile`, - * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`, - * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, - * `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, - * `invoke`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, - * `matchesProperty`, `memoize`, `merge`, `method`, `methodOf`, `mixin`, - * `modArgs`, `negate`, `omit`, `once`, `pairs`, `partial`, `partialRight`, - * `partition`, `pick`, `plant`, `pluck`, `property`, `propertyOf`, `pull`, - * `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`, `rest`, `restParam`, - * `reverse`, `set`, `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`, - * `sortByOrder`, `splice`, `spread`, `take`, `takeRight`, `takeRightWhile`, - * `takeWhile`, `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`, - * `transform`, `union`, `uniq`, `unshift`, `unzip`, `unzipWith`, `values`, - * `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, `zipObject`, `zipWith` - * - * The wrapper methods that are **not** chainable by default are: - * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`, - * `deburr`, `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, - * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, - * `floor`, `get`, `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`, - * `inRange`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`, - * `isEmpty`, `isEqual`, `isError`, `isFinite` `isFunction`, `isMatch`, - * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`, - * `isRegExp`, `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`, - * `last`, `lastIndexOf`, `lt`, `lte`, `max`, `min`, `noConflict`, `noop`, - * `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`, `reduce`, - * `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `shift`, `size`, - * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`, - * `startsWith`, `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, - * `unescape`, `uniqueId`, `value`, and `words` - * - * The wrapper method `sample` will return a wrapped value when `n` is provided, - * otherwise an unwrapped value is returned. - * - * @name _ - * @constructor - * @category Chain - * @param {*} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var wrapped = _([1, 2, 3]); - * - * // returns an unwrapped value - * wrapped.reduce(function(total, n) { - * return total + n; - * }); - * // => 6 - * - * // returns a wrapped value - * var squares = wrapped.map(function(n) { - * return n * n; - * }); - * - * _.isArray(squares); - * // => false - * - * _.isArray(squares.value()); - * // => true - */ -function lodash(value) { - if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { - if (value instanceof LodashWrapper) { - return value; - } - if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) { - return wrapperClone(value); - } - } - return new LodashWrapper(value); -} - -// Ensure wrappers are instances of `baseLodash`. -lodash.prototype = baseLodash.prototype; - -module.exports = lodash; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/plant.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/plant.js deleted file mode 100644 index 04099f2..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/plant.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./wrapperPlant'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/reverse.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/reverse.js deleted file mode 100644 index f72a64a..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/reverse.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./wrapperReverse'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/run.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/run.js deleted file mode 100644 index 5e751a2..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/run.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./wrapperValue'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/tap.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/tap.js deleted file mode 100644 index 3d0257e..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/tap.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This method invokes `interceptor` and returns `value`. The interceptor is - * bound to `thisArg` and invoked with one argument; (value). The purpose of - * this method is to "tap into" a method chain in order to perform operations - * on intermediate results within the chain. - * - * @static - * @memberOf _ - * @category Chain - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @param {*} [thisArg] The `this` binding of `interceptor`. - * @returns {*} Returns `value`. - * @example - * - * _([1, 2, 3]) - * .tap(function(array) { - * array.pop(); - * }) - * .reverse() - * .value(); - * // => [2, 1] - */ -function tap(value, interceptor, thisArg) { - interceptor.call(thisArg, value); - return value; -} - -module.exports = tap; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/thru.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/thru.js deleted file mode 100644 index a715780..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/thru.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This method is like `_.tap` except that it returns the result of `interceptor`. - * - * @static - * @memberOf _ - * @category Chain - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @param {*} [thisArg] The `this` binding of `interceptor`. - * @returns {*} Returns the result of `interceptor`. - * @example - * - * _(' abc ') - * .chain() - * .trim() - * .thru(function(value) { - * return [value]; - * }) - * .value(); - * // => ['abc'] - */ -function thru(value, interceptor, thisArg) { - return interceptor.call(thisArg, value); -} - -module.exports = thru; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/toJSON.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/toJSON.js deleted file mode 100644 index 5e751a2..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/toJSON.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./wrapperValue'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/toString.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/toString.js deleted file mode 100644 index c7bcbf9..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/toString.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./wrapperToString'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/value.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/value.js deleted file mode 100644 index 5e751a2..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/value.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./wrapperValue'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/valueOf.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/valueOf.js deleted file mode 100644 index 5e751a2..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/valueOf.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./wrapperValue'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperChain.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperChain.js deleted file mode 100644 index 3823481..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperChain.js +++ /dev/null @@ -1,32 +0,0 @@ -var chain = require('./chain'); - -/** - * Enables explicit method chaining on the wrapper object. - * - * @name chain - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // without explicit chaining - * _(users).first(); - * // => { 'user': 'barney', 'age': 36 } - * - * // with explicit chaining - * _(users).chain() - * .first() - * .pick('user') - * .value(); - * // => { 'user': 'barney' } - */ -function wrapperChain() { - return chain(this); -} - -module.exports = wrapperChain; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperCommit.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperCommit.js deleted file mode 100644 index c3d2898..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperCommit.js +++ /dev/null @@ -1,32 +0,0 @@ -var LodashWrapper = require('../internal/LodashWrapper'); - -/** - * Executes the chained sequence and returns the wrapped result. - * - * @name commit - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2]; - * var wrapped = _(array).push(3); - * - * console.log(array); - * // => [1, 2] - * - * wrapped = wrapped.commit(); - * console.log(array); - * // => [1, 2, 3] - * - * wrapped.last(); - * // => 3 - * - * console.log(array); - * // => [1, 2, 3] - */ -function wrapperCommit() { - return new LodashWrapper(this.value(), this.__chain__); -} - -module.exports = wrapperCommit; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperConcat.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperConcat.js deleted file mode 100644 index 799156c..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperConcat.js +++ /dev/null @@ -1,34 +0,0 @@ -var arrayConcat = require('../internal/arrayConcat'), - baseFlatten = require('../internal/baseFlatten'), - isArray = require('../lang/isArray'), - restParam = require('../function/restParam'), - toObject = require('../internal/toObject'); - -/** - * Creates a new array joining a wrapped array with any additional arrays - * and/or values. - * - * @name concat - * @memberOf _ - * @category Chain - * @param {...*} [values] The values to concatenate. - * @returns {Array} Returns the new concatenated array. - * @example - * - * var array = [1]; - * var wrapped = _(array).concat(2, [3], [[4]]); - * - * console.log(wrapped.value()); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ -var wrapperConcat = restParam(function(values) { - values = baseFlatten(values); - return this.thru(function(array) { - return arrayConcat(isArray(array) ? array : [toObject(array)], values); - }); -}); - -module.exports = wrapperConcat; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperPlant.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperPlant.js deleted file mode 100644 index 234fe41..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperPlant.js +++ /dev/null @@ -1,45 +0,0 @@ -var baseLodash = require('../internal/baseLodash'), - wrapperClone = require('../internal/wrapperClone'); - -/** - * Creates a clone of the chained sequence planting `value` as the wrapped value. - * - * @name plant - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2]; - * var wrapped = _(array).map(function(value) { - * return Math.pow(value, 2); - * }); - * - * var other = [3, 4]; - * var otherWrapped = wrapped.plant(other); - * - * otherWrapped.value(); - * // => [9, 16] - * - * wrapped.value(); - * // => [1, 4] - */ -function wrapperPlant(value) { - var result, - parent = this; - - while (parent instanceof baseLodash) { - var clone = wrapperClone(parent); - if (result) { - previous.__wrapped__ = clone; - } else { - result = clone; - } - var previous = clone; - parent = parent.__wrapped__; - } - previous.__wrapped__ = value; - return result; -} - -module.exports = wrapperPlant; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperReverse.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperReverse.js deleted file mode 100644 index 6ba546d..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperReverse.js +++ /dev/null @@ -1,43 +0,0 @@ -var LazyWrapper = require('../internal/LazyWrapper'), - LodashWrapper = require('../internal/LodashWrapper'), - thru = require('./thru'); - -/** - * Reverses the wrapped array so the first element becomes the last, the - * second element becomes the second to last, and so on. - * - * **Note:** This method mutates the wrapped array. - * - * @name reverse - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new reversed `lodash` wrapper instance. - * @example - * - * var array = [1, 2, 3]; - * - * _(array).reverse().value() - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ -function wrapperReverse() { - var value = this.__wrapped__; - - var interceptor = function(value) { - return value.reverse(); - }; - if (value instanceof LazyWrapper) { - var wrapped = value; - if (this.__actions__.length) { - wrapped = new LazyWrapper(this); - } - wrapped = wrapped.reverse(); - wrapped.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined }); - return new LodashWrapper(wrapped, this.__chain__); - } - return this.thru(interceptor); -} - -module.exports = wrapperReverse; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperToString.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperToString.js deleted file mode 100644 index db975a5..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperToString.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Produces the result of coercing the unwrapped value to a string. - * - * @name toString - * @memberOf _ - * @category Chain - * @returns {string} Returns the coerced string value. - * @example - * - * _([1, 2, 3]).toString(); - * // => '1,2,3' - */ -function wrapperToString() { - return (this.value() + ''); -} - -module.exports = wrapperToString; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperValue.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperValue.js deleted file mode 100644 index 2734e41..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperValue.js +++ /dev/null @@ -1,20 +0,0 @@ -var baseWrapperValue = require('../internal/baseWrapperValue'); - -/** - * Executes the chained sequence to extract the unwrapped value. - * - * @name value - * @memberOf _ - * @alias run, toJSON, valueOf - * @category Chain - * @returns {*} Returns the resolved unwrapped value. - * @example - * - * _([1, 2, 3]).value(); - * // => [1, 2, 3] - */ -function wrapperValue() { - return baseWrapperValue(this.__wrapped__, this.__actions__); -} - -module.exports = wrapperValue; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection.js deleted file mode 100644 index 0338857..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection.js +++ /dev/null @@ -1,44 +0,0 @@ -module.exports = { - 'all': require('./collection/all'), - 'any': require('./collection/any'), - 'at': require('./collection/at'), - 'collect': require('./collection/collect'), - 'contains': require('./collection/contains'), - 'countBy': require('./collection/countBy'), - 'detect': require('./collection/detect'), - 'each': require('./collection/each'), - 'eachRight': require('./collection/eachRight'), - 'every': require('./collection/every'), - 'filter': require('./collection/filter'), - 'find': require('./collection/find'), - 'findLast': require('./collection/findLast'), - 'findWhere': require('./collection/findWhere'), - 'foldl': require('./collection/foldl'), - 'foldr': require('./collection/foldr'), - 'forEach': require('./collection/forEach'), - 'forEachRight': require('./collection/forEachRight'), - 'groupBy': require('./collection/groupBy'), - 'include': require('./collection/include'), - 'includes': require('./collection/includes'), - 'indexBy': require('./collection/indexBy'), - 'inject': require('./collection/inject'), - 'invoke': require('./collection/invoke'), - 'map': require('./collection/map'), - 'max': require('./math/max'), - 'min': require('./math/min'), - 'partition': require('./collection/partition'), - 'pluck': require('./collection/pluck'), - 'reduce': require('./collection/reduce'), - 'reduceRight': require('./collection/reduceRight'), - 'reject': require('./collection/reject'), - 'sample': require('./collection/sample'), - 'select': require('./collection/select'), - 'shuffle': require('./collection/shuffle'), - 'size': require('./collection/size'), - 'some': require('./collection/some'), - 'sortBy': require('./collection/sortBy'), - 'sortByAll': require('./collection/sortByAll'), - 'sortByOrder': require('./collection/sortByOrder'), - 'sum': require('./math/sum'), - 'where': require('./collection/where') -}; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/all.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/all.js deleted file mode 100644 index d0839f7..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/all.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./every'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/any.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/any.js deleted file mode 100644 index 900ac25..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/any.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./some'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/at.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/at.js deleted file mode 100644 index 29236e5..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/at.js +++ /dev/null @@ -1,29 +0,0 @@ -var baseAt = require('../internal/baseAt'), - baseFlatten = require('../internal/baseFlatten'), - restParam = require('../function/restParam'); - -/** - * Creates an array of elements corresponding to the given keys, or indexes, - * of `collection`. Keys may be specified as individual arguments or as arrays - * of keys. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {...(number|number[]|string|string[])} [props] The property names - * or indexes of elements to pick, specified individually or in arrays. - * @returns {Array} Returns the new array of picked elements. - * @example - * - * _.at(['a', 'b', 'c'], [0, 2]); - * // => ['a', 'c'] - * - * _.at(['barney', 'fred', 'pebbles'], 0, 2); - * // => ['barney', 'pebbles'] - */ -var at = restParam(function(collection, props) { - return baseAt(collection, baseFlatten(props)); -}); - -module.exports = at; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/collect.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/collect.js deleted file mode 100644 index 0d1e1ab..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/collect.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./map'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/contains.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/contains.js deleted file mode 100644 index 594722a..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/contains.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./includes'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/countBy.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/countBy.js deleted file mode 100644 index e97dbb7..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/countBy.js +++ /dev/null @@ -1,54 +0,0 @@ -var createAggregator = require('../internal/createAggregator'); - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is the number of times the key was returned by `iteratee`. - * The `iteratee` is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.countBy([4.3, 6.1, 6.4], function(n) { - * return Math.floor(n); - * }); - * // => { '4': 1, '6': 2 } - * - * _.countBy([4.3, 6.1, 6.4], function(n) { - * return this.floor(n); - * }, Math); - * // => { '4': 1, '6': 2 } - * - * _.countBy(['one', 'two', 'three'], 'length'); - * // => { '3': 2, '5': 1 } - */ -var countBy = createAggregator(function(result, value, key) { - hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1); -}); - -module.exports = countBy; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/detect.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/detect.js deleted file mode 100644 index 2fb6303..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/detect.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./find'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/each.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/each.js deleted file mode 100644 index 8800f42..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/each.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./forEach'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/eachRight.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/eachRight.js deleted file mode 100644 index 3252b2a..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/eachRight.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./forEachRight'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/every.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/every.js deleted file mode 100644 index 5a2d0f5..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/every.js +++ /dev/null @@ -1,66 +0,0 @@ -var arrayEvery = require('../internal/arrayEvery'), - baseCallback = require('../internal/baseCallback'), - baseEvery = require('../internal/baseEvery'), - isArray = require('../lang/isArray'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Checks if `predicate` returns truthy for **all** elements of `collection`. - * The predicate is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias all - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - * @example - * - * _.every([true, 1, null, 'yes'], Boolean); - * // => false - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.every(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // using the `_.matchesProperty` callback shorthand - * _.every(users, 'active', false); - * // => true - * - * // using the `_.property` callback shorthand - * _.every(users, 'active'); - * // => false - */ -function every(collection, predicate, thisArg) { - var func = isArray(collection) ? arrayEvery : baseEvery; - if (thisArg && isIterateeCall(collection, predicate, thisArg)) { - predicate = undefined; - } - if (typeof predicate != 'function' || thisArg !== undefined) { - predicate = baseCallback(predicate, thisArg, 3); - } - return func(collection, predicate); -} - -module.exports = every; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/filter.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/filter.js deleted file mode 100644 index 7620aa7..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/filter.js +++ /dev/null @@ -1,61 +0,0 @@ -var arrayFilter = require('../internal/arrayFilter'), - baseCallback = require('../internal/baseCallback'), - baseFilter = require('../internal/baseFilter'), - isArray = require('../lang/isArray'); - -/** - * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is bound to `thisArg` and - * invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias select - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the new filtered array. - * @example - * - * _.filter([4, 5, 6], function(n) { - * return n % 2 == 0; - * }); - * // => [4, 6] - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user'); - * // => ['barney'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.filter(users, 'active', false), 'user'); - * // => ['fred'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.filter(users, 'active'), 'user'); - * // => ['barney'] - */ -function filter(collection, predicate, thisArg) { - var func = isArray(collection) ? arrayFilter : baseFilter; - predicate = baseCallback(predicate, thisArg, 3); - return func(collection, predicate); -} - -module.exports = filter; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/find.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/find.js deleted file mode 100644 index 7358cfe..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/find.js +++ /dev/null @@ -1,56 +0,0 @@ -var baseEach = require('../internal/baseEach'), - createFind = require('../internal/createFind'); - -/** - * Iterates over elements of `collection`, returning the first element - * `predicate` returns truthy for. The predicate is bound to `thisArg` and - * invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias detect - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false }, - * { 'user': 'pebbles', 'age': 1, 'active': true } - * ]; - * - * _.result(_.find(users, function(chr) { - * return chr.age < 40; - * }), 'user'); - * // => 'barney' - * - * // using the `_.matches` callback shorthand - * _.result(_.find(users, { 'age': 1, 'active': true }), 'user'); - * // => 'pebbles' - * - * // using the `_.matchesProperty` callback shorthand - * _.result(_.find(users, 'active', false), 'user'); - * // => 'fred' - * - * // using the `_.property` callback shorthand - * _.result(_.find(users, 'active'), 'user'); - * // => 'barney' - */ -var find = createFind(baseEach); - -module.exports = find; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/findLast.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/findLast.js deleted file mode 100644 index 75dbadc..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/findLast.js +++ /dev/null @@ -1,25 +0,0 @@ -var baseEachRight = require('../internal/baseEachRight'), - createFind = require('../internal/createFind'); - -/** - * This method is like `_.find` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * _.findLast([1, 2, 3, 4], function(n) { - * return n % 2 == 1; - * }); - * // => 3 - */ -var findLast = createFind(baseEachRight, true); - -module.exports = findLast; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/findWhere.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/findWhere.js deleted file mode 100644 index 2d62065..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/findWhere.js +++ /dev/null @@ -1,37 +0,0 @@ -var baseMatches = require('../internal/baseMatches'), - find = require('./find'); - -/** - * Performs a deep comparison between each element in `collection` and the - * source object, returning the first element that has equivalent property - * values. - * - * **Note:** This method supports comparing arrays, booleans, `Date` objects, - * numbers, `Object` objects, regexes, and strings. Objects are compared by - * their own, not inherited, enumerable properties. For comparing a single - * own or inherited property value see `_.matchesProperty`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Object} source The object of property values to match. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user'); - * // => 'barney' - * - * _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user'); - * // => 'fred' - */ -function findWhere(collection, source) { - return find(collection, baseMatches(source)); -} - -module.exports = findWhere; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/foldl.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/foldl.js deleted file mode 100644 index 26f53cf..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/foldl.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./reduce'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/foldr.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/foldr.js deleted file mode 100644 index 8fb199e..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/foldr.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./reduceRight'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/forEach.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/forEach.js deleted file mode 100644 index 05a8e21..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/forEach.js +++ /dev/null @@ -1,37 +0,0 @@ -var arrayEach = require('../internal/arrayEach'), - baseEach = require('../internal/baseEach'), - createForEach = require('../internal/createForEach'); - -/** - * Iterates over elements of `collection` invoking `iteratee` for each element. - * The `iteratee` is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early - * by explicitly returning `false`. - * - * **Note:** As with other "Collections" methods, objects with a "length" property - * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn` - * may be used for object iteration. - * - * @static - * @memberOf _ - * @alias each - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array|Object|string} Returns `collection`. - * @example - * - * _([1, 2]).forEach(function(n) { - * console.log(n); - * }).value(); - * // => logs each value from left to right and returns the array - * - * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) { - * console.log(n, key); - * }); - * // => logs each value-key pair and returns the object (iteration order is not guaranteed) - */ -var forEach = createForEach(arrayEach, baseEach); - -module.exports = forEach; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/forEachRight.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/forEachRight.js deleted file mode 100644 index 3499711..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/forEachRight.js +++ /dev/null @@ -1,26 +0,0 @@ -var arrayEachRight = require('../internal/arrayEachRight'), - baseEachRight = require('../internal/baseEachRight'), - createForEach = require('../internal/createForEach'); - -/** - * This method is like `_.forEach` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @alias eachRight - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array|Object|string} Returns `collection`. - * @example - * - * _([1, 2]).forEachRight(function(n) { - * console.log(n); - * }).value(); - * // => logs each value from right to left and returns the array - */ -var forEachRight = createForEach(arrayEachRight, baseEachRight); - -module.exports = forEachRight; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/groupBy.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/groupBy.js deleted file mode 100644 index a925c89..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/groupBy.js +++ /dev/null @@ -1,59 +0,0 @@ -var createAggregator = require('../internal/createAggregator'); - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is an array of the elements responsible for generating the key. - * The `iteratee` is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.groupBy([4.2, 6.1, 6.4], function(n) { - * return Math.floor(n); - * }); - * // => { '4': [4.2], '6': [6.1, 6.4] } - * - * _.groupBy([4.2, 6.1, 6.4], function(n) { - * return this.floor(n); - * }, Math); - * // => { '4': [4.2], '6': [6.1, 6.4] } - * - * // using the `_.property` callback shorthand - * _.groupBy(['one', 'two', 'three'], 'length'); - * // => { '3': ['one', 'two'], '5': ['three'] } - */ -var groupBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - result[key].push(value); - } else { - result[key] = [value]; - } -}); - -module.exports = groupBy; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/include.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/include.js deleted file mode 100644 index 594722a..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/include.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./includes'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/includes.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/includes.js deleted file mode 100644 index 329486a..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/includes.js +++ /dev/null @@ -1,57 +0,0 @@ -var baseIndexOf = require('../internal/baseIndexOf'), - getLength = require('../internal/getLength'), - isArray = require('../lang/isArray'), - isIterateeCall = require('../internal/isIterateeCall'), - isLength = require('../internal/isLength'), - isString = require('../lang/isString'), - values = require('../object/values'); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Checks if `target` is in `collection` using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `collection`. - * - * @static - * @memberOf _ - * @alias contains, include - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {*} target The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`. - * @returns {boolean} Returns `true` if a matching element is found, else `false`. - * @example - * - * _.includes([1, 2, 3], 1); - * // => true - * - * _.includes([1, 2, 3], 1, 2); - * // => false - * - * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); - * // => true - * - * _.includes('pebbles', 'eb'); - * // => true - */ -function includes(collection, target, fromIndex, guard) { - var length = collection ? getLength(collection) : 0; - if (!isLength(length)) { - collection = values(collection); - length = collection.length; - } - if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) { - fromIndex = 0; - } else { - fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0); - } - return (typeof collection == 'string' || !isArray(collection) && isString(collection)) - ? (fromIndex <= length && collection.indexOf(target, fromIndex) > -1) - : (!!length && baseIndexOf(collection, target, fromIndex) > -1); -} - -module.exports = includes; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/indexBy.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/indexBy.js deleted file mode 100644 index 34a941e..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/indexBy.js +++ /dev/null @@ -1,53 +0,0 @@ -var createAggregator = require('../internal/createAggregator'); - -/** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is the last element responsible for generating the key. The - * iteratee function is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * var keyData = [ - * { 'dir': 'left', 'code': 97 }, - * { 'dir': 'right', 'code': 100 } - * ]; - * - * _.indexBy(keyData, 'dir'); - * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } - * - * _.indexBy(keyData, function(object) { - * return String.fromCharCode(object.code); - * }); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } - * - * _.indexBy(keyData, function(object) { - * return this.fromCharCode(object.code); - * }, String); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } - */ -var indexBy = createAggregator(function(result, value, key) { - result[key] = value; -}); - -module.exports = indexBy; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/inject.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/inject.js deleted file mode 100644 index 26f53cf..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/inject.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./reduce'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/invoke.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/invoke.js deleted file mode 100644 index 6e71721..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/invoke.js +++ /dev/null @@ -1,42 +0,0 @@ -var baseEach = require('../internal/baseEach'), - invokePath = require('../internal/invokePath'), - isArrayLike = require('../internal/isArrayLike'), - isKey = require('../internal/isKey'), - restParam = require('../function/restParam'); - -/** - * Invokes the method at `path` of each element in `collection`, returning - * an array of the results of each invoked method. Any additional arguments - * are provided to each invoked method. If `methodName` is a function it's - * invoked for, and `this` bound to, each element in `collection`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Array|Function|string} path The path of the method to invoke or - * the function invoked per iteration. - * @param {...*} [args] The arguments to invoke the method with. - * @returns {Array} Returns the array of results. - * @example - * - * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); - * // => [[1, 5, 7], [1, 2, 3]] - * - * _.invoke([123, 456], String.prototype.split, ''); - * // => [['1', '2', '3'], ['4', '5', '6']] - */ -var invoke = restParam(function(collection, path, args) { - var index = -1, - isFunc = typeof path == 'function', - isProp = isKey(path), - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value) { - var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined); - result[++index] = func ? func.apply(value, args) : invokePath(value, path, args); - }); - return result; -}); - -module.exports = invoke; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/map.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/map.js deleted file mode 100644 index 5381110..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/map.js +++ /dev/null @@ -1,68 +0,0 @@ -var arrayMap = require('../internal/arrayMap'), - baseCallback = require('../internal/baseCallback'), - baseMap = require('../internal/baseMap'), - isArray = require('../lang/isArray'); - -/** - * Creates an array of values by running each element in `collection` through - * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three - * arguments: (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. - * - * The guarded methods are: - * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`, - * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`, - * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`, - * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`, - * `sum`, `uniq`, and `words` - * - * @static - * @memberOf _ - * @alias collect - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new mapped array. - * @example - * - * function timesThree(n) { - * return n * 3; - * } - * - * _.map([1, 2], timesThree); - * // => [3, 6] - * - * _.map({ 'a': 1, 'b': 2 }, timesThree); - * // => [3, 6] (iteration order is not guaranteed) - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * // using the `_.property` callback shorthand - * _.map(users, 'user'); - * // => ['barney', 'fred'] - */ -function map(collection, iteratee, thisArg) { - var func = isArray(collection) ? arrayMap : baseMap; - iteratee = baseCallback(iteratee, thisArg, 3); - return func(collection, iteratee); -} - -module.exports = map; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/max.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/max.js deleted file mode 100644 index bb1d213..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/max.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../math/max'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/min.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/min.js deleted file mode 100644 index eef13d0..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/min.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../math/min'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/partition.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/partition.js deleted file mode 100644 index ee35f27..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/partition.js +++ /dev/null @@ -1,66 +0,0 @@ -var createAggregator = require('../internal/createAggregator'); - -/** - * Creates an array of elements split into two groups, the first of which - * contains elements `predicate` returns truthy for, while the second of which - * contains elements `predicate` returns falsey for. The predicate is bound - * to `thisArg` and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the array of grouped elements. - * @example - * - * _.partition([1, 2, 3], function(n) { - * return n % 2; - * }); - * // => [[1, 3], [2]] - * - * _.partition([1.2, 2.3, 3.4], function(n) { - * return this.floor(n) % 2; - * }, Math); - * // => [[1.2, 3.4], [2.3]] - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true }, - * { 'user': 'pebbles', 'age': 1, 'active': false } - * ]; - * - * var mapper = function(array) { - * return _.pluck(array, 'user'); - * }; - * - * // using the `_.matches` callback shorthand - * _.map(_.partition(users, { 'age': 1, 'active': false }), mapper); - * // => [['pebbles'], ['barney', 'fred']] - * - * // using the `_.matchesProperty` callback shorthand - * _.map(_.partition(users, 'active', false), mapper); - * // => [['barney', 'pebbles'], ['fred']] - * - * // using the `_.property` callback shorthand - * _.map(_.partition(users, 'active'), mapper); - * // => [['fred'], ['barney', 'pebbles']] - */ -var partition = createAggregator(function(result, value, key) { - result[key ? 0 : 1].push(value); -}, function() { return [[], []]; }); - -module.exports = partition; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/pluck.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/pluck.js deleted file mode 100644 index 5ee1ec8..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/pluck.js +++ /dev/null @@ -1,31 +0,0 @@ -var map = require('./map'), - property = require('../utility/property'); - -/** - * Gets the property value of `path` from all elements in `collection`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Array|string} path The path of the property to pluck. - * @returns {Array} Returns the property values. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * _.pluck(users, 'user'); - * // => ['barney', 'fred'] - * - * var userIndex = _.indexBy(users, 'user'); - * _.pluck(userIndex, 'age'); - * // => [36, 40] (iteration order is not guaranteed) - */ -function pluck(collection, path) { - return map(collection, property(path)); -} - -module.exports = pluck; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/reduce.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/reduce.js deleted file mode 100644 index 5d5e8c9..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/reduce.js +++ /dev/null @@ -1,44 +0,0 @@ -var arrayReduce = require('../internal/arrayReduce'), - baseEach = require('../internal/baseEach'), - createReduce = require('../internal/createReduce'); - -/** - * Reduces `collection` to a value which is the accumulated result of running - * each element in `collection` through `iteratee`, where each successive - * invocation is supplied the return value of the previous. If `accumulator` - * is not provided the first element of `collection` is used as the initial - * value. The `iteratee` is bound to `thisArg` and invoked with four arguments: - * (accumulator, value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.reduce`, `_.reduceRight`, and `_.transform`. - * - * The guarded methods are: - * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `sortByAll`, - * and `sortByOrder` - * - * @static - * @memberOf _ - * @alias foldl, inject - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {*} Returns the accumulated value. - * @example - * - * _.reduce([1, 2], function(total, n) { - * return total + n; - * }); - * // => 3 - * - * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) { - * result[key] = n * 3; - * return result; - * }, {}); - * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed) - */ -var reduce = createReduce(arrayReduce, baseEach); - -module.exports = reduce; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/reduceRight.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/reduceRight.js deleted file mode 100644 index 5a5753b..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/reduceRight.js +++ /dev/null @@ -1,29 +0,0 @@ -var arrayReduceRight = require('../internal/arrayReduceRight'), - baseEachRight = require('../internal/baseEachRight'), - createReduce = require('../internal/createReduce'); - -/** - * This method is like `_.reduce` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @alias foldr - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {*} Returns the accumulated value. - * @example - * - * var array = [[0, 1], [2, 3], [4, 5]]; - * - * _.reduceRight(array, function(flattened, other) { - * return flattened.concat(other); - * }, []); - * // => [4, 5, 2, 3, 0, 1] - */ -var reduceRight = createReduce(arrayReduceRight, baseEachRight); - -module.exports = reduceRight; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/reject.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/reject.js deleted file mode 100644 index 5592453..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/reject.js +++ /dev/null @@ -1,50 +0,0 @@ -var arrayFilter = require('../internal/arrayFilter'), - baseCallback = require('../internal/baseCallback'), - baseFilter = require('../internal/baseFilter'), - isArray = require('../lang/isArray'); - -/** - * The opposite of `_.filter`; this method returns the elements of `collection` - * that `predicate` does **not** return truthy for. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the new filtered array. - * @example - * - * _.reject([1, 2, 3, 4], function(n) { - * return n % 2 == 0; - * }); - * // => [1, 3] - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.reject(users, { 'age': 40, 'active': true }), 'user'); - * // => ['barney'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.reject(users, 'active', false), 'user'); - * // => ['fred'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.reject(users, 'active'), 'user'); - * // => ['barney'] - */ -function reject(collection, predicate, thisArg) { - var func = isArray(collection) ? arrayFilter : baseFilter; - predicate = baseCallback(predicate, thisArg, 3); - return func(collection, function(value, index, collection) { - return !predicate(value, index, collection); - }); -} - -module.exports = reject; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/sample.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/sample.js deleted file mode 100644 index 8e01533..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/sample.js +++ /dev/null @@ -1,50 +0,0 @@ -var baseRandom = require('../internal/baseRandom'), - isIterateeCall = require('../internal/isIterateeCall'), - toArray = require('../lang/toArray'), - toIterable = require('../internal/toIterable'); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMin = Math.min; - -/** - * Gets a random element or `n` random elements from a collection. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to sample. - * @param {number} [n] The number of elements to sample. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {*} Returns the random sample(s). - * @example - * - * _.sample([1, 2, 3, 4]); - * // => 2 - * - * _.sample([1, 2, 3, 4], 2); - * // => [3, 1] - */ -function sample(collection, n, guard) { - if (guard ? isIterateeCall(collection, n, guard) : n == null) { - collection = toIterable(collection); - var length = collection.length; - return length > 0 ? collection[baseRandom(0, length - 1)] : undefined; - } - var index = -1, - result = toArray(collection), - length = result.length, - lastIndex = length - 1; - - n = nativeMin(n < 0 ? 0 : (+n || 0), length); - while (++index < n) { - var rand = baseRandom(index, lastIndex), - value = result[rand]; - - result[rand] = result[index]; - result[index] = value; - } - result.length = n; - return result; -} - -module.exports = sample; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/select.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/select.js deleted file mode 100644 index ade80f6..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/select.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./filter'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/shuffle.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/shuffle.js deleted file mode 100644 index 949689c..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/shuffle.js +++ /dev/null @@ -1,24 +0,0 @@ -var sample = require('./sample'); - -/** Used as references for `-Infinity` and `Infinity`. */ -var POSITIVE_INFINITY = Number.POSITIVE_INFINITY; - -/** - * Creates an array of shuffled values, using a version of the - * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to shuffle. - * @returns {Array} Returns the new shuffled array. - * @example - * - * _.shuffle([1, 2, 3, 4]); - * // => [4, 1, 3, 2] - */ -function shuffle(collection) { - return sample(collection, POSITIVE_INFINITY); -} - -module.exports = shuffle; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/size.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/size.js deleted file mode 100644 index 78dcf4c..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/size.js +++ /dev/null @@ -1,30 +0,0 @@ -var getLength = require('../internal/getLength'), - isLength = require('../internal/isLength'), - keys = require('../object/keys'); - -/** - * Gets the size of `collection` by returning its length for array-like - * values or the number of own enumerable properties for objects. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @returns {number} Returns the size of `collection`. - * @example - * - * _.size([1, 2, 3]); - * // => 3 - * - * _.size({ 'a': 1, 'b': 2 }); - * // => 2 - * - * _.size('pebbles'); - * // => 7 - */ -function size(collection) { - var length = collection ? getLength(collection) : 0; - return isLength(length) ? length : keys(collection).length; -} - -module.exports = size; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/some.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/some.js deleted file mode 100644 index d0b09a4..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/some.js +++ /dev/null @@ -1,67 +0,0 @@ -var arraySome = require('../internal/arraySome'), - baseCallback = require('../internal/baseCallback'), - baseSome = require('../internal/baseSome'), - isArray = require('../lang/isArray'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Checks if `predicate` returns truthy for **any** element of `collection`. - * The function returns as soon as it finds a passing value and does not iterate - * over the entire collection. The predicate is bound to `thisArg` and invoked - * with three arguments: (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias any - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - * @example - * - * _.some([null, 0, 'yes', false], Boolean); - * // => true - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.some(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // using the `_.matchesProperty` callback shorthand - * _.some(users, 'active', false); - * // => true - * - * // using the `_.property` callback shorthand - * _.some(users, 'active'); - * // => true - */ -function some(collection, predicate, thisArg) { - var func = isArray(collection) ? arraySome : baseSome; - if (thisArg && isIterateeCall(collection, predicate, thisArg)) { - predicate = undefined; - } - if (typeof predicate != 'function' || thisArg !== undefined) { - predicate = baseCallback(predicate, thisArg, 3); - } - return func(collection, predicate); -} - -module.exports = some; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/sortBy.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/sortBy.js deleted file mode 100644 index 4401c77..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/sortBy.js +++ /dev/null @@ -1,71 +0,0 @@ -var baseCallback = require('../internal/baseCallback'), - baseMap = require('../internal/baseMap'), - baseSortBy = require('../internal/baseSortBy'), - compareAscending = require('../internal/compareAscending'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through `iteratee`. This method performs - * a stable sort, that is, it preserves the original sort order of equal elements. - * The `iteratee` is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new sorted array. - * @example - * - * _.sortBy([1, 2, 3], function(n) { - * return Math.sin(n); - * }); - * // => [3, 1, 2] - * - * _.sortBy([1, 2, 3], function(n) { - * return this.sin(n); - * }, Math); - * // => [3, 1, 2] - * - * var users = [ - * { 'user': 'fred' }, - * { 'user': 'pebbles' }, - * { 'user': 'barney' } - * ]; - * - * // using the `_.property` callback shorthand - * _.pluck(_.sortBy(users, 'user'), 'user'); - * // => ['barney', 'fred', 'pebbles'] - */ -function sortBy(collection, iteratee, thisArg) { - if (collection == null) { - return []; - } - if (thisArg && isIterateeCall(collection, iteratee, thisArg)) { - iteratee = undefined; - } - var index = -1; - iteratee = baseCallback(iteratee, thisArg, 3); - - var result = baseMap(collection, function(value, key, collection) { - return { 'criteria': iteratee(value, key, collection), 'index': ++index, 'value': value }; - }); - return baseSortBy(result, compareAscending); -} - -module.exports = sortBy; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/sortByAll.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/sortByAll.js deleted file mode 100644 index 4766c20..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/sortByAll.js +++ /dev/null @@ -1,52 +0,0 @@ -var baseFlatten = require('../internal/baseFlatten'), - baseSortByOrder = require('../internal/baseSortByOrder'), - isIterateeCall = require('../internal/isIterateeCall'), - restParam = require('../function/restParam'); - -/** - * This method is like `_.sortBy` except that it can sort by multiple iteratees - * or property names. - * - * If a property name is provided for an iteratee the created `_.property` - * style callback returns the property value of the given element. - * - * If an object is provided for an iteratee the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {...(Function|Function[]|Object|Object[]|string|string[])} iteratees - * The iteratees to sort by, specified as individual values or arrays of values. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.map(_.sortByAll(users, ['user', 'age']), _.values); - * // => [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.map(_.sortByAll(users, 'user', function(chr) { - * return Math.floor(chr.age / 10); - * }), _.values); - * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ -var sortByAll = restParam(function(collection, iteratees) { - if (collection == null) { - return []; - } - var guard = iteratees[2]; - if (guard && isIterateeCall(iteratees[0], iteratees[1], guard)) { - iteratees.length = 1; - } - return baseSortByOrder(collection, baseFlatten(iteratees), []); -}); - -module.exports = sortByAll; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/sortByOrder.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/sortByOrder.js deleted file mode 100644 index 8b4fc19..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/sortByOrder.js +++ /dev/null @@ -1,55 +0,0 @@ -var baseSortByOrder = require('../internal/baseSortByOrder'), - isArray = require('../lang/isArray'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * This method is like `_.sortByAll` except that it allows specifying the - * sort orders of the iteratees to sort by. If `orders` is unspecified, all - * values are sorted in ascending order. Otherwise, a value is sorted in - * ascending order if its corresponding order is "asc", and descending if "desc". - * - * If a property name is provided for an iteratee the created `_.property` - * style callback returns the property value of the given element. - * - * If an object is provided for an iteratee the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. - * @param {boolean[]} [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.map(_.sortByOrder(users, ['user', 'age'], ['asc', 'desc']), _.values); - * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ -function sortByOrder(collection, iteratees, orders, guard) { - if (collection == null) { - return []; - } - if (guard && isIterateeCall(iteratees, orders, guard)) { - orders = undefined; - } - if (!isArray(iteratees)) { - iteratees = iteratees == null ? [] : [iteratees]; - } - if (!isArray(orders)) { - orders = orders == null ? [] : [orders]; - } - return baseSortByOrder(collection, iteratees, orders); -} - -module.exports = sortByOrder; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/sum.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/sum.js deleted file mode 100644 index a2e9380..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/sum.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../math/sum'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/where.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/where.js deleted file mode 100644 index f603bf8..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/collection/where.js +++ /dev/null @@ -1,37 +0,0 @@ -var baseMatches = require('../internal/baseMatches'), - filter = require('./filter'); - -/** - * Performs a deep comparison between each element in `collection` and the - * source object, returning an array of all elements that have equivalent - * property values. - * - * **Note:** This method supports comparing arrays, booleans, `Date` objects, - * numbers, `Object` objects, regexes, and strings. Objects are compared by - * their own, not inherited, enumerable properties. For comparing a single - * own or inherited property value see `_.matchesProperty`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Object} source The object of property values to match. - * @returns {Array} Returns the new filtered array. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false, 'pets': ['hoppy'] }, - * { 'user': 'fred', 'age': 40, 'active': true, 'pets': ['baby puss', 'dino'] } - * ]; - * - * _.pluck(_.where(users, { 'age': 36, 'active': false }), 'user'); - * // => ['barney'] - * - * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user'); - * // => ['fred'] - */ -function where(collection, source) { - return filter(collection, baseMatches(source)); -} - -module.exports = where; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/date.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/date.js deleted file mode 100644 index 195366e..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/date.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - 'now': require('./date/now') -}; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/date/now.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/date/now.js deleted file mode 100644 index ffe3060..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/date/now.js +++ /dev/null @@ -1,24 +0,0 @@ -var getNative = require('../internal/getNative'); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeNow = getNative(Date, 'now'); - -/** - * Gets the number of milliseconds that have elapsed since the Unix epoch - * (1 January 1970 00:00:00 UTC). - * - * @static - * @memberOf _ - * @category Date - * @example - * - * _.defer(function(stamp) { - * console.log(_.now() - stamp); - * }, _.now()); - * // => logs the number of milliseconds it took for the deferred function to be invoked - */ -var now = nativeNow || function() { - return new Date().getTime(); -}; - -module.exports = now; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function.js deleted file mode 100644 index 71f8ebe..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function.js +++ /dev/null @@ -1,28 +0,0 @@ -module.exports = { - 'after': require('./function/after'), - 'ary': require('./function/ary'), - 'backflow': require('./function/backflow'), - 'before': require('./function/before'), - 'bind': require('./function/bind'), - 'bindAll': require('./function/bindAll'), - 'bindKey': require('./function/bindKey'), - 'compose': require('./function/compose'), - 'curry': require('./function/curry'), - 'curryRight': require('./function/curryRight'), - 'debounce': require('./function/debounce'), - 'defer': require('./function/defer'), - 'delay': require('./function/delay'), - 'flow': require('./function/flow'), - 'flowRight': require('./function/flowRight'), - 'memoize': require('./function/memoize'), - 'modArgs': require('./function/modArgs'), - 'negate': require('./function/negate'), - 'once': require('./function/once'), - 'partial': require('./function/partial'), - 'partialRight': require('./function/partialRight'), - 'rearg': require('./function/rearg'), - 'restParam': require('./function/restParam'), - 'spread': require('./function/spread'), - 'throttle': require('./function/throttle'), - 'wrap': require('./function/wrap') -}; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/after.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/after.js deleted file mode 100644 index 96a51fd..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/after.js +++ /dev/null @@ -1,48 +0,0 @@ -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeIsFinite = global.isFinite; - -/** - * The opposite of `_.before`; this method creates a function that invokes - * `func` once it's called `n` or more times. - * - * @static - * @memberOf _ - * @category Function - * @param {number} n The number of calls before `func` is invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var saves = ['profile', 'settings']; - * - * var done = _.after(saves.length, function() { - * console.log('done saving!'); - * }); - * - * _.forEach(saves, function(type) { - * asyncSave({ 'type': type, 'complete': done }); - * }); - * // => logs 'done saving!' after the two async saves have completed - */ -function after(n, func) { - if (typeof func != 'function') { - if (typeof n == 'function') { - var temp = n; - n = func; - func = temp; - } else { - throw new TypeError(FUNC_ERROR_TEXT); - } - } - n = nativeIsFinite(n = +n) ? n : 0; - return function() { - if (--n < 1) { - return func.apply(this, arguments); - } - }; -} - -module.exports = after; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/ary.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/ary.js deleted file mode 100644 index 53a6913..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/ary.js +++ /dev/null @@ -1,34 +0,0 @@ -var createWrapper = require('../internal/createWrapper'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** Used to compose bitmasks for wrapper metadata. */ -var ARY_FLAG = 128; - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Creates a function that accepts up to `n` arguments ignoring any - * additional arguments. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to cap arguments for. - * @param {number} [n=func.length] The arity cap. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Function} Returns the new function. - * @example - * - * _.map(['6', '8', '10'], _.ary(parseInt, 1)); - * // => [6, 8, 10] - */ -function ary(func, n, guard) { - if (guard && isIterateeCall(func, n, guard)) { - n = undefined; - } - n = (func && n == null) ? func.length : nativeMax(+n || 0, 0); - return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n); -} - -module.exports = ary; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/backflow.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/backflow.js deleted file mode 100644 index 1954e94..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/backflow.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./flowRight'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/before.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/before.js deleted file mode 100644 index 3d94216..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/before.js +++ /dev/null @@ -1,42 +0,0 @@ -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * Creates a function that invokes `func`, with the `this` binding and arguments - * of the created function, while it's called less than `n` times. Subsequent - * calls to the created function return the result of the last `func` invocation. - * - * @static - * @memberOf _ - * @category Function - * @param {number} n The number of calls at which `func` is no longer invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * jQuery('#add').on('click', _.before(5, addContactToList)); - * // => allows adding up to 4 contacts to the list - */ -function before(n, func) { - var result; - if (typeof func != 'function') { - if (typeof n == 'function') { - var temp = n; - n = func; - func = temp; - } else { - throw new TypeError(FUNC_ERROR_TEXT); - } - } - return function() { - if (--n > 0) { - result = func.apply(this, arguments); - } - if (n <= 1) { - func = undefined; - } - return result; - }; -} - -module.exports = before; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/bind.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/bind.js deleted file mode 100644 index 0de126a..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/bind.js +++ /dev/null @@ -1,56 +0,0 @@ -var createWrapper = require('../internal/createWrapper'), - replaceHolders = require('../internal/replaceHolders'), - restParam = require('./restParam'); - -/** Used to compose bitmasks for wrapper metadata. */ -var BIND_FLAG = 1, - PARTIAL_FLAG = 32; - -/** - * Creates a function that invokes `func` with the `this` binding of `thisArg` - * and prepends any additional `_.bind` arguments to those provided to the - * bound function. - * - * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for partially applied arguments. - * - * **Note:** Unlike native `Function#bind` this method does not set the "length" - * property of bound functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var greet = function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * }; - * - * var object = { 'user': 'fred' }; - * - * var bound = _.bind(greet, object, 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * // using placeholders - * var bound = _.bind(greet, object, _, '!'); - * bound('hi'); - * // => 'hi fred!' - */ -var bind = restParam(function(func, thisArg, partials) { - var bitmask = BIND_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, bind.placeholder); - bitmask |= PARTIAL_FLAG; - } - return createWrapper(func, bitmask, thisArg, partials, holders); -}); - -// Assign default placeholders. -bind.placeholder = {}; - -module.exports = bind; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/bindAll.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/bindAll.js deleted file mode 100644 index a09e948..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/bindAll.js +++ /dev/null @@ -1,50 +0,0 @@ -var baseFlatten = require('../internal/baseFlatten'), - createWrapper = require('../internal/createWrapper'), - functions = require('../object/functions'), - restParam = require('./restParam'); - -/** Used to compose bitmasks for wrapper metadata. */ -var BIND_FLAG = 1; - -/** - * Binds methods of an object to the object itself, overwriting the existing - * method. Method names may be specified as individual arguments or as arrays - * of method names. If no method names are provided all enumerable function - * properties, own and inherited, of `object` are bound. - * - * **Note:** This method does not set the "length" property of bound functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Object} object The object to bind and assign the bound methods to. - * @param {...(string|string[])} [methodNames] The object method names to bind, - * specified as individual method names or arrays of method names. - * @returns {Object} Returns `object`. - * @example - * - * var view = { - * 'label': 'docs', - * 'onClick': function() { - * console.log('clicked ' + this.label); - * } - * }; - * - * _.bindAll(view); - * jQuery('#docs').on('click', view.onClick); - * // => logs 'clicked docs' when the element is clicked - */ -var bindAll = restParam(function(object, methodNames) { - methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object); - - var index = -1, - length = methodNames.length; - - while (++index < length) { - var key = methodNames[index]; - object[key] = createWrapper(object[key], BIND_FLAG, object); - } - return object; -}); - -module.exports = bindAll; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/bindKey.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/bindKey.js deleted file mode 100644 index b787fe7..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/bindKey.js +++ /dev/null @@ -1,66 +0,0 @@ -var createWrapper = require('../internal/createWrapper'), - replaceHolders = require('../internal/replaceHolders'), - restParam = require('./restParam'); - -/** Used to compose bitmasks for wrapper metadata. */ -var BIND_FLAG = 1, - BIND_KEY_FLAG = 2, - PARTIAL_FLAG = 32; - -/** - * Creates a function that invokes the method at `object[key]` and prepends - * any additional `_.bindKey` arguments to those provided to the bound function. - * - * This method differs from `_.bind` by allowing bound functions to reference - * methods that may be redefined or don't yet exist. - * See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) - * for more details. - * - * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * @static - * @memberOf _ - * @category Function - * @param {Object} object The object the method belongs to. - * @param {string} key The key of the method. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var object = { - * 'user': 'fred', - * 'greet': function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * }; - * - * var bound = _.bindKey(object, 'greet', 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * object.greet = function(greeting, punctuation) { - * return greeting + 'ya ' + this.user + punctuation; - * }; - * - * bound('!'); - * // => 'hiya fred!' - * - * // using placeholders - * var bound = _.bindKey(object, 'greet', _, '!'); - * bound('hi'); - * // => 'hiya fred!' - */ -var bindKey = restParam(function(object, key, partials) { - var bitmask = BIND_FLAG | BIND_KEY_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, bindKey.placeholder); - bitmask |= PARTIAL_FLAG; - } - return createWrapper(key, bitmask, object, partials, holders); -}); - -// Assign default placeholders. -bindKey.placeholder = {}; - -module.exports = bindKey; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/compose.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/compose.js deleted file mode 100644 index 1954e94..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/compose.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./flowRight'); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/curry.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/curry.js deleted file mode 100644 index b7db3fd..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/curry.js +++ /dev/null @@ -1,51 +0,0 @@ -var createCurry = require('../internal/createCurry'); - -/** Used to compose bitmasks for wrapper metadata. */ -var CURRY_FLAG = 8; - -/** - * Creates a function that accepts one or more arguments of `func` that when - * called either invokes `func` returning its result, if all `func` arguments - * have been provided, or returns a function that accepts one or more of the - * remaining `func` arguments, and so on. The arity of `func` may be specified - * if `func.length` is not sufficient. - * - * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for provided arguments. - * - * **Note:** This method does not set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curry(abc); - * - * curried(1)(2)(3); - * // => [1, 2, 3] - * - * curried(1, 2)(3); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // using placeholders - * curried(1)(_, 3)(2); - * // => [1, 2, 3] - */ -var curry = createCurry(CURRY_FLAG); - -// Assign default placeholders. -curry.placeholder = {}; - -module.exports = curry; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/curryRight.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/curryRight.js deleted file mode 100644 index 11c5403..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/curryRight.js +++ /dev/null @@ -1,48 +0,0 @@ -var createCurry = require('../internal/createCurry'); - -/** Used to compose bitmasks for wrapper metadata. */ -var CURRY_RIGHT_FLAG = 16; - -/** - * This method is like `_.curry` except that arguments are applied to `func` - * in the manner of `_.partialRight` instead of `_.partial`. - * - * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for provided arguments. - * - * **Note:** This method does not set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curryRight(abc); - * - * curried(3)(2)(1); - * // => [1, 2, 3] - * - * curried(2, 3)(1); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // using placeholders - * curried(3)(1, _)(2); - * // => [1, 2, 3] - */ -var curryRight = createCurry(CURRY_RIGHT_FLAG); - -// Assign default placeholders. -curryRight.placeholder = {}; - -module.exports = curryRight; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/debounce.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/debounce.js deleted file mode 100644 index 163af90..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/debounce.js +++ /dev/null @@ -1,181 +0,0 @@ -var isObject = require('../lang/isObject'), - now = require('../date/now'); - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked. The debounced function comes with a `cancel` method to cancel - * delayed invocations. Provide an options object to indicate that `func` - * should be invoked on the leading and/or trailing edge of the `wait` timeout. - * Subsequent calls to the debounced function return the result of the last - * `func` invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked - * on the trailing edge of the timeout only if the the debounced function is - * invoked more than once during the `wait` timeout. - * - * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) - * for details over the differences between `_.debounce` and `_.throttle`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options] The options object. - * @param {boolean} [options.leading=false] Specify invoking on the leading - * edge of the timeout. - * @param {number} [options.maxWait] The maximum time `func` is allowed to be - * delayed before it's invoked. - * @param {boolean} [options.trailing=true] Specify invoking on the trailing - * edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // avoid costly calculations while the window size is in flux - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // invoke `sendMail` when the click event is fired, debouncing subsequent calls - * jQuery('#postbox').on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // ensure `batchLog` is invoked once after 1 second of debounced calls - * var source = new EventSource('/stream'); - * jQuery(source).on('message', _.debounce(batchLog, 250, { - * 'maxWait': 1000 - * })); - * - * // cancel a debounced call - * var todoChanges = _.debounce(batchLog, 1000); - * Object.observe(models.todo, todoChanges); - * - * Object.observe(models, function(changes) { - * if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) { - * todoChanges.cancel(); - * } - * }, ['delete']); - * - * // ...at some point `models.todo` is changed - * models.todo.completed = true; - * - * // ...before 1 second has passed `models.todo` is deleted - * // which cancels the debounced `todoChanges` call - * delete models.todo; - */ -function debounce(func, wait, options) { - var args, - maxTimeoutId, - result, - stamp, - thisArg, - timeoutId, - trailingCall, - lastCalled = 0, - maxWait = false, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = wait < 0 ? 0 : (+wait || 0); - if (options === true) { - var leading = true; - trailing = false; - } else if (isObject(options)) { - leading = !!options.leading; - maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait); - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - - function cancel() { - if (timeoutId) { - clearTimeout(timeoutId); - } - if (maxTimeoutId) { - clearTimeout(maxTimeoutId); - } - lastCalled = 0; - maxTimeoutId = timeoutId = trailingCall = undefined; - } - - function complete(isCalled, id) { - if (id) { - clearTimeout(id); - } - maxTimeoutId = timeoutId = trailingCall = undefined; - if (isCalled) { - lastCalled = now(); - result = func.apply(thisArg, args); - if (!timeoutId && !maxTimeoutId) { - args = thisArg = undefined; - } - } - } - - function delayed() { - var remaining = wait - (now() - stamp); - if (remaining <= 0 || remaining > wait) { - complete(trailingCall, maxTimeoutId); - } else { - timeoutId = setTimeout(delayed, remaining); - } - } - - function maxDelayed() { - complete(trailing, timeoutId); - } - - function debounced() { - args = arguments; - stamp = now(); - thisArg = this; - trailingCall = trailing && (timeoutId || !leading); - - if (maxWait === false) { - var leadingCall = leading && !timeoutId; - } else { - if (!maxTimeoutId && !leading) { - lastCalled = stamp; - } - var remaining = maxWait - (stamp - lastCalled), - isCalled = remaining <= 0 || remaining > maxWait; - - if (isCalled) { - if (maxTimeoutId) { - maxTimeoutId = clearTimeout(maxTimeoutId); - } - lastCalled = stamp; - result = func.apply(thisArg, args); - } - else if (!maxTimeoutId) { - maxTimeoutId = setTimeout(maxDelayed, remaining); - } - } - if (isCalled && timeoutId) { - timeoutId = clearTimeout(timeoutId); - } - else if (!timeoutId && wait !== maxWait) { - timeoutId = setTimeout(delayed, wait); - } - if (leadingCall) { - isCalled = true; - result = func.apply(thisArg, args); - } - if (isCalled && !timeoutId && !maxTimeoutId) { - args = thisArg = undefined; - } - return result; - } - debounced.cancel = cancel; - return debounced; -} - -module.exports = debounce; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/defer.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/defer.js deleted file mode 100644 index 3accbf9..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/defer.js +++ /dev/null @@ -1,25 +0,0 @@ -var baseDelay = require('../internal/baseDelay'), - restParam = require('./restParam'); - -/** - * Defers invoking the `func` until the current call stack has cleared. Any - * additional arguments are provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to defer. - * @param {...*} [args] The arguments to invoke the function with. - * @returns {number} Returns the timer id. - * @example - * - * _.defer(function(text) { - * console.log(text); - * }, 'deferred'); - * // logs 'deferred' after one or more milliseconds - */ -var defer = restParam(function(func, args) { - return baseDelay(func, 1, args); -}); - -module.exports = defer; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/delay.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/delay.js deleted file mode 100644 index d5eef27..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/delay.js +++ /dev/null @@ -1,26 +0,0 @@ -var baseDelay = require('../internal/baseDelay'), - restParam = require('./restParam'); - -/** - * Invokes `func` after `wait` milliseconds. Any additional arguments are - * provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {...*} [args] The arguments to invoke the function with. - * @returns {number} Returns the timer id. - * @example - * - * _.delay(function(text) { - * console.log(text); - * }, 1000, 'later'); - * // => logs 'later' after one second - */ -var delay = restParam(function(func, wait, args) { - return baseDelay(func, wait, args); -}); - -module.exports = delay; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/flow.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/flow.js deleted file mode 100644 index a435a3d..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/flow.js +++ /dev/null @@ -1,25 +0,0 @@ -var createFlow = require('../internal/createFlow'); - -/** - * Creates a function that returns the result of invoking the provided - * functions with the `this` binding of the created function, where each - * successive invocation is supplied the return value of the previous. - * - * @static - * @memberOf _ - * @category Function - * @param {...Function} [funcs] Functions to invoke. - * @returns {Function} Returns the new function. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var addSquare = _.flow(_.add, square); - * addSquare(1, 2); - * // => 9 - */ -var flow = createFlow(); - -module.exports = flow; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/flowRight.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/flowRight.js deleted file mode 100644 index 23b9d76..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/flowRight.js +++ /dev/null @@ -1,25 +0,0 @@ -var createFlow = require('../internal/createFlow'); - -/** - * This method is like `_.flow` except that it creates a function that - * invokes the provided functions from right to left. - * - * @static - * @memberOf _ - * @alias backflow, compose - * @category Function - * @param {...Function} [funcs] Functions to invoke. - * @returns {Function} Returns the new function. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var addSquare = _.flowRight(square, _.add); - * addSquare(1, 2); - * // => 9 - */ -var flowRight = createFlow(true); - -module.exports = flowRight; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/memoize.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/memoize.js deleted file mode 100644 index f3b8d69..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/memoize.js +++ /dev/null @@ -1,80 +0,0 @@ -var MapCache = require('../internal/MapCache'); - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is coerced to a string and used as the - * cache key. The `func` is invoked with the `this` binding of the memoized - * function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) - * method interface of `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoizing function. - * @example - * - * var upperCase = _.memoize(function(string) { - * return string.toUpperCase(); - * }); - * - * upperCase('fred'); - * // => 'FRED' - * - * // modifying the result cache - * upperCase.cache.set('fred', 'BARNEY'); - * upperCase('fred'); - * // => 'BARNEY' - * - * // replacing `_.memoize.Cache` - * var object = { 'user': 'fred' }; - * var other = { 'user': 'barney' }; - * var identity = _.memoize(_.identity); - * - * identity(object); - * // => { 'user': 'fred' } - * identity(other); - * // => { 'user': 'fred' } - * - * _.memoize.Cache = WeakMap; - * var identity = _.memoize(_.identity); - * - * identity(object); - * // => { 'user': 'fred' } - * identity(other); - * // => { 'user': 'barney' } - */ -function memoize(func, resolver) { - if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result); - return result; - }; - memoized.cache = new memoize.Cache; - return memoized; -} - -// Assign cache to `_.memoize`. -memoize.Cache = MapCache; - -module.exports = memoize; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/modArgs.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/modArgs.js deleted file mode 100644 index 49b9b5e..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/modArgs.js +++ /dev/null @@ -1,58 +0,0 @@ -var arrayEvery = require('../internal/arrayEvery'), - baseFlatten = require('../internal/baseFlatten'), - baseIsFunction = require('../internal/baseIsFunction'), - restParam = require('./restParam'); - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMin = Math.min; - -/** - * Creates a function that runs each argument through a corresponding - * transform function. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to wrap. - * @param {...(Function|Function[])} [transforms] The functions to transform - * arguments, specified as individual functions or arrays of functions. - * @returns {Function} Returns the new function. - * @example - * - * function doubled(n) { - * return n * 2; - * } - * - * function square(n) { - * return n * n; - * } - * - * var modded = _.modArgs(function(x, y) { - * return [x, y]; - * }, square, doubled); - * - * modded(1, 2); - * // => [1, 4] - * - * modded(5, 10); - * // => [25, 20] - */ -var modArgs = restParam(function(func, transforms) { - transforms = baseFlatten(transforms); - if (typeof func != 'function' || !arrayEvery(transforms, baseIsFunction)) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var length = transforms.length; - return restParam(function(args) { - var index = nativeMin(args.length, length); - while (index--) { - args[index] = transforms[index](args[index]); - } - return func.apply(this, args); - }); -}); - -module.exports = modArgs; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/negate.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/negate.js deleted file mode 100644 index 8247939..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/negate.js +++ /dev/null @@ -1,32 +0,0 @@ -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * Creates a function that negates the result of the predicate `func`. The - * `func` predicate is invoked with the `this` binding and arguments of the - * created function. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} predicate The predicate to negate. - * @returns {Function} Returns the new function. - * @example - * - * function isEven(n) { - * return n % 2 == 0; - * } - * - * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); - * // => [1, 3, 5] - */ -function negate(predicate) { - if (typeof predicate != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function() { - return !predicate.apply(this, arguments); - }; -} - -module.exports = negate; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/once.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/once.js deleted file mode 100644 index 0b5bd85..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/once.js +++ /dev/null @@ -1,24 +0,0 @@ -var before = require('./before'); - -/** - * Creates a function that is restricted to invoking `func` once. Repeat calls - * to the function return the value of the first call. The `func` is invoked - * with the `this` binding and arguments of the created function. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var initialize = _.once(createApplication); - * initialize(); - * initialize(); - * // `initialize` invokes `createApplication` once - */ -function once(func) { - return before(2, func); -} - -module.exports = once; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/partial.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/partial.js deleted file mode 100644 index fb1d04f..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/partial.js +++ /dev/null @@ -1,43 +0,0 @@ -var createPartial = require('../internal/createPartial'); - -/** Used to compose bitmasks for wrapper metadata. */ -var PARTIAL_FLAG = 32; - -/** - * Creates a function that invokes `func` with `partial` arguments prepended - * to those provided to the new function. This method is like `_.bind` except - * it does **not** alter the `this` binding. - * - * The `_.partial.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method does not set the "length" property of partially - * applied functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * var greet = function(greeting, name) { - * return greeting + ' ' + name; - * }; - * - * var sayHelloTo = _.partial(greet, 'hello'); - * sayHelloTo('fred'); - * // => 'hello fred' - * - * // using placeholders - * var greetFred = _.partial(greet, _, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - */ -var partial = createPartial(PARTIAL_FLAG); - -// Assign default placeholders. -partial.placeholder = {}; - -module.exports = partial; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/partialRight.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/partialRight.js deleted file mode 100644 index 634e6a4..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/partialRight.js +++ /dev/null @@ -1,42 +0,0 @@ -var createPartial = require('../internal/createPartial'); - -/** Used to compose bitmasks for wrapper metadata. */ -var PARTIAL_RIGHT_FLAG = 64; - -/** - * This method is like `_.partial` except that partially applied arguments - * are appended to those provided to the new function. - * - * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method does not set the "length" property of partially - * applied functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * var greet = function(greeting, name) { - * return greeting + ' ' + name; - * }; - * - * var greetFred = _.partialRight(greet, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - * - * // using placeholders - * var sayHelloTo = _.partialRight(greet, 'hello', _); - * sayHelloTo('fred'); - * // => 'hello fred' - */ -var partialRight = createPartial(PARTIAL_RIGHT_FLAG); - -// Assign default placeholders. -partialRight.placeholder = {}; - -module.exports = partialRight; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/rearg.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/rearg.js deleted file mode 100644 index f2bd9c4..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/rearg.js +++ /dev/null @@ -1,40 +0,0 @@ -var baseFlatten = require('../internal/baseFlatten'), - createWrapper = require('../internal/createWrapper'), - restParam = require('./restParam'); - -/** Used to compose bitmasks for wrapper metadata. */ -var REARG_FLAG = 256; - -/** - * Creates a function that invokes `func` with arguments arranged according - * to the specified indexes where the argument value at the first index is - * provided as the first argument, the argument value at the second index is - * provided as the second argument, and so on. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to rearrange arguments for. - * @param {...(number|number[])} indexes The arranged argument indexes, - * specified as individual indexes or arrays of indexes. - * @returns {Function} Returns the new function. - * @example - * - * var rearged = _.rearg(function(a, b, c) { - * return [a, b, c]; - * }, 2, 0, 1); - * - * rearged('b', 'c', 'a') - * // => ['a', 'b', 'c'] - * - * var map = _.rearg(_.map, [1, 0]); - * map(function(n) { - * return n * 3; - * }, [1, 2, 3]); - * // => [3, 6, 9] - */ -var rearg = restParam(function(func, indexes) { - return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes)); -}); - -module.exports = rearg; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/restParam.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/restParam.js deleted file mode 100644 index 8852286..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/restParam.js +++ /dev/null @@ -1,58 +0,0 @@ -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as an array. - * - * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters). - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.restParam(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' - */ -function restParam(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - rest = Array(length); - - while (++index < length) { - rest[index] = args[start + index]; - } - switch (start) { - case 0: return func.call(this, rest); - case 1: return func.call(this, args[0], rest); - case 2: return func.call(this, args[0], args[1], rest); - } - var otherArgs = Array(start + 1); - index = -1; - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = rest; - return func.apply(this, otherArgs); - }; -} - -module.exports = restParam; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/spread.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/spread.js deleted file mode 100644 index 780f504..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/spread.js +++ /dev/null @@ -1,44 +0,0 @@ -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * Creates a function that invokes `func` with the `this` binding of the created - * function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3). - * - * **Note:** This method is based on the [spread operator](https://developer.mozilla.org/Web/JavaScript/Reference/Operators/Spread_operator). - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to spread arguments over. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.spread(function(who, what) { - * return who + ' says ' + what; - * }); - * - * say(['fred', 'hello']); - * // => 'fred says hello' - * - * // with a Promise - * var numbers = Promise.all([ - * Promise.resolve(40), - * Promise.resolve(36) - * ]); - * - * numbers.then(_.spread(function(x, y) { - * return x + y; - * })); - * // => a Promise of 76 - */ -function spread(func) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function(array) { - return func.apply(this, array); - }; -} - -module.exports = spread; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/throttle.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/throttle.js deleted file mode 100644 index 1dd00ea..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/throttle.js +++ /dev/null @@ -1,62 +0,0 @@ -var debounce = require('./debounce'), - isObject = require('../lang/isObject'); - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * Creates a throttled function that only invokes `func` at most once per - * every `wait` milliseconds. The throttled function comes with a `cancel` - * method to cancel delayed invocations. Provide an options object to indicate - * that `func` should be invoked on the leading and/or trailing edge of the - * `wait` timeout. Subsequent calls to the throttled function return the - * result of the last `func` call. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked - * on the trailing edge of the timeout only if the the throttled function is - * invoked more than once during the `wait` timeout. - * - * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) - * for details over the differences between `_.throttle` and `_.debounce`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to throttle. - * @param {number} [wait=0] The number of milliseconds to throttle invocations to. - * @param {Object} [options] The options object. - * @param {boolean} [options.leading=true] Specify invoking on the leading - * edge of the timeout. - * @param {boolean} [options.trailing=true] Specify invoking on the trailing - * edge of the timeout. - * @returns {Function} Returns the new throttled function. - * @example - * - * // avoid excessively updating the position while scrolling - * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); - * - * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes - * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, { - * 'trailing': false - * })); - * - * // cancel a trailing throttled call - * jQuery(window).on('popstate', throttled.cancel); - */ -function throttle(func, wait, options) { - var leading = true, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (options === false) { - leading = false; - } else if (isObject(options)) { - leading = 'leading' in options ? !!options.leading : leading; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - return debounce(func, wait, { 'leading': leading, 'maxWait': +wait, 'trailing': trailing }); -} - -module.exports = throttle; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/wrap.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/wrap.js deleted file mode 100644 index 6a33c5e..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/function/wrap.js +++ /dev/null @@ -1,33 +0,0 @@ -var createWrapper = require('../internal/createWrapper'), - identity = require('../utility/identity'); - -/** Used to compose bitmasks for wrapper metadata. */ -var PARTIAL_FLAG = 32; - -/** - * Creates a function that provides `value` to the wrapper function as its - * first argument. Any additional arguments provided to the function are - * appended to those provided to the wrapper function. The wrapper is invoked - * with the `this` binding of the created function. - * - * @static - * @memberOf _ - * @category Function - * @param {*} value The value to wrap. - * @param {Function} wrapper The wrapper function. - * @returns {Function} Returns the new function. - * @example - * - * var p = _.wrap(_.escape, function(func, text) { - * return '

' + func(text) + '

'; - * }); - * - * p('fred, barney, & pebbles'); - * // => '

fred, barney, & pebbles

' - */ -function wrap(value, wrapper) { - wrapper = wrapper == null ? identity : wrapper; - return createWrapper(wrapper, PARTIAL_FLAG, undefined, [value], []); -} - -module.exports = wrap; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/index.js b/node_modules/eslint/node_modules/inquirer/node_modules/lodash/index.js deleted file mode 100644 index 5f17319..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/lodash/index.js +++ /dev/null @@ -1,12351 +0,0 @@ -/** - * @license - * lodash 3.10.1 (Custom Build) - * Build: `lodash modern -d -o ./index.js` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -;(function() { - - /** Used as a safe reference for `undefined` in pre-ES5 environments. */ - var undefined; - - /** Used as the semantic version number. */ - var VERSION = '3.10.1'; - - /** Used to compose bitmasks for wrapper metadata. */ - var BIND_FLAG = 1, - BIND_KEY_FLAG = 2, - CURRY_BOUND_FLAG = 4, - CURRY_FLAG = 8, - CURRY_RIGHT_FLAG = 16, - PARTIAL_FLAG = 32, - PARTIAL_RIGHT_FLAG = 64, - ARY_FLAG = 128, - REARG_FLAG = 256; - - /** Used as default options for `_.trunc`. */ - var DEFAULT_TRUNC_LENGTH = 30, - DEFAULT_TRUNC_OMISSION = '...'; - - /** Used to detect when a function becomes hot. */ - var HOT_COUNT = 150, - HOT_SPAN = 16; - - /** Used as the size to enable large array optimizations. */ - var LARGE_ARRAY_SIZE = 200; - - /** Used to indicate the type of lazy iteratees. */ - var LAZY_FILTER_FLAG = 1, - LAZY_MAP_FLAG = 2; - - /** Used as the `TypeError` message for "Functions" methods. */ - var FUNC_ERROR_TEXT = 'Expected a function'; - - /** Used as the internal argument placeholder. */ - var PLACEHOLDER = '__lodash_placeholder__'; - - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - weakMapTag = '[object WeakMap]'; - - var arrayBufferTag = '[object ArrayBuffer]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - - /** Used to match empty string literals in compiled template source. */ - var reEmptyStringLeading = /\b__p \+= '';/g, - reEmptyStringMiddle = /\b(__p \+=) '' \+/g, - reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; - - /** Used to match HTML entities and HTML characters. */ - var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g, - reUnescapedHtml = /[&<>"'`]/g, - reHasEscapedHtml = RegExp(reEscapedHtml.source), - reHasUnescapedHtml = RegExp(reUnescapedHtml.source); - - /** Used to match template delimiters. */ - var reEscape = /<%-([\s\S]+?)%>/g, - reEvaluate = /<%([\s\S]+?)%>/g, - reInterpolate = /<%=([\s\S]+?)%>/g; - - /** Used to match property names within property paths. */ - var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g; - - /** - * Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns) - * and those outlined by [`EscapeRegExpPattern`](http://ecma-international.org/ecma-262/6.0/#sec-escaperegexppattern). - */ - var reRegExpChars = /^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g, - reHasRegExpChars = RegExp(reRegExpChars.source); - - /** Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). */ - var reComboMark = /[\u0300-\u036f\ufe20-\ufe23]/g; - - /** Used to match backslashes in property paths. */ - var reEscapeChar = /\\(\\)?/g; - - /** Used to match [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components). */ - var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; - - /** Used to match `RegExp` flags from their coerced string values. */ - var reFlags = /\w*$/; - - /** Used to detect hexadecimal string values. */ - var reHasHexPrefix = /^0[xX]/; - - /** Used to detect host constructors (Safari > 5). */ - var reIsHostCtor = /^\[object .+?Constructor\]$/; - - /** Used to detect unsigned integer values. */ - var reIsUint = /^\d+$/; - - /** Used to match latin-1 supplementary letters (excluding mathematical operators). */ - var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g; - - /** Used to ensure capturing order of template delimiters. */ - var reNoMatch = /($^)/; - - /** Used to match unescaped characters in compiled string literals. */ - var reUnescapedString = /['\n\r\u2028\u2029\\]/g; - - /** Used to match words to create compound words. */ - var reWords = (function() { - var upper = '[A-Z\\xc0-\\xd6\\xd8-\\xde]', - lower = '[a-z\\xdf-\\xf6\\xf8-\\xff]+'; - - return RegExp(upper + '+(?=' + upper + lower + ')|' + upper + '?' + lower + '|' + upper + '+|[0-9]+', 'g'); - }()); - - /** Used to assign default `context` object properties. */ - var contextProps = [ - 'Array', 'ArrayBuffer', 'Date', 'Error', 'Float32Array', 'Float64Array', - 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Math', 'Number', - 'Object', 'RegExp', 'Set', 'String', '_', 'clearTimeout', 'isFinite', - 'parseFloat', 'parseInt', 'setTimeout', 'TypeError', 'Uint8Array', - 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap' - ]; - - /** Used to make template sourceURLs easier to identify. */ - var templateCounter = -1; - - /** Used to identify `toStringTag` values of typed arrays. */ - var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = - typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = - typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = - typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = - typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = - typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = - typedArrayTags[dateTag] = typedArrayTags[errorTag] = - typedArrayTags[funcTag] = typedArrayTags[mapTag] = - typedArrayTags[numberTag] = typedArrayTags[objectTag] = - typedArrayTags[regexpTag] = typedArrayTags[setTag] = - typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; - - /** Used to identify `toStringTag` values supported by `_.clone`. */ - var cloneableTags = {}; - cloneableTags[argsTag] = cloneableTags[arrayTag] = - cloneableTags[arrayBufferTag] = cloneableTags[boolTag] = - cloneableTags[dateTag] = cloneableTags[float32Tag] = - cloneableTags[float64Tag] = cloneableTags[int8Tag] = - cloneableTags[int16Tag] = cloneableTags[int32Tag] = - cloneableTags[numberTag] = cloneableTags[objectTag] = - cloneableTags[regexpTag] = cloneableTags[stringTag] = - cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = - cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; - cloneableTags[errorTag] = cloneableTags[funcTag] = - cloneableTags[mapTag] = cloneableTags[setTag] = - cloneableTags[weakMapTag] = false; - - /** Used to map latin-1 supplementary letters to basic latin letters. */ - var deburredLetters = { - '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', - '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', - '\xc7': 'C', '\xe7': 'c', - '\xd0': 'D', '\xf0': 'd', - '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', - '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', - '\xcC': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', - '\xeC': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', - '\xd1': 'N', '\xf1': 'n', - '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', - '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', - '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', - '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', - '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', - '\xc6': 'Ae', '\xe6': 'ae', - '\xde': 'Th', '\xfe': 'th', - '\xdf': 'ss' - }; - - /** Used to map characters to HTML entities. */ - var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' - }; - - /** Used to map HTML entities to characters. */ - var htmlUnescapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': "'", - '`': '`' - }; - - /** Used to determine if values are of the language type `Object`. */ - var objectTypes = { - 'function': true, - 'object': true - }; - - /** Used to escape characters for inclusion in compiled regexes. */ - var regexpEscapes = { - '0': 'x30', '1': 'x31', '2': 'x32', '3': 'x33', '4': 'x34', - '5': 'x35', '6': 'x36', '7': 'x37', '8': 'x38', '9': 'x39', - 'A': 'x41', 'B': 'x42', 'C': 'x43', 'D': 'x44', 'E': 'x45', 'F': 'x46', - 'a': 'x61', 'b': 'x62', 'c': 'x63', 'd': 'x64', 'e': 'x65', 'f': 'x66', - 'n': 'x6e', 'r': 'x72', 't': 'x74', 'u': 'x75', 'v': 'x76', 'x': 'x78' - }; - - /** Used to escape characters for inclusion in compiled string literals. */ - var stringEscapes = { - '\\': '\\', - "'": "'", - '\n': 'n', - '\r': 'r', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - /** Detect free variable `exports`. */ - var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; - - /** Detect free variable `module`. */ - var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; - - /** Detect free variable `global` from Node.js. */ - var freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global; - - /** Detect free variable `self`. */ - var freeSelf = objectTypes[typeof self] && self && self.Object && self; - - /** Detect free variable `window`. */ - var freeWindow = objectTypes[typeof window] && window && window.Object && window; - - /** Detect the popular CommonJS extension `module.exports`. */ - var moduleExports = freeModule && freeModule.exports === freeExports && freeExports; - - /** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ - var root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this; - - /*--------------------------------------------------------------------------*/ - - /** - * The base implementation of `compareAscending` which compares values and - * sorts them in ascending order without guaranteeing a stable sort. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {number} Returns the sort order indicator for `value`. - */ - function baseCompareAscending(value, other) { - if (value !== other) { - var valIsNull = value === null, - valIsUndef = value === undefined, - valIsReflexive = value === value; - - var othIsNull = other === null, - othIsUndef = other === undefined, - othIsReflexive = other === other; - - if ((value > other && !othIsNull) || !valIsReflexive || - (valIsNull && !othIsUndef && othIsReflexive) || - (valIsUndef && othIsReflexive)) { - return 1; - } - if ((value < other && !valIsNull) || !othIsReflexive || - (othIsNull && !valIsUndef && valIsReflexive) || - (othIsUndef && valIsReflexive)) { - return -1; - } - } - return 0; - } - - /** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for callback shorthands and `this` binding. - * - * @private - * @param {Array} array The array to search. - * @param {Function} predicate The function invoked per iteration. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseFindIndex(array, predicate, fromRight) { - var length = array.length, - index = fromRight ? length : -1; - - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; - } - - /** - * The base implementation of `_.indexOf` without support for binary searches. - * - * @private - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseIndexOf(array, value, fromIndex) { - if (value !== value) { - return indexOfNaN(array, fromIndex); - } - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; - } - - /** - * The base implementation of `_.isFunction` without support for environments - * with incorrect `typeof` results. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - */ - function baseIsFunction(value) { - // Avoid a Chakra JIT bug in compatibility modes of IE 11. - // See https://github.com/jashkenas/underscore/issues/1621 for more details. - return typeof value == 'function' || false; - } - - /** - * Converts `value` to a string if it's not one. An empty string is returned - * for `null` or `undefined` values. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ - function baseToString(value) { - return value == null ? '' : (value + ''); - } - - /** - * Used by `_.trim` and `_.trimLeft` to get the index of the first character - * of `string` that is not found in `chars`. - * - * @private - * @param {string} string The string to inspect. - * @param {string} chars The characters to find. - * @returns {number} Returns the index of the first character not found in `chars`. - */ - function charsLeftIndex(string, chars) { - var index = -1, - length = string.length; - - while (++index < length && chars.indexOf(string.charAt(index)) > -1) {} - return index; - } - - /** - * Used by `_.trim` and `_.trimRight` to get the index of the last character - * of `string` that is not found in `chars`. - * - * @private - * @param {string} string The string to inspect. - * @param {string} chars The characters to find. - * @returns {number} Returns the index of the last character not found in `chars`. - */ - function charsRightIndex(string, chars) { - var index = string.length; - - while (index-- && chars.indexOf(string.charAt(index)) > -1) {} - return index; - } - - /** - * Used by `_.sortBy` to compare transformed elements of a collection and stable - * sort them in ascending order. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @returns {number} Returns the sort order indicator for `object`. - */ - function compareAscending(object, other) { - return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index); - } - - /** - * Used by `_.sortByOrder` to compare multiple properties of a value to another - * and stable sort them. - * - * If `orders` is unspecified, all valuess are sorted in ascending order. Otherwise, - * a value is sorted in ascending order if its corresponding order is "asc", and - * descending if "desc". - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {boolean[]} orders The order to sort by for each property. - * @returns {number} Returns the sort order indicator for `object`. - */ - function compareMultiple(object, other, orders) { - var index = -1, - objCriteria = object.criteria, - othCriteria = other.criteria, - length = objCriteria.length, - ordersLength = orders.length; - - while (++index < length) { - var result = baseCompareAscending(objCriteria[index], othCriteria[index]); - if (result) { - if (index >= ordersLength) { - return result; - } - var order = orders[index]; - return result * ((order === 'asc' || order === true) ? 1 : -1); - } - } - // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications - // that causes it, under certain circumstances, to provide the same value for - // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 - // for more details. - // - // This also ensures a stable sort in V8 and other engines. - // See https://code.google.com/p/v8/issues/detail?id=90 for more details. - return object.index - other.index; - } - - /** - * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters. - * - * @private - * @param {string} letter The matched letter to deburr. - * @returns {string} Returns the deburred letter. - */ - function deburrLetter(letter) { - return deburredLetters[letter]; - } - - /** - * Used by `_.escape` to convert characters to HTML entities. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - function escapeHtmlChar(chr) { - return htmlEscapes[chr]; - } - - /** - * Used by `_.escapeRegExp` to escape characters for inclusion in compiled regexes. - * - * @private - * @param {string} chr The matched character to escape. - * @param {string} leadingChar The capture group for a leading character. - * @param {string} whitespaceChar The capture group for a whitespace character. - * @returns {string} Returns the escaped character. - */ - function escapeRegExpChar(chr, leadingChar, whitespaceChar) { - if (leadingChar) { - chr = regexpEscapes[chr]; - } else if (whitespaceChar) { - chr = stringEscapes[chr]; - } - return '\\' + chr; - } - - /** - * Used by `_.template` to escape characters for inclusion in compiled string literals. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - function escapeStringChar(chr) { - return '\\' + stringEscapes[chr]; - } - - /** - * Gets the index at which the first occurrence of `NaN` is found in `array`. - * - * @private - * @param {Array} array The array to search. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched `NaN`, else `-1`. - */ - function indexOfNaN(array, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 0 : -1); - - while ((fromRight ? index-- : ++index < length)) { - var other = array[index]; - if (other !== other) { - return index; - } - } - return -1; - } - - /** - * Checks if `value` is object-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - */ - function isObjectLike(value) { - return !!value && typeof value == 'object'; - } - - /** - * Used by `trimmedLeftIndex` and `trimmedRightIndex` to determine if a - * character code is whitespace. - * - * @private - * @param {number} charCode The character code to inspect. - * @returns {boolean} Returns `true` if `charCode` is whitespace, else `false`. - */ - function isSpace(charCode) { - return ((charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160) || charCode == 5760 || charCode == 6158 || - (charCode >= 8192 && (charCode <= 8202 || charCode == 8232 || charCode == 8233 || charCode == 8239 || charCode == 8287 || charCode == 12288 || charCode == 65279))); - } - - /** - * Replaces all `placeholder` elements in `array` with an internal placeholder - * and returns an array of their indexes. - * - * @private - * @param {Array} array The array to modify. - * @param {*} placeholder The placeholder to replace. - * @returns {Array} Returns the new array of placeholder indexes. - */ - function replaceHolders(array, placeholder) { - var index = -1, - length = array.length, - resIndex = -1, - result = []; - - while (++index < length) { - if (array[index] === placeholder) { - array[index] = PLACEHOLDER; - result[++resIndex] = index; - } - } - return result; - } - - /** - * An implementation of `_.uniq` optimized for sorted arrays without support - * for callback shorthands and `this` binding. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The function invoked per iteration. - * @returns {Array} Returns the new duplicate-value-free array. - */ - function sortedUniq(array, iteratee) { - var seen, - index = -1, - length = array.length, - resIndex = -1, - result = []; - - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value, index, array) : value; - - if (!index || seen !== computed) { - seen = computed; - result[++resIndex] = value; - } - } - return result; - } - - /** - * Used by `_.trim` and `_.trimLeft` to get the index of the first non-whitespace - * character of `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the index of the first non-whitespace character. - */ - function trimmedLeftIndex(string) { - var index = -1, - length = string.length; - - while (++index < length && isSpace(string.charCodeAt(index))) {} - return index; - } - - /** - * Used by `_.trim` and `_.trimRight` to get the index of the last non-whitespace - * character of `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the index of the last non-whitespace character. - */ - function trimmedRightIndex(string) { - var index = string.length; - - while (index-- && isSpace(string.charCodeAt(index))) {} - return index; - } - - /** - * Used by `_.unescape` to convert HTML entities to characters. - * - * @private - * @param {string} chr The matched character to unescape. - * @returns {string} Returns the unescaped character. - */ - function unescapeHtmlChar(chr) { - return htmlUnescapes[chr]; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Create a new pristine `lodash` function using the given `context` object. - * - * @static - * @memberOf _ - * @category Utility - * @param {Object} [context=root] The context object. - * @returns {Function} Returns a new `lodash` function. - * @example - * - * _.mixin({ 'foo': _.constant('foo') }); - * - * var lodash = _.runInContext(); - * lodash.mixin({ 'bar': lodash.constant('bar') }); - * - * _.isFunction(_.foo); - * // => true - * _.isFunction(_.bar); - * // => false - * - * lodash.isFunction(lodash.foo); - * // => false - * lodash.isFunction(lodash.bar); - * // => true - * - * // using `context` to mock `Date#getTime` use in `_.now` - * var mock = _.runInContext({ - * 'Date': function() { - * return { 'getTime': getTimeMock }; - * } - * }); - * - * // or creating a suped-up `defer` in Node.js - * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; - */ - function runInContext(context) { - // Avoid issues with some ES3 environments that attempt to use values, named - // after built-in constructors like `Object`, for the creation of literals. - // ES5 clears this up by stating that literals must use built-in constructors. - // See https://es5.github.io/#x11.1.5 for more details. - context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root; - - /** Native constructor references. */ - var Array = context.Array, - Date = context.Date, - Error = context.Error, - Function = context.Function, - Math = context.Math, - Number = context.Number, - Object = context.Object, - RegExp = context.RegExp, - String = context.String, - TypeError = context.TypeError; - - /** Used for native method references. */ - var arrayProto = Array.prototype, - objectProto = Object.prototype, - stringProto = String.prototype; - - /** Used to resolve the decompiled source of functions. */ - var fnToString = Function.prototype.toString; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** Used to generate unique IDs. */ - var idCounter = 0; - - /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objToString = objectProto.toString; - - /** Used to restore the original `_` reference in `_.noConflict`. */ - var oldDash = root._; - - /** Used to detect if a method is native. */ - var reIsNative = RegExp('^' + - fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' - ); - - /** Native method references. */ - var ArrayBuffer = context.ArrayBuffer, - clearTimeout = context.clearTimeout, - parseFloat = context.parseFloat, - pow = Math.pow, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - Set = getNative(context, 'Set'), - setTimeout = context.setTimeout, - splice = arrayProto.splice, - Uint8Array = context.Uint8Array, - WeakMap = getNative(context, 'WeakMap'); - - /* Native method references for those with the same name as other `lodash` methods. */ - var nativeCeil = Math.ceil, - nativeCreate = getNative(Object, 'create'), - nativeFloor = Math.floor, - nativeIsArray = getNative(Array, 'isArray'), - nativeIsFinite = context.isFinite, - nativeKeys = getNative(Object, 'keys'), - nativeMax = Math.max, - nativeMin = Math.min, - nativeNow = getNative(Date, 'now'), - nativeParseInt = context.parseInt, - nativeRandom = Math.random; - - /** Used as references for `-Infinity` and `Infinity`. */ - var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY, - POSITIVE_INFINITY = Number.POSITIVE_INFINITY; - - /** Used as references for the maximum length and index of an array. */ - var MAX_ARRAY_LENGTH = 4294967295, - MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, - HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; - - /** - * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) - * of an array-like value. - */ - var MAX_SAFE_INTEGER = 9007199254740991; - - /** Used to store function metadata. */ - var metaMap = WeakMap && new WeakMap; - - /** Used to lookup unminified function names. */ - var realNames = {}; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a `lodash` object which wraps `value` to enable implicit chaining. - * Methods that operate on and return arrays, collections, and functions can - * be chained together. Methods that retrieve a single value or may return a - * primitive value will automatically end the chain returning the unwrapped - * value. Explicit chaining may be enabled using `_.chain`. The execution of - * chained methods is lazy, that is, execution is deferred until `_#value` - * is implicitly or explicitly called. - * - * Lazy evaluation allows several methods to support shortcut fusion. Shortcut - * fusion is an optimization strategy which merge iteratee calls; this can help - * to avoid the creation of intermediate data structures and greatly reduce the - * number of iteratee executions. - * - * Chaining is supported in custom builds as long as the `_#value` method is - * directly or indirectly included in the build. - * - * In addition to lodash methods, wrappers have `Array` and `String` methods. - * - * The wrapper `Array` methods are: - * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, - * `splice`, and `unshift` - * - * The wrapper `String` methods are: - * `replace` and `split` - * - * The wrapper methods that support shortcut fusion are: - * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, - * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`, - * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`, - * and `where` - * - * The chainable wrapper methods are: - * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`, - * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`, - * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defaultsDeep`, - * `defer`, `delay`, `difference`, `drop`, `dropRight`, `dropRightWhile`, - * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`, - * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, - * `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, - * `invoke`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, - * `matchesProperty`, `memoize`, `merge`, `method`, `methodOf`, `mixin`, - * `modArgs`, `negate`, `omit`, `once`, `pairs`, `partial`, `partialRight`, - * `partition`, `pick`, `plant`, `pluck`, `property`, `propertyOf`, `pull`, - * `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`, `rest`, `restParam`, - * `reverse`, `set`, `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`, - * `sortByOrder`, `splice`, `spread`, `take`, `takeRight`, `takeRightWhile`, - * `takeWhile`, `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`, - * `transform`, `union`, `uniq`, `unshift`, `unzip`, `unzipWith`, `values`, - * `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, `zipObject`, `zipWith` - * - * The wrapper methods that are **not** chainable by default are: - * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`, - * `deburr`, `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, - * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, - * `floor`, `get`, `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`, - * `inRange`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`, - * `isEmpty`, `isEqual`, `isError`, `isFinite` `isFunction`, `isMatch`, - * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`, - * `isRegExp`, `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`, - * `last`, `lastIndexOf`, `lt`, `lte`, `max`, `min`, `noConflict`, `noop`, - * `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`, `reduce`, - * `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `shift`, `size`, - * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`, - * `startsWith`, `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, - * `unescape`, `uniqueId`, `value`, and `words` - * - * The wrapper method `sample` will return a wrapped value when `n` is provided, - * otherwise an unwrapped value is returned. - * - * @name _ - * @constructor - * @category Chain - * @param {*} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var wrapped = _([1, 2, 3]); - * - * // returns an unwrapped value - * wrapped.reduce(function(total, n) { - * return total + n; - * }); - * // => 6 - * - * // returns a wrapped value - * var squares = wrapped.map(function(n) { - * return n * n; - * }); - * - * _.isArray(squares); - * // => false - * - * _.isArray(squares.value()); - * // => true - */ - function lodash(value) { - if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { - if (value instanceof LodashWrapper) { - return value; - } - if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) { - return wrapperClone(value); - } - } - return new LodashWrapper(value); - } - - /** - * The function whose prototype all chaining wrappers inherit from. - * - * @private - */ - function baseLodash() { - // No operation performed. - } - - /** - * The base constructor for creating `lodash` wrapper objects. - * - * @private - * @param {*} value The value to wrap. - * @param {boolean} [chainAll] Enable chaining for all wrapper methods. - * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value. - */ - function LodashWrapper(value, chainAll, actions) { - this.__wrapped__ = value; - this.__actions__ = actions || []; - this.__chain__ = !!chainAll; - } - - /** - * An object environment feature flags. - * - * @static - * @memberOf _ - * @type Object - */ - var support = lodash.support = {}; - - /** - * By default, the template delimiters used by lodash are like those in - * embedded Ruby (ERB). Change the following template settings to use - * alternative delimiters. - * - * @static - * @memberOf _ - * @type Object - */ - lodash.templateSettings = { - - /** - * Used to detect `data` property values to be HTML-escaped. - * - * @memberOf _.templateSettings - * @type RegExp - */ - 'escape': reEscape, - - /** - * Used to detect code to be evaluated. - * - * @memberOf _.templateSettings - * @type RegExp - */ - 'evaluate': reEvaluate, - - /** - * Used to detect `data` property values to inject. - * - * @memberOf _.templateSettings - * @type RegExp - */ - 'interpolate': reInterpolate, - - /** - * Used to reference the data object in the template text. - * - * @memberOf _.templateSettings - * @type string - */ - 'variable': '', - - /** - * Used to import variables into the compiled template. - * - * @memberOf _.templateSettings - * @type Object - */ - 'imports': { - - /** - * A reference to the `lodash` function. - * - * @memberOf _.templateSettings.imports - * @type Function - */ - '_': lodash - } - }; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. - * - * @private - * @param {*} value The value to wrap. - */ - function LazyWrapper(value) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__dir__ = 1; - this.__filtered__ = false; - this.__iteratees__ = []; - this.__takeCount__ = POSITIVE_INFINITY; - this.__views__ = []; - } - - /** - * Creates a clone of the lazy wrapper object. - * - * @private - * @name clone - * @memberOf LazyWrapper - * @returns {Object} Returns the cloned `LazyWrapper` object. - */ - function lazyClone() { - var result = new LazyWrapper(this.__wrapped__); - result.__actions__ = arrayCopy(this.__actions__); - result.__dir__ = this.__dir__; - result.__filtered__ = this.__filtered__; - result.__iteratees__ = arrayCopy(this.__iteratees__); - result.__takeCount__ = this.__takeCount__; - result.__views__ = arrayCopy(this.__views__); - return result; - } - - /** - * Reverses the direction of lazy iteration. - * - * @private - * @name reverse - * @memberOf LazyWrapper - * @returns {Object} Returns the new reversed `LazyWrapper` object. - */ - function lazyReverse() { - if (this.__filtered__) { - var result = new LazyWrapper(this); - result.__dir__ = -1; - result.__filtered__ = true; - } else { - result = this.clone(); - result.__dir__ *= -1; - } - return result; - } - - /** - * Extracts the unwrapped value from its lazy wrapper. - * - * @private - * @name value - * @memberOf LazyWrapper - * @returns {*} Returns the unwrapped value. - */ - function lazyValue() { - var array = this.__wrapped__.value(), - dir = this.__dir__, - isArr = isArray(array), - isRight = dir < 0, - arrLength = isArr ? array.length : 0, - view = getView(0, arrLength, this.__views__), - start = view.start, - end = view.end, - length = end - start, - index = isRight ? end : (start - 1), - iteratees = this.__iteratees__, - iterLength = iteratees.length, - resIndex = 0, - takeCount = nativeMin(length, this.__takeCount__); - - if (!isArr || arrLength < LARGE_ARRAY_SIZE || (arrLength == length && takeCount == length)) { - return baseWrapperValue((isRight && isArr) ? array.reverse() : array, this.__actions__); - } - var result = []; - - outer: - while (length-- && resIndex < takeCount) { - index += dir; - - var iterIndex = -1, - value = array[index]; - - while (++iterIndex < iterLength) { - var data = iteratees[iterIndex], - iteratee = data.iteratee, - type = data.type, - computed = iteratee(value); - - if (type == LAZY_MAP_FLAG) { - value = computed; - } else if (!computed) { - if (type == LAZY_FILTER_FLAG) { - continue outer; - } else { - break outer; - } - } - } - result[resIndex++] = value; - } - return result; - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates a cache object to store key/value pairs. - * - * @private - * @static - * @name Cache - * @memberOf _.memoize - */ - function MapCache() { - this.__data__ = {}; - } - - /** - * Removes `key` and its value from the cache. - * - * @private - * @name delete - * @memberOf _.memoize.Cache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed successfully, else `false`. - */ - function mapDelete(key) { - return this.has(key) && delete this.__data__[key]; - } - - /** - * Gets the cached value for `key`. - * - * @private - * @name get - * @memberOf _.memoize.Cache - * @param {string} key The key of the value to get. - * @returns {*} Returns the cached value. - */ - function mapGet(key) { - return key == '__proto__' ? undefined : this.__data__[key]; - } - - /** - * Checks if a cached value for `key` exists. - * - * @private - * @name has - * @memberOf _.memoize.Cache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function mapHas(key) { - return key != '__proto__' && hasOwnProperty.call(this.__data__, key); - } - - /** - * Sets `value` to `key` of the cache. - * - * @private - * @name set - * @memberOf _.memoize.Cache - * @param {string} key The key of the value to cache. - * @param {*} value The value to cache. - * @returns {Object} Returns the cache object. - */ - function mapSet(key, value) { - if (key != '__proto__') { - this.__data__[key] = value; - } - return this; - } - - /*------------------------------------------------------------------------*/ - - /** - * - * Creates a cache object to store unique values. - * - * @private - * @param {Array} [values] The values to cache. - */ - function SetCache(values) { - var length = values ? values.length : 0; - - this.data = { 'hash': nativeCreate(null), 'set': new Set }; - while (length--) { - this.push(values[length]); - } - } - - /** - * Checks if `value` is in `cache` mimicking the return signature of - * `_.indexOf` by returning `0` if the value is found, else `-1`. - * - * @private - * @param {Object} cache The cache to search. - * @param {*} value The value to search for. - * @returns {number} Returns `0` if `value` is found, else `-1`. - */ - function cacheIndexOf(cache, value) { - var data = cache.data, - result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value]; - - return result ? 0 : -1; - } - - /** - * Adds `value` to the cache. - * - * @private - * @name push - * @memberOf SetCache - * @param {*} value The value to cache. - */ - function cachePush(value) { - var data = this.data; - if (typeof value == 'string' || isObject(value)) { - data.set.add(value); - } else { - data.hash[value] = true; - } - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates a new array joining `array` with `other`. - * - * @private - * @param {Array} array The array to join. - * @param {Array} other The other array to join. - * @returns {Array} Returns the new concatenated array. - */ - function arrayConcat(array, other) { - var index = -1, - length = array.length, - othIndex = -1, - othLength = other.length, - result = Array(length + othLength); - - while (++index < length) { - result[index] = array[index]; - } - while (++othIndex < othLength) { - result[index++] = other[othIndex]; - } - return result; - } - - /** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ - function arrayCopy(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; - } - - /** - * A specialized version of `_.forEach` for arrays without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEach(array, iteratee) { - var index = -1, - length = array.length; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; - } - - /** - * A specialized version of `_.forEachRight` for arrays without support for - * callback shorthands and `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEachRight(array, iteratee) { - var length = array.length; - - while (length--) { - if (iteratee(array[length], length, array) === false) { - break; - } - } - return array; - } - - /** - * A specialized version of `_.every` for arrays without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - */ - function arrayEvery(array, predicate) { - var index = -1, - length = array.length; - - while (++index < length) { - if (!predicate(array[index], index, array)) { - return false; - } - } - return true; - } - - /** - * A specialized version of `baseExtremum` for arrays which invokes `iteratee` - * with one argument: (value). - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} comparator The function used to compare values. - * @param {*} exValue The initial extremum value. - * @returns {*} Returns the extremum value. - */ - function arrayExtremum(array, iteratee, comparator, exValue) { - var index = -1, - length = array.length, - computed = exValue, - result = computed; - - while (++index < length) { - var value = array[index], - current = +iteratee(value); - - if (comparator(current, computed)) { - computed = current; - result = value; - } - } - return result; - } - - /** - * A specialized version of `_.filter` for arrays without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function arrayFilter(array, predicate) { - var index = -1, - length = array.length, - resIndex = -1, - result = []; - - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[++resIndex] = value; - } - } - return result; - } - - /** - * A specialized version of `_.map` for arrays without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function arrayMap(array, iteratee) { - var index = -1, - length = array.length, - result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; - } - - /** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ - function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; - } - - /** - * A specialized version of `_.reduce` for arrays without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initFromArray] Specify using the first element of `array` - * as the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduce(array, iteratee, accumulator, initFromArray) { - var index = -1, - length = array.length; - - if (initFromArray && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; - } - - /** - * A specialized version of `_.reduceRight` for arrays without support for - * callback shorthands and `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initFromArray] Specify using the last element of `array` - * as the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduceRight(array, iteratee, accumulator, initFromArray) { - var length = array.length; - if (initFromArray && length) { - accumulator = array[--length]; - } - while (length--) { - accumulator = iteratee(accumulator, array[length], length, array); - } - return accumulator; - } - - /** - * A specialized version of `_.some` for arrays without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ - function arraySome(array, predicate) { - var index = -1, - length = array.length; - - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; - } - } - return false; - } - - /** - * A specialized version of `_.sum` for arrays without support for callback - * shorthands and `this` binding.. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {number} Returns the sum. - */ - function arraySum(array, iteratee) { - var length = array.length, - result = 0; - - while (length--) { - result += +iteratee(array[length]) || 0; - } - return result; - } - - /** - * Used by `_.defaults` to customize its `_.assign` use. - * - * @private - * @param {*} objectValue The destination object property value. - * @param {*} sourceValue The source object property value. - * @returns {*} Returns the value to assign to the destination object. - */ - function assignDefaults(objectValue, sourceValue) { - return objectValue === undefined ? sourceValue : objectValue; - } - - /** - * Used by `_.template` to customize its `_.assign` use. - * - * **Note:** This function is like `assignDefaults` except that it ignores - * inherited property values when checking if a property is `undefined`. - * - * @private - * @param {*} objectValue The destination object property value. - * @param {*} sourceValue The source object property value. - * @param {string} key The key associated with the object and source values. - * @param {Object} object The destination object. - * @returns {*} Returns the value to assign to the destination object. - */ - function assignOwnDefaults(objectValue, sourceValue, key, object) { - return (objectValue === undefined || !hasOwnProperty.call(object, key)) - ? sourceValue - : objectValue; - } - - /** - * A specialized version of `_.assign` for customizing assigned values without - * support for argument juggling, multiple sources, and `this` binding `customizer` - * functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {Function} customizer The function to customize assigned values. - * @returns {Object} Returns `object`. - */ - function assignWith(object, source, customizer) { - var index = -1, - props = keys(source), - length = props.length; - - while (++index < length) { - var key = props[index], - value = object[key], - result = customizer(value, source[key], key, object, source); - - if ((result === result ? (result !== value) : (value === value)) || - (value === undefined && !(key in object))) { - object[key] = result; - } - } - return object; - } - - /** - * The base implementation of `_.assign` without support for argument juggling, - * multiple sources, and `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ - function baseAssign(object, source) { - return source == null - ? object - : baseCopy(source, keys(source), object); - } - - /** - * The base implementation of `_.at` without support for string collections - * and individual key arguments. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {number[]|string[]} props The property names or indexes of elements to pick. - * @returns {Array} Returns the new array of picked elements. - */ - function baseAt(collection, props) { - var index = -1, - isNil = collection == null, - isArr = !isNil && isArrayLike(collection), - length = isArr ? collection.length : 0, - propsLength = props.length, - result = Array(propsLength); - - while(++index < propsLength) { - var key = props[index]; - if (isArr) { - result[index] = isIndex(key, length) ? collection[key] : undefined; - } else { - result[index] = isNil ? undefined : collection[key]; - } - } - return result; - } - - /** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. - * @param {Object} [object={}] The object to copy properties to. - * @returns {Object} Returns `object`. - */ - function baseCopy(source, props, object) { - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - object[key] = source[key]; - } - return object; - } - - /** - * The base implementation of `_.callback` which supports specifying the - * number of arguments to provide to `func`. - * - * @private - * @param {*} [func=_.identity] The value to convert to a callback. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {number} [argCount] The number of arguments to provide to `func`. - * @returns {Function} Returns the callback. - */ - function baseCallback(func, thisArg, argCount) { - var type = typeof func; - if (type == 'function') { - return thisArg === undefined - ? func - : bindCallback(func, thisArg, argCount); - } - if (func == null) { - return identity; - } - if (type == 'object') { - return baseMatches(func); - } - return thisArg === undefined - ? property(func) - : baseMatchesProperty(func, thisArg); - } - - /** - * The base implementation of `_.clone` without support for argument juggling - * and `this` binding `customizer` functions. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @param {Function} [customizer] The function to customize cloning values. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The object `value` belongs to. - * @param {Array} [stackA=[]] Tracks traversed source objects. - * @param {Array} [stackB=[]] Associates clones with source counterparts. - * @returns {*} Returns the cloned value. - */ - function baseClone(value, isDeep, customizer, key, object, stackA, stackB) { - var result; - if (customizer) { - result = object ? customizer(value, key, object) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return arrayCopy(value, result); - } - } else { - var tag = objToString.call(value), - isFunc = tag == funcTag; - - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - result = initCloneObject(isFunc ? {} : value); - if (!isDeep) { - return baseAssign(result, value); - } - } else { - return cloneableTags[tag] - ? initCloneByTag(value, tag, isDeep) - : (object ? value : {}); - } - } - // Check for circular references and return its corresponding clone. - stackA || (stackA = []); - stackB || (stackB = []); - - var length = stackA.length; - while (length--) { - if (stackA[length] == value) { - return stackB[length]; - } - } - // Add the source value to the stack of traversed objects and associate it with its clone. - stackA.push(value); - stackB.push(result); - - // Recursively populate clone (susceptible to call stack limits). - (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) { - result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB); - }); - return result; - } - - /** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} prototype The object to inherit from. - * @returns {Object} Returns the new object. - */ - var baseCreate = (function() { - function object() {} - return function(prototype) { - if (isObject(prototype)) { - object.prototype = prototype; - var result = new object; - object.prototype = undefined; - } - return result || {}; - }; - }()); - - /** - * The base implementation of `_.delay` and `_.defer` which accepts an index - * of where to slice the arguments to provide to `func`. - * - * @private - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {Object} args The arguments provide to `func`. - * @returns {number} Returns the timer id. - */ - function baseDelay(func, wait, args) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return setTimeout(function() { func.apply(undefined, args); }, wait); - } - - /** - * The base implementation of `_.difference` which accepts a single array - * of values to exclude. - * - * @private - * @param {Array} array The array to inspect. - * @param {Array} values The values to exclude. - * @returns {Array} Returns the new array of filtered values. - */ - function baseDifference(array, values) { - var length = array ? array.length : 0, - result = []; - - if (!length) { - return result; - } - var index = -1, - indexOf = getIndexOf(), - isCommon = indexOf == baseIndexOf, - cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : null, - valuesLength = values.length; - - if (cache) { - indexOf = cacheIndexOf; - isCommon = false; - values = cache; - } - outer: - while (++index < length) { - var value = array[index]; - - if (isCommon && value === value) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values[valuesIndex] === value) { - continue outer; - } - } - result.push(value); - } - else if (indexOf(values, value, 0) < 0) { - result.push(value); - } - } - return result; - } - - /** - * The base implementation of `_.forEach` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object|string} Returns `collection`. - */ - var baseEach = createBaseEach(baseForOwn); - - /** - * The base implementation of `_.forEachRight` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object|string} Returns `collection`. - */ - var baseEachRight = createBaseEach(baseForOwnRight, true); - - /** - * The base implementation of `_.every` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false` - */ - function baseEvery(collection, predicate) { - var result = true; - baseEach(collection, function(value, index, collection) { - result = !!predicate(value, index, collection); - return result; - }); - return result; - } - - /** - * Gets the extremum value of `collection` invoking `iteratee` for each value - * in `collection` to generate the criterion by which the value is ranked. - * The `iteratee` is invoked with three arguments: (value, index|key, collection). - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} comparator The function used to compare values. - * @param {*} exValue The initial extremum value. - * @returns {*} Returns the extremum value. - */ - function baseExtremum(collection, iteratee, comparator, exValue) { - var computed = exValue, - result = computed; - - baseEach(collection, function(value, index, collection) { - var current = +iteratee(value, index, collection); - if (comparator(current, computed) || (current === exValue && current === result)) { - computed = current; - result = value; - } - }); - return result; - } - - /** - * The base implementation of `_.fill` without an iteratee call guard. - * - * @private - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - */ - function baseFill(array, value, start, end) { - var length = array.length; - - start = start == null ? 0 : (+start || 0); - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = (end === undefined || end > length) ? length : (+end || 0); - if (end < 0) { - end += length; - } - length = start > end ? 0 : (end >>> 0); - start >>>= 0; - - while (start < length) { - array[start++] = value; - } - return array; - } - - /** - * The base implementation of `_.filter` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function baseFilter(collection, predicate) { - var result = []; - baseEach(collection, function(value, index, collection) { - if (predicate(value, index, collection)) { - result.push(value); - } - }); - return result; - } - - /** - * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`, - * without support for callback shorthands and `this` binding, which iterates - * over `collection` using the provided `eachFunc`. - * - * @private - * @param {Array|Object|string} collection The collection to search. - * @param {Function} predicate The function invoked per iteration. - * @param {Function} eachFunc The function to iterate over `collection`. - * @param {boolean} [retKey] Specify returning the key of the found element - * instead of the element itself. - * @returns {*} Returns the found element or its key, else `undefined`. - */ - function baseFind(collection, predicate, eachFunc, retKey) { - var result; - eachFunc(collection, function(value, key, collection) { - if (predicate(value, key, collection)) { - result = retKey ? key : value; - return false; - } - }); - return result; - } - - /** - * The base implementation of `_.flatten` with added support for restricting - * flattening and specifying the start index. - * - * @private - * @param {Array} array The array to flatten. - * @param {boolean} [isDeep] Specify a deep flatten. - * @param {boolean} [isStrict] Restrict flattening to arrays-like objects. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. - */ - function baseFlatten(array, isDeep, isStrict, result) { - result || (result = []); - - var index = -1, - length = array.length; - - while (++index < length) { - var value = array[index]; - if (isObjectLike(value) && isArrayLike(value) && - (isStrict || isArray(value) || isArguments(value))) { - if (isDeep) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, isDeep, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; - } - - /** - * The base implementation of `baseForIn` and `baseForOwn` which iterates - * over `object` properties returned by `keysFunc` invoking `iteratee` for - * each property. Iteratee functions may exit iteration early by explicitly - * returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - var baseFor = createBaseFor(); - - /** - * This function is like `baseFor` except that it iterates over properties - * in the opposite order. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - var baseForRight = createBaseFor(true); - - /** - * The base implementation of `_.forIn` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForIn(object, iteratee) { - return baseFor(object, iteratee, keysIn); - } - - /** - * The base implementation of `_.forOwn` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwn(object, iteratee) { - return baseFor(object, iteratee, keys); - } - - /** - * The base implementation of `_.forOwnRight` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwnRight(object, iteratee) { - return baseForRight(object, iteratee, keys); - } - - /** - * The base implementation of `_.functions` which creates an array of - * `object` function property names filtered from those provided. - * - * @private - * @param {Object} object The object to inspect. - * @param {Array} props The property names to filter. - * @returns {Array} Returns the new array of filtered property names. - */ - function baseFunctions(object, props) { - var index = -1, - length = props.length, - resIndex = -1, - result = []; - - while (++index < length) { - var key = props[index]; - if (isFunction(object[key])) { - result[++resIndex] = key; - } - } - return result; - } - - /** - * The base implementation of `get` without support for string paths - * and default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array} path The path of the property to get. - * @param {string} [pathKey] The key representation of path. - * @returns {*} Returns the resolved value. - */ - function baseGet(object, path, pathKey) { - if (object == null) { - return; - } - if (pathKey !== undefined && pathKey in toObject(object)) { - path = [pathKey]; - } - var index = 0, - length = path.length; - - while (object != null && index < length) { - object = object[path[index++]]; - } - return (index && index == length) ? object : undefined; - } - - /** - * The base implementation of `_.isEqual` without support for `this` binding - * `customizer` functions. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparing values. - * @param {boolean} [isLoose] Specify performing partial comparisons. - * @param {Array} [stackA] Tracks traversed `value` objects. - * @param {Array} [stackB] Tracks traversed `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - */ - function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) { - if (value === other) { - return true; - } - if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { - return value !== value && other !== other; - } - return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB); - } - - /** - * A specialized version of `baseIsEqual` for arrays and objects which performs - * deep comparisons and tracks traversed objects enabling objects with circular - * references to be compared. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparing objects. - * @param {boolean} [isLoose] Specify performing partial comparisons. - * @param {Array} [stackA=[]] Tracks traversed `value` objects. - * @param {Array} [stackB=[]] Tracks traversed `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) { - var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = arrayTag, - othTag = arrayTag; - - if (!objIsArr) { - objTag = objToString.call(object); - if (objTag == argsTag) { - objTag = objectTag; - } else if (objTag != objectTag) { - objIsArr = isTypedArray(object); - } - } - if (!othIsArr) { - othTag = objToString.call(other); - if (othTag == argsTag) { - othTag = objectTag; - } else if (othTag != objectTag) { - othIsArr = isTypedArray(other); - } - } - var objIsObj = objTag == objectTag, - othIsObj = othTag == objectTag, - isSameTag = objTag == othTag; - - if (isSameTag && !(objIsArr || objIsObj)) { - return equalByTag(object, other, objTag); - } - if (!isLoose) { - var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), - othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - - if (objIsWrapped || othIsWrapped) { - return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB); - } - } - if (!isSameTag) { - return false; - } - // Assume cyclic values are equal. - // For more information on detecting circular references see https://es5.github.io/#JO. - stackA || (stackA = []); - stackB || (stackB = []); - - var length = stackA.length; - while (length--) { - if (stackA[length] == object) { - return stackB[length] == other; - } - } - // Add `object` and `other` to the stack of traversed objects. - stackA.push(object); - stackB.push(other); - - var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB); - - stackA.pop(); - stackB.pop(); - - return result; - } - - /** - * The base implementation of `_.isMatch` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Object} object The object to inspect. - * @param {Array} matchData The propery names, values, and compare flags to match. - * @param {Function} [customizer] The function to customize comparing objects. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - */ - function baseIsMatch(object, matchData, customizer) { - var index = matchData.length, - length = index, - noCustomizer = !customizer; - - if (object == null) { - return !length; - } - object = toObject(object); - while (index--) { - var data = matchData[index]; - if ((noCustomizer && data[2]) - ? data[1] !== object[data[0]] - : !(data[0] in object) - ) { - return false; - } - } - while (++index < length) { - data = matchData[index]; - var key = data[0], - objValue = object[key], - srcValue = data[1]; - - if (noCustomizer && data[2]) { - if (objValue === undefined && !(key in object)) { - return false; - } - } else { - var result = customizer ? customizer(objValue, srcValue, key) : undefined; - if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) { - return false; - } - } - } - return true; - } - - /** - * The base implementation of `_.map` without support for callback shorthands - * and `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function baseMap(collection, iteratee) { - var index = -1, - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value, key, collection) { - result[++index] = iteratee(value, key, collection); - }); - return result; - } - - /** - * The base implementation of `_.matches` which does not clone `source`. - * - * @private - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new function. - */ - function baseMatches(source) { - var matchData = getMatchData(source); - if (matchData.length == 1 && matchData[0][2]) { - var key = matchData[0][0], - value = matchData[0][1]; - - return function(object) { - if (object == null) { - return false; - } - return object[key] === value && (value !== undefined || (key in toObject(object))); - }; - } - return function(object) { - return baseIsMatch(object, matchData); - }; - } - - /** - * The base implementation of `_.matchesProperty` which does not clone `srcValue`. - * - * @private - * @param {string} path The path of the property to get. - * @param {*} srcValue The value to compare. - * @returns {Function} Returns the new function. - */ - function baseMatchesProperty(path, srcValue) { - var isArr = isArray(path), - isCommon = isKey(path) && isStrictComparable(srcValue), - pathKey = (path + ''); - - path = toPath(path); - return function(object) { - if (object == null) { - return false; - } - var key = pathKey; - object = toObject(object); - if ((isArr || !isCommon) && !(key in object)) { - object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); - if (object == null) { - return false; - } - key = last(path); - object = toObject(object); - } - return object[key] === srcValue - ? (srcValue !== undefined || (key in object)) - : baseIsEqual(srcValue, object[key], undefined, true); - }; - } - - /** - * The base implementation of `_.merge` without support for argument juggling, - * multiple sources, and `this` binding `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {Function} [customizer] The function to customize merged values. - * @param {Array} [stackA=[]] Tracks traversed source objects. - * @param {Array} [stackB=[]] Associates values with source counterparts. - * @returns {Object} Returns `object`. - */ - function baseMerge(object, source, customizer, stackA, stackB) { - if (!isObject(object)) { - return object; - } - var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)), - props = isSrcArr ? undefined : keys(source); - - arrayEach(props || source, function(srcValue, key) { - if (props) { - key = srcValue; - srcValue = source[key]; - } - if (isObjectLike(srcValue)) { - stackA || (stackA = []); - stackB || (stackB = []); - baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB); - } - else { - var value = object[key], - result = customizer ? customizer(value, srcValue, key, object, source) : undefined, - isCommon = result === undefined; - - if (isCommon) { - result = srcValue; - } - if ((result !== undefined || (isSrcArr && !(key in object))) && - (isCommon || (result === result ? (result !== value) : (value === value)))) { - object[key] = result; - } - } - }); - return object; - } - - /** - * A specialized version of `baseMerge` for arrays and objects which performs - * deep merges and tracks traversed objects enabling objects with circular - * references to be merged. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {string} key The key of the value to merge. - * @param {Function} mergeFunc The function to merge values. - * @param {Function} [customizer] The function to customize merged values. - * @param {Array} [stackA=[]] Tracks traversed source objects. - * @param {Array} [stackB=[]] Associates values with source counterparts. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) { - var length = stackA.length, - srcValue = source[key]; - - while (length--) { - if (stackA[length] == srcValue) { - object[key] = stackB[length]; - return; - } - } - var value = object[key], - result = customizer ? customizer(value, srcValue, key, object, source) : undefined, - isCommon = result === undefined; - - if (isCommon) { - result = srcValue; - if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) { - result = isArray(value) - ? value - : (isArrayLike(value) ? arrayCopy(value) : []); - } - else if (isPlainObject(srcValue) || isArguments(srcValue)) { - result = isArguments(value) - ? toPlainObject(value) - : (isPlainObject(value) ? value : {}); - } - else { - isCommon = false; - } - } - // Add the source value to the stack of traversed objects and associate - // it with its merged value. - stackA.push(srcValue); - stackB.push(result); - - if (isCommon) { - // Recursively merge objects and arrays (susceptible to call stack limits). - object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB); - } else if (result === result ? (result !== value) : (value === value)) { - object[key] = result; - } - } - - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ - function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; - } - - /** - * A specialized version of `baseProperty` which supports deep paths. - * - * @private - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new function. - */ - function basePropertyDeep(path) { - var pathKey = (path + ''); - path = toPath(path); - return function(object) { - return baseGet(object, path, pathKey); - }; - } - - /** - * The base implementation of `_.pullAt` without support for individual - * index arguments and capturing the removed elements. - * - * @private - * @param {Array} array The array to modify. - * @param {number[]} indexes The indexes of elements to remove. - * @returns {Array} Returns `array`. - */ - function basePullAt(array, indexes) { - var length = array ? indexes.length : 0; - while (length--) { - var index = indexes[length]; - if (index != previous && isIndex(index)) { - var previous = index; - splice.call(array, index, 1); - } - } - return array; - } - - /** - * The base implementation of `_.random` without support for argument juggling - * and returning floating-point numbers. - * - * @private - * @param {number} min The minimum possible value. - * @param {number} max The maximum possible value. - * @returns {number} Returns the random number. - */ - function baseRandom(min, max) { - return min + nativeFloor(nativeRandom() * (max - min + 1)); - } - - /** - * The base implementation of `_.reduce` and `_.reduceRight` without support - * for callback shorthands and `this` binding, which iterates over `collection` - * using the provided `eachFunc`. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} accumulator The initial value. - * @param {boolean} initFromCollection Specify using the first or last element - * of `collection` as the initial value. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the accumulated value. - */ - function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) { - eachFunc(collection, function(value, index, collection) { - accumulator = initFromCollection - ? (initFromCollection = false, value) - : iteratee(accumulator, value, index, collection); - }); - return accumulator; - } - - /** - * The base implementation of `setData` without support for hot loop detection. - * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. - */ - var baseSetData = !metaMap ? identity : function(func, data) { - metaMap.set(func, data); - return func; - }; - - /** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - start = start == null ? 0 : (+start || 0); - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = (end === undefined || end > length) ? length : (+end || 0); - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; - } - - /** - * The base implementation of `_.some` without support for callback shorthands - * and `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ - function baseSome(collection, predicate) { - var result; - - baseEach(collection, function(value, index, collection) { - result = predicate(value, index, collection); - return !result; - }); - return !!result; - } - - /** - * The base implementation of `_.sortBy` which uses `comparer` to define - * the sort order of `array` and replaces criteria objects with their - * corresponding values. - * - * @private - * @param {Array} array The array to sort. - * @param {Function} comparer The function to define sort order. - * @returns {Array} Returns `array`. - */ - function baseSortBy(array, comparer) { - var length = array.length; - - array.sort(comparer); - while (length--) { - array[length] = array[length].value; - } - return array; - } - - /** - * The base implementation of `_.sortByOrder` without param guards. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. - * @param {boolean[]} orders The sort orders of `iteratees`. - * @returns {Array} Returns the new sorted array. - */ - function baseSortByOrder(collection, iteratees, orders) { - var callback = getCallback(), - index = -1; - - iteratees = arrayMap(iteratees, function(iteratee) { return callback(iteratee); }); - - var result = baseMap(collection, function(value) { - var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); }); - return { 'criteria': criteria, 'index': ++index, 'value': value }; - }); - - return baseSortBy(result, function(object, other) { - return compareMultiple(object, other, orders); - }); - } - - /** - * The base implementation of `_.sum` without support for callback shorthands - * and `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {number} Returns the sum. - */ - function baseSum(collection, iteratee) { - var result = 0; - baseEach(collection, function(value, index, collection) { - result += +iteratee(value, index, collection) || 0; - }); - return result; - } - - /** - * The base implementation of `_.uniq` without support for callback shorthands - * and `this` binding. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The function invoked per iteration. - * @returns {Array} Returns the new duplicate-value-free array. - */ - function baseUniq(array, iteratee) { - var index = -1, - indexOf = getIndexOf(), - length = array.length, - isCommon = indexOf == baseIndexOf, - isLarge = isCommon && length >= LARGE_ARRAY_SIZE, - seen = isLarge ? createCache() : null, - result = []; - - if (seen) { - indexOf = cacheIndexOf; - isCommon = false; - } else { - isLarge = false; - seen = iteratee ? [] : result; - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value, index, array) : value; - - if (isCommon && value === value) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee) { - seen.push(computed); - } - result.push(value); - } - else if (indexOf(seen, computed, 0) < 0) { - if (iteratee || isLarge) { - seen.push(computed); - } - result.push(value); - } - } - return result; - } - - /** - * The base implementation of `_.values` and `_.valuesIn` which creates an - * array of `object` property values corresponding to the property names - * of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the array of property values. - */ - function baseValues(object, props) { - var index = -1, - length = props.length, - result = Array(length); - - while (++index < length) { - result[index] = object[props[index]]; - } - return result; - } - - /** - * The base implementation of `_.dropRightWhile`, `_.dropWhile`, `_.takeRightWhile`, - * and `_.takeWhile` without support for callback shorthands and `this` binding. - * - * @private - * @param {Array} array The array to query. - * @param {Function} predicate The function invoked per iteration. - * @param {boolean} [isDrop] Specify dropping elements instead of taking them. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the slice of `array`. - */ - function baseWhile(array, predicate, isDrop, fromRight) { - var length = array.length, - index = fromRight ? length : -1; - - while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {} - return isDrop - ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) - : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); - } - - /** - * The base implementation of `wrapperValue` which returns the result of - * performing a sequence of actions on the unwrapped `value`, where each - * successive action is supplied the return value of the previous. - * - * @private - * @param {*} value The unwrapped value. - * @param {Array} actions Actions to peform to resolve the unwrapped value. - * @returns {*} Returns the resolved value. - */ - function baseWrapperValue(value, actions) { - var result = value; - if (result instanceof LazyWrapper) { - result = result.value(); - } - var index = -1, - length = actions.length; - - while (++index < length) { - var action = actions[index]; - result = action.func.apply(action.thisArg, arrayPush([result], action.args)); - } - return result; - } - - /** - * Performs a binary search of `array` to determine the index at which `value` - * should be inserted into `array` in order to maintain its sort order. - * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - */ - function binaryIndex(array, value, retHighest) { - var low = 0, - high = array ? array.length : low; - - if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { - while (low < high) { - var mid = (low + high) >>> 1, - computed = array[mid]; - - if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) { - low = mid + 1; - } else { - high = mid; - } - } - return high; - } - return binaryIndexBy(array, value, identity, retHighest); - } - - /** - * This function is like `binaryIndex` except that it invokes `iteratee` for - * `value` and each element of `array` to compute their sort ranking. The - * iteratee is invoked with one argument; (value). - * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} iteratee The function invoked per iteration. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - */ - function binaryIndexBy(array, value, iteratee, retHighest) { - value = iteratee(value); - - var low = 0, - high = array ? array.length : 0, - valIsNaN = value !== value, - valIsNull = value === null, - valIsUndef = value === undefined; - - while (low < high) { - var mid = nativeFloor((low + high) / 2), - computed = iteratee(array[mid]), - isDef = computed !== undefined, - isReflexive = computed === computed; - - if (valIsNaN) { - var setLow = isReflexive || retHighest; - } else if (valIsNull) { - setLow = isReflexive && isDef && (retHighest || computed != null); - } else if (valIsUndef) { - setLow = isReflexive && (retHighest || isDef); - } else if (computed == null) { - setLow = false; - } else { - setLow = retHighest ? (computed <= value) : (computed < value); - } - if (setLow) { - low = mid + 1; - } else { - high = mid; - } - } - return nativeMin(high, MAX_ARRAY_INDEX); - } - - /** - * A specialized version of `baseCallback` which only supports `this` binding - * and specifying the number of arguments to provide to `func`. - * - * @private - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {number} [argCount] The number of arguments to provide to `func`. - * @returns {Function} Returns the callback. - */ - function bindCallback(func, thisArg, argCount) { - if (typeof func != 'function') { - return identity; - } - if (thisArg === undefined) { - return func; - } - switch (argCount) { - case 1: return function(value) { - return func.call(thisArg, value); - }; - case 3: return function(value, index, collection) { - return func.call(thisArg, value, index, collection); - }; - case 4: return function(accumulator, value, index, collection) { - return func.call(thisArg, accumulator, value, index, collection); - }; - case 5: return function(value, other, key, object, source) { - return func.call(thisArg, value, other, key, object, source); - }; - } - return function() { - return func.apply(thisArg, arguments); - }; - } - - /** - * Creates a clone of the given array buffer. - * - * @private - * @param {ArrayBuffer} buffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ - function bufferClone(buffer) { - var result = new ArrayBuffer(buffer.byteLength), - view = new Uint8Array(result); - - view.set(new Uint8Array(buffer)); - return result; - } - - /** - * Creates an array that is the composition of partially applied arguments, - * placeholders, and provided arguments into a single array of arguments. - * - * @private - * @param {Array|Object} args The provided arguments. - * @param {Array} partials The arguments to prepend to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @returns {Array} Returns the new array of composed arguments. - */ - function composeArgs(args, partials, holders) { - var holdersLength = holders.length, - argsIndex = -1, - argsLength = nativeMax(args.length - holdersLength, 0), - leftIndex = -1, - leftLength = partials.length, - result = Array(leftLength + argsLength); - - while (++leftIndex < leftLength) { - result[leftIndex] = partials[leftIndex]; - } - while (++argsIndex < holdersLength) { - result[holders[argsIndex]] = args[argsIndex]; - } - while (argsLength--) { - result[leftIndex++] = args[argsIndex++]; - } - return result; - } - - /** - * This function is like `composeArgs` except that the arguments composition - * is tailored for `_.partialRight`. - * - * @private - * @param {Array|Object} args The provided arguments. - * @param {Array} partials The arguments to append to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @returns {Array} Returns the new array of composed arguments. - */ - function composeArgsRight(args, partials, holders) { - var holdersIndex = -1, - holdersLength = holders.length, - argsIndex = -1, - argsLength = nativeMax(args.length - holdersLength, 0), - rightIndex = -1, - rightLength = partials.length, - result = Array(argsLength + rightLength); - - while (++argsIndex < argsLength) { - result[argsIndex] = args[argsIndex]; - } - var offset = argsIndex; - while (++rightIndex < rightLength) { - result[offset + rightIndex] = partials[rightIndex]; - } - while (++holdersIndex < holdersLength) { - result[offset + holders[holdersIndex]] = args[argsIndex++]; - } - return result; - } - - /** - * Creates a `_.countBy`, `_.groupBy`, `_.indexBy`, or `_.partition` function. - * - * @private - * @param {Function} setter The function to set keys and values of the accumulator object. - * @param {Function} [initializer] The function to initialize the accumulator object. - * @returns {Function} Returns the new aggregator function. - */ - function createAggregator(setter, initializer) { - return function(collection, iteratee, thisArg) { - var result = initializer ? initializer() : {}; - iteratee = getCallback(iteratee, thisArg, 3); - - if (isArray(collection)) { - var index = -1, - length = collection.length; - - while (++index < length) { - var value = collection[index]; - setter(result, value, iteratee(value, index, collection), collection); - } - } else { - baseEach(collection, function(value, key, collection) { - setter(result, value, iteratee(value, key, collection), collection); - }); - } - return result; - }; - } - - /** - * Creates a `_.assign`, `_.defaults`, or `_.merge` function. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ - function createAssigner(assigner) { - return restParam(function(object, sources) { - var index = -1, - length = object == null ? 0 : sources.length, - customizer = length > 2 ? sources[length - 2] : undefined, - guard = length > 2 ? sources[2] : undefined, - thisArg = length > 1 ? sources[length - 1] : undefined; - - if (typeof customizer == 'function') { - customizer = bindCallback(customizer, thisArg, 5); - length -= 2; - } else { - customizer = typeof thisArg == 'function' ? thisArg : undefined; - length -= (customizer ? 1 : 0); - } - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, customizer); - } - } - return object; - }); - } - - /** - * Creates a `baseEach` or `baseEachRight` function. - * - * @private - * @param {Function} eachFunc The function to iterate over a collection. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee) { - var length = collection ? getLength(collection) : 0; - if (!isLength(length)) { - return eachFunc(collection, iteratee); - } - var index = fromRight ? length : -1, - iterable = toObject(collection); - - while ((fromRight ? index-- : ++index < length)) { - if (iteratee(iterable[index], index, iterable) === false) { - break; - } - } - return collection; - }; - } - - /** - * Creates a base function for `_.forIn` or `_.forInRight`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var iterable = toObject(object), - props = keysFunc(object), - length = props.length, - index = fromRight ? length : -1; - - while ((fromRight ? index-- : ++index < length)) { - var key = props[index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; - } - - /** - * Creates a function that wraps `func` and invokes it with the `this` - * binding of `thisArg`. - * - * @private - * @param {Function} func The function to bind. - * @param {*} [thisArg] The `this` binding of `func`. - * @returns {Function} Returns the new bound function. - */ - function createBindWrapper(func, thisArg) { - var Ctor = createCtorWrapper(func); - - function wrapper() { - var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - return fn.apply(thisArg, arguments); - } - return wrapper; - } - - /** - * Creates a `Set` cache object to optimize linear searches of large arrays. - * - * @private - * @param {Array} [values] The values to cache. - * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`. - */ - function createCache(values) { - return (nativeCreate && Set) ? new SetCache(values) : null; - } - - /** - * Creates a function that produces compound words out of the words in a - * given string. - * - * @private - * @param {Function} callback The function to combine each word. - * @returns {Function} Returns the new compounder function. - */ - function createCompounder(callback) { - return function(string) { - var index = -1, - array = words(deburr(string)), - length = array.length, - result = ''; - - while (++index < length) { - result = callback(result, array[index], index); - } - return result; - }; - } - - /** - * Creates a function that produces an instance of `Ctor` regardless of - * whether it was invoked as part of a `new` expression or by `call` or `apply`. - * - * @private - * @param {Function} Ctor The constructor to wrap. - * @returns {Function} Returns the new wrapped function. - */ - function createCtorWrapper(Ctor) { - return function() { - // Use a `switch` statement to work with class constructors. - // See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist - // for more details. - var args = arguments; - switch (args.length) { - case 0: return new Ctor; - case 1: return new Ctor(args[0]); - case 2: return new Ctor(args[0], args[1]); - case 3: return new Ctor(args[0], args[1], args[2]); - case 4: return new Ctor(args[0], args[1], args[2], args[3]); - case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); - case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); - case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); - } - var thisBinding = baseCreate(Ctor.prototype), - result = Ctor.apply(thisBinding, args); - - // Mimic the constructor's `return` behavior. - // See https://es5.github.io/#x13.2.2 for more details. - return isObject(result) ? result : thisBinding; - }; - } - - /** - * Creates a `_.curry` or `_.curryRight` function. - * - * @private - * @param {boolean} flag The curry bit flag. - * @returns {Function} Returns the new curry function. - */ - function createCurry(flag) { - function curryFunc(func, arity, guard) { - if (guard && isIterateeCall(func, arity, guard)) { - arity = undefined; - } - var result = createWrapper(func, flag, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = curryFunc.placeholder; - return result; - } - return curryFunc; - } - - /** - * Creates a `_.defaults` or `_.defaultsDeep` function. - * - * @private - * @param {Function} assigner The function to assign values. - * @param {Function} customizer The function to customize assigned values. - * @returns {Function} Returns the new defaults function. - */ - function createDefaults(assigner, customizer) { - return restParam(function(args) { - var object = args[0]; - if (object == null) { - return object; - } - args.push(customizer); - return assigner.apply(undefined, args); - }); - } - - /** - * Creates a `_.max` or `_.min` function. - * - * @private - * @param {Function} comparator The function used to compare values. - * @param {*} exValue The initial extremum value. - * @returns {Function} Returns the new extremum function. - */ - function createExtremum(comparator, exValue) { - return function(collection, iteratee, thisArg) { - if (thisArg && isIterateeCall(collection, iteratee, thisArg)) { - iteratee = undefined; - } - iteratee = getCallback(iteratee, thisArg, 3); - if (iteratee.length == 1) { - collection = isArray(collection) ? collection : toIterable(collection); - var result = arrayExtremum(collection, iteratee, comparator, exValue); - if (!(collection.length && result === exValue)) { - return result; - } - } - return baseExtremum(collection, iteratee, comparator, exValue); - }; - } - - /** - * Creates a `_.find` or `_.findLast` function. - * - * @private - * @param {Function} eachFunc The function to iterate over a collection. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new find function. - */ - function createFind(eachFunc, fromRight) { - return function(collection, predicate, thisArg) { - predicate = getCallback(predicate, thisArg, 3); - if (isArray(collection)) { - var index = baseFindIndex(collection, predicate, fromRight); - return index > -1 ? collection[index] : undefined; - } - return baseFind(collection, predicate, eachFunc); - }; - } - - /** - * Creates a `_.findIndex` or `_.findLastIndex` function. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new find function. - */ - function createFindIndex(fromRight) { - return function(array, predicate, thisArg) { - if (!(array && array.length)) { - return -1; - } - predicate = getCallback(predicate, thisArg, 3); - return baseFindIndex(array, predicate, fromRight); - }; - } - - /** - * Creates a `_.findKey` or `_.findLastKey` function. - * - * @private - * @param {Function} objectFunc The function to iterate over an object. - * @returns {Function} Returns the new find function. - */ - function createFindKey(objectFunc) { - return function(object, predicate, thisArg) { - predicate = getCallback(predicate, thisArg, 3); - return baseFind(object, predicate, objectFunc, true); - }; - } - - /** - * Creates a `_.flow` or `_.flowRight` function. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new flow function. - */ - function createFlow(fromRight) { - return function() { - var wrapper, - length = arguments.length, - index = fromRight ? length : -1, - leftIndex = 0, - funcs = Array(length); - - while ((fromRight ? index-- : ++index < length)) { - var func = funcs[leftIndex++] = arguments[index]; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (!wrapper && LodashWrapper.prototype.thru && getFuncName(func) == 'wrapper') { - wrapper = new LodashWrapper([], true); - } - } - index = wrapper ? -1 : length; - while (++index < length) { - func = funcs[index]; - - var funcName = getFuncName(func), - data = funcName == 'wrapper' ? getData(func) : undefined; - - if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) { - wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); - } else { - wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func); - } - } - return function() { - var args = arguments, - value = args[0]; - - if (wrapper && args.length == 1 && isArray(value) && value.length >= LARGE_ARRAY_SIZE) { - return wrapper.plant(value).value(); - } - var index = 0, - result = length ? funcs[index].apply(this, args) : value; - - while (++index < length) { - result = funcs[index].call(this, result); - } - return result; - }; - }; - } - - /** - * Creates a function for `_.forEach` or `_.forEachRight`. - * - * @private - * @param {Function} arrayFunc The function to iterate over an array. - * @param {Function} eachFunc The function to iterate over a collection. - * @returns {Function} Returns the new each function. - */ - function createForEach(arrayFunc, eachFunc) { - return function(collection, iteratee, thisArg) { - return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) - ? arrayFunc(collection, iteratee) - : eachFunc(collection, bindCallback(iteratee, thisArg, 3)); - }; - } - - /** - * Creates a function for `_.forIn` or `_.forInRight`. - * - * @private - * @param {Function} objectFunc The function to iterate over an object. - * @returns {Function} Returns the new each function. - */ - function createForIn(objectFunc) { - return function(object, iteratee, thisArg) { - if (typeof iteratee != 'function' || thisArg !== undefined) { - iteratee = bindCallback(iteratee, thisArg, 3); - } - return objectFunc(object, iteratee, keysIn); - }; - } - - /** - * Creates a function for `_.forOwn` or `_.forOwnRight`. - * - * @private - * @param {Function} objectFunc The function to iterate over an object. - * @returns {Function} Returns the new each function. - */ - function createForOwn(objectFunc) { - return function(object, iteratee, thisArg) { - if (typeof iteratee != 'function' || thisArg !== undefined) { - iteratee = bindCallback(iteratee, thisArg, 3); - } - return objectFunc(object, iteratee); - }; - } - - /** - * Creates a function for `_.mapKeys` or `_.mapValues`. - * - * @private - * @param {boolean} [isMapKeys] Specify mapping keys instead of values. - * @returns {Function} Returns the new map function. - */ - function createObjectMapper(isMapKeys) { - return function(object, iteratee, thisArg) { - var result = {}; - iteratee = getCallback(iteratee, thisArg, 3); - - baseForOwn(object, function(value, key, object) { - var mapped = iteratee(value, key, object); - key = isMapKeys ? mapped : key; - value = isMapKeys ? value : mapped; - result[key] = value; - }); - return result; - }; - } - - /** - * Creates a function for `_.padLeft` or `_.padRight`. - * - * @private - * @param {boolean} [fromRight] Specify padding from the right. - * @returns {Function} Returns the new pad function. - */ - function createPadDir(fromRight) { - return function(string, length, chars) { - string = baseToString(string); - return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string); - }; - } - - /** - * Creates a `_.partial` or `_.partialRight` function. - * - * @private - * @param {boolean} flag The partial bit flag. - * @returns {Function} Returns the new partial function. - */ - function createPartial(flag) { - var partialFunc = restParam(function(func, partials) { - var holders = replaceHolders(partials, partialFunc.placeholder); - return createWrapper(func, flag, undefined, partials, holders); - }); - return partialFunc; - } - - /** - * Creates a function for `_.reduce` or `_.reduceRight`. - * - * @private - * @param {Function} arrayFunc The function to iterate over an array. - * @param {Function} eachFunc The function to iterate over a collection. - * @returns {Function} Returns the new each function. - */ - function createReduce(arrayFunc, eachFunc) { - return function(collection, iteratee, accumulator, thisArg) { - var initFromArray = arguments.length < 3; - return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) - ? arrayFunc(collection, iteratee, accumulator, initFromArray) - : baseReduce(collection, getCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc); - }; - } - - /** - * Creates a function that wraps `func` and invokes it with optional `this` - * binding of, partial application, and currying. - * - * @private - * @param {Function|string} func The function or method name to reference. - * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to the new function. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [partialsRight] The arguments to append to those provided to the new function. - * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { - var isAry = bitmask & ARY_FLAG, - isBind = bitmask & BIND_FLAG, - isBindKey = bitmask & BIND_KEY_FLAG, - isCurry = bitmask & CURRY_FLAG, - isCurryBound = bitmask & CURRY_BOUND_FLAG, - isCurryRight = bitmask & CURRY_RIGHT_FLAG, - Ctor = isBindKey ? undefined : createCtorWrapper(func); - - function wrapper() { - // Avoid `arguments` object use disqualifying optimizations by - // converting it to an array before providing it to other functions. - var length = arguments.length, - index = length, - args = Array(length); - - while (index--) { - args[index] = arguments[index]; - } - if (partials) { - args = composeArgs(args, partials, holders); - } - if (partialsRight) { - args = composeArgsRight(args, partialsRight, holdersRight); - } - if (isCurry || isCurryRight) { - var placeholder = wrapper.placeholder, - argsHolders = replaceHolders(args, placeholder); - - length -= argsHolders.length; - if (length < arity) { - var newArgPos = argPos ? arrayCopy(argPos) : undefined, - newArity = nativeMax(arity - length, 0), - newsHolders = isCurry ? argsHolders : undefined, - newHoldersRight = isCurry ? undefined : argsHolders, - newPartials = isCurry ? args : undefined, - newPartialsRight = isCurry ? undefined : args; - - bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG); - bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG); - - if (!isCurryBound) { - bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); - } - var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity], - result = createHybridWrapper.apply(undefined, newData); - - if (isLaziable(func)) { - setData(result, newData); - } - result.placeholder = placeholder; - return result; - } - } - var thisBinding = isBind ? thisArg : this, - fn = isBindKey ? thisBinding[func] : func; - - if (argPos) { - args = reorder(args, argPos); - } - if (isAry && ary < args.length) { - args.length = ary; - } - if (this && this !== root && this instanceof wrapper) { - fn = Ctor || createCtorWrapper(func); - } - return fn.apply(thisBinding, args); - } - return wrapper; - } - - /** - * Creates the padding required for `string` based on the given `length`. - * The `chars` string is truncated if the number of characters exceeds `length`. - * - * @private - * @param {string} string The string to create padding for. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the pad for `string`. - */ - function createPadding(string, length, chars) { - var strLength = string.length; - length = +length; - - if (strLength >= length || !nativeIsFinite(length)) { - return ''; - } - var padLength = length - strLength; - chars = chars == null ? ' ' : (chars + ''); - return repeat(chars, nativeCeil(padLength / chars.length)).slice(0, padLength); - } - - /** - * Creates a function that wraps `func` and invokes it with the optional `this` - * binding of `thisArg` and the `partials` prepended to those provided to - * the wrapper. - * - * @private - * @param {Function} func The function to partially apply arguments to. - * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} partials The arguments to prepend to those provided to the new function. - * @returns {Function} Returns the new bound function. - */ - function createPartialWrapper(func, bitmask, thisArg, partials) { - var isBind = bitmask & BIND_FLAG, - Ctor = createCtorWrapper(func); - - function wrapper() { - // Avoid `arguments` object use disqualifying optimizations by - // converting it to an array before providing it `func`. - var argsIndex = -1, - argsLength = arguments.length, - leftIndex = -1, - leftLength = partials.length, - args = Array(leftLength + argsLength); - - while (++leftIndex < leftLength) { - args[leftIndex] = partials[leftIndex]; - } - while (argsLength--) { - args[leftIndex++] = arguments[++argsIndex]; - } - var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - return fn.apply(isBind ? thisArg : this, args); - } - return wrapper; - } - - /** - * Creates a `_.ceil`, `_.floor`, or `_.round` function. - * - * @private - * @param {string} methodName The name of the `Math` method to use when rounding. - * @returns {Function} Returns the new round function. - */ - function createRound(methodName) { - var func = Math[methodName]; - return function(number, precision) { - precision = precision === undefined ? 0 : (+precision || 0); - if (precision) { - precision = pow(10, precision); - return func(number * precision) / precision; - } - return func(number); - }; - } - - /** - * Creates a `_.sortedIndex` or `_.sortedLastIndex` function. - * - * @private - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {Function} Returns the new index function. - */ - function createSortedIndex(retHighest) { - return function(array, value, iteratee, thisArg) { - var callback = getCallback(iteratee); - return (iteratee == null && callback === baseCallback) - ? binaryIndex(array, value, retHighest) - : binaryIndexBy(array, value, callback(iteratee, thisArg, 1), retHighest); - }; - } - - /** - * Creates a function that either curries or invokes `func` with optional - * `this` binding and partially applied arguments. - * - * @private - * @param {Function|string} func The function or method name to reference. - * @param {number} bitmask The bitmask of flags. - * The bitmask may be composed of the following flags: - * 1 - `_.bind` - * 2 - `_.bindKey` - * 4 - `_.curry` or `_.curryRight` of a bound function - * 8 - `_.curry` - * 16 - `_.curryRight` - * 32 - `_.partial` - * 64 - `_.partialRight` - * 128 - `_.rearg` - * 256 - `_.ary` - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to be partially applied. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { - var isBindKey = bitmask & BIND_KEY_FLAG; - if (!isBindKey && typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - var length = partials ? partials.length : 0; - if (!length) { - bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG); - partials = holders = undefined; - } - length -= (holders ? holders.length : 0); - if (bitmask & PARTIAL_RIGHT_FLAG) { - var partialsRight = partials, - holdersRight = holders; - - partials = holders = undefined; - } - var data = isBindKey ? undefined : getData(func), - newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity]; - - if (data) { - mergeData(newData, data); - bitmask = newData[1]; - arity = newData[9]; - } - newData[9] = arity == null - ? (isBindKey ? 0 : func.length) - : (nativeMax(arity - length, 0) || 0); - - if (bitmask == BIND_FLAG) { - var result = createBindWrapper(newData[0], newData[2]); - } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) { - result = createPartialWrapper.apply(undefined, newData); - } else { - result = createHybridWrapper.apply(undefined, newData); - } - var setter = data ? baseSetData : setData; - return setter(result, newData); - } - - /** - * A specialized version of `baseIsEqualDeep` for arrays with support for - * partial deep comparisons. - * - * @private - * @param {Array} array The array to compare. - * @param {Array} other The other array to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparing arrays. - * @param {boolean} [isLoose] Specify performing partial comparisons. - * @param {Array} [stackA] Tracks traversed `value` objects. - * @param {Array} [stackB] Tracks traversed `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. - */ - function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) { - var index = -1, - arrLength = array.length, - othLength = other.length; - - if (arrLength != othLength && !(isLoose && othLength > arrLength)) { - return false; - } - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index], - result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined; - - if (result !== undefined) { - if (result) { - continue; - } - return false; - } - // Recursively compare arrays (susceptible to call stack limits). - if (isLoose) { - if (!arraySome(other, function(othValue) { - return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB); - })) { - return false; - } - } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) { - return false; - } - } - return true; - } - - /** - * A specialized version of `baseIsEqualDeep` for comparing objects of - * the same `toStringTag`. - * - * **Note:** This function only supports comparing values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {string} tag The `toStringTag` of the objects to compare. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalByTag(object, other, tag) { - switch (tag) { - case boolTag: - case dateTag: - // Coerce dates and booleans to numbers, dates to milliseconds and booleans - // to `1` or `0` treating invalid dates coerced to `NaN` as not equal. - return +object == +other; - - case errorTag: - return object.name == other.name && object.message == other.message; - - case numberTag: - // Treat `NaN` vs. `NaN` as equal. - return (object != +object) - ? other != +other - : object == +other; - - case regexpTag: - case stringTag: - // Coerce regexes to strings and treat strings primitives and string - // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details. - return object == (other + ''); - } - return false; - } - - /** - * A specialized version of `baseIsEqualDeep` for objects with support for - * partial deep comparisons. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparing values. - * @param {boolean} [isLoose] Specify performing partial comparisons. - * @param {Array} [stackA] Tracks traversed `value` objects. - * @param {Array} [stackB] Tracks traversed `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) { - var objProps = keys(object), - objLength = objProps.length, - othProps = keys(other), - othLength = othProps.length; - - if (objLength != othLength && !isLoose) { - return false; - } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) { - return false; - } - } - var skipCtor = isLoose; - while (++index < objLength) { - key = objProps[index]; - var objValue = object[key], - othValue = other[key], - result = customizer ? customizer(isLoose ? othValue : objValue, isLoose? objValue : othValue, key) : undefined; - - // Recursively compare objects (susceptible to call stack limits). - if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) { - return false; - } - skipCtor || (skipCtor = key == 'constructor'); - } - if (!skipCtor) { - var objCtor = object.constructor, - othCtor = other.constructor; - - // Non `Object` object instances with different constructors are not equal. - if (objCtor != othCtor && - ('constructor' in object && 'constructor' in other) && - !(typeof objCtor == 'function' && objCtor instanceof objCtor && - typeof othCtor == 'function' && othCtor instanceof othCtor)) { - return false; - } - } - return true; - } - - /** - * Gets the appropriate "callback" function. If the `_.callback` method is - * customized this function returns the custom method, otherwise it returns - * the `baseCallback` function. If arguments are provided the chosen function - * is invoked with them and its result is returned. - * - * @private - * @returns {Function} Returns the chosen function or its result. - */ - function getCallback(func, thisArg, argCount) { - var result = lodash.callback || callback; - result = result === callback ? baseCallback : result; - return argCount ? result(func, thisArg, argCount) : result; - } - - /** - * Gets metadata for `func`. - * - * @private - * @param {Function} func The function to query. - * @returns {*} Returns the metadata for `func`. - */ - var getData = !metaMap ? noop : function(func) { - return metaMap.get(func); - }; - - /** - * Gets the name of `func`. - * - * @private - * @param {Function} func The function to query. - * @returns {string} Returns the function name. - */ - function getFuncName(func) { - var result = func.name, - array = realNames[result], - length = array ? array.length : 0; - - while (length--) { - var data = array[length], - otherFunc = data.func; - if (otherFunc == null || otherFunc == func) { - return data.name; - } - } - return result; - } - - /** - * Gets the appropriate "indexOf" function. If the `_.indexOf` method is - * customized this function returns the custom method, otherwise it returns - * the `baseIndexOf` function. If arguments are provided the chosen function - * is invoked with them and its result is returned. - * - * @private - * @returns {Function|number} Returns the chosen function or its result. - */ - function getIndexOf(collection, target, fromIndex) { - var result = lodash.indexOf || indexOf; - result = result === indexOf ? baseIndexOf : result; - return collection ? result(collection, target, fromIndex) : result; - } - - /** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ - var getLength = baseProperty('length'); - - /** - * Gets the propery names, values, and compare flags of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the match data of `object`. - */ - function getMatchData(object) { - var result = pairs(object), - length = result.length; - - while (length--) { - result[length][2] = isStrictComparable(result[length][1]); - } - return result; - } - - /** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ - function getNative(object, key) { - var value = object == null ? undefined : object[key]; - return isNative(value) ? value : undefined; - } - - /** - * Gets the view, applying any `transforms` to the `start` and `end` positions. - * - * @private - * @param {number} start The start of the view. - * @param {number} end The end of the view. - * @param {Array} transforms The transformations to apply to the view. - * @returns {Object} Returns an object containing the `start` and `end` - * positions of the view. - */ - function getView(start, end, transforms) { - var index = -1, - length = transforms.length; - - while (++index < length) { - var data = transforms[index], - size = data.size; - - switch (data.type) { - case 'drop': start += size; break; - case 'dropRight': end -= size; break; - case 'take': end = nativeMin(end, start + size); break; - case 'takeRight': start = nativeMax(start, end - size); break; - } - } - return { 'start': start, 'end': end }; - } - - /** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ - function initCloneArray(array) { - var length = array.length, - result = new array.constructor(length); - - // Add array properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; - } - return result; - } - - /** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneObject(object) { - var Ctor = object.constructor; - if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) { - Ctor = Object; - } - return new Ctor; - } - - /** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneByTag(object, tag, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return bufferClone(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - var buffer = object.buffer; - return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length); - - case numberTag: - case stringTag: - return new Ctor(object); - - case regexpTag: - var result = new Ctor(object.source, reFlags.exec(object)); - result.lastIndex = object.lastIndex; - } - return result; - } - - /** - * Invokes the method at `path` on `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {Array} args The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. - */ - function invokePath(object, path, args) { - if (object != null && !isKey(path, object)) { - path = toPath(path); - object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); - path = last(path); - } - var func = object == null ? object : object[path]; - return func == null ? undefined : func.apply(object, args); - } - - /** - * Checks if `value` is array-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - */ - function isArrayLike(value) { - return value != null && isLength(getLength(value)); - } - - /** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; - } - - /** - * Checks if the provided arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. - */ - function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object)) { - var other = object[index]; - return value === value ? (value === other) : (other !== other); - } - return false; - } - - /** - * Checks if `value` is a property name and not a property path. - * - * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. - */ - function isKey(value, object) { - var type = typeof value; - if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') { - return true; - } - if (isArray(value)) { - return false; - } - var result = !reIsDeepProp.test(value); - return result || (object != null && value in toObject(object)); - } - - /** - * Checks if `func` has a lazy counterpart. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`. - */ - function isLaziable(func) { - var funcName = getFuncName(func); - if (!(funcName in LazyWrapper.prototype)) { - return false; - } - var other = lodash[funcName]; - if (func === other) { - return true; - } - var data = getData(other); - return !!data && func === data[0]; - } - - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - */ - function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - - /** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. - */ - function isStrictComparable(value) { - return value === value && !isObject(value); - } - - /** - * Merges the function metadata of `source` into `data`. - * - * Merging metadata reduces the number of wrappers required to invoke a function. - * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` - * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg` - * augment function arguments, making the order in which they are executed important, - * preventing the merging of metadata. However, we make an exception for a safe - * common case where curried functions have `_.ary` and or `_.rearg` applied. - * - * @private - * @param {Array} data The destination metadata. - * @param {Array} source The source metadata. - * @returns {Array} Returns `data`. - */ - function mergeData(data, source) { - var bitmask = data[1], - srcBitmask = source[1], - newBitmask = bitmask | srcBitmask, - isCommon = newBitmask < ARY_FLAG; - - var isCombo = - (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) || - (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) || - (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG); - - // Exit early if metadata can't be merged. - if (!(isCommon || isCombo)) { - return data; - } - // Use source `thisArg` if available. - if (srcBitmask & BIND_FLAG) { - data[2] = source[2]; - // Set when currying a bound function. - newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG; - } - // Compose partial arguments. - var value = source[3]; - if (value) { - var partials = data[3]; - data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value); - data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]); - } - // Compose partial right arguments. - value = source[5]; - if (value) { - partials = data[5]; - data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value); - data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]); - } - // Use source `argPos` if available. - value = source[7]; - if (value) { - data[7] = arrayCopy(value); - } - // Use source `ary` if it's smaller. - if (srcBitmask & ARY_FLAG) { - data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); - } - // Use source `arity` if one is not provided. - if (data[9] == null) { - data[9] = source[9]; - } - // Use source `func` and merge bitmasks. - data[0] = source[0]; - data[1] = newBitmask; - - return data; - } - - /** - * Used by `_.defaultsDeep` to customize its `_.merge` use. - * - * @private - * @param {*} objectValue The destination object property value. - * @param {*} sourceValue The source object property value. - * @returns {*} Returns the value to assign to the destination object. - */ - function mergeDefaults(objectValue, sourceValue) { - return objectValue === undefined ? sourceValue : merge(objectValue, sourceValue, mergeDefaults); - } - - /** - * A specialized version of `_.pick` which picks `object` properties specified - * by `props`. - * - * @private - * @param {Object} object The source object. - * @param {string[]} props The property names to pick. - * @returns {Object} Returns the new object. - */ - function pickByArray(object, props) { - object = toObject(object); - - var index = -1, - length = props.length, - result = {}; - - while (++index < length) { - var key = props[index]; - if (key in object) { - result[key] = object[key]; - } - } - return result; - } - - /** - * A specialized version of `_.pick` which picks `object` properties `predicate` - * returns truthy for. - * - * @private - * @param {Object} object The source object. - * @param {Function} predicate The function invoked per iteration. - * @returns {Object} Returns the new object. - */ - function pickByCallback(object, predicate) { - var result = {}; - baseForIn(object, function(value, key, object) { - if (predicate(value, key, object)) { - result[key] = value; - } - }); - return result; - } - - /** - * Reorder `array` according to the specified indexes where the element at - * the first index is assigned as the first element, the element at - * the second index is assigned as the second element, and so on. - * - * @private - * @param {Array} array The array to reorder. - * @param {Array} indexes The arranged array indexes. - * @returns {Array} Returns `array`. - */ - function reorder(array, indexes) { - var arrLength = array.length, - length = nativeMin(indexes.length, arrLength), - oldArray = arrayCopy(array); - - while (length--) { - var index = indexes[length]; - array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; - } - return array; - } - - /** - * Sets metadata for `func`. - * - * **Note:** If this function becomes hot, i.e. is invoked a lot in a short - * period of time, it will trip its breaker and transition to an identity function - * to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070) - * for more details. - * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. - */ - var setData = (function() { - var count = 0, - lastCalled = 0; - - return function(key, value) { - var stamp = now(), - remaining = HOT_SPAN - (stamp - lastCalled); - - lastCalled = stamp; - if (remaining > 0) { - if (++count >= HOT_COUNT) { - return key; - } - } else { - count = 0; - } - return baseSetData(key, value); - }; - }()); - - /** - * A fallback implementation of `Object.keys` which creates an array of the - * own enumerable property names of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function shimKeys(object) { - var props = keysIn(object), - propsLength = props.length, - length = propsLength && object.length; - - var allowIndexes = !!length && isLength(length) && - (isArray(object) || isArguments(object)); - - var index = -1, - result = []; - - while (++index < propsLength) { - var key = props[index]; - if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) { - result.push(key); - } - } - return result; - } - - /** - * Converts `value` to an array-like object if it's not one. - * - * @private - * @param {*} value The value to process. - * @returns {Array|Object} Returns the array-like object. - */ - function toIterable(value) { - if (value == null) { - return []; - } - if (!isArrayLike(value)) { - return values(value); - } - return isObject(value) ? value : Object(value); - } - - /** - * Converts `value` to an object if it's not one. - * - * @private - * @param {*} value The value to process. - * @returns {Object} Returns the object. - */ - function toObject(value) { - return isObject(value) ? value : Object(value); - } - - /** - * Converts `value` to property path array if it's not one. - * - * @private - * @param {*} value The value to process. - * @returns {Array} Returns the property path array. - */ - function toPath(value) { - if (isArray(value)) { - return value; - } - var result = []; - baseToString(value).replace(rePropName, function(match, number, quote, string) { - result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; - } - - /** - * Creates a clone of `wrapper`. - * - * @private - * @param {Object} wrapper The wrapper to clone. - * @returns {Object} Returns the cloned wrapper. - */ - function wrapperClone(wrapper) { - return wrapper instanceof LazyWrapper - ? wrapper.clone() - : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__)); - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates an array of elements split into groups the length of `size`. - * If `collection` can't be split evenly, the final chunk will be the remaining - * elements. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to process. - * @param {number} [size=1] The length of each chunk. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the new array containing chunks. - * @example - * - * _.chunk(['a', 'b', 'c', 'd'], 2); - * // => [['a', 'b'], ['c', 'd']] - * - * _.chunk(['a', 'b', 'c', 'd'], 3); - * // => [['a', 'b', 'c'], ['d']] - */ - function chunk(array, size, guard) { - if (guard ? isIterateeCall(array, size, guard) : size == null) { - size = 1; - } else { - size = nativeMax(nativeFloor(size) || 1, 1); - } - var index = 0, - length = array ? array.length : 0, - resIndex = -1, - result = Array(nativeCeil(length / size)); - - while (index < length) { - result[++resIndex] = baseSlice(array, index, (index += size)); - } - return result; - } - - /** - * Creates an array with all falsey values removed. The values `false`, `null`, - * `0`, `""`, `undefined`, and `NaN` are falsey. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to compact. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.compact([0, 1, false, 2, '', 3]); - * // => [1, 2, 3] - */ - function compact(array) { - var index = -1, - length = array ? array.length : 0, - resIndex = -1, - result = []; - - while (++index < length) { - var value = array[index]; - if (value) { - result[++resIndex] = value; - } - } - return result; - } - - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The arrays of values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.difference([1, 2, 3], [4, 2]); - * // => [1, 3] - */ - var difference = restParam(function(array, values) { - return (isObjectLike(array) && isArrayLike(array)) - ? baseDifference(array, baseFlatten(values, false, true)) - : []; - }); - - /** - * Creates a slice of `array` with `n` elements dropped from the beginning. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.drop([1, 2, 3]); - * // => [2, 3] - * - * _.drop([1, 2, 3], 2); - * // => [3] - * - * _.drop([1, 2, 3], 5); - * // => [] - * - * _.drop([1, 2, 3], 0); - * // => [1, 2, 3] - */ - function drop(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - return baseSlice(array, n < 0 ? 0 : n); - } - - /** - * Creates a slice of `array` with `n` elements dropped from the end. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropRight([1, 2, 3]); - * // => [1, 2] - * - * _.dropRight([1, 2, 3], 2); - * // => [1] - * - * _.dropRight([1, 2, 3], 5); - * // => [] - * - * _.dropRight([1, 2, 3], 0); - * // => [1, 2, 3] - */ - function dropRight(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - n = length - (+n || 0); - return baseSlice(array, 0, n < 0 ? 0 : n); - } - - /** - * Creates a slice of `array` excluding elements dropped from the end. - * Elements are dropped until `predicate` returns falsey. The predicate is - * bound to `thisArg` and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that match the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropRightWhile([1, 2, 3], function(n) { - * return n > 1; - * }); - * // => [1] - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.dropRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user'); - * // => ['barney', 'fred'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.dropRightWhile(users, 'active', false), 'user'); - * // => ['barney'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.dropRightWhile(users, 'active'), 'user'); - * // => ['barney', 'fred', 'pebbles'] - */ - function dropRightWhile(array, predicate, thisArg) { - return (array && array.length) - ? baseWhile(array, getCallback(predicate, thisArg, 3), true, true) - : []; - } - - /** - * Creates a slice of `array` excluding elements dropped from the beginning. - * Elements are dropped until `predicate` returns falsey. The predicate is - * bound to `thisArg` and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropWhile([1, 2, 3], function(n) { - * return n < 3; - * }); - * // => [3] - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.dropWhile(users, { 'user': 'barney', 'active': false }), 'user'); - * // => ['fred', 'pebbles'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.dropWhile(users, 'active', false), 'user'); - * // => ['pebbles'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.dropWhile(users, 'active'), 'user'); - * // => ['barney', 'fred', 'pebbles'] - */ - function dropWhile(array, predicate, thisArg) { - return (array && array.length) - ? baseWhile(array, getCallback(predicate, thisArg, 3), true) - : []; - } - - /** - * Fills elements of `array` with `value` from `start` up to, but not - * including, `end`. - * - * **Note:** This method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.fill(array, 'a'); - * console.log(array); - * // => ['a', 'a', 'a'] - * - * _.fill(Array(3), 2); - * // => [2, 2, 2] - * - * _.fill([4, 6, 8], '*', 1, 2); - * // => [4, '*', 8] - */ - function fill(array, value, start, end) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { - start = 0; - end = length; - } - return baseFill(array, value, start, end); - } - - /** - * This method is like `_.find` except that it returns the index of the first - * element `predicate` returns truthy for instead of the element itself. - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.findIndex(users, function(chr) { - * return chr.user == 'barney'; - * }); - * // => 0 - * - * // using the `_.matches` callback shorthand - * _.findIndex(users, { 'user': 'fred', 'active': false }); - * // => 1 - * - * // using the `_.matchesProperty` callback shorthand - * _.findIndex(users, 'active', false); - * // => 0 - * - * // using the `_.property` callback shorthand - * _.findIndex(users, 'active'); - * // => 2 - */ - var findIndex = createFindIndex(); - - /** - * This method is like `_.findIndex` except that it iterates over elements - * of `collection` from right to left. - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.findLastIndex(users, function(chr) { - * return chr.user == 'pebbles'; - * }); - * // => 2 - * - * // using the `_.matches` callback shorthand - * _.findLastIndex(users, { 'user': 'barney', 'active': true }); - * // => 0 - * - * // using the `_.matchesProperty` callback shorthand - * _.findLastIndex(users, 'active', false); - * // => 2 - * - * // using the `_.property` callback shorthand - * _.findLastIndex(users, 'active'); - * // => 0 - */ - var findLastIndex = createFindIndex(true); - - /** - * Gets the first element of `array`. - * - * @static - * @memberOf _ - * @alias head - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the first element of `array`. - * @example - * - * _.first([1, 2, 3]); - * // => 1 - * - * _.first([]); - * // => undefined - */ - function first(array) { - return array ? array[0] : undefined; - } - - /** - * Flattens a nested array. If `isDeep` is `true` the array is recursively - * flattened, otherwise it is only flattened a single level. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to flatten. - * @param {boolean} [isDeep] Specify a deep flatten. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flatten([1, [2, 3, [4]]]); - * // => [1, 2, 3, [4]] - * - * // using `isDeep` - * _.flatten([1, [2, 3, [4]]], true); - * // => [1, 2, 3, 4] - */ - function flatten(array, isDeep, guard) { - var length = array ? array.length : 0; - if (guard && isIterateeCall(array, isDeep, guard)) { - isDeep = false; - } - return length ? baseFlatten(array, isDeep) : []; - } - - /** - * Recursively flattens a nested array. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to recursively flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flattenDeep([1, [2, 3, [4]]]); - * // => [1, 2, 3, 4] - */ - function flattenDeep(array) { - var length = array ? array.length : 0; - return length ? baseFlatten(array, true) : []; - } - - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it is used as the offset - * from the end of `array`. If `array` is sorted providing `true` for `fromIndex` - * performs a faster binary search. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {boolean|number} [fromIndex=0] The index to search from or `true` - * to perform a binary search on a sorted array. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - * - * // performing a binary search - * _.indexOf([1, 1, 2, 2], 2, true); - * // => 2 - */ - function indexOf(array, value, fromIndex) { - var length = array ? array.length : 0; - if (!length) { - return -1; - } - if (typeof fromIndex == 'number') { - fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex; - } else if (fromIndex) { - var index = binaryIndex(array, value); - if (index < length && - (value === value ? (value === array[index]) : (array[index] !== array[index]))) { - return index; - } - return -1; - } - return baseIndexOf(array, value, fromIndex || 0); - } - - /** - * Gets all but the last element of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.initial([1, 2, 3]); - * // => [1, 2] - */ - function initial(array) { - return dropRight(array, 1); - } - - /** - * Creates an array of unique values that are included in all of the provided - * arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of shared values. - * @example - * _.intersection([1, 2], [4, 2], [2, 1]); - * // => [2] - */ - var intersection = restParam(function(arrays) { - var othLength = arrays.length, - othIndex = othLength, - caches = Array(length), - indexOf = getIndexOf(), - isCommon = indexOf == baseIndexOf, - result = []; - - while (othIndex--) { - var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : []; - caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null; - } - var array = arrays[0], - index = -1, - length = array ? array.length : 0, - seen = caches[0]; - - outer: - while (++index < length) { - value = array[index]; - if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) { - var othIndex = othLength; - while (--othIndex) { - var cache = caches[othIndex]; - if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) { - continue outer; - } - } - if (seen) { - seen.push(value); - } - result.push(value); - } - } - return result; - }); - - /** - * Gets the last element of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the last element of `array`. - * @example - * - * _.last([1, 2, 3]); - * // => 3 - */ - function last(array) { - var length = array ? array.length : 0; - return length ? array[length - 1] : undefined; - } - - /** - * This method is like `_.indexOf` except that it iterates over elements of - * `array` from right to left. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {boolean|number} [fromIndex=array.length-1] The index to search from - * or `true` to perform a binary search on a sorted array. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.lastIndexOf([1, 2, 1, 2], 2); - * // => 3 - * - * // using `fromIndex` - * _.lastIndexOf([1, 2, 1, 2], 2, 2); - * // => 1 - * - * // performing a binary search - * _.lastIndexOf([1, 1, 2, 2], 2, true); - * // => 3 - */ - function lastIndexOf(array, value, fromIndex) { - var length = array ? array.length : 0; - if (!length) { - return -1; - } - var index = length; - if (typeof fromIndex == 'number') { - index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1; - } else if (fromIndex) { - index = binaryIndex(array, value, true) - 1; - var other = array[index]; - if (value === value ? (value === other) : (other !== other)) { - return index; - } - return -1; - } - if (value !== value) { - return indexOfNaN(array, index, true); - } - while (index--) { - if (array[index] === value) { - return index; - } - } - return -1; - } - - /** - * Removes all provided values from `array` using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * **Note:** Unlike `_.without`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {...*} [values] The values to remove. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, 2, 3); - * console.log(array); - * // => [1, 1] - */ - function pull() { - var args = arguments, - array = args[0]; - - if (!(array && array.length)) { - return array; - } - var index = 0, - indexOf = getIndexOf(), - length = args.length; - - while (++index < length) { - var fromIndex = 0, - value = args[index]; - - while ((fromIndex = indexOf(array, value, fromIndex)) > -1) { - splice.call(array, fromIndex, 1); - } - } - return array; - } - - /** - * Removes elements from `array` corresponding to the given indexes and returns - * an array of the removed elements. Indexes may be specified as an array of - * indexes or as individual arguments. - * - * **Note:** Unlike `_.at`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {...(number|number[])} [indexes] The indexes of elements to remove, - * specified as individual indexes or arrays of indexes. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = [5, 10, 15, 20]; - * var evens = _.pullAt(array, 1, 3); - * - * console.log(array); - * // => [5, 15] - * - * console.log(evens); - * // => [10, 20] - */ - var pullAt = restParam(function(array, indexes) { - indexes = baseFlatten(indexes); - - var result = baseAt(array, indexes); - basePullAt(array, indexes.sort(baseCompareAscending)); - return result; - }); - - /** - * Removes all elements from `array` that `predicate` returns truthy for - * and returns an array of the removed elements. The predicate is bound to - * `thisArg` and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * **Note:** Unlike `_.filter`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = [1, 2, 3, 4]; - * var evens = _.remove(array, function(n) { - * return n % 2 == 0; - * }); - * - * console.log(array); - * // => [1, 3] - * - * console.log(evens); - * // => [2, 4] - */ - function remove(array, predicate, thisArg) { - var result = []; - if (!(array && array.length)) { - return result; - } - var index = -1, - indexes = [], - length = array.length; - - predicate = getCallback(predicate, thisArg, 3); - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result.push(value); - indexes.push(index); - } - } - basePullAt(array, indexes); - return result; - } - - /** - * Gets all but the first element of `array`. - * - * @static - * @memberOf _ - * @alias tail - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.rest([1, 2, 3]); - * // => [2, 3] - */ - function rest(array) { - return drop(array, 1); - } - - /** - * Creates a slice of `array` from `start` up to, but not including, `end`. - * - * **Note:** This method is used instead of `Array#slice` to support node - * lists in IE < 9 and to ensure dense arrays are returned. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function slice(array, start, end) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { - start = 0; - end = length; - } - return baseSlice(array, start, end); - } - - /** - * Uses a binary search to determine the lowest index at which `value` should - * be inserted into `array` in order to maintain its sort order. If an iteratee - * function is provided it is invoked for `value` and each element of `array` - * to compute their sort ranking. The iteratee is bound to `thisArg` and - * invoked with one argument; (value). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - * - * _.sortedIndex([4, 4, 5, 5], 5); - * // => 2 - * - * var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } }; - * - * // using an iteratee function - * _.sortedIndex(['thirty', 'fifty'], 'forty', function(word) { - * return this.data[word]; - * }, dict); - * // => 1 - * - * // using the `_.property` callback shorthand - * _.sortedIndex([{ 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); - * // => 1 - */ - var sortedIndex = createSortedIndex(); - - /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedLastIndex([4, 4, 5, 5], 5); - * // => 4 - */ - var sortedLastIndex = createSortedIndex(true); - - /** - * Creates a slice of `array` with `n` elements taken from the beginning. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.take([1, 2, 3]); - * // => [1] - * - * _.take([1, 2, 3], 2); - * // => [1, 2] - * - * _.take([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.take([1, 2, 3], 0); - * // => [] - */ - function take(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - return baseSlice(array, 0, n < 0 ? 0 : n); - } - - /** - * Creates a slice of `array` with `n` elements taken from the end. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeRight([1, 2, 3]); - * // => [3] - * - * _.takeRight([1, 2, 3], 2); - * // => [2, 3] - * - * _.takeRight([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.takeRight([1, 2, 3], 0); - * // => [] - */ - function takeRight(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - n = length - (+n || 0); - return baseSlice(array, n < 0 ? 0 : n); - } - - /** - * Creates a slice of `array` with elements taken from the end. Elements are - * taken until `predicate` returns falsey. The predicate is bound to `thisArg` - * and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeRightWhile([1, 2, 3], function(n) { - * return n > 1; - * }); - * // => [2, 3] - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user'); - * // => ['pebbles'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.takeRightWhile(users, 'active', false), 'user'); - * // => ['fred', 'pebbles'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.takeRightWhile(users, 'active'), 'user'); - * // => [] - */ - function takeRightWhile(array, predicate, thisArg) { - return (array && array.length) - ? baseWhile(array, getCallback(predicate, thisArg, 3), false, true) - : []; - } - - /** - * Creates a slice of `array` with elements taken from the beginning. Elements - * are taken until `predicate` returns falsey. The predicate is bound to - * `thisArg` and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeWhile([1, 2, 3], function(n) { - * return n < 3; - * }); - * // => [1, 2] - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false}, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.takeWhile(users, { 'user': 'barney', 'active': false }), 'user'); - * // => ['barney'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.takeWhile(users, 'active', false), 'user'); - * // => ['barney', 'fred'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.takeWhile(users, 'active'), 'user'); - * // => [] - */ - function takeWhile(array, predicate, thisArg) { - return (array && array.length) - ? baseWhile(array, getCallback(predicate, thisArg, 3)) - : []; - } - - /** - * Creates an array of unique values, in order, from all of the provided arrays - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of combined values. - * @example - * - * _.union([1, 2], [4, 2], [2, 1]); - * // => [1, 2, 4] - */ - var union = restParam(function(arrays) { - return baseUniq(baseFlatten(arrays, false, true)); - }); - - /** - * Creates a duplicate-free version of an array, using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons, in which only the first occurence of each element - * is kept. Providing `true` for `isSorted` performs a faster search algorithm - * for sorted arrays. If an iteratee function is provided it is invoked for - * each element in the array to generate the criterion by which uniqueness - * is computed. The `iteratee` is bound to `thisArg` and invoked with three - * arguments: (value, index, array). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias unique - * @category Array - * @param {Array} array The array to inspect. - * @param {boolean} [isSorted] Specify the array is sorted. - * @param {Function|Object|string} [iteratee] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new duplicate-value-free array. - * @example - * - * _.uniq([2, 1, 2]); - * // => [2, 1] - * - * // using `isSorted` - * _.uniq([1, 1, 2], true); - * // => [1, 2] - * - * // using an iteratee function - * _.uniq([1, 2.5, 1.5, 2], function(n) { - * return this.floor(n); - * }, Math); - * // => [1, 2.5] - * - * // using the `_.property` callback shorthand - * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - function uniq(array, isSorted, iteratee, thisArg) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (isSorted != null && typeof isSorted != 'boolean') { - thisArg = iteratee; - iteratee = isIterateeCall(array, isSorted, thisArg) ? undefined : isSorted; - isSorted = false; - } - var callback = getCallback(); - if (!(iteratee == null && callback === baseCallback)) { - iteratee = callback(iteratee, thisArg, 3); - } - return (isSorted && getIndexOf() == baseIndexOf) - ? sortedUniq(array, iteratee) - : baseUniq(array, iteratee); - } - - /** - * This method is like `_.zip` except that it accepts an array of grouped - * elements and creates an array regrouping the elements to their pre-zip - * configuration. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array of grouped elements to process. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]); - * // => [['fred', 30, true], ['barney', 40, false]] - * - * _.unzip(zipped); - * // => [['fred', 'barney'], [30, 40], [true, false]] - */ - function unzip(array) { - if (!(array && array.length)) { - return []; - } - var index = -1, - length = 0; - - array = arrayFilter(array, function(group) { - if (isArrayLike(group)) { - length = nativeMax(group.length, length); - return true; - } - }); - var result = Array(length); - while (++index < length) { - result[index] = arrayMap(array, baseProperty(index)); - } - return result; - } - - /** - * This method is like `_.unzip` except that it accepts an iteratee to specify - * how regrouped values should be combined. The `iteratee` is bound to `thisArg` - * and invoked with four arguments: (accumulator, value, index, group). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array of grouped elements to process. - * @param {Function} [iteratee] The function to combine regrouped values. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip([1, 2], [10, 20], [100, 200]); - * // => [[1, 10, 100], [2, 20, 200]] - * - * _.unzipWith(zipped, _.add); - * // => [3, 30, 300] - */ - function unzipWith(array, iteratee, thisArg) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - var result = unzip(array); - if (iteratee == null) { - return result; - } - iteratee = bindCallback(iteratee, thisArg, 4); - return arrayMap(result, function(group) { - return arrayReduce(group, iteratee, undefined, true); - }); - } - - /** - * Creates an array excluding all provided values using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to filter. - * @param {...*} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.without([1, 2, 1, 3], 1, 2); - * // => [3] - */ - var without = restParam(function(array, values) { - return isArrayLike(array) - ? baseDifference(array, values) - : []; - }); - - /** - * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) - * of the provided arrays. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of values. - * @example - * - * _.xor([1, 2], [4, 2]); - * // => [1, 4] - */ - function xor() { - var index = -1, - length = arguments.length; - - while (++index < length) { - var array = arguments[index]; - if (isArrayLike(array)) { - var result = result - ? arrayPush(baseDifference(result, array), baseDifference(array, result)) - : array; - } - } - return result ? baseUniq(result) : []; - } - - /** - * Creates an array of grouped elements, the first of which contains the first - * elements of the given arrays, the second of which contains the second elements - * of the given arrays, and so on. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zip(['fred', 'barney'], [30, 40], [true, false]); - * // => [['fred', 30, true], ['barney', 40, false]] - */ - var zip = restParam(unzip); - - /** - * The inverse of `_.pairs`; this method returns an object composed from arrays - * of property names and values. Provide either a single two dimensional array, - * e.g. `[[key1, value1], [key2, value2]]` or two arrays, one of property names - * and one of corresponding values. - * - * @static - * @memberOf _ - * @alias object - * @category Array - * @param {Array} props The property names. - * @param {Array} [values=[]] The property values. - * @returns {Object} Returns the new object. - * @example - * - * _.zipObject([['fred', 30], ['barney', 40]]); - * // => { 'fred': 30, 'barney': 40 } - * - * _.zipObject(['fred', 'barney'], [30, 40]); - * // => { 'fred': 30, 'barney': 40 } - */ - function zipObject(props, values) { - var index = -1, - length = props ? props.length : 0, - result = {}; - - if (length && !values && !isArray(props[0])) { - values = []; - } - while (++index < length) { - var key = props[index]; - if (values) { - result[key] = values[index]; - } else if (key) { - result[key[0]] = key[1]; - } - } - return result; - } - - /** - * This method is like `_.zip` except that it accepts an iteratee to specify - * how grouped values should be combined. The `iteratee` is bound to `thisArg` - * and invoked with four arguments: (accumulator, value, index, group). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @param {Function} [iteratee] The function to combine grouped values. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zipWith([1, 2], [10, 20], [100, 200], _.add); - * // => [111, 222] - */ - var zipWith = restParam(function(arrays) { - var length = arrays.length, - iteratee = length > 2 ? arrays[length - 2] : undefined, - thisArg = length > 1 ? arrays[length - 1] : undefined; - - if (length > 2 && typeof iteratee == 'function') { - length -= 2; - } else { - iteratee = (length > 1 && typeof thisArg == 'function') ? (--length, thisArg) : undefined; - thisArg = undefined; - } - arrays.length = length; - return unzipWith(arrays, iteratee, thisArg); - }); - - /*------------------------------------------------------------------------*/ - - /** - * Creates a `lodash` object that wraps `value` with explicit method - * chaining enabled. - * - * @static - * @memberOf _ - * @category Chain - * @param {*} value The value to wrap. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'pebbles', 'age': 1 } - * ]; - * - * var youngest = _.chain(users) - * .sortBy('age') - * .map(function(chr) { - * return chr.user + ' is ' + chr.age; - * }) - * .first() - * .value(); - * // => 'pebbles is 1' - */ - function chain(value) { - var result = lodash(value); - result.__chain__ = true; - return result; - } - - /** - * This method invokes `interceptor` and returns `value`. The interceptor is - * bound to `thisArg` and invoked with one argument; (value). The purpose of - * this method is to "tap into" a method chain in order to perform operations - * on intermediate results within the chain. - * - * @static - * @memberOf _ - * @category Chain - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @param {*} [thisArg] The `this` binding of `interceptor`. - * @returns {*} Returns `value`. - * @example - * - * _([1, 2, 3]) - * .tap(function(array) { - * array.pop(); - * }) - * .reverse() - * .value(); - * // => [2, 1] - */ - function tap(value, interceptor, thisArg) { - interceptor.call(thisArg, value); - return value; - } - - /** - * This method is like `_.tap` except that it returns the result of `interceptor`. - * - * @static - * @memberOf _ - * @category Chain - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @param {*} [thisArg] The `this` binding of `interceptor`. - * @returns {*} Returns the result of `interceptor`. - * @example - * - * _(' abc ') - * .chain() - * .trim() - * .thru(function(value) { - * return [value]; - * }) - * .value(); - * // => ['abc'] - */ - function thru(value, interceptor, thisArg) { - return interceptor.call(thisArg, value); - } - - /** - * Enables explicit method chaining on the wrapper object. - * - * @name chain - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // without explicit chaining - * _(users).first(); - * // => { 'user': 'barney', 'age': 36 } - * - * // with explicit chaining - * _(users).chain() - * .first() - * .pick('user') - * .value(); - * // => { 'user': 'barney' } - */ - function wrapperChain() { - return chain(this); - } - - /** - * Executes the chained sequence and returns the wrapped result. - * - * @name commit - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2]; - * var wrapped = _(array).push(3); - * - * console.log(array); - * // => [1, 2] - * - * wrapped = wrapped.commit(); - * console.log(array); - * // => [1, 2, 3] - * - * wrapped.last(); - * // => 3 - * - * console.log(array); - * // => [1, 2, 3] - */ - function wrapperCommit() { - return new LodashWrapper(this.value(), this.__chain__); - } - - /** - * Creates a new array joining a wrapped array with any additional arrays - * and/or values. - * - * @name concat - * @memberOf _ - * @category Chain - * @param {...*} [values] The values to concatenate. - * @returns {Array} Returns the new concatenated array. - * @example - * - * var array = [1]; - * var wrapped = _(array).concat(2, [3], [[4]]); - * - * console.log(wrapped.value()); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ - var wrapperConcat = restParam(function(values) { - values = baseFlatten(values); - return this.thru(function(array) { - return arrayConcat(isArray(array) ? array : [toObject(array)], values); - }); - }); - - /** - * Creates a clone of the chained sequence planting `value` as the wrapped value. - * - * @name plant - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2]; - * var wrapped = _(array).map(function(value) { - * return Math.pow(value, 2); - * }); - * - * var other = [3, 4]; - * var otherWrapped = wrapped.plant(other); - * - * otherWrapped.value(); - * // => [9, 16] - * - * wrapped.value(); - * // => [1, 4] - */ - function wrapperPlant(value) { - var result, - parent = this; - - while (parent instanceof baseLodash) { - var clone = wrapperClone(parent); - if (result) { - previous.__wrapped__ = clone; - } else { - result = clone; - } - var previous = clone; - parent = parent.__wrapped__; - } - previous.__wrapped__ = value; - return result; - } - - /** - * Reverses the wrapped array so the first element becomes the last, the - * second element becomes the second to last, and so on. - * - * **Note:** This method mutates the wrapped array. - * - * @name reverse - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new reversed `lodash` wrapper instance. - * @example - * - * var array = [1, 2, 3]; - * - * _(array).reverse().value() - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ - function wrapperReverse() { - var value = this.__wrapped__; - - var interceptor = function(value) { - return (wrapped && wrapped.__dir__ < 0) ? value : value.reverse(); - }; - if (value instanceof LazyWrapper) { - var wrapped = value; - if (this.__actions__.length) { - wrapped = new LazyWrapper(this); - } - wrapped = wrapped.reverse(); - wrapped.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined }); - return new LodashWrapper(wrapped, this.__chain__); - } - return this.thru(interceptor); - } - - /** - * Produces the result of coercing the unwrapped value to a string. - * - * @name toString - * @memberOf _ - * @category Chain - * @returns {string} Returns the coerced string value. - * @example - * - * _([1, 2, 3]).toString(); - * // => '1,2,3' - */ - function wrapperToString() { - return (this.value() + ''); - } - - /** - * Executes the chained sequence to extract the unwrapped value. - * - * @name value - * @memberOf _ - * @alias run, toJSON, valueOf - * @category Chain - * @returns {*} Returns the resolved unwrapped value. - * @example - * - * _([1, 2, 3]).value(); - * // => [1, 2, 3] - */ - function wrapperValue() { - return baseWrapperValue(this.__wrapped__, this.__actions__); - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates an array of elements corresponding to the given keys, or indexes, - * of `collection`. Keys may be specified as individual arguments or as arrays - * of keys. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {...(number|number[]|string|string[])} [props] The property names - * or indexes of elements to pick, specified individually or in arrays. - * @returns {Array} Returns the new array of picked elements. - * @example - * - * _.at(['a', 'b', 'c'], [0, 2]); - * // => ['a', 'c'] - * - * _.at(['barney', 'fred', 'pebbles'], 0, 2); - * // => ['barney', 'pebbles'] - */ - var at = restParam(function(collection, props) { - return baseAt(collection, baseFlatten(props)); - }); - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is the number of times the key was returned by `iteratee`. - * The `iteratee` is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.countBy([4.3, 6.1, 6.4], function(n) { - * return Math.floor(n); - * }); - * // => { '4': 1, '6': 2 } - * - * _.countBy([4.3, 6.1, 6.4], function(n) { - * return this.floor(n); - * }, Math); - * // => { '4': 1, '6': 2 } - * - * _.countBy(['one', 'two', 'three'], 'length'); - * // => { '3': 2, '5': 1 } - */ - var countBy = createAggregator(function(result, value, key) { - hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1); - }); - - /** - * Checks if `predicate` returns truthy for **all** elements of `collection`. - * The predicate is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias all - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - * @example - * - * _.every([true, 1, null, 'yes'], Boolean); - * // => false - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.every(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // using the `_.matchesProperty` callback shorthand - * _.every(users, 'active', false); - * // => true - * - * // using the `_.property` callback shorthand - * _.every(users, 'active'); - * // => false - */ - function every(collection, predicate, thisArg) { - var func = isArray(collection) ? arrayEvery : baseEvery; - if (thisArg && isIterateeCall(collection, predicate, thisArg)) { - predicate = undefined; - } - if (typeof predicate != 'function' || thisArg !== undefined) { - predicate = getCallback(predicate, thisArg, 3); - } - return func(collection, predicate); - } - - /** - * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is bound to `thisArg` and - * invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias select - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the new filtered array. - * @example - * - * _.filter([4, 5, 6], function(n) { - * return n % 2 == 0; - * }); - * // => [4, 6] - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user'); - * // => ['barney'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.filter(users, 'active', false), 'user'); - * // => ['fred'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.filter(users, 'active'), 'user'); - * // => ['barney'] - */ - function filter(collection, predicate, thisArg) { - var func = isArray(collection) ? arrayFilter : baseFilter; - predicate = getCallback(predicate, thisArg, 3); - return func(collection, predicate); - } - - /** - * Iterates over elements of `collection`, returning the first element - * `predicate` returns truthy for. The predicate is bound to `thisArg` and - * invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias detect - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false }, - * { 'user': 'pebbles', 'age': 1, 'active': true } - * ]; - * - * _.result(_.find(users, function(chr) { - * return chr.age < 40; - * }), 'user'); - * // => 'barney' - * - * // using the `_.matches` callback shorthand - * _.result(_.find(users, { 'age': 1, 'active': true }), 'user'); - * // => 'pebbles' - * - * // using the `_.matchesProperty` callback shorthand - * _.result(_.find(users, 'active', false), 'user'); - * // => 'fred' - * - * // using the `_.property` callback shorthand - * _.result(_.find(users, 'active'), 'user'); - * // => 'barney' - */ - var find = createFind(baseEach); - - /** - * This method is like `_.find` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * _.findLast([1, 2, 3, 4], function(n) { - * return n % 2 == 1; - * }); - * // => 3 - */ - var findLast = createFind(baseEachRight, true); - - /** - * Performs a deep comparison between each element in `collection` and the - * source object, returning the first element that has equivalent property - * values. - * - * **Note:** This method supports comparing arrays, booleans, `Date` objects, - * numbers, `Object` objects, regexes, and strings. Objects are compared by - * their own, not inherited, enumerable properties. For comparing a single - * own or inherited property value see `_.matchesProperty`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Object} source The object of property values to match. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user'); - * // => 'barney' - * - * _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user'); - * // => 'fred' - */ - function findWhere(collection, source) { - return find(collection, baseMatches(source)); - } - - /** - * Iterates over elements of `collection` invoking `iteratee` for each element. - * The `iteratee` is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early - * by explicitly returning `false`. - * - * **Note:** As with other "Collections" methods, objects with a "length" property - * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn` - * may be used for object iteration. - * - * @static - * @memberOf _ - * @alias each - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array|Object|string} Returns `collection`. - * @example - * - * _([1, 2]).forEach(function(n) { - * console.log(n); - * }).value(); - * // => logs each value from left to right and returns the array - * - * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) { - * console.log(n, key); - * }); - * // => logs each value-key pair and returns the object (iteration order is not guaranteed) - */ - var forEach = createForEach(arrayEach, baseEach); - - /** - * This method is like `_.forEach` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @alias eachRight - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array|Object|string} Returns `collection`. - * @example - * - * _([1, 2]).forEachRight(function(n) { - * console.log(n); - * }).value(); - * // => logs each value from right to left and returns the array - */ - var forEachRight = createForEach(arrayEachRight, baseEachRight); - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is an array of the elements responsible for generating the key. - * The `iteratee` is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.groupBy([4.2, 6.1, 6.4], function(n) { - * return Math.floor(n); - * }); - * // => { '4': [4.2], '6': [6.1, 6.4] } - * - * _.groupBy([4.2, 6.1, 6.4], function(n) { - * return this.floor(n); - * }, Math); - * // => { '4': [4.2], '6': [6.1, 6.4] } - * - * // using the `_.property` callback shorthand - * _.groupBy(['one', 'two', 'three'], 'length'); - * // => { '3': ['one', 'two'], '5': ['three'] } - */ - var groupBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - result[key].push(value); - } else { - result[key] = [value]; - } - }); - - /** - * Checks if `value` is in `collection` using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it is used as the offset - * from the end of `collection`. - * - * @static - * @memberOf _ - * @alias contains, include - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {*} target The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`. - * @returns {boolean} Returns `true` if a matching element is found, else `false`. - * @example - * - * _.includes([1, 2, 3], 1); - * // => true - * - * _.includes([1, 2, 3], 1, 2); - * // => false - * - * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); - * // => true - * - * _.includes('pebbles', 'eb'); - * // => true - */ - function includes(collection, target, fromIndex, guard) { - var length = collection ? getLength(collection) : 0; - if (!isLength(length)) { - collection = values(collection); - length = collection.length; - } - if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) { - fromIndex = 0; - } else { - fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0); - } - return (typeof collection == 'string' || !isArray(collection) && isString(collection)) - ? (fromIndex <= length && collection.indexOf(target, fromIndex) > -1) - : (!!length && getIndexOf(collection, target, fromIndex) > -1); - } - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is the last element responsible for generating the key. The - * iteratee function is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * var keyData = [ - * { 'dir': 'left', 'code': 97 }, - * { 'dir': 'right', 'code': 100 } - * ]; - * - * _.indexBy(keyData, 'dir'); - * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } - * - * _.indexBy(keyData, function(object) { - * return String.fromCharCode(object.code); - * }); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } - * - * _.indexBy(keyData, function(object) { - * return this.fromCharCode(object.code); - * }, String); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } - */ - var indexBy = createAggregator(function(result, value, key) { - result[key] = value; - }); - - /** - * Invokes the method at `path` of each element in `collection`, returning - * an array of the results of each invoked method. Any additional arguments - * are provided to each invoked method. If `methodName` is a function it is - * invoked for, and `this` bound to, each element in `collection`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Array|Function|string} path The path of the method to invoke or - * the function invoked per iteration. - * @param {...*} [args] The arguments to invoke the method with. - * @returns {Array} Returns the array of results. - * @example - * - * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); - * // => [[1, 5, 7], [1, 2, 3]] - * - * _.invoke([123, 456], String.prototype.split, ''); - * // => [['1', '2', '3'], ['4', '5', '6']] - */ - var invoke = restParam(function(collection, path, args) { - var index = -1, - isFunc = typeof path == 'function', - isProp = isKey(path), - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value) { - var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined); - result[++index] = func ? func.apply(value, args) : invokePath(value, path, args); - }); - return result; - }); - - /** - * Creates an array of values by running each element in `collection` through - * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three - * arguments: (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. - * - * The guarded methods are: - * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`, - * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`, - * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`, - * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`, - * `sum`, `uniq`, and `words` - * - * @static - * @memberOf _ - * @alias collect - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new mapped array. - * @example - * - * function timesThree(n) { - * return n * 3; - * } - * - * _.map([1, 2], timesThree); - * // => [3, 6] - * - * _.map({ 'a': 1, 'b': 2 }, timesThree); - * // => [3, 6] (iteration order is not guaranteed) - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * // using the `_.property` callback shorthand - * _.map(users, 'user'); - * // => ['barney', 'fred'] - */ - function map(collection, iteratee, thisArg) { - var func = isArray(collection) ? arrayMap : baseMap; - iteratee = getCallback(iteratee, thisArg, 3); - return func(collection, iteratee); - } - - /** - * Creates an array of elements split into two groups, the first of which - * contains elements `predicate` returns truthy for, while the second of which - * contains elements `predicate` returns falsey for. The predicate is bound - * to `thisArg` and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the array of grouped elements. - * @example - * - * _.partition([1, 2, 3], function(n) { - * return n % 2; - * }); - * // => [[1, 3], [2]] - * - * _.partition([1.2, 2.3, 3.4], function(n) { - * return this.floor(n) % 2; - * }, Math); - * // => [[1.2, 3.4], [2.3]] - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true }, - * { 'user': 'pebbles', 'age': 1, 'active': false } - * ]; - * - * var mapper = function(array) { - * return _.pluck(array, 'user'); - * }; - * - * // using the `_.matches` callback shorthand - * _.map(_.partition(users, { 'age': 1, 'active': false }), mapper); - * // => [['pebbles'], ['barney', 'fred']] - * - * // using the `_.matchesProperty` callback shorthand - * _.map(_.partition(users, 'active', false), mapper); - * // => [['barney', 'pebbles'], ['fred']] - * - * // using the `_.property` callback shorthand - * _.map(_.partition(users, 'active'), mapper); - * // => [['fred'], ['barney', 'pebbles']] - */ - var partition = createAggregator(function(result, value, key) { - result[key ? 0 : 1].push(value); - }, function() { return [[], []]; }); - - /** - * Gets the property value of `path` from all elements in `collection`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Array|string} path The path of the property to pluck. - * @returns {Array} Returns the property values. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * _.pluck(users, 'user'); - * // => ['barney', 'fred'] - * - * var userIndex = _.indexBy(users, 'user'); - * _.pluck(userIndex, 'age'); - * // => [36, 40] (iteration order is not guaranteed) - */ - function pluck(collection, path) { - return map(collection, property(path)); - } - - /** - * Reduces `collection` to a value which is the accumulated result of running - * each element in `collection` through `iteratee`, where each successive - * invocation is supplied the return value of the previous. If `accumulator` - * is not provided the first element of `collection` is used as the initial - * value. The `iteratee` is bound to `thisArg` and invoked with four arguments: - * (accumulator, value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.reduce`, `_.reduceRight`, and `_.transform`. - * - * The guarded methods are: - * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `sortByAll`, - * and `sortByOrder` - * - * @static - * @memberOf _ - * @alias foldl, inject - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {*} Returns the accumulated value. - * @example - * - * _.reduce([1, 2], function(total, n) { - * return total + n; - * }); - * // => 3 - * - * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) { - * result[key] = n * 3; - * return result; - * }, {}); - * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed) - */ - var reduce = createReduce(arrayReduce, baseEach); - - /** - * This method is like `_.reduce` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @alias foldr - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {*} Returns the accumulated value. - * @example - * - * var array = [[0, 1], [2, 3], [4, 5]]; - * - * _.reduceRight(array, function(flattened, other) { - * return flattened.concat(other); - * }, []); - * // => [4, 5, 2, 3, 0, 1] - */ - var reduceRight = createReduce(arrayReduceRight, baseEachRight); - - /** - * The opposite of `_.filter`; this method returns the elements of `collection` - * that `predicate` does **not** return truthy for. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the new filtered array. - * @example - * - * _.reject([1, 2, 3, 4], function(n) { - * return n % 2 == 0; - * }); - * // => [1, 3] - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.reject(users, { 'age': 40, 'active': true }), 'user'); - * // => ['barney'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.reject(users, 'active', false), 'user'); - * // => ['fred'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.reject(users, 'active'), 'user'); - * // => ['barney'] - */ - function reject(collection, predicate, thisArg) { - var func = isArray(collection) ? arrayFilter : baseFilter; - predicate = getCallback(predicate, thisArg, 3); - return func(collection, function(value, index, collection) { - return !predicate(value, index, collection); - }); - } - - /** - * Gets a random element or `n` random elements from a collection. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to sample. - * @param {number} [n] The number of elements to sample. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {*} Returns the random sample(s). - * @example - * - * _.sample([1, 2, 3, 4]); - * // => 2 - * - * _.sample([1, 2, 3, 4], 2); - * // => [3, 1] - */ - function sample(collection, n, guard) { - if (guard ? isIterateeCall(collection, n, guard) : n == null) { - collection = toIterable(collection); - var length = collection.length; - return length > 0 ? collection[baseRandom(0, length - 1)] : undefined; - } - var index = -1, - result = toArray(collection), - length = result.length, - lastIndex = length - 1; - - n = nativeMin(n < 0 ? 0 : (+n || 0), length); - while (++index < n) { - var rand = baseRandom(index, lastIndex), - value = result[rand]; - - result[rand] = result[index]; - result[index] = value; - } - result.length = n; - return result; - } - - /** - * Creates an array of shuffled values, using a version of the - * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to shuffle. - * @returns {Array} Returns the new shuffled array. - * @example - * - * _.shuffle([1, 2, 3, 4]); - * // => [4, 1, 3, 2] - */ - function shuffle(collection) { - return sample(collection, POSITIVE_INFINITY); - } - - /** - * Gets the size of `collection` by returning its length for array-like - * values or the number of own enumerable properties for objects. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @returns {number} Returns the size of `collection`. - * @example - * - * _.size([1, 2, 3]); - * // => 3 - * - * _.size({ 'a': 1, 'b': 2 }); - * // => 2 - * - * _.size('pebbles'); - * // => 7 - */ - function size(collection) { - var length = collection ? getLength(collection) : 0; - return isLength(length) ? length : keys(collection).length; - } - - /** - * Checks if `predicate` returns truthy for **any** element of `collection`. - * The function returns as soon as it finds a passing value and does not iterate - * over the entire collection. The predicate is bound to `thisArg` and invoked - * with three arguments: (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias any - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - * @example - * - * _.some([null, 0, 'yes', false], Boolean); - * // => true - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.some(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // using the `_.matchesProperty` callback shorthand - * _.some(users, 'active', false); - * // => true - * - * // using the `_.property` callback shorthand - * _.some(users, 'active'); - * // => true - */ - function some(collection, predicate, thisArg) { - var func = isArray(collection) ? arraySome : baseSome; - if (thisArg && isIterateeCall(collection, predicate, thisArg)) { - predicate = undefined; - } - if (typeof predicate != 'function' || thisArg !== undefined) { - predicate = getCallback(predicate, thisArg, 3); - } - return func(collection, predicate); - } - - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through `iteratee`. This method performs - * a stable sort, that is, it preserves the original sort order of equal elements. - * The `iteratee` is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new sorted array. - * @example - * - * _.sortBy([1, 2, 3], function(n) { - * return Math.sin(n); - * }); - * // => [3, 1, 2] - * - * _.sortBy([1, 2, 3], function(n) { - * return this.sin(n); - * }, Math); - * // => [3, 1, 2] - * - * var users = [ - * { 'user': 'fred' }, - * { 'user': 'pebbles' }, - * { 'user': 'barney' } - * ]; - * - * // using the `_.property` callback shorthand - * _.pluck(_.sortBy(users, 'user'), 'user'); - * // => ['barney', 'fred', 'pebbles'] - */ - function sortBy(collection, iteratee, thisArg) { - if (collection == null) { - return []; - } - if (thisArg && isIterateeCall(collection, iteratee, thisArg)) { - iteratee = undefined; - } - var index = -1; - iteratee = getCallback(iteratee, thisArg, 3); - - var result = baseMap(collection, function(value, key, collection) { - return { 'criteria': iteratee(value, key, collection), 'index': ++index, 'value': value }; - }); - return baseSortBy(result, compareAscending); - } - - /** - * This method is like `_.sortBy` except that it can sort by multiple iteratees - * or property names. - * - * If a property name is provided for an iteratee the created `_.property` - * style callback returns the property value of the given element. - * - * If an object is provided for an iteratee the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {...(Function|Function[]|Object|Object[]|string|string[])} iteratees - * The iteratees to sort by, specified as individual values or arrays of values. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.map(_.sortByAll(users, ['user', 'age']), _.values); - * // => [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.map(_.sortByAll(users, 'user', function(chr) { - * return Math.floor(chr.age / 10); - * }), _.values); - * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - var sortByAll = restParam(function(collection, iteratees) { - if (collection == null) { - return []; - } - var guard = iteratees[2]; - if (guard && isIterateeCall(iteratees[0], iteratees[1], guard)) { - iteratees.length = 1; - } - return baseSortByOrder(collection, baseFlatten(iteratees), []); - }); - - /** - * This method is like `_.sortByAll` except that it allows specifying the - * sort orders of the iteratees to sort by. If `orders` is unspecified, all - * values are sorted in ascending order. Otherwise, a value is sorted in - * ascending order if its corresponding order is "asc", and descending if "desc". - * - * If a property name is provided for an iteratee the created `_.property` - * style callback returns the property value of the given element. - * - * If an object is provided for an iteratee the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. - * @param {boolean[]} [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.map(_.sortByOrder(users, ['user', 'age'], ['asc', 'desc']), _.values); - * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - function sortByOrder(collection, iteratees, orders, guard) { - if (collection == null) { - return []; - } - if (guard && isIterateeCall(iteratees, orders, guard)) { - orders = undefined; - } - if (!isArray(iteratees)) { - iteratees = iteratees == null ? [] : [iteratees]; - } - if (!isArray(orders)) { - orders = orders == null ? [] : [orders]; - } - return baseSortByOrder(collection, iteratees, orders); - } - - /** - * Performs a deep comparison between each element in `collection` and the - * source object, returning an array of all elements that have equivalent - * property values. - * - * **Note:** This method supports comparing arrays, booleans, `Date` objects, - * numbers, `Object` objects, regexes, and strings. Objects are compared by - * their own, not inherited, enumerable properties. For comparing a single - * own or inherited property value see `_.matchesProperty`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Object} source The object of property values to match. - * @returns {Array} Returns the new filtered array. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false, 'pets': ['hoppy'] }, - * { 'user': 'fred', 'age': 40, 'active': true, 'pets': ['baby puss', 'dino'] } - * ]; - * - * _.pluck(_.where(users, { 'age': 36, 'active': false }), 'user'); - * // => ['barney'] - * - * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user'); - * // => ['fred'] - */ - function where(collection, source) { - return filter(collection, baseMatches(source)); - } - - /*------------------------------------------------------------------------*/ - - /** - * Gets the number of milliseconds that have elapsed since the Unix epoch - * (1 January 1970 00:00:00 UTC). - * - * @static - * @memberOf _ - * @category Date - * @example - * - * _.defer(function(stamp) { - * console.log(_.now() - stamp); - * }, _.now()); - * // => logs the number of milliseconds it took for the deferred function to be invoked - */ - var now = nativeNow || function() { - return new Date().getTime(); - }; - - /*------------------------------------------------------------------------*/ - - /** - * The opposite of `_.before`; this method creates a function that invokes - * `func` once it is called `n` or more times. - * - * @static - * @memberOf _ - * @category Function - * @param {number} n The number of calls before `func` is invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var saves = ['profile', 'settings']; - * - * var done = _.after(saves.length, function() { - * console.log('done saving!'); - * }); - * - * _.forEach(saves, function(type) { - * asyncSave({ 'type': type, 'complete': done }); - * }); - * // => logs 'done saving!' after the two async saves have completed - */ - function after(n, func) { - if (typeof func != 'function') { - if (typeof n == 'function') { - var temp = n; - n = func; - func = temp; - } else { - throw new TypeError(FUNC_ERROR_TEXT); - } - } - n = nativeIsFinite(n = +n) ? n : 0; - return function() { - if (--n < 1) { - return func.apply(this, arguments); - } - }; - } - - /** - * Creates a function that accepts up to `n` arguments ignoring any - * additional arguments. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to cap arguments for. - * @param {number} [n=func.length] The arity cap. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Function} Returns the new function. - * @example - * - * _.map(['6', '8', '10'], _.ary(parseInt, 1)); - * // => [6, 8, 10] - */ - function ary(func, n, guard) { - if (guard && isIterateeCall(func, n, guard)) { - n = undefined; - } - n = (func && n == null) ? func.length : nativeMax(+n || 0, 0); - return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n); - } - - /** - * Creates a function that invokes `func`, with the `this` binding and arguments - * of the created function, while it is called less than `n` times. Subsequent - * calls to the created function return the result of the last `func` invocation. - * - * @static - * @memberOf _ - * @category Function - * @param {number} n The number of calls at which `func` is no longer invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * jQuery('#add').on('click', _.before(5, addContactToList)); - * // => allows adding up to 4 contacts to the list - */ - function before(n, func) { - var result; - if (typeof func != 'function') { - if (typeof n == 'function') { - var temp = n; - n = func; - func = temp; - } else { - throw new TypeError(FUNC_ERROR_TEXT); - } - } - return function() { - if (--n > 0) { - result = func.apply(this, arguments); - } - if (n <= 1) { - func = undefined; - } - return result; - }; - } - - /** - * Creates a function that invokes `func` with the `this` binding of `thisArg` - * and prepends any additional `_.bind` arguments to those provided to the - * bound function. - * - * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for partially applied arguments. - * - * **Note:** Unlike native `Function#bind` this method does not set the "length" - * property of bound functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var greet = function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * }; - * - * var object = { 'user': 'fred' }; - * - * var bound = _.bind(greet, object, 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * // using placeholders - * var bound = _.bind(greet, object, _, '!'); - * bound('hi'); - * // => 'hi fred!' - */ - var bind = restParam(function(func, thisArg, partials) { - var bitmask = BIND_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, bind.placeholder); - bitmask |= PARTIAL_FLAG; - } - return createWrapper(func, bitmask, thisArg, partials, holders); - }); - - /** - * Binds methods of an object to the object itself, overwriting the existing - * method. Method names may be specified as individual arguments or as arrays - * of method names. If no method names are provided all enumerable function - * properties, own and inherited, of `object` are bound. - * - * **Note:** This method does not set the "length" property of bound functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Object} object The object to bind and assign the bound methods to. - * @param {...(string|string[])} [methodNames] The object method names to bind, - * specified as individual method names or arrays of method names. - * @returns {Object} Returns `object`. - * @example - * - * var view = { - * 'label': 'docs', - * 'onClick': function() { - * console.log('clicked ' + this.label); - * } - * }; - * - * _.bindAll(view); - * jQuery('#docs').on('click', view.onClick); - * // => logs 'clicked docs' when the element is clicked - */ - var bindAll = restParam(function(object, methodNames) { - methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object); - - var index = -1, - length = methodNames.length; - - while (++index < length) { - var key = methodNames[index]; - object[key] = createWrapper(object[key], BIND_FLAG, object); - } - return object; - }); - - /** - * Creates a function that invokes the method at `object[key]` and prepends - * any additional `_.bindKey` arguments to those provided to the bound function. - * - * This method differs from `_.bind` by allowing bound functions to reference - * methods that may be redefined or don't yet exist. - * See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) - * for more details. - * - * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * @static - * @memberOf _ - * @category Function - * @param {Object} object The object the method belongs to. - * @param {string} key The key of the method. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var object = { - * 'user': 'fred', - * 'greet': function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * }; - * - * var bound = _.bindKey(object, 'greet', 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * object.greet = function(greeting, punctuation) { - * return greeting + 'ya ' + this.user + punctuation; - * }; - * - * bound('!'); - * // => 'hiya fred!' - * - * // using placeholders - * var bound = _.bindKey(object, 'greet', _, '!'); - * bound('hi'); - * // => 'hiya fred!' - */ - var bindKey = restParam(function(object, key, partials) { - var bitmask = BIND_FLAG | BIND_KEY_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, bindKey.placeholder); - bitmask |= PARTIAL_FLAG; - } - return createWrapper(key, bitmask, object, partials, holders); - }); - - /** - * Creates a function that accepts one or more arguments of `func` that when - * called either invokes `func` returning its result, if all `func` arguments - * have been provided, or returns a function that accepts one or more of the - * remaining `func` arguments, and so on. The arity of `func` may be specified - * if `func.length` is not sufficient. - * - * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for provided arguments. - * - * **Note:** This method does not set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curry(abc); - * - * curried(1)(2)(3); - * // => [1, 2, 3] - * - * curried(1, 2)(3); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // using placeholders - * curried(1)(_, 3)(2); - * // => [1, 2, 3] - */ - var curry = createCurry(CURRY_FLAG); - - /** - * This method is like `_.curry` except that arguments are applied to `func` - * in the manner of `_.partialRight` instead of `_.partial`. - * - * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for provided arguments. - * - * **Note:** This method does not set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curryRight(abc); - * - * curried(3)(2)(1); - * // => [1, 2, 3] - * - * curried(2, 3)(1); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // using placeholders - * curried(3)(1, _)(2); - * // => [1, 2, 3] - */ - var curryRight = createCurry(CURRY_RIGHT_FLAG); - - /** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked. The debounced function comes with a `cancel` method to cancel - * delayed invocations. Provide an options object to indicate that `func` - * should be invoked on the leading and/or trailing edge of the `wait` timeout. - * Subsequent calls to the debounced function return the result of the last - * `func` invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked - * on the trailing edge of the timeout only if the the debounced function is - * invoked more than once during the `wait` timeout. - * - * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) - * for details over the differences between `_.debounce` and `_.throttle`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options] The options object. - * @param {boolean} [options.leading=false] Specify invoking on the leading - * edge of the timeout. - * @param {number} [options.maxWait] The maximum time `func` is allowed to be - * delayed before it is invoked. - * @param {boolean} [options.trailing=true] Specify invoking on the trailing - * edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // avoid costly calculations while the window size is in flux - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // invoke `sendMail` when the click event is fired, debouncing subsequent calls - * jQuery('#postbox').on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // ensure `batchLog` is invoked once after 1 second of debounced calls - * var source = new EventSource('/stream'); - * jQuery(source).on('message', _.debounce(batchLog, 250, { - * 'maxWait': 1000 - * })); - * - * // cancel a debounced call - * var todoChanges = _.debounce(batchLog, 1000); - * Object.observe(models.todo, todoChanges); - * - * Object.observe(models, function(changes) { - * if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) { - * todoChanges.cancel(); - * } - * }, ['delete']); - * - * // ...at some point `models.todo` is changed - * models.todo.completed = true; - * - * // ...before 1 second has passed `models.todo` is deleted - * // which cancels the debounced `todoChanges` call - * delete models.todo; - */ - function debounce(func, wait, options) { - var args, - maxTimeoutId, - result, - stamp, - thisArg, - timeoutId, - trailingCall, - lastCalled = 0, - maxWait = false, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = wait < 0 ? 0 : (+wait || 0); - if (options === true) { - var leading = true; - trailing = false; - } else if (isObject(options)) { - leading = !!options.leading; - maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait); - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - - function cancel() { - if (timeoutId) { - clearTimeout(timeoutId); - } - if (maxTimeoutId) { - clearTimeout(maxTimeoutId); - } - lastCalled = 0; - maxTimeoutId = timeoutId = trailingCall = undefined; - } - - function complete(isCalled, id) { - if (id) { - clearTimeout(id); - } - maxTimeoutId = timeoutId = trailingCall = undefined; - if (isCalled) { - lastCalled = now(); - result = func.apply(thisArg, args); - if (!timeoutId && !maxTimeoutId) { - args = thisArg = undefined; - } - } - } - - function delayed() { - var remaining = wait - (now() - stamp); - if (remaining <= 0 || remaining > wait) { - complete(trailingCall, maxTimeoutId); - } else { - timeoutId = setTimeout(delayed, remaining); - } - } - - function maxDelayed() { - complete(trailing, timeoutId); - } - - function debounced() { - args = arguments; - stamp = now(); - thisArg = this; - trailingCall = trailing && (timeoutId || !leading); - - if (maxWait === false) { - var leadingCall = leading && !timeoutId; - } else { - if (!maxTimeoutId && !leading) { - lastCalled = stamp; - } - var remaining = maxWait - (stamp - lastCalled), - isCalled = remaining <= 0 || remaining > maxWait; - - if (isCalled) { - if (maxTimeoutId) { - maxTimeoutId = clearTimeout(maxTimeoutId); - } - lastCalled = stamp; - result = func.apply(thisArg, args); - } - else if (!maxTimeoutId) { - maxTimeoutId = setTimeout(maxDelayed, remaining); - } - } - if (isCalled && timeoutId) { - timeoutId = clearTimeout(timeoutId); - } - else if (!timeoutId && wait !== maxWait) { - timeoutId = setTimeout(delayed, wait); - } - if (leadingCall) { - isCalled = true; - result = func.apply(thisArg, args); - } - if (isCalled && !timeoutId && !maxTimeoutId) { - args = thisArg = undefined; - } - return result; - } - debounced.cancel = cancel; - return debounced; - } - - /** - * Defers invoking the `func` until the current call stack has cleared. Any - * additional arguments are provided to `func` when it is invoked. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to defer. - * @param {...*} [args] The arguments to invoke the function with. - * @returns {number} Returns the timer id. - * @example - * - * _.defer(function(text) { - * console.log(text); - * }, 'deferred'); - * // logs 'deferred' after one or more milliseconds - */ - var defer = restParam(function(func, args) { - return baseDelay(func, 1, args); - }); - - /** - * Invokes `func` after `wait` milliseconds. Any additional arguments are - * provided to `func` when it is invoked. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {...*} [args] The arguments to invoke the function with. - * @returns {number} Returns the timer id. - * @example - * - * _.delay(function(text) { - * console.log(text); - * }, 1000, 'later'); - * // => logs 'later' after one second - */ - var delay = restParam(function(func, wait, args) { - return baseDelay(func, wait, args); - }); - - /** - * Creates a function that returns the result of invoking the provided - * functions with the `this` binding of the created function, where each - * successive invocation is supplied the return value of the previous. - * - * @static - * @memberOf _ - * @category Function - * @param {...Function} [funcs] Functions to invoke. - * @returns {Function} Returns the new function. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var addSquare = _.flow(_.add, square); - * addSquare(1, 2); - * // => 9 - */ - var flow = createFlow(); - - /** - * This method is like `_.flow` except that it creates a function that - * invokes the provided functions from right to left. - * - * @static - * @memberOf _ - * @alias backflow, compose - * @category Function - * @param {...Function} [funcs] Functions to invoke. - * @returns {Function} Returns the new function. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var addSquare = _.flowRight(square, _.add); - * addSquare(1, 2); - * // => 9 - */ - var flowRight = createFlow(true); - - /** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is coerced to a string and used as the - * cache key. The `func` is invoked with the `this` binding of the memoized - * function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) - * method interface of `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoizing function. - * @example - * - * var upperCase = _.memoize(function(string) { - * return string.toUpperCase(); - * }); - * - * upperCase('fred'); - * // => 'FRED' - * - * // modifying the result cache - * upperCase.cache.set('fred', 'BARNEY'); - * upperCase('fred'); - * // => 'BARNEY' - * - * // replacing `_.memoize.Cache` - * var object = { 'user': 'fred' }; - * var other = { 'user': 'barney' }; - * var identity = _.memoize(_.identity); - * - * identity(object); - * // => { 'user': 'fred' } - * identity(other); - * // => { 'user': 'fred' } - * - * _.memoize.Cache = WeakMap; - * var identity = _.memoize(_.identity); - * - * identity(object); - * // => { 'user': 'fred' } - * identity(other); - * // => { 'user': 'barney' } - */ - function memoize(func, resolver) { - if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result); - return result; - }; - memoized.cache = new memoize.Cache; - return memoized; - } - - /** - * Creates a function that runs each argument through a corresponding - * transform function. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to wrap. - * @param {...(Function|Function[])} [transforms] The functions to transform - * arguments, specified as individual functions or arrays of functions. - * @returns {Function} Returns the new function. - * @example - * - * function doubled(n) { - * return n * 2; - * } - * - * function square(n) { - * return n * n; - * } - * - * var modded = _.modArgs(function(x, y) { - * return [x, y]; - * }, square, doubled); - * - * modded(1, 2); - * // => [1, 4] - * - * modded(5, 10); - * // => [25, 20] - */ - var modArgs = restParam(function(func, transforms) { - transforms = baseFlatten(transforms); - if (typeof func != 'function' || !arrayEvery(transforms, baseIsFunction)) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var length = transforms.length; - return restParam(function(args) { - var index = nativeMin(args.length, length); - while (index--) { - args[index] = transforms[index](args[index]); - } - return func.apply(this, args); - }); - }); - - /** - * Creates a function that negates the result of the predicate `func`. The - * `func` predicate is invoked with the `this` binding and arguments of the - * created function. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} predicate The predicate to negate. - * @returns {Function} Returns the new function. - * @example - * - * function isEven(n) { - * return n % 2 == 0; - * } - * - * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); - * // => [1, 3, 5] - */ - function negate(predicate) { - if (typeof predicate != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function() { - return !predicate.apply(this, arguments); - }; - } - - /** - * Creates a function that is restricted to invoking `func` once. Repeat calls - * to the function return the value of the first call. The `func` is invoked - * with the `this` binding and arguments of the created function. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var initialize = _.once(createApplication); - * initialize(); - * initialize(); - * // `initialize` invokes `createApplication` once - */ - function once(func) { - return before(2, func); - } - - /** - * Creates a function that invokes `func` with `partial` arguments prepended - * to those provided to the new function. This method is like `_.bind` except - * it does **not** alter the `this` binding. - * - * The `_.partial.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method does not set the "length" property of partially - * applied functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * var greet = function(greeting, name) { - * return greeting + ' ' + name; - * }; - * - * var sayHelloTo = _.partial(greet, 'hello'); - * sayHelloTo('fred'); - * // => 'hello fred' - * - * // using placeholders - * var greetFred = _.partial(greet, _, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - */ - var partial = createPartial(PARTIAL_FLAG); - - /** - * This method is like `_.partial` except that partially applied arguments - * are appended to those provided to the new function. - * - * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method does not set the "length" property of partially - * applied functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * var greet = function(greeting, name) { - * return greeting + ' ' + name; - * }; - * - * var greetFred = _.partialRight(greet, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - * - * // using placeholders - * var sayHelloTo = _.partialRight(greet, 'hello', _); - * sayHelloTo('fred'); - * // => 'hello fred' - */ - var partialRight = createPartial(PARTIAL_RIGHT_FLAG); - - /** - * Creates a function that invokes `func` with arguments arranged according - * to the specified indexes where the argument value at the first index is - * provided as the first argument, the argument value at the second index is - * provided as the second argument, and so on. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to rearrange arguments for. - * @param {...(number|number[])} indexes The arranged argument indexes, - * specified as individual indexes or arrays of indexes. - * @returns {Function} Returns the new function. - * @example - * - * var rearged = _.rearg(function(a, b, c) { - * return [a, b, c]; - * }, 2, 0, 1); - * - * rearged('b', 'c', 'a') - * // => ['a', 'b', 'c'] - * - * var map = _.rearg(_.map, [1, 0]); - * map(function(n) { - * return n * 3; - * }, [1, 2, 3]); - * // => [3, 6, 9] - */ - var rearg = restParam(function(func, indexes) { - return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes)); - }); - - /** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as an array. - * - * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters). - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.restParam(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' - */ - function restParam(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - rest = Array(length); - - while (++index < length) { - rest[index] = args[start + index]; - } - switch (start) { - case 0: return func.call(this, rest); - case 1: return func.call(this, args[0], rest); - case 2: return func.call(this, args[0], args[1], rest); - } - var otherArgs = Array(start + 1); - index = -1; - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = rest; - return func.apply(this, otherArgs); - }; - } - - /** - * Creates a function that invokes `func` with the `this` binding of the created - * function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3). - * - * **Note:** This method is based on the [spread operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator). - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to spread arguments over. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.spread(function(who, what) { - * return who + ' says ' + what; - * }); - * - * say(['fred', 'hello']); - * // => 'fred says hello' - * - * // with a Promise - * var numbers = Promise.all([ - * Promise.resolve(40), - * Promise.resolve(36) - * ]); - * - * numbers.then(_.spread(function(x, y) { - * return x + y; - * })); - * // => a Promise of 76 - */ - function spread(func) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function(array) { - return func.apply(this, array); - }; - } - - /** - * Creates a throttled function that only invokes `func` at most once per - * every `wait` milliseconds. The throttled function comes with a `cancel` - * method to cancel delayed invocations. Provide an options object to indicate - * that `func` should be invoked on the leading and/or trailing edge of the - * `wait` timeout. Subsequent calls to the throttled function return the - * result of the last `func` call. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked - * on the trailing edge of the timeout only if the the throttled function is - * invoked more than once during the `wait` timeout. - * - * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) - * for details over the differences between `_.throttle` and `_.debounce`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to throttle. - * @param {number} [wait=0] The number of milliseconds to throttle invocations to. - * @param {Object} [options] The options object. - * @param {boolean} [options.leading=true] Specify invoking on the leading - * edge of the timeout. - * @param {boolean} [options.trailing=true] Specify invoking on the trailing - * edge of the timeout. - * @returns {Function} Returns the new throttled function. - * @example - * - * // avoid excessively updating the position while scrolling - * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); - * - * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes - * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, { - * 'trailing': false - * })); - * - * // cancel a trailing throttled call - * jQuery(window).on('popstate', throttled.cancel); - */ - function throttle(func, wait, options) { - var leading = true, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (options === false) { - leading = false; - } else if (isObject(options)) { - leading = 'leading' in options ? !!options.leading : leading; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - return debounce(func, wait, { 'leading': leading, 'maxWait': +wait, 'trailing': trailing }); - } - - /** - * Creates a function that provides `value` to the wrapper function as its - * first argument. Any additional arguments provided to the function are - * appended to those provided to the wrapper function. The wrapper is invoked - * with the `this` binding of the created function. - * - * @static - * @memberOf _ - * @category Function - * @param {*} value The value to wrap. - * @param {Function} wrapper The wrapper function. - * @returns {Function} Returns the new function. - * @example - * - * var p = _.wrap(_.escape, function(func, text) { - * return '

' + func(text) + '

'; - * }); - * - * p('fred, barney, & pebbles'); - * // => '

fred, barney, & pebbles

' - */ - function wrap(value, wrapper) { - wrapper = wrapper == null ? identity : wrapper; - return createWrapper(wrapper, PARTIAL_FLAG, undefined, [value], []); - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned, - * otherwise they are assigned by reference. If `customizer` is provided it is - * invoked to produce the cloned values. If `customizer` returns `undefined` - * cloning is handled by the method instead. The `customizer` is bound to - * `thisArg` and invoked with two argument; (value [, index|key, object]). - * - * **Note:** This method is loosely based on the - * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm). - * The enumerable properties of `arguments` objects and objects created by - * constructors other than `Object` are cloned to plain `Object` objects. An - * empty object is returned for uncloneable values such as functions, DOM nodes, - * Maps, Sets, and WeakMaps. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @param {Function} [customizer] The function to customize cloning values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {*} Returns the cloned value. - * @example - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * var shallow = _.clone(users); - * shallow[0] === users[0]; - * // => true - * - * var deep = _.clone(users, true); - * deep[0] === users[0]; - * // => false - * - * // using a customizer callback - * var el = _.clone(document.body, function(value) { - * if (_.isElement(value)) { - * return value.cloneNode(false); - * } - * }); - * - * el === document.body - * // => false - * el.nodeName - * // => BODY - * el.childNodes.length; - * // => 0 - */ - function clone(value, isDeep, customizer, thisArg) { - if (isDeep && typeof isDeep != 'boolean' && isIterateeCall(value, isDeep, customizer)) { - isDeep = false; - } - else if (typeof isDeep == 'function') { - thisArg = customizer; - customizer = isDeep; - isDeep = false; - } - return typeof customizer == 'function' - ? baseClone(value, isDeep, bindCallback(customizer, thisArg, 1)) - : baseClone(value, isDeep); - } - - /** - * Creates a deep clone of `value`. If `customizer` is provided it is invoked - * to produce the cloned values. If `customizer` returns `undefined` cloning - * is handled by the method instead. The `customizer` is bound to `thisArg` - * and invoked with two argument; (value [, index|key, object]). - * - * **Note:** This method is loosely based on the - * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm). - * The enumerable properties of `arguments` objects and objects created by - * constructors other than `Object` are cloned to plain `Object` objects. An - * empty object is returned for uncloneable values such as functions, DOM nodes, - * Maps, Sets, and WeakMaps. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to deep clone. - * @param {Function} [customizer] The function to customize cloning values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {*} Returns the deep cloned value. - * @example - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * var deep = _.cloneDeep(users); - * deep[0] === users[0]; - * // => false - * - * // using a customizer callback - * var el = _.cloneDeep(document.body, function(value) { - * if (_.isElement(value)) { - * return value.cloneNode(true); - * } - * }); - * - * el === document.body - * // => false - * el.nodeName - * // => BODY - * el.childNodes.length; - * // => 20 - */ - function cloneDeep(value, customizer, thisArg) { - return typeof customizer == 'function' - ? baseClone(value, true, bindCallback(customizer, thisArg, 1)) - : baseClone(value, true); - } - - /** - * Checks if `value` is greater than `other`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`. - * @example - * - * _.gt(3, 1); - * // => true - * - * _.gt(3, 3); - * // => false - * - * _.gt(1, 3); - * // => false - */ - function gt(value, other) { - return value > other; - } - - /** - * Checks if `value` is greater than or equal to `other`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than or equal to `other`, else `false`. - * @example - * - * _.gte(3, 1); - * // => true - * - * _.gte(3, 3); - * // => true - * - * _.gte(1, 3); - * // => false - */ - function gte(value, other) { - return value >= other; - } - - /** - * Checks if `value` is classified as an `arguments` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - function isArguments(value) { - return isObjectLike(value) && isArrayLike(value) && - hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); - } - - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(function() { return arguments; }()); - * // => false - */ - var isArray = nativeIsArray || function(value) { - return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; - }; - - /** - * Checks if `value` is classified as a boolean primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isBoolean(false); - * // => true - * - * _.isBoolean(null); - * // => false - */ - function isBoolean(value) { - return value === true || value === false || (isObjectLike(value) && objToString.call(value) == boolTag); - } - - /** - * Checks if `value` is classified as a `Date` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isDate(new Date); - * // => true - * - * _.isDate('Mon April 23 2012'); - * // => false - */ - function isDate(value) { - return isObjectLike(value) && objToString.call(value) == dateTag; - } - - /** - * Checks if `value` is a DOM element. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. - * @example - * - * _.isElement(document.body); - * // => true - * - * _.isElement(''); - * // => false - */ - function isElement(value) { - return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value); - } - - /** - * Checks if `value` is empty. A value is considered empty unless it is an - * `arguments` object, array, string, or jQuery-like collection with a length - * greater than `0` or an object with own enumerable properties. - * - * @static - * @memberOf _ - * @category Lang - * @param {Array|Object|string} value The value to inspect. - * @returns {boolean} Returns `true` if `value` is empty, else `false`. - * @example - * - * _.isEmpty(null); - * // => true - * - * _.isEmpty(true); - * // => true - * - * _.isEmpty(1); - * // => true - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({ 'a': 1 }); - * // => false - */ - function isEmpty(value) { - if (value == null) { - return true; - } - if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) || - (isObjectLike(value) && isFunction(value.splice)))) { - return !value.length; - } - return !keys(value).length; - } - - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. If `customizer` is provided it is invoked to compare values. - * If `customizer` returns `undefined` comparisons are handled by the method - * instead. The `customizer` is bound to `thisArg` and invoked with three - * arguments: (value, other [, index|key]). - * - * **Note:** This method supports comparing arrays, booleans, `Date` objects, - * numbers, `Object` objects, regexes, and strings. Objects are compared by - * their own, not inherited, enumerable properties. Functions and DOM nodes - * are **not** supported. Provide a customizer function to extend support - * for comparing other values. - * - * @static - * @memberOf _ - * @alias eq - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize value comparisons. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * object == other; - * // => false - * - * _.isEqual(object, other); - * // => true - * - * // using a customizer callback - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqual(array, other, function(value, other) { - * if (_.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/)) { - * return true; - * } - * }); - * // => true - */ - function isEqual(value, other, customizer, thisArg) { - customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined; - var result = customizer ? customizer(value, other) : undefined; - return result === undefined ? baseIsEqual(value, other, customizer) : !!result; - } - - /** - * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, - * `SyntaxError`, `TypeError`, or `URIError` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an error object, else `false`. - * @example - * - * _.isError(new Error); - * // => true - * - * _.isError(Error); - * // => false - */ - function isError(value) { - return isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag; - } - - /** - * Checks if `value` is a finite primitive number. - * - * **Note:** This method is based on [`Number.isFinite`](http://ecma-international.org/ecma-262/6.0/#sec-number.isfinite). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. - * @example - * - * _.isFinite(10); - * // => true - * - * _.isFinite('10'); - * // => false - * - * _.isFinite(true); - * // => false - * - * _.isFinite(Object(10)); - * // => false - * - * _.isFinite(Infinity); - * // => false - */ - function isFinite(value) { - return typeof value == 'number' && nativeIsFinite(value); - } - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in older versions of Chrome and Safari which return 'function' for regexes - // and Safari 8 equivalents which return 'object' for typed array constructors. - return isObject(value) && objToString.call(value) == funcTag; - } - - /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ - function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } - - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. If `customizer` is provided - * it is invoked to compare values. If `customizer` returns `undefined` - * comparisons are handled by the method instead. The `customizer` is bound - * to `thisArg` and invoked with three arguments: (value, other, index|key). - * - * **Note:** This method supports comparing properties of arrays, booleans, - * `Date` objects, numbers, `Object` objects, regexes, and strings. Functions - * and DOM nodes are **not** supported. Provide a customizer function to extend - * support for comparing other values. - * - * @static - * @memberOf _ - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Function} [customizer] The function to customize value comparisons. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - * - * // using a customizer callback - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatch(object, source, function(value, other) { - * return _.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined; - * }); - * // => true - */ - function isMatch(object, source, customizer, thisArg) { - customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined; - return baseIsMatch(object, getMatchData(source), customizer); - } - - /** - * Checks if `value` is `NaN`. - * - * **Note:** This method is not the same as [`isNaN`](https://es5.github.io/#x15.1.2.4) - * which returns `true` for `undefined` and other non-numeric values. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - * @example - * - * _.isNaN(NaN); - * // => true - * - * _.isNaN(new Number(NaN)); - * // => true - * - * isNaN(undefined); - * // => true - * - * _.isNaN(undefined); - * // => false - */ - function isNaN(value) { - // An `NaN` primitive is the only value that is not equal to itself. - // Perform the `toStringTag` check first to avoid errors with some host objects in IE. - return isNumber(value) && value != +value; - } - - /** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ - function isNative(value) { - if (value == null) { - return false; - } - if (isFunction(value)) { - return reIsNative.test(fnToString.call(value)); - } - return isObjectLike(value) && reIsHostCtor.test(value); - } - - /** - * Checks if `value` is `null`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `null`, else `false`. - * @example - * - * _.isNull(null); - * // => true - * - * _.isNull(void 0); - * // => false - */ - function isNull(value) { - return value === null; - } - - /** - * Checks if `value` is classified as a `Number` primitive or object. - * - * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified - * as numbers, use the `_.isFinite` method. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isNumber(8.4); - * // => true - * - * _.isNumber(NaN); - * // => true - * - * _.isNumber('8.4'); - * // => false - */ - function isNumber(value) { - return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag); - } - - /** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * **Note:** This method assumes objects created by the `Object` constructor - * have no inherited enumerable properties. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ - function isPlainObject(value) { - var Ctor; - - // Exit early for non `Object` objects. - if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isArguments(value)) || - (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) { - return false; - } - // IE < 9 iterates inherited properties before own properties. If the first - // iterated property is an object's own property then there are no inherited - // enumerable properties. - var result; - // In most environments an object's own properties are iterated before - // its inherited properties. If the last iterated property is an object's - // own property then there are no inherited enumerable properties. - baseForIn(value, function(subValue, key) { - result = key; - }); - return result === undefined || hasOwnProperty.call(value, result); - } - - /** - * Checks if `value` is classified as a `RegExp` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isRegExp(/abc/); - * // => true - * - * _.isRegExp('/abc/'); - * // => false - */ - function isRegExp(value) { - return isObject(value) && objToString.call(value) == regexpTag; - } - - /** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ - function isString(value) { - return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag); - } - - /** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ - function isTypedArray(value) { - return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)]; - } - - /** - * Checks if `value` is `undefined`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. - * @example - * - * _.isUndefined(void 0); - * // => true - * - * _.isUndefined(null); - * // => false - */ - function isUndefined(value) { - return value === undefined; - } - - /** - * Checks if `value` is less than `other`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`. - * @example - * - * _.lt(1, 3); - * // => true - * - * _.lt(3, 3); - * // => false - * - * _.lt(3, 1); - * // => false - */ - function lt(value, other) { - return value < other; - } - - /** - * Checks if `value` is less than or equal to `other`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than or equal to `other`, else `false`. - * @example - * - * _.lte(1, 3); - * // => true - * - * _.lte(3, 3); - * // => true - * - * _.lte(3, 1); - * // => false - */ - function lte(value, other) { - return value <= other; - } - - /** - * Converts `value` to an array. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {Array} Returns the converted array. - * @example - * - * (function() { - * return _.toArray(arguments).slice(1); - * }(1, 2, 3)); - * // => [2, 3] - */ - function toArray(value) { - var length = value ? getLength(value) : 0; - if (!isLength(length)) { - return values(value); - } - if (!length) { - return []; - } - return arrayCopy(value); - } - - /** - * Converts `value` to a plain object flattening inherited enumerable - * properties of `value` to own properties of the plain object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {Object} Returns the converted plain object. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.assign({ 'a': 1 }, new Foo); - * // => { 'a': 1, 'b': 2 } - * - * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); - * // => { 'a': 1, 'b': 2, 'c': 3 } - */ - function toPlainObject(value) { - return baseCopy(value, keysIn(value)); - } - - /*------------------------------------------------------------------------*/ - - /** - * Recursively merges own enumerable properties of the source object(s), that - * don't resolve to `undefined` into the destination object. Subsequent sources - * overwrite property assignments of previous sources. If `customizer` is - * provided it is invoked to produce the merged values of the destination and - * source properties. If `customizer` returns `undefined` merging is handled - * by the method instead. The `customizer` is bound to `thisArg` and invoked - * with five arguments: (objectValue, sourceValue, key, object, source). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {Object} Returns `object`. - * @example - * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] - * }; - * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] - * }; - * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } - * - * // using a customizer callback - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, function(a, b) { - * if (_.isArray(a)) { - * return a.concat(b); - * } - * }); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - var merge = createAssigner(baseMerge); - - /** - * Assigns own enumerable properties of source object(s) to the destination - * object. Subsequent sources overwrite property assignments of previous sources. - * If `customizer` is provided it is invoked to produce the assigned values. - * The `customizer` is bound to `thisArg` and invoked with five arguments: - * (objectValue, sourceValue, key, object, source). - * - * **Note:** This method mutates `object` and is based on - * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign). - * - * @static - * @memberOf _ - * @alias extend - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {Object} Returns `object`. - * @example - * - * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); - * // => { 'user': 'fred', 'age': 40 } - * - * // using a customizer callback - * var defaults = _.partialRight(_.assign, function(value, other) { - * return _.isUndefined(value) ? other : value; - * }); - * - * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); - * // => { 'user': 'barney', 'age': 36 } - */ - var assign = createAssigner(function(object, source, customizer) { - return customizer - ? assignWith(object, source, customizer) - : baseAssign(object, source); - }); - - /** - * Creates an object that inherits from the given `prototype` object. If a - * `properties` object is provided its own enumerable properties are assigned - * to the created object. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} prototype The object to inherit from. - * @param {Object} [properties] The properties to assign to the object. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Object} Returns the new object. - * @example - * - * function Shape() { - * this.x = 0; - * this.y = 0; - * } - * - * function Circle() { - * Shape.call(this); - * } - * - * Circle.prototype = _.create(Shape.prototype, { - * 'constructor': Circle - * }); - * - * var circle = new Circle; - * circle instanceof Circle; - * // => true - * - * circle instanceof Shape; - * // => true - */ - function create(prototype, properties, guard) { - var result = baseCreate(prototype); - if (guard && isIterateeCall(prototype, properties, guard)) { - properties = undefined; - } - return properties ? baseAssign(result, properties) : result; - } - - /** - * Assigns own enumerable properties of source object(s) to the destination - * object for all destination properties that resolve to `undefined`. Once a - * property is set, additional values of the same property are ignored. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); - * // => { 'user': 'barney', 'age': 36 } - */ - var defaults = createDefaults(assign, assignDefaults); - - /** - * This method is like `_.defaults` except that it recursively assigns - * default properties. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } }); - * // => { 'user': { 'name': 'barney', 'age': 36 } } - * - */ - var defaultsDeep = createDefaults(merge, mergeDefaults); - - /** - * This method is like `_.find` except that it returns the key of the first - * element `predicate` returns truthy for instead of the element itself. - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {string|undefined} Returns the key of the matched element, else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findKey(users, function(chr) { - * return chr.age < 40; - * }); - * // => 'barney' (iteration order is not guaranteed) - * - * // using the `_.matches` callback shorthand - * _.findKey(users, { 'age': 1, 'active': true }); - * // => 'pebbles' - * - * // using the `_.matchesProperty` callback shorthand - * _.findKey(users, 'active', false); - * // => 'fred' - * - * // using the `_.property` callback shorthand - * _.findKey(users, 'active'); - * // => 'barney' - */ - var findKey = createFindKey(baseForOwn); - - /** - * This method is like `_.findKey` except that it iterates over elements of - * a collection in the opposite order. - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {string|undefined} Returns the key of the matched element, else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findLastKey(users, function(chr) { - * return chr.age < 40; - * }); - * // => returns `pebbles` assuming `_.findKey` returns `barney` - * - * // using the `_.matches` callback shorthand - * _.findLastKey(users, { 'age': 36, 'active': true }); - * // => 'barney' - * - * // using the `_.matchesProperty` callback shorthand - * _.findLastKey(users, 'active', false); - * // => 'fred' - * - * // using the `_.property` callback shorthand - * _.findLastKey(users, 'active'); - * // => 'pebbles' - */ - var findLastKey = createFindKey(baseForOwnRight); - - /** - * Iterates over own and inherited enumerable properties of an object invoking - * `iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked - * with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forIn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'a', 'b', and 'c' (iteration order is not guaranteed) - */ - var forIn = createForIn(baseFor); - - /** - * This method is like `_.forIn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forInRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c' - */ - var forInRight = createForIn(baseForRight); - - /** - * Iterates over own enumerable properties of an object invoking `iteratee` - * for each property. The `iteratee` is bound to `thisArg` and invoked with - * three arguments: (value, key, object). Iteratee functions may exit iteration - * early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'a' and 'b' (iteration order is not guaranteed) - */ - var forOwn = createForOwn(baseForOwn); - - /** - * This method is like `_.forOwn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwnRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'b' and 'a' assuming `_.forOwn` logs 'a' and 'b' - */ - var forOwnRight = createForOwn(baseForOwnRight); - - /** - * Creates an array of function property names from all enumerable properties, - * own and inherited, of `object`. - * - * @static - * @memberOf _ - * @alias methods - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the new array of property names. - * @example - * - * _.functions(_); - * // => ['after', 'ary', 'assign', ...] - */ - function functions(object) { - return baseFunctions(object, keysIn(object)); - } - - /** - * Gets the property value at `path` of `object`. If the resolved value is - * `undefined` the `defaultValue` is used in its place. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 - * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 - * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' - */ - function get(object, path, defaultValue) { - var result = object == null ? undefined : baseGet(object, toPath(path), path + ''); - return result === undefined ? defaultValue : result; - } - - /** - * Checks if `path` is a direct property. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` is a direct property, else `false`. - * @example - * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b.c'); - * // => true - * - * _.has(object, ['a', 'b', 'c']); - * // => true - */ - function has(object, path) { - if (object == null) { - return false; - } - var result = hasOwnProperty.call(object, path); - if (!result && !isKey(path)) { - path = toPath(path); - object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); - if (object == null) { - return false; - } - path = last(path); - result = hasOwnProperty.call(object, path); - } - return result || (isLength(object.length) && isIndex(path, object.length) && - (isArray(object) || isArguments(object))); - } - - /** - * Creates an object composed of the inverted keys and values of `object`. - * If `object` contains duplicate values, subsequent values overwrite property - * assignments of previous values unless `multiValue` is `true`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to invert. - * @param {boolean} [multiValue] Allow multiple values per key. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Object} Returns the new inverted object. - * @example - * - * var object = { 'a': 1, 'b': 2, 'c': 1 }; - * - * _.invert(object); - * // => { '1': 'c', '2': 'b' } - * - * // with `multiValue` - * _.invert(object, true); - * // => { '1': ['a', 'c'], '2': ['b'] } - */ - function invert(object, multiValue, guard) { - if (guard && isIterateeCall(object, multiValue, guard)) { - multiValue = undefined; - } - var index = -1, - props = keys(object), - length = props.length, - result = {}; - - while (++index < length) { - var key = props[index], - value = object[key]; - - if (multiValue) { - if (hasOwnProperty.call(result, value)) { - result[value].push(key); - } else { - result[value] = [key]; - } - } - else { - result[value] = key; - } - } - return result; - } - - /** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) - * for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ - var keys = !nativeKeys ? shimKeys : function(object) { - var Ctor = object == null ? undefined : object.constructor; - if ((typeof Ctor == 'function' && Ctor.prototype === object) || - (typeof object != 'function' && isArrayLike(object))) { - return shimKeys(object); - } - return isObject(object) ? nativeKeys(object) : []; - }; - - /** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ - function keysIn(object) { - if (object == null) { - return []; - } - if (!isObject(object)) { - object = Object(object); - } - var length = object.length; - length = (length && isLength(length) && - (isArray(object) || isArguments(object)) && length) || 0; - - var Ctor = object.constructor, - index = -1, - isProto = typeof Ctor == 'function' && Ctor.prototype === object, - result = Array(length), - skipIndexes = length > 0; - - while (++index < length) { - result[index] = (index + ''); - } - for (var key in object) { - if (!(skipIndexes && isIndex(key, length)) && - !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; - } - - /** - * The opposite of `_.mapValues`; this method creates an object with the - * same values as `object` and keys generated by running each own enumerable - * property of `object` through `iteratee`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the new mapped object. - * @example - * - * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { - * return key + value; - * }); - * // => { 'a1': 1, 'b2': 2 } - */ - var mapKeys = createObjectMapper(true); - - /** - * Creates an object with the same keys as `object` and values generated by - * running each own enumerable property of `object` through `iteratee`. The - * iteratee function is bound to `thisArg` and invoked with three arguments: - * (value, key, object). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the new mapped object. - * @example - * - * _.mapValues({ 'a': 1, 'b': 2 }, function(n) { - * return n * 3; - * }); - * // => { 'a': 3, 'b': 6 } - * - * var users = { - * 'fred': { 'user': 'fred', 'age': 40 }, - * 'pebbles': { 'user': 'pebbles', 'age': 1 } - * }; - * - * // using the `_.property` callback shorthand - * _.mapValues(users, 'age'); - * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) - */ - var mapValues = createObjectMapper(); - - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {Function|...(string|string[])} [predicate] The function invoked per - * iteration or property names to omit, specified as individual property - * names or arrays of property names. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.omit(object, 'age'); - * // => { 'user': 'fred' } - * - * _.omit(object, _.isNumber); - * // => { 'user': 'fred' } - */ - var omit = restParam(function(object, props) { - if (object == null) { - return {}; - } - if (typeof props[0] != 'function') { - var props = arrayMap(baseFlatten(props), String); - return pickByArray(object, baseDifference(keysIn(object), props)); - } - var predicate = bindCallback(props[0], props[1], 3); - return pickByCallback(object, function(value, key, object) { - return !predicate(value, key, object); - }); - }); - - /** - * Creates a two dimensional array of the key-value pairs for `object`, - * e.g. `[[key1, value1], [key2, value2]]`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the new array of key-value pairs. - * @example - * - * _.pairs({ 'barney': 36, 'fred': 40 }); - * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed) - */ - function pairs(object) { - object = toObject(object); - - var index = -1, - props = keys(object), - length = props.length, - result = Array(length); - - while (++index < length) { - var key = props[index]; - result[index] = [key, object[key]]; - } - return result; - } - - /** - * Creates an object composed of the picked `object` properties. Property - * names may be specified as individual arguments or as arrays of property - * names. If `predicate` is provided it is invoked for each property of `object` - * picking the properties `predicate` returns truthy for. The predicate is - * bound to `thisArg` and invoked with three arguments: (value, key, object). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {Function|...(string|string[])} [predicate] The function invoked per - * iteration or property names to pick, specified as individual property - * names or arrays of property names. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.pick(object, 'user'); - * // => { 'user': 'fred' } - * - * _.pick(object, _.isString); - * // => { 'user': 'fred' } - */ - var pick = restParam(function(object, props) { - if (object == null) { - return {}; - } - return typeof props[0] == 'function' - ? pickByCallback(object, bindCallback(props[0], props[1], 3)) - : pickByArray(object, baseFlatten(props)); - }); - - /** - * This method is like `_.get` except that if the resolved value is a function - * it is invoked with the `this` binding of its parent object and its result - * is returned. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to resolve. - * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; - * - * _.result(object, 'a[0].b.c1'); - * // => 3 - * - * _.result(object, 'a[0].b.c2'); - * // => 4 - * - * _.result(object, 'a.b.c', 'default'); - * // => 'default' - * - * _.result(object, 'a.b.c', _.constant('default')); - * // => 'default' - */ - function result(object, path, defaultValue) { - var result = object == null ? undefined : object[path]; - if (result === undefined) { - if (object != null && !isKey(path, object)) { - path = toPath(path); - object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); - result = object == null ? undefined : object[last(path)]; - } - result = result === undefined ? defaultValue : result; - } - return isFunction(result) ? result.call(object) : result; - } - - /** - * Sets the property value of `path` on `object`. If a portion of `path` - * does not exist it is created. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to augment. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @returns {Object} Returns `object`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.set(object, 'a[0].b.c', 4); - * console.log(object.a[0].b.c); - * // => 4 - * - * _.set(object, 'x[0].y.z', 5); - * console.log(object.x[0].y.z); - * // => 5 - */ - function set(object, path, value) { - if (object == null) { - return object; - } - var pathKey = (path + ''); - path = (object[pathKey] != null || isKey(path, object)) ? [pathKey] : toPath(path); - - var index = -1, - length = path.length, - lastIndex = length - 1, - nested = object; - - while (nested != null && ++index < length) { - var key = path[index]; - if (isObject(nested)) { - if (index == lastIndex) { - nested[key] = value; - } else if (nested[key] == null) { - nested[key] = isIndex(path[index + 1]) ? [] : {}; - } - } - nested = nested[key]; - } - return object; - } - - /** - * An alternative to `_.reduce`; this method transforms `object` to a new - * `accumulator` object which is the result of running each of its own enumerable - * properties through `iteratee`, with each invocation potentially mutating - * the `accumulator` object. The `iteratee` is bound to `thisArg` and invoked - * with four arguments: (accumulator, value, key, object). Iteratee functions - * may exit iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Array|Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The custom accumulator value. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {*} Returns the accumulated value. - * @example - * - * _.transform([2, 3, 4], function(result, n) { - * result.push(n *= n); - * return n % 2 == 0; - * }); - * // => [4, 9] - * - * _.transform({ 'a': 1, 'b': 2 }, function(result, n, key) { - * result[key] = n * 3; - * }); - * // => { 'a': 3, 'b': 6 } - */ - function transform(object, iteratee, accumulator, thisArg) { - var isArr = isArray(object) || isTypedArray(object); - iteratee = getCallback(iteratee, thisArg, 4); - - if (accumulator == null) { - if (isArr || isObject(object)) { - var Ctor = object.constructor; - if (isArr) { - accumulator = isArray(object) ? new Ctor : []; - } else { - accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined); - } - } else { - accumulator = {}; - } - } - (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) { - return iteratee(accumulator, value, index, object); - }); - return accumulator; - } - - /** - * Creates an array of the own enumerable property values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.values(new Foo); - * // => [1, 2] (iteration order is not guaranteed) - * - * _.values('hi'); - * // => ['h', 'i'] - */ - function values(object) { - return baseValues(object, keys(object)); - } - - /** - * Creates an array of the own and inherited enumerable property values - * of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.valuesIn(new Foo); - * // => [1, 2, 3] (iteration order is not guaranteed) - */ - function valuesIn(object) { - return baseValues(object, keysIn(object)); - } - - /*------------------------------------------------------------------------*/ - - /** - * Checks if `n` is between `start` and up to but not including, `end`. If - * `end` is not specified it is set to `start` with `start` then set to `0`. - * - * @static - * @memberOf _ - * @category Number - * @param {number} n The number to check. - * @param {number} [start=0] The start of the range. - * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `n` is in the range, else `false`. - * @example - * - * _.inRange(3, 2, 4); - * // => true - * - * _.inRange(4, 8); - * // => true - * - * _.inRange(4, 2); - * // => false - * - * _.inRange(2, 2); - * // => false - * - * _.inRange(1.2, 2); - * // => true - * - * _.inRange(5.2, 4); - * // => false - */ - function inRange(value, start, end) { - start = +start || 0; - if (end === undefined) { - end = start; - start = 0; - } else { - end = +end || 0; - } - return value >= nativeMin(start, end) && value < nativeMax(start, end); - } - - /** - * Produces a random number between `min` and `max` (inclusive). If only one - * argument is provided a number between `0` and the given number is returned. - * If `floating` is `true`, or either `min` or `max` are floats, a floating-point - * number is returned instead of an integer. - * - * @static - * @memberOf _ - * @category Number - * @param {number} [min=0] The minimum possible value. - * @param {number} [max=1] The maximum possible value. - * @param {boolean} [floating] Specify returning a floating-point number. - * @returns {number} Returns the random number. - * @example - * - * _.random(0, 5); - * // => an integer between 0 and 5 - * - * _.random(5); - * // => also an integer between 0 and 5 - * - * _.random(5, true); - * // => a floating-point number between 0 and 5 - * - * _.random(1.2, 5.2); - * // => a floating-point number between 1.2 and 5.2 - */ - function random(min, max, floating) { - if (floating && isIterateeCall(min, max, floating)) { - max = floating = undefined; - } - var noMin = min == null, - noMax = max == null; - - if (floating == null) { - if (noMax && typeof min == 'boolean') { - floating = min; - min = 1; - } - else if (typeof max == 'boolean') { - floating = max; - noMax = true; - } - } - if (noMin && noMax) { - max = 1; - noMax = false; - } - min = +min || 0; - if (noMax) { - max = min; - min = 0; - } else { - max = +max || 0; - } - if (floating || min % 1 || max % 1) { - var rand = nativeRandom(); - return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand + '').length - 1)))), max); - } - return baseRandom(min, max); - } - - /*------------------------------------------------------------------------*/ - - /** - * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the camel cased string. - * @example - * - * _.camelCase('Foo Bar'); - * // => 'fooBar' - * - * _.camelCase('--foo-bar'); - * // => 'fooBar' - * - * _.camelCase('__foo_bar__'); - * // => 'fooBar' - */ - var camelCase = createCompounder(function(result, word, index) { - word = word.toLowerCase(); - return result + (index ? (word.charAt(0).toUpperCase() + word.slice(1)) : word); - }); - - /** - * Capitalizes the first character of `string`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to capitalize. - * @returns {string} Returns the capitalized string. - * @example - * - * _.capitalize('fred'); - * // => 'Fred' - */ - function capitalize(string) { - string = baseToString(string); - return string && (string.charAt(0).toUpperCase() + string.slice(1)); - } - - /** - * Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) - * to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to deburr. - * @returns {string} Returns the deburred string. - * @example - * - * _.deburr('déjà vu'); - * // => 'deja vu' - */ - function deburr(string) { - string = baseToString(string); - return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, ''); - } - - /** - * Checks if `string` ends with the given target string. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to search. - * @param {string} [target] The string to search for. - * @param {number} [position=string.length] The position to search from. - * @returns {boolean} Returns `true` if `string` ends with `target`, else `false`. - * @example - * - * _.endsWith('abc', 'c'); - * // => true - * - * _.endsWith('abc', 'b'); - * // => false - * - * _.endsWith('abc', 'b', 2); - * // => true - */ - function endsWith(string, target, position) { - string = baseToString(string); - target = (target + ''); - - var length = string.length; - position = position === undefined - ? length - : nativeMin(position < 0 ? 0 : (+position || 0), length); - - position -= target.length; - return position >= 0 && string.indexOf(target, position) == position; - } - - /** - * Converts the characters "&", "<", ">", '"', "'", and "\`", in `string` to - * their corresponding HTML entities. - * - * **Note:** No other characters are escaped. To escape additional characters - * use a third-party library like [_he_](https://mths.be/he). - * - * Though the ">" character is escaped for symmetry, characters like - * ">" and "/" don't need escaping in HTML and have no special meaning - * unless they're part of a tag or unquoted attribute value. - * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) - * (under "semi-related fun fact") for more details. - * - * Backticks are escaped because in Internet Explorer < 9, they can break out - * of attribute values or HTML comments. See [#59](https://html5sec.org/#59), - * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and - * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/) - * for more details. - * - * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping) - * to reduce XSS vectors. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escape('fred, barney, & pebbles'); - * // => 'fred, barney, & pebbles' - */ - function escape(string) { - // Reset `lastIndex` because in IE < 9 `String#replace` does not. - string = baseToString(string); - return (string && reHasUnescapedHtml.test(string)) - ? string.replace(reUnescapedHtml, escapeHtmlChar) - : string; - } - - /** - * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|", "?", - * "*", "+", "(", ")", "[", "]", "{" and "}" in `string`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escapeRegExp('[lodash](https://lodash.com/)'); - * // => '\[lodash\]\(https:\/\/lodash\.com\/\)' - */ - function escapeRegExp(string) { - string = baseToString(string); - return (string && reHasRegExpChars.test(string)) - ? string.replace(reRegExpChars, escapeRegExpChar) - : (string || '(?:)'); - } - - /** - * Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the kebab cased string. - * @example - * - * _.kebabCase('Foo Bar'); - * // => 'foo-bar' - * - * _.kebabCase('fooBar'); - * // => 'foo-bar' - * - * _.kebabCase('__foo_bar__'); - * // => 'foo-bar' - */ - var kebabCase = createCompounder(function(result, word, index) { - return result + (index ? '-' : '') + word.toLowerCase(); - }); - - /** - * Pads `string` on the left and right sides if it's shorter than `length`. - * Padding characters are truncated if they can't be evenly divided by `length`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.pad('abc', 8); - * // => ' abc ' - * - * _.pad('abc', 8, '_-'); - * // => '_-abc_-_' - * - * _.pad('abc', 3); - * // => 'abc' - */ - function pad(string, length, chars) { - string = baseToString(string); - length = +length; - - var strLength = string.length; - if (strLength >= length || !nativeIsFinite(length)) { - return string; - } - var mid = (length - strLength) / 2, - leftLength = nativeFloor(mid), - rightLength = nativeCeil(mid); - - chars = createPadding('', rightLength, chars); - return chars.slice(0, leftLength) + string + chars; - } - - /** - * Pads `string` on the left side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padLeft('abc', 6); - * // => ' abc' - * - * _.padLeft('abc', 6, '_-'); - * // => '_-_abc' - * - * _.padLeft('abc', 3); - * // => 'abc' - */ - var padLeft = createPadDir(); - - /** - * Pads `string` on the right side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padRight('abc', 6); - * // => 'abc ' - * - * _.padRight('abc', 6, '_-'); - * // => 'abc_-_' - * - * _.padRight('abc', 3); - * // => 'abc' - */ - var padRight = createPadDir(true); - - /** - * Converts `string` to an integer of the specified radix. If `radix` is - * `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal, - * in which case a `radix` of `16` is used. - * - * **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#E) - * of `parseInt`. - * - * @static - * @memberOf _ - * @category String - * @param {string} string The string to convert. - * @param {number} [radix] The radix to interpret `value` by. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {number} Returns the converted integer. - * @example - * - * _.parseInt('08'); - * // => 8 - * - * _.map(['6', '08', '10'], _.parseInt); - * // => [6, 8, 10] - */ - function parseInt(string, radix, guard) { - // Firefox < 21 and Opera < 15 follow ES3 for `parseInt`. - // Chrome fails to trim leading whitespace characters. - // See https://code.google.com/p/v8/issues/detail?id=3109 for more details. - if (guard ? isIterateeCall(string, radix, guard) : radix == null) { - radix = 0; - } else if (radix) { - radix = +radix; - } - string = trim(string); - return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10)); - } - - /** - * Repeats the given string `n` times. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to repeat. - * @param {number} [n=0] The number of times to repeat the string. - * @returns {string} Returns the repeated string. - * @example - * - * _.repeat('*', 3); - * // => '***' - * - * _.repeat('abc', 2); - * // => 'abcabc' - * - * _.repeat('abc', 0); - * // => '' - */ - function repeat(string, n) { - var result = ''; - string = baseToString(string); - n = +n; - if (n < 1 || !string || !nativeIsFinite(n)) { - return result; - } - // Leverage the exponentiation by squaring algorithm for a faster repeat. - // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. - do { - if (n % 2) { - result += string; - } - n = nativeFloor(n / 2); - string += string; - } while (n); - - return result; - } - - /** - * Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the snake cased string. - * @example - * - * _.snakeCase('Foo Bar'); - * // => 'foo_bar' - * - * _.snakeCase('fooBar'); - * // => 'foo_bar' - * - * _.snakeCase('--foo-bar'); - * // => 'foo_bar' - */ - var snakeCase = createCompounder(function(result, word, index) { - return result + (index ? '_' : '') + word.toLowerCase(); - }); - - /** - * Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the start cased string. - * @example - * - * _.startCase('--foo-bar'); - * // => 'Foo Bar' - * - * _.startCase('fooBar'); - * // => 'Foo Bar' - * - * _.startCase('__foo_bar__'); - * // => 'Foo Bar' - */ - var startCase = createCompounder(function(result, word, index) { - return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1)); - }); - - /** - * Checks if `string` starts with the given target string. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to search. - * @param {string} [target] The string to search for. - * @param {number} [position=0] The position to search from. - * @returns {boolean} Returns `true` if `string` starts with `target`, else `false`. - * @example - * - * _.startsWith('abc', 'a'); - * // => true - * - * _.startsWith('abc', 'b'); - * // => false - * - * _.startsWith('abc', 'b', 1); - * // => true - */ - function startsWith(string, target, position) { - string = baseToString(string); - position = position == null - ? 0 - : nativeMin(position < 0 ? 0 : (+position || 0), string.length); - - return string.lastIndexOf(target, position) == position; - } - - /** - * Creates a compiled template function that can interpolate data properties - * in "interpolate" delimiters, HTML-escape interpolated data properties in - * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data - * properties may be accessed as free variables in the template. If a setting - * object is provided it takes precedence over `_.templateSettings` values. - * - * **Note:** In the development build `_.template` utilizes - * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) - * for easier debugging. - * - * For more information on precompiling templates see - * [lodash's custom builds documentation](https://lodash.com/custom-builds). - * - * For more information on Chrome extension sandboxes see - * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The template string. - * @param {Object} [options] The options object. - * @param {RegExp} [options.escape] The HTML "escape" delimiter. - * @param {RegExp} [options.evaluate] The "evaluate" delimiter. - * @param {Object} [options.imports] An object to import into the template as free variables. - * @param {RegExp} [options.interpolate] The "interpolate" delimiter. - * @param {string} [options.sourceURL] The sourceURL of the template's compiled source. - * @param {string} [options.variable] The data object variable name. - * @param- {Object} [otherOptions] Enables the legacy `options` param signature. - * @returns {Function} Returns the compiled template function. - * @example - * - * // using the "interpolate" delimiter to create a compiled template - * var compiled = _.template('hello <%= user %>!'); - * compiled({ 'user': 'fred' }); - * // => 'hello fred!' - * - * // using the HTML "escape" delimiter to escape data property values - * var compiled = _.template('<%- value %>'); - * compiled({ 'value': ' -``` - -## Included Observable Operators ## - -### `Observable Methods` -- [`catch | catchException`](../../doc/api/core/operators/catch.md) -- [`concat`](../../doc/api/core/operators/concat.md) -- [`create | createWithDisposable`](../../doc/api/core/operators/create.md) -- [`defer`](../../doc/api/core/operators/defer.md) -- [`empty`](../../doc/api/core/operators/empty.md) -- [`from`](../../doc/api/core/operators/from.md) -- [`fromArray`](../../doc/api/core/operators/fromarray.md) -- [`fromCallback`](../../doc/api/core/operators/fromcallback.md) -- [`fromEvent`](../../doc/api/core/operators/fromevent.md) -- [`fromEventPattern`](../../doc/api/core/operators/fromeventpattern.md) -- [`fromNodeCallback`](../../doc/api/core/operators/fromnodecallback.md) -- [`fromPromise`](../../doc/api/core/operators/frompromise.md) -- [`interval`](../../doc/api/core/operators/interval.md) -- [`just`](../../doc/api/core/operators/return.md) -- [`merge`](../../doc/api/core/operators/merge.md) -- [`mergeDelayError`](../../doc/api/core/operators/mergedelayerror.md) -- [`never`](../../doc/api/core/operators/never.md) -- [`of`](../../doc/api/core/operators/of.md) -- [`ofWithScheduler`](../../doc/api/core/operators/ofwithscheduler.md) -- [`range`](../../doc/api/core/operators/range.md) -- [`repeat`](../../doc/api/core/operators/repeat.md) -- [`return | returnValue`](../../doc/api/core/operators/return.md) -- [`throw | throwError | throwException`](../../doc/api/core/operators/throw.md) -- [`timer`](../../doc/api/core/operators/timer.md) -- [`zip`](../../doc/api/core/operators/zip.md) -- [`zipArray`](../../doc/api/core/operators/ziparray.md) - -### `Observable Instance Methods` -- [`asObservable`](../../doc/api/core/operators/asobservable.md) -- [`catch | catchException`](../../doc/api/core/operators/catchproto.md) -- [`combineLatest`](../../doc/api/core/operators/combinelatest.md) -- [`concat`](../../doc/api/core/operators/concatproto.md) -- [`concatMap`](../../doc/api/core/operators/concatmap.md) -- [`connect`](../../doc/api/core/operators/connect.md) -- [`debounce`](../../doc/api/core/operators/debounce.md) -- [`defaultIfEmpty`](../../doc/api/core/operators/defaultifempty.md) -- [`delay`](../../doc/api/core/operators/delay.md) -- [`dematerialize`](../../doc/api/core/operators/dematerialize.md) -- [`distinctUntilChanged`](../../doc/api/core/operators/distinctuntilchanged.md) -- [`do | doAction`](../../doc/api/core/operators/do.md) -- [`doOnNext`](../../doc/api/core/operators/doonnext.md) -- [`doOnError`](../../doc/api/core/operators/doonerror.md) -- [`doOnCompleted`](../../doc/api/core/operators/dooncompleted.md) -- [`filter`](../../doc/api/core/operators/where.md) -- [`finally | finallyAction`](../../doc/api/core/operators/finally.md) -- [`flatMap`](../../doc/api/core/operators/selectmany.md) -- [`flatMapLatest`](../../doc/api/core/operators/flatmaplatest.md) -- [`ignoreElements`](../../doc/api/core/operators/ignoreelements.md) -- [`map`](../../doc/api/core/operators/select.md) -- [`merge`](../../doc/api/core/operators/mergeproto.md) -- [`mergeObservable | mergeAll`](../../doc/api/core/operators/mergeall.md) -- [`multicast`](../../doc/api/core/operators/multicast.md) -- [`publish`](../../doc/api/core/operators/publish.md) -- [`publishLast`](../../doc/api/core/operators/publishlast.md) -- [`publishValue`](../../doc/api/core/operators/publishvalue.md) -- [`refCount`](../../doc/api/core/operators/refcount.md) -- [`repeat`](../../doc/api/core/operators/repeat.md) -- [`replay`](../../doc/api/core/operators/replay.md) -- [`retry`](../../doc/api/core/operators/retry.md) -- [`retryWhen`](../../doc/api/core/operators/retrywhen.md) -- [`sample`](../../doc/api/core/operators/sample.md) -- [`scan`](../../doc/api/core/operators/scan.md) -- [`select`](../../doc/api/core/operators/select.md) -- [`selectConcat`](../../doc/api/core/operators/concatmap.md) -- [`selectMany`](../../doc/api/core/operators/selectmany.md) -- [`selectSwitch`](../../doc/api/core/operators/flatmaplatest.md) -- [`singleInstance`](../../doc/api/core/operators/singleinstance.md) -- [`skip`](../../doc/api/core/operators/skip.md) -- [`skipLast`](../../doc/api/core/operators/skiplast.md) -- [`skipUntil`](../../doc/api/core/operators/skipuntil.md) -- [`skipWhile`](../../doc/api/core/operators/skipwhile.md) -- [`startWith`](../../doc/api/core/operators/startwith.md) -- [`subscribe | forEach`](../../doc/api/core/operators/subscribe.md) -- [`subscribeOnNext`](../../doc/api/core/operators/subscribeonnext.md) -- [`subscribeOnError`](../../doc/api/core/operators/subscribeonerror.md) -- [`subscribeOnCompleted`](../../doc/api/core/operators/subscribeoncompleted.md) -- [`switch | switchLatest`](../../doc/api/core/operators/switch.md) -- [`take`](../../doc/api/core/operators/take.md) -- [`takeLast`](../../doc/api/core/operators/takelast.md) -- [`takeUntil`](../../doc/api/core/operators/takeuntil.md) -- [`takeWhile`](../../doc/api/core/operators/takewhile.md) -- [`tap`](../../doc/api/core/operators/do.md) -- [`tapOnNext`](../../doc/api/core/operators/doonnext.md) -- [`tapOnError`](../../doc/api/core/operators/doonerror.md) -- [`tapOnCompleted`](../../doc/api/core/operators/dooncompleted.md) -- [`throttle`](../../doc/api/core/operators/throttle.md) -- [`throttleFirst`](../../doc/api/core/operators/throttlefirst.md) -- [`timeout`](../../doc/api/core/operators/timeout.md) -- [`timestamp`](../../doc/api/core/operators/timestamp.md) -- [`toArray`](../../doc/api/core/operators/toarray.md) -- [`transduce`](../../doc/api/core/operators/transduce.md) -- [`where`](../../doc/api/core/operators/where.md) -- [`withLatestFrom`](../../doc/api/core/operators/withlatestfrom.md) -- [`zip`](../../doc/api/core/operators/zipproto.md) - -## Included Classes ## - -### Core Objects -- [`Rx.Observer`](../../doc/api/core/observer.md) -- [`Rx.Notification`](../../doc/api/core/notification.md) - -### Subjects - -- [`Rx.AsyncSubject`](../../doc/api/subjects/asyncsubject.md) -- [`Rx.BehaviorSubject`](../../doc/api/subjects/behaviorsubject.md) -- [`Rx.ReplaySubject`](../../doc/api/subjects/replaysubject.md) -- [`Rx.Subject`](../../doc/api/subjects/subject.md) - -### Schedulers - -- [`Rx.Scheduler`](../../doc/api/schedulers/scheduler.md) - -### Disposables - -- [`Rx.CompositeDisposable`](../../doc/api/disposables/compositedisposable.md) -- [`Rx.Disposable`](../../doc/api/disposables/disposable.md) -- [`Rx.RefCountDisposable`](../../doc/api/disposables/refcountdisposable.md) -- [`Rx.SerialDisposable`](../../doc/api/disposables/serialdisposable.md) -- [`Rx.SingleAssignmentDisposable`](../../doc/api/disposables/singleassignmentdisposable.md) - -## Contributing ## - -There are lots of ways to contribute to the project, and we appreciate our [contributors](https://github.com/Reactive-Extensions/RxJS/wiki/Contributors). If you wish to contribute, check out our [style guide]((https://github.com/Reactive-Extensions/RxJS/tree/master/doc/contributing)). - -You can contribute by reviewing and sending feedback on code checkins, suggesting and trying out new features as they are implemented, submit bugs and help us verify fixes as they are checked in, as well as submit code fixes or code contributions of your own. Note that all code submissions will be rigorously reviewed and tested by the Rx Team, and only those that meet an extremely high bar for both quality and design/roadmap appropriateness will be merged into the source. - -## License ## - -Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. -Microsoft Open Technologies would like to thank its contributors, a list -of whom are at https://github.com/Reactive-Extensions/RxJS/wiki/Contributors. - -Licensed under the Apache License, Version 2.0 (the "License"); you -may not use this file except in compliance with the License. You may -obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -implied. See the License for the specific language governing permissions -and limitations under the License. diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/rx-lite/rx.lite.js b/node_modules/eslint/node_modules/inquirer/node_modules/rx-lite/rx.lite.js deleted file mode 100644 index c06f934..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/rx-lite/rx.lite.js +++ /dev/null @@ -1,6366 +0,0 @@ -// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. - -;(function (undefined) { - - var objectTypes = { - 'function': true, - 'object': true - }; - - var - freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports, - freeSelf = objectTypes[typeof self] && self.Object && self, - freeWindow = objectTypes[typeof window] && window && window.Object && window, - freeModule = objectTypes[typeof module] && module && !module.nodeType && module, - moduleExports = freeModule && freeModule.exports === freeExports && freeExports, - freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global; - - var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this; - - var Rx = { - internals: {}, - config: { - Promise: root.Promise - }, - helpers: { } - }; - - // Defaults - var noop = Rx.helpers.noop = function () { }, - identity = Rx.helpers.identity = function (x) { return x; }, - defaultNow = Rx.helpers.defaultNow = Date.now, - defaultComparer = Rx.helpers.defaultComparer = function (x, y) { return isEqual(x, y); }, - defaultSubComparer = Rx.helpers.defaultSubComparer = function (x, y) { return x > y ? 1 : (x < y ? -1 : 0); }, - defaultKeySerializer = Rx.helpers.defaultKeySerializer = function (x) { return x.toString(); }, - defaultError = Rx.helpers.defaultError = function (err) { throw err; }, - isPromise = Rx.helpers.isPromise = function (p) { return !!p && typeof p.subscribe !== 'function' && typeof p.then === 'function'; }, - isFunction = Rx.helpers.isFunction = (function () { - - var isFn = function (value) { - return typeof value == 'function' || false; - } - - // fallback for older versions of Chrome and Safari - if (isFn(/x/)) { - isFn = function(value) { - return typeof value == 'function' && toString.call(value) == '[object Function]'; - }; - } - - return isFn; - }()); - - function cloneArray(arr) { - var len = arr.length, a = new Array(len); - for(var i = 0; i < len; i++) { a[i] = arr[i]; } - return a; - } - - var errorObj = {e: {}}; - function tryCatcherGen(tryCatchTarget) { - return function tryCatcher() { - try { - return tryCatchTarget.apply(this, arguments); - } catch (e) { - errorObj.e = e; - return errorObj; - } - } - } - var tryCatch = Rx.internals.tryCatch = function tryCatch(fn) { - if (!isFunction(fn)) { throw new TypeError('fn must be a function'); } - return tryCatcherGen(fn); - } - function thrower(e) { - throw e; - } - - Rx.config.longStackSupport = false; - var hasStacks = false, stacks = tryCatch(function () { throw new Error(); })(); - hasStacks = !!stacks.e && !!stacks.e.stack; - - // All code after this point will be filtered from stack traces reported by RxJS - var rStartingLine = captureLine(), rFileName; - - var STACK_JUMP_SEPARATOR = 'From previous event:'; - - function makeStackTraceLong(error, observable) { - // If possible, transform the error stack trace by removing Node and RxJS - // cruft, then concatenating with the stack trace of `observable`. - if (hasStacks && - observable.stack && - typeof error === 'object' && - error !== null && - error.stack && - error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1 - ) { - var stacks = []; - for (var o = observable; !!o; o = o.source) { - if (o.stack) { - stacks.unshift(o.stack); - } - } - stacks.unshift(error.stack); - - var concatedStacks = stacks.join('\n' + STACK_JUMP_SEPARATOR + '\n'); - error.stack = filterStackString(concatedStacks); - } - } - - function filterStackString(stackString) { - var lines = stackString.split('\n'), desiredLines = []; - for (var i = 0, len = lines.length; i < len; i++) { - var line = lines[i]; - - if (!isInternalFrame(line) && !isNodeFrame(line) && line) { - desiredLines.push(line); - } - } - return desiredLines.join('\n'); - } - - function isInternalFrame(stackLine) { - var fileNameAndLineNumber = getFileNameAndLineNumber(stackLine); - if (!fileNameAndLineNumber) { - return false; - } - var fileName = fileNameAndLineNumber[0], lineNumber = fileNameAndLineNumber[1]; - - return fileName === rFileName && - lineNumber >= rStartingLine && - lineNumber <= rEndingLine; - } - - function isNodeFrame(stackLine) { - return stackLine.indexOf('(module.js:') !== -1 || - stackLine.indexOf('(node.js:') !== -1; - } - - function captureLine() { - if (!hasStacks) { return; } - - try { - throw new Error(); - } catch (e) { - var lines = e.stack.split('\n'); - var firstLine = lines[0].indexOf('@') > 0 ? lines[1] : lines[2]; - var fileNameAndLineNumber = getFileNameAndLineNumber(firstLine); - if (!fileNameAndLineNumber) { return; } - - rFileName = fileNameAndLineNumber[0]; - return fileNameAndLineNumber[1]; - } - } - - function getFileNameAndLineNumber(stackLine) { - // Named functions: 'at functionName (filename:lineNumber:columnNumber)' - var attempt1 = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(stackLine); - if (attempt1) { return [attempt1[1], Number(attempt1[2])]; } - - // Anonymous functions: 'at filename:lineNumber:columnNumber' - var attempt2 = /at ([^ ]+):(\d+):(?:\d+)$/.exec(stackLine); - if (attempt2) { return [attempt2[1], Number(attempt2[2])]; } - - // Firefox style: 'function@filename:lineNumber or @filename:lineNumber' - var attempt3 = /.*@(.+):(\d+)$/.exec(stackLine); - if (attempt3) { return [attempt3[1], Number(attempt3[2])]; } - } - - var EmptyError = Rx.EmptyError = function() { - this.message = 'Sequence contains no elements.'; - this.name = 'EmptyError'; - Error.call(this); - }; - EmptyError.prototype = Object.create(Error.prototype); - - var ObjectDisposedError = Rx.ObjectDisposedError = function() { - this.message = 'Object has been disposed'; - this.name = 'ObjectDisposedError'; - Error.call(this); - }; - ObjectDisposedError.prototype = Object.create(Error.prototype); - - var ArgumentOutOfRangeError = Rx.ArgumentOutOfRangeError = function () { - this.message = 'Argument out of range'; - this.name = 'ArgumentOutOfRangeError'; - Error.call(this); - }; - ArgumentOutOfRangeError.prototype = Object.create(Error.prototype); - - var NotSupportedError = Rx.NotSupportedError = function (message) { - this.message = message || 'This operation is not supported'; - this.name = 'NotSupportedError'; - Error.call(this); - }; - NotSupportedError.prototype = Object.create(Error.prototype); - - var NotImplementedError = Rx.NotImplementedError = function (message) { - this.message = message || 'This operation is not implemented'; - this.name = 'NotImplementedError'; - Error.call(this); - }; - NotImplementedError.prototype = Object.create(Error.prototype); - - var notImplemented = Rx.helpers.notImplemented = function () { - throw new NotImplementedError(); - }; - - var notSupported = Rx.helpers.notSupported = function () { - throw new NotSupportedError(); - }; - - // Shim in iterator support - var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) || - '_es6shim_iterator_'; - // Bug for mozilla version - if (root.Set && typeof new root.Set()['@@iterator'] === 'function') { - $iterator$ = '@@iterator'; - } - - var doneEnumerator = Rx.doneEnumerator = { done: true, value: undefined }; - - var isIterable = Rx.helpers.isIterable = function (o) { - return o[$iterator$] !== undefined; - } - - var isArrayLike = Rx.helpers.isArrayLike = function (o) { - return o && o.length !== undefined; - } - - Rx.helpers.iterator = $iterator$; - - var bindCallback = Rx.internals.bindCallback = function (func, thisArg, argCount) { - if (typeof thisArg === 'undefined') { return func; } - switch(argCount) { - case 0: - return function() { - return func.call(thisArg) - }; - case 1: - return function(arg) { - return func.call(thisArg, arg); - } - case 2: - return function(value, index) { - return func.call(thisArg, value, index); - }; - case 3: - return function(value, index, collection) { - return func.call(thisArg, value, index, collection); - }; - } - - return function() { - return func.apply(thisArg, arguments); - }; - }; - - /** Used to determine if values are of the language type Object */ - var dontEnums = ['toString', - 'toLocaleString', - 'valueOf', - 'hasOwnProperty', - 'isPrototypeOf', - 'propertyIsEnumerable', - 'constructor'], - dontEnumsLength = dontEnums.length; - - /** `Object#toString` result shortcuts */ - var argsClass = '[object Arguments]', - arrayClass = '[object Array]', - boolClass = '[object Boolean]', - dateClass = '[object Date]', - errorClass = '[object Error]', - funcClass = '[object Function]', - numberClass = '[object Number]', - objectClass = '[object Object]', - regexpClass = '[object RegExp]', - stringClass = '[object String]'; - - var toString = Object.prototype.toString, - hasOwnProperty = Object.prototype.hasOwnProperty, - supportsArgsClass = toString.call(arguments) == argsClass, // For less -1); - } - }); - } - } - stackA.pop(); - stackB.pop(); - - return result; - } - - var hasProp = {}.hasOwnProperty, - slice = Array.prototype.slice; - - var inherits = Rx.internals.inherits = function (child, parent) { - function __() { this.constructor = child; } - __.prototype = parent.prototype; - child.prototype = new __(); - }; - - var addProperties = Rx.internals.addProperties = function (obj) { - for(var sources = [], i = 1, len = arguments.length; i < len; i++) { sources.push(arguments[i]); } - for (var idx = 0, ln = sources.length; idx < ln; idx++) { - var source = sources[idx]; - for (var prop in source) { - obj[prop] = source[prop]; - } - } - }; - - // Rx Utils - var addRef = Rx.internals.addRef = function (xs, r) { - return new AnonymousObservable(function (observer) { - return new CompositeDisposable(r.getDisposable(), xs.subscribe(observer)); - }); - }; - - function arrayInitialize(count, factory) { - var a = new Array(count); - for (var i = 0; i < count; i++) { - a[i] = factory(); - } - return a; - } - - /** - * Represents a group of disposable resources that are disposed together. - * @constructor - */ - var CompositeDisposable = Rx.CompositeDisposable = function () { - var args = [], i, len; - if (Array.isArray(arguments[0])) { - args = arguments[0]; - len = args.length; - } else { - len = arguments.length; - args = new Array(len); - for(i = 0; i < len; i++) { args[i] = arguments[i]; } - } - for(i = 0; i < len; i++) { - if (!isDisposable(args[i])) { throw new TypeError('Not a disposable'); } - } - this.disposables = args; - this.isDisposed = false; - this.length = args.length; - }; - - var CompositeDisposablePrototype = CompositeDisposable.prototype; - - /** - * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed. - * @param {Mixed} item Disposable to add. - */ - CompositeDisposablePrototype.add = function (item) { - if (this.isDisposed) { - item.dispose(); - } else { - this.disposables.push(item); - this.length++; - } - }; - - /** - * Removes and disposes the first occurrence of a disposable from the CompositeDisposable. - * @param {Mixed} item Disposable to remove. - * @returns {Boolean} true if found; false otherwise. - */ - CompositeDisposablePrototype.remove = function (item) { - var shouldDispose = false; - if (!this.isDisposed) { - var idx = this.disposables.indexOf(item); - if (idx !== -1) { - shouldDispose = true; - this.disposables.splice(idx, 1); - this.length--; - item.dispose(); - } - } - return shouldDispose; - }; - - /** - * Disposes all disposables in the group and removes them from the group. - */ - CompositeDisposablePrototype.dispose = function () { - if (!this.isDisposed) { - this.isDisposed = true; - var len = this.disposables.length, currentDisposables = new Array(len); - for(var i = 0; i < len; i++) { currentDisposables[i] = this.disposables[i]; } - this.disposables = []; - this.length = 0; - - for (i = 0; i < len; i++) { - currentDisposables[i].dispose(); - } - } - }; - - /** - * Provides a set of static methods for creating Disposables. - * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. - */ - var Disposable = Rx.Disposable = function (action) { - this.isDisposed = false; - this.action = action || noop; - }; - - /** Performs the task of cleaning up resources. */ - Disposable.prototype.dispose = function () { - if (!this.isDisposed) { - this.action(); - this.isDisposed = true; - } - }; - - /** - * Creates a disposable object that invokes the specified action when disposed. - * @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once. - * @return {Disposable} The disposable object that runs the given action upon disposal. - */ - var disposableCreate = Disposable.create = function (action) { return new Disposable(action); }; - - /** - * Gets the disposable that does nothing when disposed. - */ - var disposableEmpty = Disposable.empty = { dispose: noop }; - - /** - * Validates whether the given object is a disposable - * @param {Object} Object to test whether it has a dispose method - * @returns {Boolean} true if a disposable object, else false. - */ - var isDisposable = Disposable.isDisposable = function (d) { - return d && isFunction(d.dispose); - }; - - var checkDisposed = Disposable.checkDisposed = function (disposable) { - if (disposable.isDisposed) { throw new ObjectDisposedError(); } - }; - - // Single assignment - var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = function () { - this.isDisposed = false; - this.current = null; - }; - SingleAssignmentDisposable.prototype.getDisposable = function () { - return this.current; - }; - SingleAssignmentDisposable.prototype.setDisposable = function (value) { - if (this.current) { throw new Error('Disposable has already been assigned'); } - var shouldDispose = this.isDisposed; - !shouldDispose && (this.current = value); - shouldDispose && value && value.dispose(); - }; - SingleAssignmentDisposable.prototype.dispose = function () { - if (!this.isDisposed) { - this.isDisposed = true; - var old = this.current; - this.current = null; - } - old && old.dispose(); - }; - - // Multiple assignment disposable - var SerialDisposable = Rx.SerialDisposable = function () { - this.isDisposed = false; - this.current = null; - }; - SerialDisposable.prototype.getDisposable = function () { - return this.current; - }; - SerialDisposable.prototype.setDisposable = function (value) { - var shouldDispose = this.isDisposed; - if (!shouldDispose) { - var old = this.current; - this.current = value; - } - old && old.dispose(); - shouldDispose && value && value.dispose(); - }; - SerialDisposable.prototype.dispose = function () { - if (!this.isDisposed) { - this.isDisposed = true; - var old = this.current; - this.current = null; - } - old && old.dispose(); - }; - - /** - * Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed. - */ - var RefCountDisposable = Rx.RefCountDisposable = (function () { - - function InnerDisposable(disposable) { - this.disposable = disposable; - this.disposable.count++; - this.isInnerDisposed = false; - } - - InnerDisposable.prototype.dispose = function () { - if (!this.disposable.isDisposed && !this.isInnerDisposed) { - this.isInnerDisposed = true; - this.disposable.count--; - if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) { - this.disposable.isDisposed = true; - this.disposable.underlyingDisposable.dispose(); - } - } - }; - - /** - * Initializes a new instance of the RefCountDisposable with the specified disposable. - * @constructor - * @param {Disposable} disposable Underlying disposable. - */ - function RefCountDisposable(disposable) { - this.underlyingDisposable = disposable; - this.isDisposed = false; - this.isPrimaryDisposed = false; - this.count = 0; - } - - /** - * Disposes the underlying disposable only when all dependent disposables have been disposed - */ - RefCountDisposable.prototype.dispose = function () { - if (!this.isDisposed && !this.isPrimaryDisposed) { - this.isPrimaryDisposed = true; - if (this.count === 0) { - this.isDisposed = true; - this.underlyingDisposable.dispose(); - } - } - }; - - /** - * Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable. - * @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime. - */ - RefCountDisposable.prototype.getDisposable = function () { - return this.isDisposed ? disposableEmpty : new InnerDisposable(this); - }; - - return RefCountDisposable; - })(); - - var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) { - this.scheduler = scheduler; - this.state = state; - this.action = action; - this.dueTime = dueTime; - this.comparer = comparer || defaultSubComparer; - this.disposable = new SingleAssignmentDisposable(); - } - - ScheduledItem.prototype.invoke = function () { - this.disposable.setDisposable(this.invokeCore()); - }; - - ScheduledItem.prototype.compareTo = function (other) { - return this.comparer(this.dueTime, other.dueTime); - }; - - ScheduledItem.prototype.isCancelled = function () { - return this.disposable.isDisposed; - }; - - ScheduledItem.prototype.invokeCore = function () { - return this.action(this.scheduler, this.state); - }; - - /** Provides a set of static properties to access commonly used schedulers. */ - var Scheduler = Rx.Scheduler = (function () { - - function Scheduler(now, schedule, scheduleRelative, scheduleAbsolute) { - this.now = now; - this._schedule = schedule; - this._scheduleRelative = scheduleRelative; - this._scheduleAbsolute = scheduleAbsolute; - } - - /** Determines whether the given object is a scheduler */ - Scheduler.isScheduler = function (s) { - return s instanceof Scheduler; - } - - function invokeAction(scheduler, action) { - action(); - return disposableEmpty; - } - - var schedulerProto = Scheduler.prototype; - - /** - * Schedules an action to be executed. - * @param {Function} action Action to execute. - * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). - */ - schedulerProto.schedule = function (action) { - return this._schedule(action, invokeAction); - }; - - /** - * Schedules an action to be executed. - * @param state State passed to the action to be executed. - * @param {Function} action Action to be executed. - * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). - */ - schedulerProto.scheduleWithState = function (state, action) { - return this._schedule(state, action); - }; - - /** - * Schedules an action to be executed after the specified relative due time. - * @param {Function} action Action to execute. - * @param {Number} dueTime Relative time after which to execute the action. - * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). - */ - schedulerProto.scheduleWithRelative = function (dueTime, action) { - return this._scheduleRelative(action, dueTime, invokeAction); - }; - - /** - * Schedules an action to be executed after dueTime. - * @param state State passed to the action to be executed. - * @param {Function} action Action to be executed. - * @param {Number} dueTime Relative time after which to execute the action. - * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). - */ - schedulerProto.scheduleWithRelativeAndState = function (state, dueTime, action) { - return this._scheduleRelative(state, dueTime, action); - }; - - /** - * Schedules an action to be executed at the specified absolute due time. - * @param {Function} action Action to execute. - * @param {Number} dueTime Absolute time at which to execute the action. - * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). - */ - schedulerProto.scheduleWithAbsolute = function (dueTime, action) { - return this._scheduleAbsolute(action, dueTime, invokeAction); - }; - - /** - * Schedules an action to be executed at dueTime. - * @param {Mixed} state State passed to the action to be executed. - * @param {Function} action Action to be executed. - * @param {Number}dueTime Absolute time at which to execute the action. - * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). - */ - schedulerProto.scheduleWithAbsoluteAndState = function (state, dueTime, action) { - return this._scheduleAbsolute(state, dueTime, action); - }; - - /** Gets the current time according to the local machine's system clock. */ - Scheduler.now = defaultNow; - - /** - * Normalizes the specified TimeSpan value to a positive value. - * @param {Number} timeSpan The time span value to normalize. - * @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0 - */ - Scheduler.normalize = function (timeSpan) { - timeSpan < 0 && (timeSpan = 0); - return timeSpan; - }; - - return Scheduler; - }()); - - var normalizeTime = Scheduler.normalize, isScheduler = Scheduler.isScheduler; - - (function (schedulerProto) { - - function invokeRecImmediate(scheduler, pair) { - var state = pair[0], action = pair[1], group = new CompositeDisposable(); - action(state, innerAction); - return group; - - function innerAction(state2) { - var isAdded = false, isDone = false; - - var d = scheduler.scheduleWithState(state2, scheduleWork); - if (!isDone) { - group.add(d); - isAdded = true; - } - - function scheduleWork(_, state3) { - if (isAdded) { - group.remove(d); - } else { - isDone = true; - } - action(state3, innerAction); - return disposableEmpty; - } - } - } - - function invokeRecDate(scheduler, pair, method) { - var state = pair[0], action = pair[1], group = new CompositeDisposable(); - action(state, innerAction); - return group; - - function innerAction(state2, dueTime1) { - var isAdded = false, isDone = false; - - var d = scheduler[method](state2, dueTime1, scheduleWork); - if (!isDone) { - group.add(d); - isAdded = true; - } - - function scheduleWork(_, state3) { - if (isAdded) { - group.remove(d); - } else { - isDone = true; - } - action(state3, innerAction); - return disposableEmpty; - } - } - } - - function invokeRecDateRelative(s, p) { - return invokeRecDate(s, p, 'scheduleWithRelativeAndState'); - } - - function invokeRecDateAbsolute(s, p) { - return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState'); - } - - function scheduleInnerRecursive(action, self) { - action(function(dt) { self(action, dt); }); - } - - /** - * Schedules an action to be executed recursively. - * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action. - * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). - */ - schedulerProto.scheduleRecursive = function (action) { - return this.scheduleRecursiveWithState(action, scheduleInnerRecursive); - }; - - /** - * Schedules an action to be executed recursively. - * @param {Mixed} state State passed to the action to be executed. - * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state. - * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). - */ - schedulerProto.scheduleRecursiveWithState = function (state, action) { - return this.scheduleWithState([state, action], invokeRecImmediate); - }; - - /** - * Schedules an action to be executed recursively after a specified relative due time. - * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified relative time. - * @param {Number}dueTime Relative time after which to execute the action for the first time. - * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). - */ - schedulerProto.scheduleRecursiveWithRelative = function (dueTime, action) { - return this.scheduleRecursiveWithRelativeAndState(action, dueTime, scheduleInnerRecursive); - }; - - /** - * Schedules an action to be executed recursively after a specified relative due time. - * @param {Mixed} state State passed to the action to be executed. - * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state. - * @param {Number}dueTime Relative time after which to execute the action for the first time. - * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). - */ - schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) { - return this._scheduleRelative([state, action], dueTime, invokeRecDateRelative); - }; - - /** - * Schedules an action to be executed recursively at a specified absolute due time. - * @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified absolute time. - * @param {Number}dueTime Absolute time at which to execute the action for the first time. - * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). - */ - schedulerProto.scheduleRecursiveWithAbsolute = function (dueTime, action) { - return this.scheduleRecursiveWithAbsoluteAndState(action, dueTime, scheduleInnerRecursive); - }; - - /** - * Schedules an action to be executed recursively at a specified absolute due time. - * @param {Mixed} state State passed to the action to be executed. - * @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state. - * @param {Number}dueTime Absolute time at which to execute the action for the first time. - * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). - */ - schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) { - return this._scheduleAbsolute([state, action], dueTime, invokeRecDateAbsolute); - }; - }(Scheduler.prototype)); - - (function (schedulerProto) { - - /** - * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation. - * @param {Number} period Period for running the work periodically. - * @param {Function} action Action to be executed. - * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). - */ - Scheduler.prototype.schedulePeriodic = function (period, action) { - return this.schedulePeriodicWithState(null, period, action); - }; - - /** - * Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation. - * @param {Mixed} state Initial state passed to the action upon the first iteration. - * @param {Number} period Period for running the work periodically. - * @param {Function} action Action to be executed, potentially updating the state. - * @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort). - */ - Scheduler.prototype.schedulePeriodicWithState = function(state, period, action) { - if (typeof root.setInterval === 'undefined') { throw new NotSupportedError(); } - period = normalizeTime(period); - var s = state, id = root.setInterval(function () { s = action(s); }, period); - return disposableCreate(function () { root.clearInterval(id); }); - }; - - }(Scheduler.prototype)); - - /** Gets a scheduler that schedules work immediately on the current thread. */ - var immediateScheduler = Scheduler.immediate = (function () { - function scheduleNow(state, action) { return action(this, state); } - return new Scheduler(defaultNow, scheduleNow, notSupported, notSupported); - }()); - - /** - * Gets a scheduler that schedules work as soon as possible on the current thread. - */ - var currentThreadScheduler = Scheduler.currentThread = (function () { - var queue; - - function runTrampoline () { - while (queue.length > 0) { - var item = queue.shift(); - !item.isCancelled() && item.invoke(); - } - } - - function scheduleNow(state, action) { - var si = new ScheduledItem(this, state, action, this.now()); - - if (!queue) { - queue = [si]; - - var result = tryCatch(runTrampoline)(); - queue = null; - if (result === errorObj) { return thrower(result.e); } - } else { - queue.push(si); - } - return si.disposable; - } - - var currentScheduler = new Scheduler(defaultNow, scheduleNow, notSupported, notSupported); - currentScheduler.scheduleRequired = function () { return !queue; }; - - return currentScheduler; - }()); - - var SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive = (function () { - function tick(command, recurse) { - recurse(0, this._period); - try { - this._state = this._action(this._state); - } catch (e) { - this._cancel.dispose(); - throw e; - } - } - - function SchedulePeriodicRecursive(scheduler, state, period, action) { - this._scheduler = scheduler; - this._state = state; - this._period = period; - this._action = action; - } - - SchedulePeriodicRecursive.prototype.start = function () { - var d = new SingleAssignmentDisposable(); - this._cancel = d; - d.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0, this._period, tick.bind(this))); - - return d; - }; - - return SchedulePeriodicRecursive; - }()); - - var scheduleMethod, clearMethod; - - var localTimer = (function () { - var localSetTimeout, localClearTimeout = noop; - if (!!root.setTimeout) { - localSetTimeout = root.setTimeout; - localClearTimeout = root.clearTimeout; - } else if (!!root.WScript) { - localSetTimeout = function (fn, time) { - root.WScript.Sleep(time); - fn(); - }; - } else { - throw new NotSupportedError(); - } - - return { - setTimeout: localSetTimeout, - clearTimeout: localClearTimeout - }; - }()); - var localSetTimeout = localTimer.setTimeout, - localClearTimeout = localTimer.clearTimeout; - - (function () { - - var nextHandle = 1, tasksByHandle = {}, currentlyRunning = false; - - clearMethod = function (handle) { - delete tasksByHandle[handle]; - }; - - function runTask(handle) { - if (currentlyRunning) { - localSetTimeout(function () { runTask(handle) }, 0); - } else { - var task = tasksByHandle[handle]; - if (task) { - currentlyRunning = true; - var result = tryCatch(task)(); - clearMethod(handle); - currentlyRunning = false; - if (result === errorObj) { return thrower(result.e); } - } - } - } - - var reNative = RegExp('^' + - String(toString) - .replace(/[.*+?^${}()|[\]\\]/g, '\\$&') - .replace(/toString| for [^\]]+/g, '.*?') + '$' - ); - - var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' && - !reNative.test(setImmediate) && setImmediate; - - function postMessageSupported () { - // Ensure not in a worker - if (!root.postMessage || root.importScripts) { return false; } - var isAsync = false, oldHandler = root.onmessage; - // Test for async - root.onmessage = function () { isAsync = true; }; - root.postMessage('', '*'); - root.onmessage = oldHandler; - - return isAsync; - } - - // Use in order, setImmediate, nextTick, postMessage, MessageChannel, script readystatechanged, setTimeout - if (isFunction(setImmediate)) { - scheduleMethod = function (action) { - var id = nextHandle++; - tasksByHandle[id] = action; - setImmediate(function () { runTask(id); }); - - return id; - }; - } else if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') { - scheduleMethod = function (action) { - var id = nextHandle++; - tasksByHandle[id] = action; - process.nextTick(function () { runTask(id); }); - - return id; - }; - } else if (postMessageSupported()) { - var MSG_PREFIX = 'ms.rx.schedule' + Math.random(); - - function onGlobalPostMessage(event) { - // Only if we're a match to avoid any other global events - if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) { - runTask(event.data.substring(MSG_PREFIX.length)); - } - } - - if (root.addEventListener) { - root.addEventListener('message', onGlobalPostMessage, false); - } else if (root.attachEvent) { - root.attachEvent('onmessage', onGlobalPostMessage); - } else { - root.onmessage = onGlobalPostMessage; - } - - scheduleMethod = function (action) { - var id = nextHandle++; - tasksByHandle[id] = action; - root.postMessage(MSG_PREFIX + currentId, '*'); - return id; - }; - } else if (!!root.MessageChannel) { - var channel = new root.MessageChannel(); - - channel.port1.onmessage = function (e) { runTask(e.data); }; - - scheduleMethod = function (action) { - var id = nextHandle++; - tasksByHandle[id] = action; - channel.port2.postMessage(id); - return id; - }; - } else if ('document' in root && 'onreadystatechange' in root.document.createElement('script')) { - - scheduleMethod = function (action) { - var scriptElement = root.document.createElement('script'); - var id = nextHandle++; - tasksByHandle[id] = action; - - scriptElement.onreadystatechange = function () { - runTask(id); - scriptElement.onreadystatechange = null; - scriptElement.parentNode.removeChild(scriptElement); - scriptElement = null; - }; - root.document.documentElement.appendChild(scriptElement); - return id; - }; - - } else { - scheduleMethod = function (action) { - var id = nextHandle++; - tasksByHandle[id] = action; - localSetTimeout(function () { - runTask(id); - }, 0); - - return id; - }; - } - }()); - - /** - * Gets a scheduler that schedules work via a timed callback based upon platform. - */ - var timeoutScheduler = Scheduler.timeout = Scheduler['default'] = (function () { - - function scheduleNow(state, action) { - var scheduler = this, disposable = new SingleAssignmentDisposable(); - var id = scheduleMethod(function () { - !disposable.isDisposed && disposable.setDisposable(action(scheduler, state)); - }); - return new CompositeDisposable(disposable, disposableCreate(function () { - clearMethod(id); - })); - } - - function scheduleRelative(state, dueTime, action) { - var scheduler = this, dt = Scheduler.normalize(dueTime), disposable = new SingleAssignmentDisposable(); - if (dt === 0) { return scheduler.scheduleWithState(state, action); } - var id = localSetTimeout(function () { - !disposable.isDisposed && disposable.setDisposable(action(scheduler, state)); - }, dt); - return new CompositeDisposable(disposable, disposableCreate(function () { - localClearTimeout(id); - })); - } - - function scheduleAbsolute(state, dueTime, action) { - return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action); - } - - return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute); - })(); - - /** - * Represents a notification to an observer. - */ - var Notification = Rx.Notification = (function () { - function Notification(kind, value, exception, accept, acceptObservable, toString) { - this.kind = kind; - this.value = value; - this.exception = exception; - this._accept = accept; - this._acceptObservable = acceptObservable; - this.toString = toString; - } - - /** - * Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result. - * - * @memberOf Notification - * @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on.. - * @param {Function} onError Delegate to invoke for an OnError notification. - * @param {Function} onCompleted Delegate to invoke for an OnCompleted notification. - * @returns {Any} Result produced by the observation. - */ - Notification.prototype.accept = function (observerOrOnNext, onError, onCompleted) { - return observerOrOnNext && typeof observerOrOnNext === 'object' ? - this._acceptObservable(observerOrOnNext) : - this._accept(observerOrOnNext, onError, onCompleted); - }; - - /** - * Returns an observable sequence with a single notification. - * - * @memberOf Notifications - * @param {Scheduler} [scheduler] Scheduler to send out the notification calls on. - * @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription. - */ - Notification.prototype.toObservable = function (scheduler) { - var self = this; - isScheduler(scheduler) || (scheduler = immediateScheduler); - return new AnonymousObservable(function (observer) { - return scheduler.scheduleWithState(self, function (_, notification) { - notification._acceptObservable(observer); - notification.kind === 'N' && observer.onCompleted(); - }); - }); - }; - - return Notification; - })(); - - /** - * Creates an object that represents an OnNext notification to an observer. - * @param {Any} value The value contained in the notification. - * @returns {Notification} The OnNext notification containing the value. - */ - var notificationCreateOnNext = Notification.createOnNext = (function () { - function _accept(onNext) { return onNext(this.value); } - function _acceptObservable(observer) { return observer.onNext(this.value); } - function toString() { return 'OnNext(' + this.value + ')'; } - - return function (value) { - return new Notification('N', value, null, _accept, _acceptObservable, toString); - }; - }()); - - /** - * Creates an object that represents an OnError notification to an observer. - * @param {Any} error The exception contained in the notification. - * @returns {Notification} The OnError notification containing the exception. - */ - var notificationCreateOnError = Notification.createOnError = (function () { - function _accept (onNext, onError) { return onError(this.exception); } - function _acceptObservable(observer) { return observer.onError(this.exception); } - function toString () { return 'OnError(' + this.exception + ')'; } - - return function (e) { - return new Notification('E', null, e, _accept, _acceptObservable, toString); - }; - }()); - - /** - * Creates an object that represents an OnCompleted notification to an observer. - * @returns {Notification} The OnCompleted notification. - */ - var notificationCreateOnCompleted = Notification.createOnCompleted = (function () { - function _accept (onNext, onError, onCompleted) { return onCompleted(); } - function _acceptObservable(observer) { return observer.onCompleted(); } - function toString () { return 'OnCompleted()'; } - - return function () { - return new Notification('C', null, null, _accept, _acceptObservable, toString); - }; - }()); - - /** - * Supports push-style iteration over an observable sequence. - */ - var Observer = Rx.Observer = function () { }; - - /** - * Creates an observer from the specified OnNext, along with optional OnError, and OnCompleted actions. - * @param {Function} [onNext] Observer's OnNext action implementation. - * @param {Function} [onError] Observer's OnError action implementation. - * @param {Function} [onCompleted] Observer's OnCompleted action implementation. - * @returns {Observer} The observer object implemented using the given actions. - */ - var observerCreate = Observer.create = function (onNext, onError, onCompleted) { - onNext || (onNext = noop); - onError || (onError = defaultError); - onCompleted || (onCompleted = noop); - return new AnonymousObserver(onNext, onError, onCompleted); - }; - - /** - * Abstract base class for implementations of the Observer class. - * This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages. - */ - var AbstractObserver = Rx.internals.AbstractObserver = (function (__super__) { - inherits(AbstractObserver, __super__); - - /** - * Creates a new observer in a non-stopped state. - */ - function AbstractObserver() { - this.isStopped = false; - } - - // Must be implemented by other observers - AbstractObserver.prototype.next = notImplemented; - AbstractObserver.prototype.error = notImplemented; - AbstractObserver.prototype.completed = notImplemented; - - /** - * Notifies the observer of a new element in the sequence. - * @param {Any} value Next element in the sequence. - */ - AbstractObserver.prototype.onNext = function (value) { - !this.isStopped && this.next(value); - }; - - /** - * Notifies the observer that an exception has occurred. - * @param {Any} error The error that has occurred. - */ - AbstractObserver.prototype.onError = function (error) { - if (!this.isStopped) { - this.isStopped = true; - this.error(error); - } - }; - - /** - * Notifies the observer of the end of the sequence. - */ - AbstractObserver.prototype.onCompleted = function () { - if (!this.isStopped) { - this.isStopped = true; - this.completed(); - } - }; - - /** - * Disposes the observer, causing it to transition to the stopped state. - */ - AbstractObserver.prototype.dispose = function () { this.isStopped = true; }; - - AbstractObserver.prototype.fail = function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.error(e); - return true; - } - - return false; - }; - - return AbstractObserver; - }(Observer)); - - /** - * Class to create an Observer instance from delegate-based implementations of the on* methods. - */ - var AnonymousObserver = Rx.AnonymousObserver = (function (__super__) { - inherits(AnonymousObserver, __super__); - - /** - * Creates an observer from the specified OnNext, OnError, and OnCompleted actions. - * @param {Any} onNext Observer's OnNext action implementation. - * @param {Any} onError Observer's OnError action implementation. - * @param {Any} onCompleted Observer's OnCompleted action implementation. - */ - function AnonymousObserver(onNext, onError, onCompleted) { - __super__.call(this); - this._onNext = onNext; - this._onError = onError; - this._onCompleted = onCompleted; - } - - /** - * Calls the onNext action. - * @param {Any} value Next element in the sequence. - */ - AnonymousObserver.prototype.next = function (value) { - this._onNext(value); - }; - - /** - * Calls the onError action. - * @param {Any} error The error that has occurred. - */ - AnonymousObserver.prototype.error = function (error) { - this._onError(error); - }; - - /** - * Calls the onCompleted action. - */ - AnonymousObserver.prototype.completed = function () { - this._onCompleted(); - }; - - return AnonymousObserver; - }(AbstractObserver)); - - var observableProto; - - /** - * Represents a push-style collection. - */ - var Observable = Rx.Observable = (function () { - - function makeSubscribe(self, subscribe) { - return function (o) { - var oldOnError = o.onError; - o.onError = function (e) { - makeStackTraceLong(e, self); - oldOnError.call(o, e); - }; - - return subscribe.call(self, o); - }; - } - - function Observable(subscribe) { - if (Rx.config.longStackSupport && hasStacks) { - var e = tryCatch(thrower)(new Error()).e; - this.stack = e.stack.substring(e.stack.indexOf('\n') + 1); - this._subscribe = makeSubscribe(this, subscribe); - } else { - this._subscribe = subscribe; - } - } - - observableProto = Observable.prototype; - - /** - * Determines whether the given object is an Observable - * @param {Any} An object to determine whether it is an Observable - * @returns {Boolean} true if an Observable, else false. - */ - Observable.isObservable = function (o) { - return o && isFunction(o.subscribe); - } - - /** - * Subscribes an o to the observable sequence. - * @param {Mixed} [oOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence. - * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. - * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. - * @returns {Diposable} A disposable handling the subscriptions and unsubscriptions. - */ - observableProto.subscribe = observableProto.forEach = function (oOrOnNext, onError, onCompleted) { - return this._subscribe(typeof oOrOnNext === 'object' ? - oOrOnNext : - observerCreate(oOrOnNext, onError, onCompleted)); - }; - - /** - * Subscribes to the next value in the sequence with an optional "this" argument. - * @param {Function} onNext The function to invoke on each element in the observable sequence. - * @param {Any} [thisArg] Object to use as this when executing callback. - * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. - */ - observableProto.subscribeOnNext = function (onNext, thisArg) { - return this._subscribe(observerCreate(typeof thisArg !== 'undefined' ? function(x) { onNext.call(thisArg, x); } : onNext)); - }; - - /** - * Subscribes to an exceptional condition in the sequence with an optional "this" argument. - * @param {Function} onError The function to invoke upon exceptional termination of the observable sequence. - * @param {Any} [thisArg] Object to use as this when executing callback. - * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. - */ - observableProto.subscribeOnError = function (onError, thisArg) { - return this._subscribe(observerCreate(null, typeof thisArg !== 'undefined' ? function(e) { onError.call(thisArg, e); } : onError)); - }; - - /** - * Subscribes to the next value in the sequence with an optional "this" argument. - * @param {Function} onCompleted The function to invoke upon graceful termination of the observable sequence. - * @param {Any} [thisArg] Object to use as this when executing callback. - * @returns {Disposable} A disposable handling the subscriptions and unsubscriptions. - */ - observableProto.subscribeOnCompleted = function (onCompleted, thisArg) { - return this._subscribe(observerCreate(null, null, typeof thisArg !== 'undefined' ? function() { onCompleted.call(thisArg); } : onCompleted)); - }; - - return Observable; - })(); - - var ScheduledObserver = Rx.internals.ScheduledObserver = (function (__super__) { - inherits(ScheduledObserver, __super__); - - function ScheduledObserver(scheduler, observer) { - __super__.call(this); - this.scheduler = scheduler; - this.observer = observer; - this.isAcquired = false; - this.hasFaulted = false; - this.queue = []; - this.disposable = new SerialDisposable(); - } - - ScheduledObserver.prototype.next = function (value) { - var self = this; - this.queue.push(function () { self.observer.onNext(value); }); - }; - - ScheduledObserver.prototype.error = function (e) { - var self = this; - this.queue.push(function () { self.observer.onError(e); }); - }; - - ScheduledObserver.prototype.completed = function () { - var self = this; - this.queue.push(function () { self.observer.onCompleted(); }); - }; - - ScheduledObserver.prototype.ensureActive = function () { - var isOwner = false; - if (!this.hasFaulted && this.queue.length > 0) { - isOwner = !this.isAcquired; - this.isAcquired = true; - } - if (isOwner) { - this.disposable.setDisposable(this.scheduler.scheduleRecursiveWithState(this, function (parent, self) { - var work; - if (parent.queue.length > 0) { - work = parent.queue.shift(); - } else { - parent.isAcquired = false; - return; - } - var res = tryCatch(work)(); - if (res === errorObj) { - parent.queue = []; - parent.hasFaulted = true; - return thrower(res.e); - } - self(parent); - })); - } - }; - - ScheduledObserver.prototype.dispose = function () { - __super__.prototype.dispose.call(this); - this.disposable.dispose(); - }; - - return ScheduledObserver; - }(AbstractObserver)); - - var ObservableBase = Rx.ObservableBase = (function (__super__) { - inherits(ObservableBase, __super__); - - function fixSubscriber(subscriber) { - return subscriber && isFunction(subscriber.dispose) ? subscriber : - isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty; - } - - function setDisposable(s, state) { - var ado = state[0], self = state[1]; - var sub = tryCatch(self.subscribeCore).call(self, ado); - - if (sub === errorObj) { - if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); } - } - ado.setDisposable(fixSubscriber(sub)); - } - - function subscribe(observer) { - var ado = new AutoDetachObserver(observer), state = [ado, this]; - - if (currentThreadScheduler.scheduleRequired()) { - currentThreadScheduler.scheduleWithState(state, setDisposable); - } else { - setDisposable(null, state); - } - return ado; - } - - function ObservableBase() { - __super__.call(this, subscribe); - } - - ObservableBase.prototype.subscribeCore = notImplemented; - - return ObservableBase; - }(Observable)); - -var FlatMapObservable = (function(__super__){ - - inherits(FlatMapObservable, __super__); - - function FlatMapObservable(source, selector, resultSelector, thisArg) { - this.resultSelector = Rx.helpers.isFunction(resultSelector) ? - resultSelector : null; - - this.selector = Rx.internals.bindCallback(Rx.helpers.isFunction(selector) ? selector : function() { return selector; }, thisArg, 3); - this.source = source; - - __super__.call(this); - - } - - FlatMapObservable.prototype.subscribeCore = function(o) { - return this.source.subscribe(new InnerObserver(o, this.selector, this.resultSelector, this)); - }; - - function InnerObserver(observer, selector, resultSelector, source) { - this.i = 0; - this.selector = selector; - this.resultSelector = resultSelector; - this.source = source; - this.isStopped = false; - this.o = observer; - } - - InnerObserver.prototype._wrapResult = function(result, x, i) { - return this.resultSelector ? - result.map(function(y, i2) { return this.resultSelector(x, y, i, i2); }, this) : - result; - }; - - InnerObserver.prototype.onNext = function(x) { - - if (this.isStopped) return; - - var i = this.i++; - var result = tryCatch(this.selector)(x, i, this.source); - - if (result === errorObj) { - return this.o.onError(result.e); - } - - Rx.helpers.isPromise(result) && (result = Rx.Observable.fromPromise(result)); - (Rx.helpers.isArrayLike(result) || Rx.helpers.isIterable(result)) && (result = Rx.Observable.from(result)); - - this.o.onNext(this._wrapResult(result, x, i)); - - }; - - InnerObserver.prototype.onError = function(e) { - if(!this.isStopped) { this.isStopped = true; this.o.onError(e); } - }; - - InnerObserver.prototype.onCompleted = function() { - if (!this.isStopped) {this.isStopped = true; this.o.onCompleted(); } - }; - - return FlatMapObservable; - -}(ObservableBase)); - - var Enumerable = Rx.internals.Enumerable = function () { }; - - var ConcatEnumerableObservable = (function(__super__) { - inherits(ConcatEnumerableObservable, __super__); - function ConcatEnumerableObservable(sources) { - this.sources = sources; - __super__.call(this); - } - - ConcatEnumerableObservable.prototype.subscribeCore = function (o) { - var isDisposed, subscription = new SerialDisposable(); - var cancelable = immediateScheduler.scheduleRecursiveWithState(this.sources[$iterator$](), function (e, self) { - if (isDisposed) { return; } - var currentItem = tryCatch(e.next).call(e); - if (currentItem === errorObj) { return o.onError(currentItem.e); } - - if (currentItem.done) { - return o.onCompleted(); - } - - // Check if promise - var currentValue = currentItem.value; - isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); - - var d = new SingleAssignmentDisposable(); - subscription.setDisposable(d); - d.setDisposable(currentValue.subscribe(new InnerObserver(o, self, e))); - }); - - return new CompositeDisposable(subscription, cancelable, disposableCreate(function () { - isDisposed = true; - })); - }; - - function InnerObserver(o, s, e) { - this.o = o; - this.s = s; - this.e = e; - this.isStopped = false; - } - InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.o.onNext(x); } }; - InnerObserver.prototype.onError = function (err) { - if (!this.isStopped) { - this.isStopped = true; - this.o.onError(err); - } - }; - InnerObserver.prototype.onCompleted = function () { - if (!this.isStopped) { - this.isStopped = true; - this.s(this.e); - } - }; - InnerObserver.prototype.dispose = function () { this.isStopped = true; }; - InnerObserver.prototype.fail = function (err) { - if (!this.isStopped) { - this.isStopped = true; - this.o.onError(err); - return true; - } - return false; - }; - - return ConcatEnumerableObservable; - }(ObservableBase)); - - Enumerable.prototype.concat = function () { - return new ConcatEnumerableObservable(this); - }; - - var CatchErrorObservable = (function(__super__) { - inherits(CatchErrorObservable, __super__); - function CatchErrorObservable(sources) { - this.sources = sources; - __super__.call(this); - } - - CatchErrorObservable.prototype.subscribeCore = function (o) { - var e = this.sources[$iterator$](); - - var isDisposed, subscription = new SerialDisposable(); - var cancelable = immediateScheduler.scheduleRecursiveWithState(null, function (lastException, self) { - if (isDisposed) { return; } - var currentItem = tryCatch(e.next).call(e); - if (currentItem === errorObj) { return o.onError(currentItem.e); } - - if (currentItem.done) { - return lastException !== null ? o.onError(lastException) : o.onCompleted(); - } - - // Check if promise - var currentValue = currentItem.value; - isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); - - var d = new SingleAssignmentDisposable(); - subscription.setDisposable(d); - d.setDisposable(currentValue.subscribe( - function(x) { o.onNext(x); }, - self, - function() { o.onCompleted(); })); - }); - return new CompositeDisposable(subscription, cancelable, disposableCreate(function () { - isDisposed = true; - })); - }; - - return CatchErrorObservable; - }(ObservableBase)); - - Enumerable.prototype.catchError = function () { - return new CatchErrorObservable(this); - }; - - Enumerable.prototype.catchErrorWhen = function (notificationHandler) { - var sources = this; - return new AnonymousObservable(function (o) { - var exceptions = new Subject(), - notifier = new Subject(), - handled = notificationHandler(exceptions), - notificationDisposable = handled.subscribe(notifier); - - var e = sources[$iterator$](); - - var isDisposed, - lastException, - subscription = new SerialDisposable(); - var cancelable = immediateScheduler.scheduleRecursive(function (self) { - if (isDisposed) { return; } - var currentItem = tryCatch(e.next).call(e); - if (currentItem === errorObj) { return o.onError(currentItem.e); } - - if (currentItem.done) { - if (lastException) { - o.onError(lastException); - } else { - o.onCompleted(); - } - return; - } - - // Check if promise - var currentValue = currentItem.value; - isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); - - var outer = new SingleAssignmentDisposable(); - var inner = new SingleAssignmentDisposable(); - subscription.setDisposable(new CompositeDisposable(inner, outer)); - outer.setDisposable(currentValue.subscribe( - function(x) { o.onNext(x); }, - function (exn) { - inner.setDisposable(notifier.subscribe(self, function(ex) { - o.onError(ex); - }, function() { - o.onCompleted(); - })); - - exceptions.onNext(exn); - }, - function() { o.onCompleted(); })); - }); - - return new CompositeDisposable(notificationDisposable, subscription, cancelable, disposableCreate(function () { - isDisposed = true; - })); - }); - }; - - var RepeatEnumerable = (function (__super__) { - inherits(RepeatEnumerable, __super__); - - function RepeatEnumerable(v, c) { - this.v = v; - this.c = c == null ? -1 : c; - } - RepeatEnumerable.prototype[$iterator$] = function () { - return new RepeatEnumerator(this); - }; - - function RepeatEnumerator(p) { - this.v = p.v; - this.l = p.c; - } - RepeatEnumerator.prototype.next = function () { - if (this.l === 0) { return doneEnumerator; } - if (this.l > 0) { this.l--; } - return { done: false, value: this.v }; - }; - - return RepeatEnumerable; - }(Enumerable)); - - var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) { - return new RepeatEnumerable(value, repeatCount); - }; - - var OfEnumerable = (function(__super__) { - inherits(OfEnumerable, __super__); - function OfEnumerable(s, fn, thisArg) { - this.s = s; - this.fn = fn ? bindCallback(fn, thisArg, 3) : null; - } - OfEnumerable.prototype[$iterator$] = function () { - return new OfEnumerator(this); - }; - - function OfEnumerator(p) { - this.i = -1; - this.s = p.s; - this.l = this.s.length; - this.fn = p.fn; - } - OfEnumerator.prototype.next = function () { - return ++this.i < this.l ? - { done: false, value: !this.fn ? this.s[this.i] : this.fn(this.s[this.i], this.i, this.s) } : - doneEnumerator; - }; - - return OfEnumerable; - }(Enumerable)); - - var enumerableOf = Enumerable.of = function (source, selector, thisArg) { - return new OfEnumerable(source, selector, thisArg); - }; - - var ToArrayObservable = (function(__super__) { - inherits(ToArrayObservable, __super__); - function ToArrayObservable(source) { - this.source = source; - __super__.call(this); - } - - ToArrayObservable.prototype.subscribeCore = function(o) { - return this.source.subscribe(new InnerObserver(o)); - }; - - function InnerObserver(o) { - this.o = o; - this.a = []; - this.isStopped = false; - } - InnerObserver.prototype.onNext = function (x) { if(!this.isStopped) { this.a.push(x); } }; - InnerObserver.prototype.onError = function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.o.onError(e); - } - }; - InnerObserver.prototype.onCompleted = function () { - if (!this.isStopped) { - this.isStopped = true; - this.o.onNext(this.a); - this.o.onCompleted(); - } - }; - InnerObserver.prototype.dispose = function () { this.isStopped = true; } - InnerObserver.prototype.fail = function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.o.onError(e); - return true; - } - - return false; - }; - - return ToArrayObservable; - }(ObservableBase)); - - /** - * Creates an array from an observable sequence. - * @returns {Observable} An observable sequence containing a single element with a list containing all the elements of the source sequence. - */ - observableProto.toArray = function () { - return new ToArrayObservable(this); - }; - - /** - * Creates an observable sequence from a specified subscribe method implementation. - * @example - * var res = Rx.Observable.create(function (observer) { return function () { } ); - * var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } ); - * var res = Rx.Observable.create(function (observer) { } ); - * @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable. - * @returns {Observable} The observable sequence with the specified implementation for the Subscribe method. - */ - Observable.create = function (subscribe, parent) { - return new AnonymousObservable(subscribe, parent); - }; - - /** - * Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes. - * - * @example - * var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); }); - * @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence or Promise. - * @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function. - */ - var observableDefer = Observable.defer = function (observableFactory) { - return new AnonymousObservable(function (observer) { - var result; - try { - result = observableFactory(); - } catch (e) { - return observableThrow(e).subscribe(observer); - } - isPromise(result) && (result = observableFromPromise(result)); - return result.subscribe(observer); - }); - }; - - var EmptyObservable = (function(__super__) { - inherits(EmptyObservable, __super__); - function EmptyObservable(scheduler) { - this.scheduler = scheduler; - __super__.call(this); - } - - EmptyObservable.prototype.subscribeCore = function (observer) { - var sink = new EmptySink(observer, this.scheduler); - return sink.run(); - }; - - function EmptySink(observer, scheduler) { - this.observer = observer; - this.scheduler = scheduler; - } - - function scheduleItem(s, state) { - state.onCompleted(); - return disposableEmpty; - } - - EmptySink.prototype.run = function () { - return this.scheduler.scheduleWithState(this.observer, scheduleItem); - }; - - return EmptyObservable; - }(ObservableBase)); - - var EMPTY_OBSERVABLE = new EmptyObservable(immediateScheduler); - - /** - * Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message. - * - * @example - * var res = Rx.Observable.empty(); - * var res = Rx.Observable.empty(Rx.Scheduler.timeout); - * @param {Scheduler} [scheduler] Scheduler to send the termination call on. - * @returns {Observable} An observable sequence with no elements. - */ - var observableEmpty = Observable.empty = function (scheduler) { - isScheduler(scheduler) || (scheduler = immediateScheduler); - return scheduler === immediateScheduler ? EMPTY_OBSERVABLE : new EmptyObservable(scheduler); - }; - - var FromObservable = (function(__super__) { - inherits(FromObservable, __super__); - function FromObservable(iterable, mapper, scheduler) { - this.iterable = iterable; - this.mapper = mapper; - this.scheduler = scheduler; - __super__.call(this); - } - - FromObservable.prototype.subscribeCore = function (o) { - var sink = new FromSink(o, this); - return sink.run(); - }; - - return FromObservable; - }(ObservableBase)); - - var FromSink = (function () { - function FromSink(o, parent) { - this.o = o; - this.parent = parent; - } - - FromSink.prototype.run = function () { - var list = Object(this.parent.iterable), - it = getIterable(list), - o = this.o, - mapper = this.parent.mapper; - - function loopRecursive(i, recurse) { - var next = tryCatch(it.next).call(it); - if (next === errorObj) { return o.onError(next.e); } - if (next.done) { return o.onCompleted(); } - - var result = next.value; - - if (isFunction(mapper)) { - result = tryCatch(mapper)(result, i); - if (result === errorObj) { return o.onError(result.e); } - } - - o.onNext(result); - recurse(i + 1); - } - - return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive); - }; - - return FromSink; - }()); - - var maxSafeInteger = Math.pow(2, 53) - 1; - - function StringIterable(s) { - this._s = s; - } - - StringIterable.prototype[$iterator$] = function () { - return new StringIterator(this._s); - }; - - function StringIterator(s) { - this._s = s; - this._l = s.length; - this._i = 0; - } - - StringIterator.prototype[$iterator$] = function () { - return this; - }; - - StringIterator.prototype.next = function () { - return this._i < this._l ? { done: false, value: this._s.charAt(this._i++) } : doneEnumerator; - }; - - function ArrayIterable(a) { - this._a = a; - } - - ArrayIterable.prototype[$iterator$] = function () { - return new ArrayIterator(this._a); - }; - - function ArrayIterator(a) { - this._a = a; - this._l = toLength(a); - this._i = 0; - } - - ArrayIterator.prototype[$iterator$] = function () { - return this; - }; - - ArrayIterator.prototype.next = function () { - return this._i < this._l ? { done: false, value: this._a[this._i++] } : doneEnumerator; - }; - - function numberIsFinite(value) { - return typeof value === 'number' && root.isFinite(value); - } - - function isNan(n) { - return n !== n; - } - - function getIterable(o) { - var i = o[$iterator$], it; - if (!i && typeof o === 'string') { - it = new StringIterable(o); - return it[$iterator$](); - } - if (!i && o.length !== undefined) { - it = new ArrayIterable(o); - return it[$iterator$](); - } - if (!i) { throw new TypeError('Object is not iterable'); } - return o[$iterator$](); - } - - function sign(value) { - var number = +value; - if (number === 0) { return number; } - if (isNaN(number)) { return number; } - return number < 0 ? -1 : 1; - } - - function toLength(o) { - var len = +o.length; - if (isNaN(len)) { return 0; } - if (len === 0 || !numberIsFinite(len)) { return len; } - len = sign(len) * Math.floor(Math.abs(len)); - if (len <= 0) { return 0; } - if (len > maxSafeInteger) { return maxSafeInteger; } - return len; - } - - /** - * This method creates a new Observable sequence from an array-like or iterable object. - * @param {Any} arrayLike An array-like or iterable object to convert to an Observable sequence. - * @param {Function} [mapFn] Map function to call on every element of the array. - * @param {Any} [thisArg] The context to use calling the mapFn if provided. - * @param {Scheduler} [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. - */ - var observableFrom = Observable.from = function (iterable, mapFn, thisArg, scheduler) { - if (iterable == null) { - throw new Error('iterable cannot be null.') - } - if (mapFn && !isFunction(mapFn)) { - throw new Error('mapFn when provided must be a function'); - } - if (mapFn) { - var mapper = bindCallback(mapFn, thisArg, 2); - } - isScheduler(scheduler) || (scheduler = currentThreadScheduler); - return new FromObservable(iterable, mapper, scheduler); - } - - var FromArrayObservable = (function(__super__) { - inherits(FromArrayObservable, __super__); - function FromArrayObservable(args, scheduler) { - this.args = args; - this.scheduler = scheduler; - __super__.call(this); - } - - FromArrayObservable.prototype.subscribeCore = function (observer) { - var sink = new FromArraySink(observer, this); - return sink.run(); - }; - - return FromArrayObservable; - }(ObservableBase)); - - function FromArraySink(observer, parent) { - this.observer = observer; - this.parent = parent; - } - - FromArraySink.prototype.run = function () { - var observer = this.observer, args = this.parent.args, len = args.length; - function loopRecursive(i, recurse) { - if (i < len) { - observer.onNext(args[i]); - recurse(i + 1); - } else { - observer.onCompleted(); - } - } - - return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive); - }; - - /** - * Converts an array to an observable sequence, using an optional scheduler to enumerate the array. - * @deprecated use Observable.from or Observable.of - * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on. - * @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence. - */ - var observableFromArray = Observable.fromArray = function (array, scheduler) { - isScheduler(scheduler) || (scheduler = currentThreadScheduler); - return new FromArrayObservable(array, scheduler) - }; - - var NeverObservable = (function(__super__) { - inherits(NeverObservable, __super__); - function NeverObservable() { - __super__.call(this); - } - - NeverObservable.prototype.subscribeCore = function (observer) { - return disposableEmpty; - }; - - return NeverObservable; - }(ObservableBase)); - - var NEVER_OBSERVABLE = new NeverObservable(); - - /** - * Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins). - * @returns {Observable} An observable sequence whose observers will never get called. - */ - var observableNever = Observable.never = function () { - return NEVER_OBSERVABLE; - }; - - function observableOf (scheduler, array) { - isScheduler(scheduler) || (scheduler = currentThreadScheduler); - return new FromArrayObservable(array, scheduler); - } - - /** - * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. - * @returns {Observable} The observable sequence whose elements are pulled from the given arguments. - */ - Observable.of = function () { - var len = arguments.length, args = new Array(len); - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } - return new FromArrayObservable(args, currentThreadScheduler); - }; - - /** - * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. - * @param {Scheduler} scheduler A scheduler to use for scheduling the arguments. - * @returns {Observable} The observable sequence whose elements are pulled from the given arguments. - */ - Observable.ofWithScheduler = function (scheduler) { - var len = arguments.length, args = new Array(len - 1); - for(var i = 1; i < len; i++) { args[i - 1] = arguments[i]; } - return new FromArrayObservable(args, scheduler); - }; - - var PairsObservable = (function(__super__) { - inherits(PairsObservable, __super__); - function PairsObservable(obj, scheduler) { - this.obj = obj; - this.keys = Object.keys(obj); - this.scheduler = scheduler; - __super__.call(this); - } - - PairsObservable.prototype.subscribeCore = function (observer) { - var sink = new PairsSink(observer, this); - return sink.run(); - }; - - return PairsObservable; - }(ObservableBase)); - - function PairsSink(observer, parent) { - this.observer = observer; - this.parent = parent; - } - - PairsSink.prototype.run = function () { - var observer = this.observer, obj = this.parent.obj, keys = this.parent.keys, len = keys.length; - function loopRecursive(i, recurse) { - if (i < len) { - var key = keys[i]; - observer.onNext([key, obj[key]]); - recurse(i + 1); - } else { - observer.onCompleted(); - } - } - - return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive); - }; - - /** - * Convert an object into an observable sequence of [key, value] pairs. - * @param {Object} obj The object to inspect. - * @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on. - * @returns {Observable} An observable sequence of [key, value] pairs from the object. - */ - Observable.pairs = function (obj, scheduler) { - scheduler || (scheduler = currentThreadScheduler); - return new PairsObservable(obj, scheduler); - }; - - var RangeObservable = (function(__super__) { - inherits(RangeObservable, __super__); - function RangeObservable(start, count, scheduler) { - this.start = start; - this.rangeCount = count; - this.scheduler = scheduler; - __super__.call(this); - } - - RangeObservable.prototype.subscribeCore = function (observer) { - var sink = new RangeSink(observer, this); - return sink.run(); - }; - - return RangeObservable; - }(ObservableBase)); - - var RangeSink = (function () { - function RangeSink(observer, parent) { - this.observer = observer; - this.parent = parent; - } - - RangeSink.prototype.run = function () { - var start = this.parent.start, count = this.parent.rangeCount, observer = this.observer; - function loopRecursive(i, recurse) { - if (i < count) { - observer.onNext(start + i); - recurse(i + 1); - } else { - observer.onCompleted(); - } - } - - return this.parent.scheduler.scheduleRecursiveWithState(0, loopRecursive); - }; - - return RangeSink; - }()); - - /** - * Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages. - * @param {Number} start The value of the first integer in the sequence. - * @param {Number} count The number of sequential integers to generate. - * @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread. - * @returns {Observable} An observable sequence that contains a range of sequential integral numbers. - */ - Observable.range = function (start, count, scheduler) { - isScheduler(scheduler) || (scheduler = currentThreadScheduler); - return new RangeObservable(start, count, scheduler); - }; - - var RepeatObservable = (function(__super__) { - inherits(RepeatObservable, __super__); - function RepeatObservable(value, repeatCount, scheduler) { - this.value = value; - this.repeatCount = repeatCount == null ? -1 : repeatCount; - this.scheduler = scheduler; - __super__.call(this); - } - - RepeatObservable.prototype.subscribeCore = function (observer) { - var sink = new RepeatSink(observer, this); - return sink.run(); - }; - - return RepeatObservable; - }(ObservableBase)); - - function RepeatSink(observer, parent) { - this.observer = observer; - this.parent = parent; - } - - RepeatSink.prototype.run = function () { - var observer = this.observer, value = this.parent.value; - function loopRecursive(i, recurse) { - if (i === -1 || i > 0) { - observer.onNext(value); - i > 0 && i--; - } - if (i === 0) { return observer.onCompleted(); } - recurse(i); - } - - return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount, loopRecursive); - }; - - /** - * Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages. - * @param {Mixed} value Element to repeat. - * @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely. - * @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate. - * @returns {Observable} An observable sequence that repeats the given element the specified number of times. - */ - Observable.repeat = function (value, repeatCount, scheduler) { - isScheduler(scheduler) || (scheduler = currentThreadScheduler); - return new RepeatObservable(value, repeatCount, scheduler); - }; - - var JustObservable = (function(__super__) { - inherits(JustObservable, __super__); - function JustObservable(value, scheduler) { - this.value = value; - this.scheduler = scheduler; - __super__.call(this); - } - - JustObservable.prototype.subscribeCore = function (observer) { - var sink = new JustSink(observer, this.value, this.scheduler); - return sink.run(); - }; - - function JustSink(observer, value, scheduler) { - this.observer = observer; - this.value = value; - this.scheduler = scheduler; - } - - function scheduleItem(s, state) { - var value = state[0], observer = state[1]; - observer.onNext(value); - observer.onCompleted(); - return disposableEmpty; - } - - JustSink.prototype.run = function () { - var state = [this.value, this.observer]; - return this.scheduler === immediateScheduler ? - scheduleItem(null, state) : - this.scheduler.scheduleWithState(state, scheduleItem); - }; - - return JustObservable; - }(ObservableBase)); - - /** - * Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages. - * There is an alias called 'just' or browsers 0) { - parent.handleSubscribe(parent.q.shift()); - } else { - parent.activeCount--; - parent.done && parent.activeCount === 0 && parent.o.onCompleted(); - } - } - }; - InnerObserver.prototype.dispose = function() { this.isStopped = true; }; - InnerObserver.prototype.fail = function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.parent.o.onError(e); - return true; - } - - return false; - }; - - return MergeObserver; - }()); - - - - - - /** - * Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences. - * Or merges two observable sequences into a single observable sequence. - * - * @example - * 1 - merged = sources.merge(1); - * 2 - merged = source.merge(otherSource); - * @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence. - * @returns {Observable} The observable sequence that merges the elements of the inner sequences. - */ - observableProto.merge = function (maxConcurrentOrOther) { - return typeof maxConcurrentOrOther !== 'number' ? - observableMerge(this, maxConcurrentOrOther) : - new MergeObservable(this, maxConcurrentOrOther); - }; - - /** - * Merges all the observable sequences into a single observable sequence. - * The scheduler is optional and if not specified, the immediate scheduler is used. - * @returns {Observable} The observable sequence that merges the elements of the observable sequences. - */ - var observableMerge = Observable.merge = function () { - var scheduler, sources = [], i, len = arguments.length; - if (!arguments[0]) { - scheduler = immediateScheduler; - for(i = 1; i < len; i++) { sources.push(arguments[i]); } - } else if (isScheduler(arguments[0])) { - scheduler = arguments[0]; - for(i = 1; i < len; i++) { sources.push(arguments[i]); } - } else { - scheduler = immediateScheduler; - for(i = 0; i < len; i++) { sources.push(arguments[i]); } - } - if (Array.isArray(sources[0])) { - sources = sources[0]; - } - return observableOf(scheduler, sources).mergeAll(); - }; - - var CompositeError = Rx.CompositeError = function(errors) { - this.name = "NotImplementedError"; - this.innerErrors = errors; - this.message = 'This contains multiple errors. Check the innerErrors'; - Error.call(this); - } - CompositeError.prototype = Error.prototype; - - /** - * Flattens an Observable that emits Observables into one Observable, in a way that allows an Observer to - * receive all successfully emitted items from all of the source Observables without being interrupted by - * an error notification from one of them. - * - * This behaves like Observable.prototype.mergeAll except that if any of the merged Observables notify of an - * error via the Observer's onError, mergeDelayError will refrain from propagating that - * error notification until all of the merged Observables have finished emitting items. - * @param {Array | Arguments} args Arguments or an array to merge. - * @returns {Observable} an Observable that emits all of the items emitted by the Observables emitted by the Observable - */ - Observable.mergeDelayError = function() { - var args; - if (Array.isArray(arguments[0])) { - args = arguments[0]; - } else { - var len = arguments.length; - args = new Array(len); - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } - } - var source = observableOf(null, args); - - return new AnonymousObservable(function (o) { - var group = new CompositeDisposable(), - m = new SingleAssignmentDisposable(), - isStopped = false, - errors = []; - - function setCompletion() { - if (errors.length === 0) { - o.onCompleted(); - } else if (errors.length === 1) { - o.onError(errors[0]); - } else { - o.onError(new CompositeError(errors)); - } - } - - group.add(m); - - m.setDisposable(source.subscribe( - function (innerSource) { - var innerSubscription = new SingleAssignmentDisposable(); - group.add(innerSubscription); - - // Check for promises support - isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); - - innerSubscription.setDisposable(innerSource.subscribe( - function (x) { o.onNext(x); }, - function (e) { - errors.push(e); - group.remove(innerSubscription); - isStopped && group.length === 1 && setCompletion(); - }, - function () { - group.remove(innerSubscription); - isStopped && group.length === 1 && setCompletion(); - })); - }, - function (e) { - errors.push(e); - isStopped = true; - group.length === 1 && setCompletion(); - }, - function () { - isStopped = true; - group.length === 1 && setCompletion(); - })); - return group; - }); - }; - - var MergeAllObservable = (function (__super__) { - inherits(MergeAllObservable, __super__); - - function MergeAllObservable(source) { - this.source = source; - __super__.call(this); - } - - MergeAllObservable.prototype.subscribeCore = function (observer) { - var g = new CompositeDisposable(), m = new SingleAssignmentDisposable(); - g.add(m); - m.setDisposable(this.source.subscribe(new MergeAllObserver(observer, g))); - return g; - }; - - function MergeAllObserver(o, g) { - this.o = o; - this.g = g; - this.isStopped = false; - this.done = false; - } - MergeAllObserver.prototype.onNext = function(innerSource) { - if(this.isStopped) { return; } - var sad = new SingleAssignmentDisposable(); - this.g.add(sad); - - isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); - - sad.setDisposable(innerSource.subscribe(new InnerObserver(this, sad))); - }; - MergeAllObserver.prototype.onError = function (e) { - if(!this.isStopped) { - this.isStopped = true; - this.o.onError(e); - } - }; - MergeAllObserver.prototype.onCompleted = function () { - if(!this.isStopped) { - this.isStopped = true; - this.done = true; - this.g.length === 1 && this.o.onCompleted(); - } - }; - MergeAllObserver.prototype.dispose = function() { this.isStopped = true; }; - MergeAllObserver.prototype.fail = function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.o.onError(e); - return true; - } - - return false; - }; - - function InnerObserver(parent, sad) { - this.parent = parent; - this.sad = sad; - this.isStopped = false; - } - InnerObserver.prototype.onNext = function (x) { if (!this.isStopped) { this.parent.o.onNext(x); } }; - InnerObserver.prototype.onError = function (e) { - if(!this.isStopped) { - this.isStopped = true; - this.parent.o.onError(e); - } - }; - InnerObserver.prototype.onCompleted = function () { - if(!this.isStopped) { - var parent = this.parent; - this.isStopped = true; - parent.g.remove(this.sad); - parent.done && parent.g.length === 1 && parent.o.onCompleted(); - } - }; - InnerObserver.prototype.dispose = function() { this.isStopped = true; }; - InnerObserver.prototype.fail = function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.parent.o.onError(e); - return true; - } - - return false; - }; - - return MergeAllObservable; - }(ObservableBase)); - - /** - * Merges an observable sequence of observable sequences into an observable sequence. - * @returns {Observable} The observable sequence that merges the elements of the inner sequences. - */ - observableProto.mergeAll = function () { - return new MergeAllObservable(this); - }; - - /** - * Returns the values from the source observable sequence only after the other observable sequence produces a value. - * @param {Observable | Promise} other The observable sequence or Promise that triggers propagation of elements of the source sequence. - * @returns {Observable} An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation. - */ - observableProto.skipUntil = function (other) { - var source = this; - return new AnonymousObservable(function (o) { - var isOpen = false; - var disposables = new CompositeDisposable(source.subscribe(function (left) { - isOpen && o.onNext(left); - }, function (e) { o.onError(e); }, function () { - isOpen && o.onCompleted(); - })); - - isPromise(other) && (other = observableFromPromise(other)); - - var rightSubscription = new SingleAssignmentDisposable(); - disposables.add(rightSubscription); - rightSubscription.setDisposable(other.subscribe(function () { - isOpen = true; - rightSubscription.dispose(); - }, function (e) { o.onError(e); }, function () { - rightSubscription.dispose(); - })); - - return disposables; - }, source); - }; - - var SwitchObservable = (function(__super__) { - inherits(SwitchObservable, __super__); - function SwitchObservable(source) { - this.source = source; - __super__.call(this); - } - - SwitchObservable.prototype.subscribeCore = function (o) { - var inner = new SerialDisposable(), s = this.source.subscribe(new SwitchObserver(o, inner)); - return new CompositeDisposable(s, inner); - }; - - function SwitchObserver(o, inner) { - this.o = o; - this.inner = inner; - this.stopped = false; - this.latest = 0; - this.hasLatest = false; - this.isStopped = false; - } - SwitchObserver.prototype.onNext = function (innerSource) { - if (this.isStopped) { return; } - var d = new SingleAssignmentDisposable(), id = ++this.latest; - this.hasLatest = true; - this.inner.setDisposable(d); - isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); - d.setDisposable(innerSource.subscribe(new InnerObserver(this, id))); - }; - SwitchObserver.prototype.onError = function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.o.onError(e); - } - }; - SwitchObserver.prototype.onCompleted = function () { - if (!this.isStopped) { - this.isStopped = true; - this.stopped = true; - !this.hasLatest && this.o.onCompleted(); - } - }; - SwitchObserver.prototype.dispose = function () { this.isStopped = true; }; - SwitchObserver.prototype.fail = function (e) { - if(!this.isStopped) { - this.isStopped = true; - this.o.onError(e); - return true; - } - return false; - }; - - function InnerObserver(parent, id) { - this.parent = parent; - this.id = id; - this.isStopped = false; - } - InnerObserver.prototype.onNext = function (x) { - if (this.isStopped) { return; } - this.parent.latest === this.id && this.parent.o.onNext(x); - }; - InnerObserver.prototype.onError = function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.parent.latest === this.id && this.parent.o.onError(e); - } - }; - InnerObserver.prototype.onCompleted = function () { - if (!this.isStopped) { - this.isStopped = true; - if (this.parent.latest === this.id) { - this.parent.hasLatest = false; - this.parent.isStopped && this.parent.o.onCompleted(); - } - } - }; - InnerObserver.prototype.dispose = function () { this.isStopped = true; } - InnerObserver.prototype.fail = function (e) { - if(!this.isStopped) { - this.isStopped = true; - this.parent.o.onError(e); - return true; - } - return false; - }; - - return SwitchObservable; - }(ObservableBase)); - - /** - * Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. - * @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received. - */ - observableProto['switch'] = observableProto.switchLatest = function () { - return new SwitchObservable(this); - }; - - var TakeUntilObservable = (function(__super__) { - inherits(TakeUntilObservable, __super__); - - function TakeUntilObservable(source, other) { - this.source = source; - this.other = isPromise(other) ? observableFromPromise(other) : other; - __super__.call(this); - } - - TakeUntilObservable.prototype.subscribeCore = function(o) { - return new CompositeDisposable( - this.source.subscribe(o), - this.other.subscribe(new InnerObserver(o)) - ); - }; - - function InnerObserver(o) { - this.o = o; - this.isStopped = false; - } - InnerObserver.prototype.onNext = function (x) { - if (this.isStopped) { return; } - this.o.onCompleted(); - }; - InnerObserver.prototype.onError = function (err) { - if (!this.isStopped) { - this.isStopped = true; - this.o.onError(err); - } - }; - InnerObserver.prototype.onCompleted = function () { - !this.isStopped && (this.isStopped = true); - }; - InnerObserver.prototype.dispose = function() { this.isStopped = true; }; - InnerObserver.prototype.fail = function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.o.onError(e); - return true; - } - return false; - }; - - return TakeUntilObservable; - }(ObservableBase)); - - /** - * Returns the values from the source observable sequence until the other observable sequence produces a value. - * @param {Observable | Promise} other Observable sequence or Promise that terminates propagation of elements of the source sequence. - * @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation. - */ - observableProto.takeUntil = function (other) { - return new TakeUntilObservable(this, other); - }; - - function falseFactory() { return false; } - - /** - * Merges the specified observable sequences into one observable sequence by using the selector function only when the (first) source observable sequence produces an element. - * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. - */ - observableProto.withLatestFrom = function () { - var len = arguments.length, args = new Array(len) - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } - var resultSelector = args.pop(), source = this; - Array.isArray(args[0]) && (args = args[0]); - - return new AnonymousObservable(function (observer) { - var n = args.length, - hasValue = arrayInitialize(n, falseFactory), - hasValueAll = false, - values = new Array(n); - - var subscriptions = new Array(n + 1); - for (var idx = 0; idx < n; idx++) { - (function (i) { - var other = args[i], sad = new SingleAssignmentDisposable(); - isPromise(other) && (other = observableFromPromise(other)); - sad.setDisposable(other.subscribe(function (x) { - values[i] = x; - hasValue[i] = true; - hasValueAll = hasValue.every(identity); - }, function (e) { observer.onError(e); }, noop)); - subscriptions[i] = sad; - }(idx)); - } - - var sad = new SingleAssignmentDisposable(); - sad.setDisposable(source.subscribe(function (x) { - var allValues = [x].concat(values); - if (!hasValueAll) { return; } - var res = tryCatch(resultSelector).apply(null, allValues); - if (res === errorObj) { return observer.onError(res.e); } - observer.onNext(res); - }, function (e) { observer.onError(e); }, function () { - observer.onCompleted(); - })); - subscriptions[n] = sad; - - return new CompositeDisposable(subscriptions); - }, this); - }; - - function falseFactory() { return false; } - function emptyArrayFactory() { return []; } - function argumentsToArray() { - var len = arguments.length, args = new Array(len); - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } - return args; - } - - /** - * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index. - * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the args. - * @returns {Observable} An observable sequence containing the result of combining elements of the args using the specified result selector function. - */ - observableProto.zip = function () { - if (arguments.length === 0) { throw new Error('invalid arguments'); } - - var len = arguments.length, args = new Array(len); - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } - var resultSelector = isFunction(args[len - 1]) ? args.pop() : argumentsToArray; - Array.isArray(args[0]) && (args = args[0]); - - var parent = this; - args.unshift(parent); - return new AnonymousObservable(function (o) { - var n = args.length, - queues = arrayInitialize(n, emptyArrayFactory), - isDone = arrayInitialize(n, falseFactory); - - var subscriptions = new Array(n); - for (var idx = 0; idx < n; idx++) { - (function (i) { - var source = args[i], sad = new SingleAssignmentDisposable(); - - isPromise(source) && (source = observableFromPromise(source)); - - sad.setDisposable(source.subscribe(function (x) { - queues[i].push(x); - if (queues.every(function (x) { return x.length > 0; })) { - var queuedValues = queues.map(function (x) { return x.shift(); }), - res = tryCatch(resultSelector).apply(parent, queuedValues); - if (res === errorObj) { return o.onError(res.e); } - o.onNext(res); - } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { - o.onCompleted(); - } - }, function (e) { o.onError(e); }, function () { - isDone[i] = true; - isDone.every(identity) && o.onCompleted(); - })); - subscriptions[i] = sad; - })(idx); - } - - return new CompositeDisposable(subscriptions); - }, parent); - }; - - /** - * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. - * @param arguments Observable sources. - * @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources. - * @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function. - */ - Observable.zip = function () { - var len = arguments.length, args = new Array(len); - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } - if (Array.isArray(args[0])) { - args = isFunction(args[1]) ? args[0].concat(args[1]) : args[0]; - } - var first = args.shift(); - return first.zip.apply(first, args); - }; - -function falseFactory() { return false; } -function emptyArrayFactory() { return []; } -function argumentsToArray() { - var len = arguments.length, args = new Array(len); - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } - return args; -} - -/** - * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index. - * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the args. - * @returns {Observable} An observable sequence containing the result of combining elements of the args using the specified result selector function. - */ -observableProto.zipIterable = function () { - if (arguments.length === 0) { throw new Error('invalid arguments'); } - - var len = arguments.length, args = new Array(len); - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } - var resultSelector = isFunction(args[len - 1]) ? args.pop() : argumentsToArray; - - var parent = this; - args.unshift(parent); - return new AnonymousObservable(function (o) { - var n = args.length, - queues = arrayInitialize(n, emptyArrayFactory), - isDone = arrayInitialize(n, falseFactory); - - var subscriptions = new Array(n); - for (var idx = 0; idx < n; idx++) { - (function (i) { - var source = args[i], sad = new SingleAssignmentDisposable(); - - (isArrayLike(source) || isIterable(source)) && (source = observableFrom(source)); - - sad.setDisposable(source.subscribe(function (x) { - queues[i].push(x); - if (queues.every(function (x) { return x.length > 0; })) { - var queuedValues = queues.map(function (x) { return x.shift(); }), - res = tryCatch(resultSelector).apply(parent, queuedValues); - if (res === errorObj) { return o.onError(res.e); } - o.onNext(res); - } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { - o.onCompleted(); - } - }, function (e) { o.onError(e); }, function () { - isDone[i] = true; - isDone.every(identity) && o.onCompleted(); - })); - subscriptions[i] = sad; - })(idx); - } - - return new CompositeDisposable(subscriptions); - }, parent); -}; - - function asObservable(source) { - return function subscribe(o) { return source.subscribe(o); }; - } - - /** - * Hides the identity of an observable sequence. - * @returns {Observable} An observable sequence that hides the identity of the source sequence. - */ - observableProto.asObservable = function () { - return new AnonymousObservable(asObservable(this), this); - }; - - /** - * Dematerializes the explicit notification values of an observable sequence as implicit notifications. - * @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values. - */ - observableProto.dematerialize = function () { - var source = this; - return new AnonymousObservable(function (o) { - return source.subscribe(function (x) { return x.accept(o); }, function(e) { o.onError(e); }, function () { o.onCompleted(); }); - }, this); - }; - - var DistinctUntilChangedObservable = (function(__super__) { - inherits(DistinctUntilChangedObservable, __super__); - function DistinctUntilChangedObservable(source, keyFn, comparer) { - this.source = source; - this.keyFn = keyFn; - this.comparer = comparer; - __super__.call(this); - } - - DistinctUntilChangedObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new DistinctUntilChangedObserver(o, this.keyFn, this.comparer)); - }; - - return DistinctUntilChangedObservable; - }(ObservableBase)); - - var DistinctUntilChangedObserver = (function(__super__) { - inherits(DistinctUntilChangedObserver, __super__); - function DistinctUntilChangedObserver(o, keyFn, comparer) { - this.o = o; - this.keyFn = keyFn; - this.comparer = comparer; - this.hasCurrentKey = false; - this.currentKey = null; - __super__.call(this); - } - - DistinctUntilChangedObserver.prototype.next = function (x) { - var key = x, comparerEquals; - if (isFunction(this.keyFn)) { - key = tryCatch(this.keyFn)(x); - if (key === errorObj) { return this.o.onError(key.e); } - } - if (this.hasCurrentKey) { - comparerEquals = tryCatch(this.comparer)(this.currentKey, key); - if (comparerEquals === errorObj) { return this.o.onError(comparerEquals.e); } - } - if (!this.hasCurrentKey || !comparerEquals) { - this.hasCurrentKey = true; - this.currentKey = key; - this.o.onNext(x); - } - }; - DistinctUntilChangedObserver.prototype.error = function(e) { - this.o.onError(e); - }; - DistinctUntilChangedObserver.prototype.completed = function () { - this.o.onCompleted(); - }; - - return DistinctUntilChangedObserver; - }(AbstractObserver)); - - /** - * Returns an observable sequence that contains only distinct contiguous elements according to the keyFn and the comparer. - * @param {Function} [keyFn] A function to compute the comparison key for each element. If not provided, it projects the value. - * @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function. - * @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence. - */ - observableProto.distinctUntilChanged = function (keyFn, comparer) { - comparer || (comparer = defaultComparer); - return new DistinctUntilChangedObservable(this, keyFn, comparer); - }; - - var TapObservable = (function(__super__) { - inherits(TapObservable,__super__); - function TapObservable(source, observerOrOnNext, onError, onCompleted) { - this.source = source; - this._oN = observerOrOnNext; - this._oE = onError; - this._oC = onCompleted; - __super__.call(this); - } - - TapObservable.prototype.subscribeCore = function(o) { - return this.source.subscribe(new InnerObserver(o, this)); - }; - - function InnerObserver(o, p) { - this.o = o; - this.t = !p._oN || isFunction(p._oN) ? - observerCreate(p._oN || noop, p._oE || noop, p._oC || noop) : - p._oN; - this.isStopped = false; - } - InnerObserver.prototype.onNext = function(x) { - if (this.isStopped) { return; } - var res = tryCatch(this.t.onNext).call(this.t, x); - if (res === errorObj) { this.o.onError(res.e); } - this.o.onNext(x); - }; - InnerObserver.prototype.onError = function(err) { - if (!this.isStopped) { - this.isStopped = true; - var res = tryCatch(this.t.onError).call(this.t, err); - if (res === errorObj) { return this.o.onError(res.e); } - this.o.onError(err); - } - }; - InnerObserver.prototype.onCompleted = function() { - if (!this.isStopped) { - this.isStopped = true; - var res = tryCatch(this.t.onCompleted).call(this.t); - if (res === errorObj) { return this.o.onError(res.e); } - this.o.onCompleted(); - } - }; - InnerObserver.prototype.dispose = function() { this.isStopped = true; }; - InnerObserver.prototype.fail = function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.o.onError(e); - return true; - } - return false; - }; - - return TapObservable; - }(ObservableBase)); - - /** - * Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence. - * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. - * @param {Function | Observer} observerOrOnNext Action to invoke for each element in the observable sequence or an o. - * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. - * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function. - * @returns {Observable} The source sequence with the side-effecting behavior applied. - */ - observableProto['do'] = observableProto.tap = observableProto.doAction = function (observerOrOnNext, onError, onCompleted) { - return new TapObservable(this, observerOrOnNext, onError, onCompleted); - }; - - /** - * Invokes an action for each element in the observable sequence. - * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. - * @param {Function} onNext Action to invoke for each element in the observable sequence. - * @param {Any} [thisArg] Object to use as this when executing callback. - * @returns {Observable} The source sequence with the side-effecting behavior applied. - */ - observableProto.doOnNext = observableProto.tapOnNext = function (onNext, thisArg) { - return this.tap(typeof thisArg !== 'undefined' ? function (x) { onNext.call(thisArg, x); } : onNext); - }; - - /** - * Invokes an action upon exceptional termination of the observable sequence. - * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. - * @param {Function} onError Action to invoke upon exceptional termination of the observable sequence. - * @param {Any} [thisArg] Object to use as this when executing callback. - * @returns {Observable} The source sequence with the side-effecting behavior applied. - */ - observableProto.doOnError = observableProto.tapOnError = function (onError, thisArg) { - return this.tap(noop, typeof thisArg !== 'undefined' ? function (e) { onError.call(thisArg, e); } : onError); - }; - - /** - * Invokes an action upon graceful termination of the observable sequence. - * This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline. - * @param {Function} onCompleted Action to invoke upon graceful termination of the observable sequence. - * @param {Any} [thisArg] Object to use as this when executing callback. - * @returns {Observable} The source sequence with the side-effecting behavior applied. - */ - observableProto.doOnCompleted = observableProto.tapOnCompleted = function (onCompleted, thisArg) { - return this.tap(noop, null, typeof thisArg !== 'undefined' ? function () { onCompleted.call(thisArg); } : onCompleted); - }; - - /** - * Invokes a specified action after the source observable sequence terminates gracefully or exceptionally. - * @param {Function} finallyAction Action to invoke after the source observable sequence terminates. - * @returns {Observable} Source sequence with the action-invoking termination behavior applied. - */ - observableProto['finally'] = function (action) { - var source = this; - return new AnonymousObservable(function (observer) { - var subscription = tryCatch(source.subscribe).call(source, observer); - if (subscription === errorObj) { - action(); - return thrower(subscription.e); - } - return disposableCreate(function () { - var r = tryCatch(subscription.dispose).call(subscription); - action(); - r === errorObj && thrower(r.e); - }); - }, this); - }; - - var IgnoreElementsObservable = (function(__super__) { - inherits(IgnoreElementsObservable, __super__); - - function IgnoreElementsObservable(source) { - this.source = source; - __super__.call(this); - } - - IgnoreElementsObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new InnerObserver(o)); - }; - - function InnerObserver(o) { - this.o = o; - this.isStopped = false; - } - InnerObserver.prototype.onNext = noop; - InnerObserver.prototype.onError = function (err) { - if(!this.isStopped) { - this.isStopped = true; - this.o.onError(err); - } - }; - InnerObserver.prototype.onCompleted = function () { - if(!this.isStopped) { - this.isStopped = true; - this.o.onCompleted(); - } - }; - InnerObserver.prototype.dispose = function() { this.isStopped = true; }; - InnerObserver.prototype.fail = function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.observer.onError(e); - return true; - } - - return false; - }; - - return IgnoreElementsObservable; - }(ObservableBase)); - - /** - * Ignores all elements in an observable sequence leaving only the termination messages. - * @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence. - */ - observableProto.ignoreElements = function () { - return new IgnoreElementsObservable(this); - }; - - /** - * Materializes the implicit notifications of an observable sequence as explicit notification values. - * @returns {Observable} An observable sequence containing the materialized notification values from the source sequence. - */ - observableProto.materialize = function () { - var source = this; - return new AnonymousObservable(function (observer) { - return source.subscribe(function (value) { - observer.onNext(notificationCreateOnNext(value)); - }, function (e) { - observer.onNext(notificationCreateOnError(e)); - observer.onCompleted(); - }, function () { - observer.onNext(notificationCreateOnCompleted()); - observer.onCompleted(); - }); - }, source); - }; - - /** - * Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely. - * @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely. - * @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly. - */ - observableProto.repeat = function (repeatCount) { - return enumerableRepeat(this, repeatCount).concat(); - }; - - /** - * Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely. - * Note if you encounter an error and want it to retry once, then you must use .retry(2); - * - * @example - * var res = retried = retry.repeat(); - * var res = retried = retry.repeat(2); - * @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely. - * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully. - */ - observableProto.retry = function (retryCount) { - return enumerableRepeat(this, retryCount).catchError(); - }; - - /** - * Repeats the source observable sequence upon error each time the notifier emits or until it successfully terminates. - * if the notifier completes, the observable sequence completes. - * - * @example - * var timer = Observable.timer(500); - * var source = observable.retryWhen(timer); - * @param {Observable} [notifier] An observable that triggers the retries or completes the observable with onNext or onCompleted respectively. - * @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully. - */ - observableProto.retryWhen = function (notifier) { - return enumerableRepeat(this).catchErrorWhen(notifier); - }; - var ScanObservable = (function(__super__) { - inherits(ScanObservable, __super__); - function ScanObservable(source, accumulator, hasSeed, seed) { - this.source = source; - this.accumulator = accumulator; - this.hasSeed = hasSeed; - this.seed = seed; - __super__.call(this); - } - - ScanObservable.prototype.subscribeCore = function(o) { - return this.source.subscribe(new InnerObserver(o,this)); - }; - - return ScanObservable; - }(ObservableBase)); - - function InnerObserver(o, parent) { - this.o = o; - this.accumulator = parent.accumulator; - this.hasSeed = parent.hasSeed; - this.seed = parent.seed; - this.hasAccumulation = false; - this.accumulation = null; - this.hasValue = false; - this.isStopped = false; - } - InnerObserver.prototype = { - onNext: function (x) { - if (this.isStopped) { return; } - !this.hasValue && (this.hasValue = true); - if (this.hasAccumulation) { - this.accumulation = tryCatch(this.accumulator)(this.accumulation, x); - } else { - this.accumulation = this.hasSeed ? tryCatch(this.accumulator)(this.seed, x) : x; - this.hasAccumulation = true; - } - if (this.accumulation === errorObj) { return this.o.onError(this.accumulation.e); } - this.o.onNext(this.accumulation); - }, - onError: function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.o.onError(e); - } - }, - onCompleted: function () { - if (!this.isStopped) { - this.isStopped = true; - !this.hasValue && this.hasSeed && this.o.onNext(this.seed); - this.o.onCompleted(); - } - }, - dispose: function() { this.isStopped = true; }, - fail: function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.o.onError(e); - return true; - } - return false; - } - }; - - /** - * Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value. - * For aggregation behavior with no intermediate results, see Observable.aggregate. - * @param {Mixed} [seed] The initial accumulator value. - * @param {Function} accumulator An accumulator function to be invoked on each element. - * @returns {Observable} An observable sequence containing the accumulated values. - */ - observableProto.scan = function () { - var hasSeed = false, seed, accumulator = arguments[0]; - if (arguments.length === 2) { - hasSeed = true; - seed = arguments[1]; - } - return new ScanObservable(this, accumulator, hasSeed, seed); - }; - - /** - * Bypasses a specified number of elements at the end of an observable sequence. - * @description - * This operator accumulates a queue with a length enough to store the first `count` elements. As more elements are - * received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed. - * @param count Number of elements to bypass at the end of the source sequence. - * @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end. - */ - observableProto.skipLast = function (count) { - if (count < 0) { throw new ArgumentOutOfRangeError(); } - var source = this; - return new AnonymousObservable(function (o) { - var q = []; - return source.subscribe(function (x) { - q.push(x); - q.length > count && o.onNext(q.shift()); - }, function (e) { o.onError(e); }, function () { o.onCompleted(); }); - }, source); - }; - - /** - * Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend. - * @example - * var res = source.startWith(1, 2, 3); - * var res = source.startWith(Rx.Scheduler.timeout, 1, 2, 3); - * @param {Arguments} args The specified values to prepend to the observable sequence - * @returns {Observable} The source sequence prepended with the specified values. - */ - observableProto.startWith = function () { - var values, scheduler, start = 0; - if (!!arguments.length && isScheduler(arguments[0])) { - scheduler = arguments[0]; - start = 1; - } else { - scheduler = immediateScheduler; - } - for(var args = [], i = start, len = arguments.length; i < len; i++) { args.push(arguments[i]); } - return enumerableOf([observableFromArray(args, scheduler), this]).concat(); - }; - - /** - * Returns a specified number of contiguous elements from the end of an observable sequence. - * @description - * This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of - * the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed. - * @param {Number} count Number of elements to take from the end of the source sequence. - * @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence. - */ - observableProto.takeLast = function (count) { - if (count < 0) { throw new ArgumentOutOfRangeError(); } - var source = this; - return new AnonymousObservable(function (o) { - var q = []; - return source.subscribe(function (x) { - q.push(x); - q.length > count && q.shift(); - }, function (e) { o.onError(e); }, function () { - while (q.length > 0) { o.onNext(q.shift()); } - o.onCompleted(); - }); - }, source); - }; - -observableProto.flatMapConcat = observableProto.concatMap = function(selector, resultSelector, thisArg) { - return new FlatMapObservable(this, selector, resultSelector, thisArg).merge(1); -}; - var MapObservable = (function (__super__) { - inherits(MapObservable, __super__); - - function MapObservable(source, selector, thisArg) { - this.source = source; - this.selector = bindCallback(selector, thisArg, 3); - __super__.call(this); - } - - function innerMap(selector, self) { - return function (x, i, o) { return selector.call(this, self.selector(x, i, o), i, o); } - } - - MapObservable.prototype.internalMap = function (selector, thisArg) { - return new MapObservable(this.source, innerMap(selector, this), thisArg); - }; - - MapObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new InnerObserver(o, this.selector, this)); - }; - - function InnerObserver(o, selector, source) { - this.o = o; - this.selector = selector; - this.source = source; - this.i = 0; - this.isStopped = false; - } - - InnerObserver.prototype.onNext = function(x) { - if (this.isStopped) { return; } - var result = tryCatch(this.selector)(x, this.i++, this.source); - if (result === errorObj) { return this.o.onError(result.e); } - this.o.onNext(result); - }; - InnerObserver.prototype.onError = function (e) { - if(!this.isStopped) { this.isStopped = true; this.o.onError(e); } - }; - InnerObserver.prototype.onCompleted = function () { - if(!this.isStopped) { this.isStopped = true; this.o.onCompleted(); } - }; - InnerObserver.prototype.dispose = function() { this.isStopped = true; }; - InnerObserver.prototype.fail = function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.o.onError(e); - return true; - } - - return false; - }; - - return MapObservable; - - }(ObservableBase)); - - /** - * Projects each element of an observable sequence into a new form by incorporating the element's index. - * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. - * @param {Any} [thisArg] Object to use as this when executing callback. - * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source. - */ - observableProto.map = observableProto.select = function (selector, thisArg) { - var selectorFn = typeof selector === 'function' ? selector : function () { return selector; }; - return this instanceof MapObservable ? - this.internalMap(selectorFn, thisArg) : - new MapObservable(this, selectorFn, thisArg); - }; - - function plucker(args, len) { - return function mapper(x) { - var currentProp = x; - for (var i = 0; i < len; i++) { - var p = currentProp[args[i]]; - if (typeof p !== 'undefined') { - currentProp = p; - } else { - return undefined; - } - } - return currentProp; - } - } - - /** - * Retrieves the value of a specified nested property from all elements in - * the Observable sequence. - * @param {Arguments} arguments The nested properties to pluck. - * @returns {Observable} Returns a new Observable sequence of property values. - */ - observableProto.pluck = function () { - var len = arguments.length, args = new Array(len); - if (len === 0) { throw new Error('List of properties cannot be empty.'); } - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } - return this.map(plucker(args, len)); - }; - -observableProto.flatMap = observableProto.selectMany = function(selector, resultSelector, thisArg) { - return new FlatMapObservable(this, selector, resultSelector, thisArg).mergeAll(); -}; - - -// -//Rx.Observable.prototype.flatMapWithMaxConcurrent = function(limit, selector, resultSelector, thisArg) { -// return new FlatMapObservable(this, selector, resultSelector, thisArg).merge(limit); -//}; -// - -Rx.Observable.prototype.flatMapLatest = function(selector, resultSelector, thisArg) { - return new FlatMapObservable(this, selector, resultSelector, thisArg).switchLatest(); -}; - var SkipObservable = (function(__super__) { - inherits(SkipObservable, __super__); - function SkipObservable(source, count) { - this.source = source; - this.skipCount = count; - __super__.call(this); - } - - SkipObservable.prototype.subscribeCore = function (o) { - return this.source.subscribe(new InnerObserver(o, this.skipCount)); - }; - - function InnerObserver(o, c) { - this.c = c; - this.r = c; - this.o = o; - this.isStopped = false; - } - InnerObserver.prototype.onNext = function (x) { - if (this.isStopped) { return; } - if (this.r <= 0) { - this.o.onNext(x); - } else { - this.r--; - } - }; - InnerObserver.prototype.onError = function(e) { - if (!this.isStopped) { this.isStopped = true; this.o.onError(e); } - }; - InnerObserver.prototype.onCompleted = function() { - if (!this.isStopped) { this.isStopped = true; this.o.onCompleted(); } - }; - InnerObserver.prototype.dispose = function() { this.isStopped = true; }; - InnerObserver.prototype.fail = function(e) { - if (!this.isStopped) { - this.isStopped = true; - this.o.onError(e); - return true; - } - return false; - }; - - return SkipObservable; - }(ObservableBase)); - - /** - * Bypasses a specified number of elements in an observable sequence and then returns the remaining elements. - * @param {Number} count The number of elements to skip before returning the remaining elements. - * @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence. - */ - observableProto.skip = function (count) { - if (count < 0) { throw new ArgumentOutOfRangeError(); } - return new SkipObservable(this, count); - }; - /** - * Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements. - * The element's index is used in the logic of the predicate function. - * - * var res = source.skipWhile(function (value) { return value < 10; }); - * var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; }); - * @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element. - * @param {Any} [thisArg] Object to use as this when executing callback. - * @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. - */ - observableProto.skipWhile = function (predicate, thisArg) { - var source = this, - callback = bindCallback(predicate, thisArg, 3); - return new AnonymousObservable(function (o) { - var i = 0, running = false; - return source.subscribe(function (x) { - if (!running) { - try { - running = !callback(x, i++, source); - } catch (e) { - o.onError(e); - return; - } - } - running && o.onNext(x); - }, function (e) { o.onError(e); }, function () { o.onCompleted(); }); - }, source); - }; - - /** - * Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0). - * - * var res = source.take(5); - * var res = source.take(0, Rx.Scheduler.timeout); - * @param {Number} count The number of elements to return. - * @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case 0) { - var now = scheduler.now(); - d = d + p; - d <= now && (d = now + p); - } - observer.onNext(count); - self(count + 1, d); - }); - }); - } - - function observableTimerTimeSpan(dueTime, scheduler) { - return new AnonymousObservable(function (observer) { - return scheduler.scheduleWithRelative(normalizeTime(dueTime), function () { - observer.onNext(0); - observer.onCompleted(); - }); - }); - } - - function observableTimerTimeSpanAndPeriod(dueTime, period, scheduler) { - return dueTime === period ? - new AnonymousObservable(function (observer) { - return scheduler.schedulePeriodicWithState(0, period, function (count) { - observer.onNext(count); - return count + 1; - }); - }) : - observableDefer(function () { - return observableTimerDateAndPeriod(scheduler.now() + dueTime, period, scheduler); - }); - } - - /** - * Returns an observable sequence that produces a value after each period. - * - * @example - * 1 - res = Rx.Observable.interval(1000); - * 2 - res = Rx.Observable.interval(1000, Rx.Scheduler.timeout); - * - * @param {Number} period Period for producing the values in the resulting sequence (specified as an integer denoting milliseconds). - * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, Rx.Scheduler.timeout is used. - * @returns {Observable} An observable sequence that produces a value after each period. - */ - var observableinterval = Observable.interval = function (period, scheduler) { - return observableTimerTimeSpanAndPeriod(period, period, isScheduler(scheduler) ? scheduler : timeoutScheduler); - }; - - /** - * Returns an observable sequence that produces a value after dueTime has elapsed and then after each period. - * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) at which to produce the first value. - * @param {Mixed} [periodOrScheduler] Period to produce subsequent values (specified as an integer denoting milliseconds), or the scheduler to run the timer on. If not specified, the resulting timer is not recurring. - * @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, the timeout scheduler is used. - * @returns {Observable} An observable sequence that produces a value after due time has elapsed and then each period. - */ - var observableTimer = Observable.timer = function (dueTime, periodOrScheduler, scheduler) { - var period; - isScheduler(scheduler) || (scheduler = timeoutScheduler); - if (periodOrScheduler != null && typeof periodOrScheduler === 'number') { - period = periodOrScheduler; - } else if (isScheduler(periodOrScheduler)) { - scheduler = periodOrScheduler; - } - if (dueTime instanceof Date && period === undefined) { - return observableTimerDate(dueTime.getTime(), scheduler); - } - if (dueTime instanceof Date && period !== undefined) { - return observableTimerDateAndPeriod(dueTime.getTime(), periodOrScheduler, scheduler); - } - return period === undefined ? - observableTimerTimeSpan(dueTime, scheduler) : - observableTimerTimeSpanAndPeriod(dueTime, period, scheduler); - }; - - function observableDelayRelative(source, dueTime, scheduler) { - return new AnonymousObservable(function (o) { - var active = false, - cancelable = new SerialDisposable(), - exception = null, - q = [], - running = false, - subscription; - subscription = source.materialize().timestamp(scheduler).subscribe(function (notification) { - var d, shouldRun; - if (notification.value.kind === 'E') { - q = []; - q.push(notification); - exception = notification.value.exception; - shouldRun = !running; - } else { - q.push({ value: notification.value, timestamp: notification.timestamp + dueTime }); - shouldRun = !active; - active = true; - } - if (shouldRun) { - if (exception !== null) { - o.onError(exception); - } else { - d = new SingleAssignmentDisposable(); - cancelable.setDisposable(d); - d.setDisposable(scheduler.scheduleRecursiveWithRelative(dueTime, function (self) { - var e, recurseDueTime, result, shouldRecurse; - if (exception !== null) { - return; - } - running = true; - do { - result = null; - if (q.length > 0 && q[0].timestamp - scheduler.now() <= 0) { - result = q.shift().value; - } - if (result !== null) { - result.accept(o); - } - } while (result !== null); - shouldRecurse = false; - recurseDueTime = 0; - if (q.length > 0) { - shouldRecurse = true; - recurseDueTime = Math.max(0, q[0].timestamp - scheduler.now()); - } else { - active = false; - } - e = exception; - running = false; - if (e !== null) { - o.onError(e); - } else if (shouldRecurse) { - self(recurseDueTime); - } - })); - } - } - }); - return new CompositeDisposable(subscription, cancelable); - }, source); - } - - function observableDelayAbsolute(source, dueTime, scheduler) { - return observableDefer(function () { - return observableDelayRelative(source, dueTime - scheduler.now(), scheduler); - }); - } - - function delayWithSelector(source, subscriptionDelay, delayDurationSelector) { - var subDelay, selector; - if (isFunction(subscriptionDelay)) { - selector = subscriptionDelay; - } else { - subDelay = subscriptionDelay; - selector = delayDurationSelector; - } - return new AnonymousObservable(function (o) { - var delays = new CompositeDisposable(), atEnd = false, subscription = new SerialDisposable(); - - function start() { - subscription.setDisposable(source.subscribe( - function (x) { - var delay = tryCatch(selector)(x); - if (delay === errorObj) { return o.onError(delay.e); } - var d = new SingleAssignmentDisposable(); - delays.add(d); - d.setDisposable(delay.subscribe( - function () { - o.onNext(x); - delays.remove(d); - done(); - }, - function (e) { o.onError(e); }, - function () { - o.onNext(x); - delays.remove(d); - done(); - } - )); - }, - function (e) { o.onError(e); }, - function () { - atEnd = true; - subscription.dispose(); - done(); - } - )); - } - - function done () { - atEnd && delays.length === 0 && o.onCompleted(); - } - - if (!subDelay) { - start(); - } else { - subscription.setDisposable(subDelay.subscribe(start, function (e) { o.onError(e); }, start)); - } - - return new CompositeDisposable(subscription, delays); - }, this); - } - - /** - * Time shifts the observable sequence by dueTime. - * The relative time intervals between the values are preserved. - * - * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) by which to shift the observable sequence. - * @param {Scheduler} [scheduler] Scheduler to run the delay timers on. If not specified, the timeout scheduler is used. - * @returns {Observable} Time-shifted sequence. - */ - observableProto.delay = function () { - if (typeof arguments[0] === 'number' || arguments[0] instanceof Date) { - var dueTime = arguments[0], scheduler = arguments[1]; - isScheduler(scheduler) || (scheduler = timeoutScheduler); - return dueTime instanceof Date ? - observableDelayAbsolute(this, dueTime, scheduler) : - observableDelayRelative(this, dueTime, scheduler); - } else if (isFunction(arguments[0])) { - return delayWithSelector(this, arguments[0], arguments[1]); - } else { - throw new Error('Invalid arguments'); - } - }; - - function debounce(source, dueTime, scheduler) { - isScheduler(scheduler) || (scheduler = timeoutScheduler); - return new AnonymousObservable(function (observer) { - var cancelable = new SerialDisposable(), hasvalue = false, value, id = 0; - var subscription = source.subscribe( - function (x) { - hasvalue = true; - value = x; - id++; - var currentId = id, - d = new SingleAssignmentDisposable(); - cancelable.setDisposable(d); - d.setDisposable(scheduler.scheduleWithRelative(dueTime, function () { - hasvalue && id === currentId && observer.onNext(value); - hasvalue = false; - })); - }, - function (e) { - cancelable.dispose(); - observer.onError(e); - hasvalue = false; - id++; - }, - function () { - cancelable.dispose(); - hasvalue && observer.onNext(value); - observer.onCompleted(); - hasvalue = false; - id++; - }); - return new CompositeDisposable(subscription, cancelable); - }, this); - } - - function debounceWithSelector(source, durationSelector) { - return new AnonymousObservable(function (o) { - var value, hasValue = false, cancelable = new SerialDisposable(), id = 0; - var subscription = source.subscribe( - function (x) { - var throttle = tryCatch(durationSelector)(x); - if (throttle === errorObj) { return o.onError(throttle.e); } - - isPromise(throttle) && (throttle = observableFromPromise(throttle)); - - hasValue = true; - value = x; - id++; - var currentid = id, d = new SingleAssignmentDisposable(); - cancelable.setDisposable(d); - d.setDisposable(throttle.subscribe( - function () { - hasValue && id === currentid && o.onNext(value); - hasValue = false; - d.dispose(); - }, - function (e) { o.onError(e); }, - function () { - hasValue && id === currentid && o.onNext(value); - hasValue = false; - d.dispose(); - } - )); - }, - function (e) { - cancelable.dispose(); - o.onError(e); - hasValue = false; - id++; - }, - function () { - cancelable.dispose(); - hasValue && o.onNext(value); - o.onCompleted(); - hasValue = false; - id++; - } - ); - return new CompositeDisposable(subscription, cancelable); - }, source); - } - - observableProto.debounce = function () { - if (isFunction (arguments[0])) { - return debounceWithSelector(this, arguments[0]); - } else if (typeof arguments[0] === 'number') { - return debounce(this, arguments[0], arguments[1]); - } else { - throw new Error('Invalid arguments'); - } - }; - - /** - * Records the timestamp for each value in an observable sequence. - * - * @example - * 1 - res = source.timestamp(); // produces { value: x, timestamp: ts } - * 2 - res = source.timestamp(Rx.Scheduler.default); - * - * @param {Scheduler} [scheduler] Scheduler used to compute timestamps. If not specified, the default scheduler is used. - * @returns {Observable} An observable sequence with timestamp information on values. - */ - observableProto.timestamp = function (scheduler) { - isScheduler(scheduler) || (scheduler = timeoutScheduler); - return this.map(function (x) { - return { value: x, timestamp: scheduler.now() }; - }); - }; - - function sampleObservable(source, sampler) { - return new AnonymousObservable(function (o) { - var atEnd = false, value, hasValue = false; - - function sampleSubscribe() { - if (hasValue) { - hasValue = false; - o.onNext(value); - } - atEnd && o.onCompleted(); - } - - var sourceSubscription = new SingleAssignmentDisposable(); - sourceSubscription.setDisposable(source.subscribe( - function (newValue) { - hasValue = true; - value = newValue; - }, - function (e) { o.onError(e); }, - function () { - atEnd = true; - sourceSubscription.dispose(); - } - )); - - return new CompositeDisposable( - sourceSubscription, - sampler.subscribe(sampleSubscribe, function (e) { o.onError(e); }, sampleSubscribe) - ); - }, source); - } - - /** - * Samples the observable sequence at each interval. - * - * @example - * 1 - res = source.sample(sampleObservable); // Sampler tick sequence - * 2 - res = source.sample(5000); // 5 seconds - * 2 - res = source.sample(5000, Rx.Scheduler.timeout); // 5 seconds - * - * @param {Mixed} intervalOrSampler Interval at which to sample (specified as an integer denoting milliseconds) or Sampler Observable. - * @param {Scheduler} [scheduler] Scheduler to run the sampling timer on. If not specified, the timeout scheduler is used. - * @returns {Observable} Sampled observable sequence. - */ - observableProto.sample = observableProto.throttleLatest = function (intervalOrSampler, scheduler) { - isScheduler(scheduler) || (scheduler = timeoutScheduler); - return typeof intervalOrSampler === 'number' ? - sampleObservable(this, observableinterval(intervalOrSampler, scheduler)) : - sampleObservable(this, intervalOrSampler); - }; - - var TimeoutError = Rx.TimeoutError = function(message) { - this.message = message || 'Timeout has occurred'; - this.name = 'TimeoutError'; - Error.call(this); - }; - TimeoutError.prototype = Object.create(Error.prototype); - - function timeoutWithSelector(source, firstTimeout, timeoutDurationSelector, other) { - if (isFunction(firstTimeout)) { - other = timeoutDurationSelector; - timeoutDurationSelector = firstTimeout; - firstTimeout = observableNever(); - } - other || (other = observableThrow(new TimeoutError())); - return new AnonymousObservable(function (o) { - var subscription = new SerialDisposable(), timer = new SerialDisposable(), original = new SingleAssignmentDisposable(); - - subscription.setDisposable(original); - - var id = 0, switched = false; - - function setTimer(timeout) { - var myId = id, d = new SingleAssignmentDisposable(); - timer.setDisposable(d); - d.setDisposable(timeout.subscribe(function () { - id === myId && subscription.setDisposable(other.subscribe(o)); - d.dispose(); - }, function (e) { - id === myId && o.onError(e); - }, function () { - id === myId && subscription.setDisposable(other.subscribe(o)); - })); - }; - - setTimer(firstTimeout); - - function oWins() { - var res = !switched; - if (res) { id++; } - return res; - } - - original.setDisposable(source.subscribe(function (x) { - if (oWins()) { - o.onNext(x); - var timeout = tryCatch(timeoutDurationSelector)(x); - if (timeout === errorObj) { return o.onError(timeout.e); } - setTimer(isPromise(timeout) ? observableFromPromise(timeout) : timeout); - } - }, function (e) { - oWins() && o.onError(e); - }, function () { - oWins() && o.onCompleted(); - })); - return new CompositeDisposable(subscription, timer); - }, source); - } - - function timeout(source, dueTime, other, scheduler) { - if (other == null) { throw new Error('other or scheduler must be specified'); } - if (isScheduler(other)) { - scheduler = other; - other = observableThrow(new TimeoutError()); - } - if (other instanceof Error) { other = observableThrow(other); } - isScheduler(scheduler) || (scheduler = timeoutScheduler); - - var schedulerMethod = dueTime instanceof Date ? - 'scheduleWithAbsolute' : - 'scheduleWithRelative'; - - return new AnonymousObservable(function (o) { - var id = 0, - original = new SingleAssignmentDisposable(), - subscription = new SerialDisposable(), - switched = false, - timer = new SerialDisposable(); - - subscription.setDisposable(original); - - function createTimer() { - var myId = id; - timer.setDisposable(scheduler[schedulerMethod](dueTime, function () { - if (id === myId) { - isPromise(other) && (other = observableFromPromise(other)); - subscription.setDisposable(other.subscribe(o)); - } - })); - } - - createTimer(); - - original.setDisposable(source.subscribe(function (x) { - if (!switched) { - id++; - o.onNext(x); - createTimer(); - } - }, function (e) { - if (!switched) { - id++; - o.onError(e); - } - }, function () { - if (!switched) { - id++; - o.onCompleted(); - } - })); - return new CompositeDisposable(subscription, timer); - }, source); - } - - observableProto.timeout = function () { - var firstArg = arguments[0]; - if (firstArg instanceof Date || typeof firstArg === 'number') { - return timeout(this, firstArg, arguments[1], arguments[2]); - } else if (Observable.isObservable(firstArg) || isFunction(firstArg)) { - return timeoutWithSelector(this, firstArg, arguments[1], arguments[2]); - } else { - throw new Error('Invalid arguments'); - } - }; - - /** - * Returns an Observable that emits only the first item emitted by the source Observable during sequential time windows of a specified duration. - * @param {Number} windowDuration time to wait before emitting another item after emitting the last item - * @param {Scheduler} [scheduler] the Scheduler to use internally to manage the timers that handle timeout for each item. If not provided, defaults to Scheduler.timeout. - * @returns {Observable} An Observable that performs the throttle operation. - */ - observableProto.throttle = function (windowDuration, scheduler) { - isScheduler(scheduler) || (scheduler = timeoutScheduler); - var duration = +windowDuration || 0; - if (duration <= 0) { throw new RangeError('windowDuration cannot be less or equal zero.'); } - var source = this; - return new AnonymousObservable(function (o) { - var lastOnNext = 0; - return source.subscribe( - function (x) { - var now = scheduler.now(); - if (lastOnNext === 0 || now - lastOnNext >= duration) { - lastOnNext = now; - o.onNext(x); - } - },function (e) { o.onError(e); }, function () { o.onCompleted(); } - ); - }, source); - }; - - var PausableObservable = (function (__super__) { - - inherits(PausableObservable, __super__); - - function subscribe(observer) { - var conn = this.source.publish(), - subscription = conn.subscribe(observer), - connection = disposableEmpty; - - var pausable = this.pauser.distinctUntilChanged().subscribe(function (b) { - if (b) { - connection = conn.connect(); - } else { - connection.dispose(); - connection = disposableEmpty; - } - }); - - return new CompositeDisposable(subscription, connection, pausable); - } - - function PausableObservable(source, pauser) { - this.source = source; - this.controller = new Subject(); - - if (pauser && pauser.subscribe) { - this.pauser = this.controller.merge(pauser); - } else { - this.pauser = this.controller; - } - - __super__.call(this, subscribe, source); - } - - PausableObservable.prototype.pause = function () { - this.controller.onNext(false); - }; - - PausableObservable.prototype.resume = function () { - this.controller.onNext(true); - }; - - return PausableObservable; - - }(Observable)); - - /** - * Pauses the underlying observable sequence based upon the observable sequence which yields true/false. - * @example - * var pauser = new Rx.Subject(); - * var source = Rx.Observable.interval(100).pausable(pauser); - * @param {Observable} pauser The observable sequence used to pause the underlying sequence. - * @returns {Observable} The observable sequence which is paused based upon the pauser. - */ - observableProto.pausable = function (pauser) { - return new PausableObservable(this, pauser); - }; - - function combineLatestSource(source, subject, resultSelector) { - return new AnonymousObservable(function (o) { - var hasValue = [false, false], - hasValueAll = false, - isDone = false, - values = new Array(2), - err; - - function next(x, i) { - values[i] = x; - hasValue[i] = true; - if (hasValueAll || (hasValueAll = hasValue.every(identity))) { - if (err) { return o.onError(err); } - var res = tryCatch(resultSelector).apply(null, values); - if (res === errorObj) { return o.onError(res.e); } - o.onNext(res); - } - isDone && values[1] && o.onCompleted(); - } - - return new CompositeDisposable( - source.subscribe( - function (x) { - next(x, 0); - }, - function (e) { - if (values[1]) { - o.onError(e); - } else { - err = e; - } - }, - function () { - isDone = true; - values[1] && o.onCompleted(); - }), - subject.subscribe( - function (x) { - next(x, 1); - }, - function (e) { o.onError(e); }, - function () { - isDone = true; - next(true, 1); - }) - ); - }, source); - } - - var PausableBufferedObservable = (function (__super__) { - - inherits(PausableBufferedObservable, __super__); - - function subscribe(o) { - var q = [], previousShouldFire; - - function drainQueue() { while (q.length > 0) { o.onNext(q.shift()); } } - - var subscription = - combineLatestSource( - this.source, - this.pauser.startWith(false).distinctUntilChanged(), - function (data, shouldFire) { - return { data: data, shouldFire: shouldFire }; - }) - .subscribe( - function (results) { - if (previousShouldFire !== undefined && results.shouldFire != previousShouldFire) { - previousShouldFire = results.shouldFire; - // change in shouldFire - if (results.shouldFire) { drainQueue(); } - } else { - previousShouldFire = results.shouldFire; - // new data - if (results.shouldFire) { - o.onNext(results.data); - } else { - q.push(results.data); - } - } - }, - function (err) { - drainQueue(); - o.onError(err); - }, - function () { - drainQueue(); - o.onCompleted(); - } - ); - return subscription; - } - - function PausableBufferedObservable(source, pauser) { - this.source = source; - this.controller = new Subject(); - - if (pauser && pauser.subscribe) { - this.pauser = this.controller.merge(pauser); - } else { - this.pauser = this.controller; - } - - __super__.call(this, subscribe, source); - } - - PausableBufferedObservable.prototype.pause = function () { - this.controller.onNext(false); - }; - - PausableBufferedObservable.prototype.resume = function () { - this.controller.onNext(true); - }; - - return PausableBufferedObservable; - - }(Observable)); - - /** - * Pauses the underlying observable sequence based upon the observable sequence which yields true/false, - * and yields the values that were buffered while paused. - * @example - * var pauser = new Rx.Subject(); - * var source = Rx.Observable.interval(100).pausableBuffered(pauser); - * @param {Observable} pauser The observable sequence used to pause the underlying sequence. - * @returns {Observable} The observable sequence which is paused based upon the pauser. - */ - observableProto.pausableBuffered = function (subject) { - return new PausableBufferedObservable(this, subject); - }; - -var ControlledObservable = (function (__super__) { - - inherits(ControlledObservable, __super__); - - function subscribe (observer) { - return this.source.subscribe(observer); - } - - function ControlledObservable (source, enableQueue, scheduler) { - __super__.call(this, subscribe, source); - this.subject = new ControlledSubject(enableQueue, scheduler); - this.source = source.multicast(this.subject).refCount(); - } - - ControlledObservable.prototype.request = function (numberOfItems) { - return this.subject.request(numberOfItems == null ? -1 : numberOfItems); - }; - - return ControlledObservable; - -}(Observable)); - -var ControlledSubject = (function (__super__) { - - function subscribe (observer) { - return this.subject.subscribe(observer); - } - - inherits(ControlledSubject, __super__); - - function ControlledSubject(enableQueue, scheduler) { - enableQueue == null && (enableQueue = true); - - __super__.call(this, subscribe); - this.subject = new Subject(); - this.enableQueue = enableQueue; - this.queue = enableQueue ? [] : null; - this.requestedCount = 0; - this.requestedDisposable = null; - this.error = null; - this.hasFailed = false; - this.hasCompleted = false; - this.scheduler = scheduler || currentThreadScheduler; - } - - addProperties(ControlledSubject.prototype, Observer, { - onCompleted: function () { - this.hasCompleted = true; - if (!this.enableQueue || this.queue.length === 0) { - this.subject.onCompleted(); - this.disposeCurrentRequest() - } else { - this.queue.push(Notification.createOnCompleted()); - } - }, - onError: function (error) { - this.hasFailed = true; - this.error = error; - if (!this.enableQueue || this.queue.length === 0) { - this.subject.onError(error); - this.disposeCurrentRequest() - } else { - this.queue.push(Notification.createOnError(error)); - } - }, - onNext: function (value) { - if (this.requestedCount <= 0) { - this.enableQueue && this.queue.push(Notification.createOnNext(value)); - } else { - (this.requestedCount-- === 0) && this.disposeCurrentRequest(); - this.subject.onNext(value); - } - }, - _processRequest: function (numberOfItems) { - if (this.enableQueue) { - while (this.queue.length > 0 && (numberOfItems > 0 || this.queue[0].kind !== 'N')) { - var first = this.queue.shift(); - first.accept(this.subject); - if (first.kind === 'N') { - numberOfItems--; - } else { - this.disposeCurrentRequest(); - this.queue = []; - } - } - } - - return numberOfItems; - }, - request: function (number) { - this.disposeCurrentRequest(); - var self = this; - - this.requestedDisposable = this.scheduler.scheduleWithState(number, - function(s, i) { - var remaining = self._processRequest(i); - var stopped = self.hasCompleted || self.hasFailed - if (!stopped && remaining > 0) { - self.requestedCount = remaining; - - return disposableCreate(function () { - self.requestedCount = 0; - }); - // Scheduled item is still in progress. Return a new - // disposable to allow the request to be interrupted - // via dispose. - } - }); - - return this.requestedDisposable; - }, - disposeCurrentRequest: function () { - if (this.requestedDisposable) { - this.requestedDisposable.dispose(); - this.requestedDisposable = null; - } - } - }); - - return ControlledSubject; -}(Observable)); - -/** - * Attaches a controller to the observable sequence with the ability to queue. - * @example - * var source = Rx.Observable.interval(100).controlled(); - * source.request(3); // Reads 3 values - * @param {bool} enableQueue truthy value to determine if values should be queued pending the next request - * @param {Scheduler} scheduler determines how the requests will be scheduled - * @returns {Observable} The observable sequence which only propagates values on request. - */ -observableProto.controlled = function (enableQueue, scheduler) { - - if (enableQueue && isScheduler(enableQueue)) { - scheduler = enableQueue; - enableQueue = true; - } - - if (enableQueue == null) { enableQueue = true; } - return new ControlledObservable(this, enableQueue, scheduler); -}; - - /** - * Pipes the existing Observable sequence into a Node.js Stream. - * @param {Stream} dest The destination Node.js stream. - * @returns {Stream} The destination stream. - */ - observableProto.pipe = function (dest) { - var source = this.pausableBuffered(); - - function onDrain() { - source.resume(); - } - - dest.addListener('drain', onDrain); - - source.subscribe( - function (x) { - !dest.write(String(x)) && source.pause(); - }, - function (err) { - dest.emit('error', err); - }, - function () { - // Hack check because STDIO is not closable - !dest._isStdio && dest.end(); - dest.removeListener('drain', onDrain); - }); - - source.resume(); - - return dest; - }; - - /** - * Executes a transducer to transform the observable sequence - * @param {Transducer} transducer A transducer to execute - * @returns {Observable} An Observable sequence containing the results from the transducer. - */ - observableProto.transduce = function(transducer) { - var source = this; - - function transformForObserver(o) { - return { - '@@transducer/init': function() { - return o; - }, - '@@transducer/step': function(obs, input) { - return obs.onNext(input); - }, - '@@transducer/result': function(obs) { - return obs.onCompleted(); - } - }; - } - - return new AnonymousObservable(function(o) { - var xform = transducer(transformForObserver(o)); - return source.subscribe( - function(v) { - var res = tryCatch(xform['@@transducer/step']).call(xform, o, v); - if (res === errorObj) { o.onError(res.e); } - }, - function (e) { o.onError(e); }, - function() { xform['@@transducer/result'](o); } - ); - }, source); - }; - - var AnonymousObservable = Rx.AnonymousObservable = (function (__super__) { - inherits(AnonymousObservable, __super__); - - // Fix subscriber to check for undefined or function returned to decorate as Disposable - function fixSubscriber(subscriber) { - return subscriber && isFunction(subscriber.dispose) ? subscriber : - isFunction(subscriber) ? disposableCreate(subscriber) : disposableEmpty; - } - - function setDisposable(s, state) { - var ado = state[0], self = state[1]; - var sub = tryCatch(self.__subscribe).call(self, ado); - - if (sub === errorObj) { - if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); } - } - ado.setDisposable(fixSubscriber(sub)); - } - - function innerSubscribe(observer) { - var ado = new AutoDetachObserver(observer), state = [ado, this]; - - if (currentThreadScheduler.scheduleRequired()) { - currentThreadScheduler.scheduleWithState(state, setDisposable); - } else { - setDisposable(null, state); - } - return ado; - } - - function AnonymousObservable(subscribe, parent) { - this.source = parent; - this.__subscribe = subscribe; - __super__.call(this, innerSubscribe); - } - - return AnonymousObservable; - - }(Observable)); - - var AutoDetachObserver = (function (__super__) { - inherits(AutoDetachObserver, __super__); - - function AutoDetachObserver(observer) { - __super__.call(this); - this.observer = observer; - this.m = new SingleAssignmentDisposable(); - } - - var AutoDetachObserverPrototype = AutoDetachObserver.prototype; - - AutoDetachObserverPrototype.next = function (value) { - var result = tryCatch(this.observer.onNext).call(this.observer, value); - if (result === errorObj) { - this.dispose(); - thrower(result.e); - } - }; - - AutoDetachObserverPrototype.error = function (err) { - var result = tryCatch(this.observer.onError).call(this.observer, err); - this.dispose(); - result === errorObj && thrower(result.e); - }; - - AutoDetachObserverPrototype.completed = function () { - var result = tryCatch(this.observer.onCompleted).call(this.observer); - this.dispose(); - result === errorObj && thrower(result.e); - }; - - AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); }; - AutoDetachObserverPrototype.getDisposable = function () { return this.m.getDisposable(); }; - - AutoDetachObserverPrototype.dispose = function () { - __super__.prototype.dispose.call(this); - this.m.dispose(); - }; - - return AutoDetachObserver; - }(AbstractObserver)); - - var InnerSubscription = function (subject, observer) { - this.subject = subject; - this.observer = observer; - }; - - InnerSubscription.prototype.dispose = function () { - if (!this.subject.isDisposed && this.observer !== null) { - var idx = this.subject.observers.indexOf(this.observer); - this.subject.observers.splice(idx, 1); - this.observer = null; - } - }; - - /** - * Represents an object that is both an observable sequence as well as an observer. - * Each notification is broadcasted to all subscribed observers. - */ - var Subject = Rx.Subject = (function (__super__) { - function subscribe(observer) { - checkDisposed(this); - if (!this.isStopped) { - this.observers.push(observer); - return new InnerSubscription(this, observer); - } - if (this.hasError) { - observer.onError(this.error); - return disposableEmpty; - } - observer.onCompleted(); - return disposableEmpty; - } - - inherits(Subject, __super__); - - /** - * Creates a subject. - */ - function Subject() { - __super__.call(this, subscribe); - this.isDisposed = false, - this.isStopped = false, - this.observers = []; - this.hasError = false; - } - - addProperties(Subject.prototype, Observer.prototype, { - /** - * Indicates whether the subject has observers subscribed to it. - * @returns {Boolean} Indicates whether the subject has observers subscribed to it. - */ - hasObservers: function () { return this.observers.length > 0; }, - /** - * Notifies all subscribed observers about the end of the sequence. - */ - onCompleted: function () { - checkDisposed(this); - if (!this.isStopped) { - this.isStopped = true; - for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { - os[i].onCompleted(); - } - - this.observers.length = 0; - } - }, - /** - * Notifies all subscribed observers about the exception. - * @param {Mixed} error The exception to send to all observers. - */ - onError: function (error) { - checkDisposed(this); - if (!this.isStopped) { - this.isStopped = true; - this.error = error; - this.hasError = true; - for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { - os[i].onError(error); - } - - this.observers.length = 0; - } - }, - /** - * Notifies all subscribed observers about the arrival of the specified element in the sequence. - * @param {Mixed} value The value to send to all observers. - */ - onNext: function (value) { - checkDisposed(this); - if (!this.isStopped) { - for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { - os[i].onNext(value); - } - } - }, - /** - * Unsubscribe all observers and release resources. - */ - dispose: function () { - this.isDisposed = true; - this.observers = null; - } - }); - - /** - * Creates a subject from the specified observer and observable. - * @param {Observer} observer The observer used to send messages to the subject. - * @param {Observable} observable The observable used to subscribe to messages sent from the subject. - * @returns {Subject} Subject implemented using the given observer and observable. - */ - Subject.create = function (observer, observable) { - return new AnonymousSubject(observer, observable); - }; - - return Subject; - }(Observable)); - - /** - * Represents the result of an asynchronous operation. - * The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers. - */ - var AsyncSubject = Rx.AsyncSubject = (function (__super__) { - - function subscribe(observer) { - checkDisposed(this); - - if (!this.isStopped) { - this.observers.push(observer); - return new InnerSubscription(this, observer); - } - - if (this.hasError) { - observer.onError(this.error); - } else if (this.hasValue) { - observer.onNext(this.value); - observer.onCompleted(); - } else { - observer.onCompleted(); - } - - return disposableEmpty; - } - - inherits(AsyncSubject, __super__); - - /** - * Creates a subject that can only receive one value and that value is cached for all future observations. - * @constructor - */ - function AsyncSubject() { - __super__.call(this, subscribe); - - this.isDisposed = false; - this.isStopped = false; - this.hasValue = false; - this.observers = []; - this.hasError = false; - } - - addProperties(AsyncSubject.prototype, Observer, { - /** - * Indicates whether the subject has observers subscribed to it. - * @returns {Boolean} Indicates whether the subject has observers subscribed to it. - */ - hasObservers: function () { - checkDisposed(this); - return this.observers.length > 0; - }, - /** - * Notifies all subscribed observers about the end of the sequence, also causing the last received value to be sent out (if any). - */ - onCompleted: function () { - var i, len; - checkDisposed(this); - if (!this.isStopped) { - this.isStopped = true; - var os = cloneArray(this.observers), len = os.length; - - if (this.hasValue) { - for (i = 0; i < len; i++) { - var o = os[i]; - o.onNext(this.value); - o.onCompleted(); - } - } else { - for (i = 0; i < len; i++) { - os[i].onCompleted(); - } - } - - this.observers.length = 0; - } - }, - /** - * Notifies all subscribed observers about the error. - * @param {Mixed} error The Error to send to all observers. - */ - onError: function (error) { - checkDisposed(this); - if (!this.isStopped) { - this.isStopped = true; - this.hasError = true; - this.error = error; - - for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { - os[i].onError(error); - } - - this.observers.length = 0; - } - }, - /** - * Sends a value to the subject. The last value received before successful termination will be sent to all subscribed and future observers. - * @param {Mixed} value The value to store in the subject. - */ - onNext: function (value) { - checkDisposed(this); - if (this.isStopped) { return; } - this.value = value; - this.hasValue = true; - }, - /** - * Unsubscribe all observers and release resources. - */ - dispose: function () { - this.isDisposed = true; - this.observers = null; - this.exception = null; - this.value = null; - } - }); - - return AsyncSubject; - }(Observable)); - - var AnonymousSubject = Rx.AnonymousSubject = (function (__super__) { - inherits(AnonymousSubject, __super__); - - function subscribe(observer) { - return this.observable.subscribe(observer); - } - - function AnonymousSubject(observer, observable) { - this.observer = observer; - this.observable = observable; - __super__.call(this, subscribe); - } - - addProperties(AnonymousSubject.prototype, Observer.prototype, { - onCompleted: function () { - this.observer.onCompleted(); - }, - onError: function (error) { - this.observer.onError(error); - }, - onNext: function (value) { - this.observer.onNext(value); - } - }); - - return AnonymousSubject; - }(Observable)); - - /** - * Represents a value that changes over time. - * Observers can subscribe to the subject to receive the last (or initial) value and all subsequent notifications. - */ - var BehaviorSubject = Rx.BehaviorSubject = (function (__super__) { - function subscribe(observer) { - checkDisposed(this); - if (!this.isStopped) { - this.observers.push(observer); - observer.onNext(this.value); - return new InnerSubscription(this, observer); - } - if (this.hasError) { - observer.onError(this.error); - } else { - observer.onCompleted(); - } - return disposableEmpty; - } - - inherits(BehaviorSubject, __super__); - - /** - * Initializes a new instance of the BehaviorSubject class which creates a subject that caches its last value and starts with the specified value. - * @param {Mixed} value Initial value sent to observers when no other value has been received by the subject yet. - */ - function BehaviorSubject(value) { - __super__.call(this, subscribe); - this.value = value, - this.observers = [], - this.isDisposed = false, - this.isStopped = false, - this.hasError = false; - } - - addProperties(BehaviorSubject.prototype, Observer, { - /** - * Gets the current value or throws an exception. - * Value is frozen after onCompleted is called. - * After onError is called always throws the specified exception. - * An exception is always thrown after dispose is called. - * @returns {Mixed} The initial value passed to the constructor until onNext is called; after which, the last value passed to onNext. - */ - getValue: function () { - checkDisposed(this); - if (this.hasError) { - throw this.error; - } - return this.value; - }, - /** - * Indicates whether the subject has observers subscribed to it. - * @returns {Boolean} Indicates whether the subject has observers subscribed to it. - */ - hasObservers: function () { return this.observers.length > 0; }, - /** - * Notifies all subscribed observers about the end of the sequence. - */ - onCompleted: function () { - checkDisposed(this); - if (this.isStopped) { return; } - this.isStopped = true; - for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { - os[i].onCompleted(); - } - - this.observers.length = 0; - }, - /** - * Notifies all subscribed observers about the exception. - * @param {Mixed} error The exception to send to all observers. - */ - onError: function (error) { - checkDisposed(this); - if (this.isStopped) { return; } - this.isStopped = true; - this.hasError = true; - this.error = error; - - for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { - os[i].onError(error); - } - - this.observers.length = 0; - }, - /** - * Notifies all subscribed observers about the arrival of the specified element in the sequence. - * @param {Mixed} value The value to send to all observers. - */ - onNext: function (value) { - checkDisposed(this); - if (this.isStopped) { return; } - this.value = value; - for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { - os[i].onNext(value); - } - }, - /** - * Unsubscribe all observers and release resources. - */ - dispose: function () { - this.isDisposed = true; - this.observers = null; - this.value = null; - this.exception = null; - } - }); - - return BehaviorSubject; - }(Observable)); - - /** - * Represents an object that is both an observable sequence as well as an observer. - * Each notification is broadcasted to all subscribed and future observers, subject to buffer trimming policies. - */ - var ReplaySubject = Rx.ReplaySubject = (function (__super__) { - - var maxSafeInteger = Math.pow(2, 53) - 1; - - function createRemovableDisposable(subject, observer) { - return disposableCreate(function () { - observer.dispose(); - !subject.isDisposed && subject.observers.splice(subject.observers.indexOf(observer), 1); - }); - } - - function subscribe(observer) { - var so = new ScheduledObserver(this.scheduler, observer), - subscription = createRemovableDisposable(this, so); - checkDisposed(this); - this._trim(this.scheduler.now()); - this.observers.push(so); - - for (var i = 0, len = this.q.length; i < len; i++) { - so.onNext(this.q[i].value); - } - - if (this.hasError) { - so.onError(this.error); - } else if (this.isStopped) { - so.onCompleted(); - } - - so.ensureActive(); - return subscription; - } - - inherits(ReplaySubject, __super__); - - /** - * Initializes a new instance of the ReplaySubject class with the specified buffer size, window size and scheduler. - * @param {Number} [bufferSize] Maximum element count of the replay buffer. - * @param {Number} [windowSize] Maximum time length of the replay buffer. - * @param {Scheduler} [scheduler] Scheduler the observers are invoked on. - */ - function ReplaySubject(bufferSize, windowSize, scheduler) { - this.bufferSize = bufferSize == null ? maxSafeInteger : bufferSize; - this.windowSize = windowSize == null ? maxSafeInteger : windowSize; - this.scheduler = scheduler || currentThreadScheduler; - this.q = []; - this.observers = []; - this.isStopped = false; - this.isDisposed = false; - this.hasError = false; - this.error = null; - __super__.call(this, subscribe); - } - - addProperties(ReplaySubject.prototype, Observer.prototype, { - /** - * Indicates whether the subject has observers subscribed to it. - * @returns {Boolean} Indicates whether the subject has observers subscribed to it. - */ - hasObservers: function () { - return this.observers.length > 0; - }, - _trim: function (now) { - while (this.q.length > this.bufferSize) { - this.q.shift(); - } - while (this.q.length > 0 && (now - this.q[0].interval) > this.windowSize) { - this.q.shift(); - } - }, - /** - * Notifies all subscribed observers about the arrival of the specified element in the sequence. - * @param {Mixed} value The value to send to all observers. - */ - onNext: function (value) { - checkDisposed(this); - if (this.isStopped) { return; } - var now = this.scheduler.now(); - this.q.push({ interval: now, value: value }); - this._trim(now); - - for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { - var observer = os[i]; - observer.onNext(value); - observer.ensureActive(); - } - }, - /** - * Notifies all subscribed observers about the exception. - * @param {Mixed} error The exception to send to all observers. - */ - onError: function (error) { - checkDisposed(this); - if (this.isStopped) { return; } - this.isStopped = true; - this.error = error; - this.hasError = true; - var now = this.scheduler.now(); - this._trim(now); - for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { - var observer = os[i]; - observer.onError(error); - observer.ensureActive(); - } - this.observers.length = 0; - }, - /** - * Notifies all subscribed observers about the end of the sequence. - */ - onCompleted: function () { - checkDisposed(this); - if (this.isStopped) { return; } - this.isStopped = true; - var now = this.scheduler.now(); - this._trim(now); - for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) { - var observer = os[i]; - observer.onCompleted(); - observer.ensureActive(); - } - this.observers.length = 0; - }, - /** - * Unsubscribe all observers and release resources. - */ - dispose: function () { - this.isDisposed = true; - this.observers = null; - } - }); - - return ReplaySubject; - }(Observable)); - - /** - * Used to pause and resume streams. - */ - Rx.Pauser = (function (__super__) { - inherits(Pauser, __super__); - - function Pauser() { - __super__.call(this); - } - - /** - * Pauses the underlying sequence. - */ - Pauser.prototype.pause = function () { this.onNext(false); }; - - /** - * Resumes the underlying sequence. - */ - Pauser.prototype.resume = function () { this.onNext(true); }; - - return Pauser; - }(Subject)); - - if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { - root.Rx = Rx; - - define(function() { - return Rx; - }); - } else if (freeExports && freeModule) { - // in Node.js or RingoJS - if (moduleExports) { - (freeModule.exports = Rx).Rx = Rx; - } else { - freeExports.Rx = Rx; - } - } else { - // in a browser or Rhino - root.Rx = Rx; - } - - // All code before this point will be filtered from stack traces. - var rEndingLine = captureLine(); - -}.call(this)); diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/rx-lite/rx.lite.map b/node_modules/eslint/node_modules/inquirer/node_modules/rx-lite/rx.lite.map deleted file mode 100644 index f3dc95d..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/rx-lite/rx.lite.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rx.lite.min.js","sources":["rx.lite.js"],"names":["undefined","cloneArray","arr","len","length","a","Array","i","tryCatcherGen","tryCatchTarget","apply","this","arguments","e","errorObj","thrower","makeStackTraceLong","error","observable","hasStacks","stack","indexOf","STACK_JUMP_SEPARATOR","stacks","o","source","unshift","concatedStacks","join","filterStackString","stackString","lines","split","desiredLines","line","isInternalFrame","isNodeFrame","push","stackLine","fileNameAndLineNumber","getFileNameAndLineNumber","fileName","lineNumber","rFileName","rStartingLine","rEndingLine","captureLine","Error","firstLine","attempt1","exec","Number","attempt2","attempt3","keysIn","object","result","isObject","support","nonEnumArgs","isArguments","slice","call","skipProto","enumPrototypes","skipErrorProps","enumErrorProps","errorProto","key","nonEnumShadows","objectProto","ctor","constructor","index","dontEnumsLength","prototype","className","stringProto","stringClass","errorClass","toString","nonEnum","nonEnumProps","dontEnums","hasOwnProperty","internalFor","callback","keysFunc","props","internalForIn","isNode","value","deepEquals","b","stackA","stackB","type","otherType","otherClass","argsClass","objectClass","boolClass","dateClass","numberClass","regexpClass","String","isArr","arrayClass","nodeClass","ctorA","argsObject","Object","ctorB","isFunction","size","pop","arrayInitialize","count","factory","StringIterable","s","_s","StringIterator","_l","_i","ArrayIterable","_a","ArrayIterator","toLength","numberIsFinite","root","isFinite","getIterable","it","$iterator$","TypeError","sign","number","isNaN","Math","floor","abs","maxSafeInteger","FromArraySink","observer","parent","observableOf","scheduler","array","isScheduler","currentThreadScheduler","FromArrayObservable","PairsSink","RepeatSink","observableCatchHandler","handler","AnonymousObservable","d1","SingleAssignmentDisposable","subscription","SerialDisposable","setDisposable","subscribe","CatchObserver","falseFactory","argumentsToArray","args","emptyArrayFactory","asObservable","InnerObserver","accumulator","hasSeed","seed","hasAccumulation","accumulation","hasValue","isStopped","plucker","x","currentProp","p","createCbObservable","fn","ctx","selector","AsyncSubject","createCbHandler","results","tryCatch","onError","onNext","onCompleted","createNodeObservable","createNodeHandler","err","ListenDisposable","n","_e","_n","_fn","addEventListener","isDisposed","createEventListener","el","eventName","disposables","CompositeDisposable","elemToString","add","item","eventHandler","observableTimerDate","dueTime","scheduleWithAbsolute","observableTimerDateAndPeriod","period","d","normalizeTime","scheduleRecursiveWithAbsoluteAndState","self","now","observableTimerTimeSpan","scheduleWithRelative","observableTimerTimeSpanAndPeriod","schedulePeriodicWithState","observableDefer","observableDelayRelative","active","cancelable","exception","q","running","materialize","timestamp","notification","shouldRun","kind","scheduleRecursiveWithRelative","recurseDueTime","shouldRecurse","shift","accept","max","observableDelayAbsolute","delayWithSelector","subscriptionDelay","delayDurationSelector","subDelay","start","delay","delays","remove","done","atEnd","dispose","debounce","timeoutScheduler","hasvalue","id","currentId","debounceWithSelector","durationSelector","throttle","isPromise","observableFromPromise","currentid","sampleObservable","sampler","sampleSubscribe","sourceSubscription","newValue","timeoutWithSelector","firstTimeout","timeoutDurationSelector","other","observableNever","observableThrow","TimeoutError","setTimer","timeout","myId","timer","oWins","res","switched","original","schedulerMethod","Date","createTimer","combineLatestSource","subject","resultSelector","next","values","hasValueAll","every","identity","isDone","objectTypes","function","freeExports","exports","nodeType","freeSelf","freeWindow","window","freeModule","module","moduleExports","freeGlobal","global","Rx","internals","config","Promise","helpers","noop","defaultNow","defaultComparer","y","isEqual","defaultSubComparer","defaultError","defaultKeySerializer","then","isFn","longStackSupport","EmptyError","message","name","create","ObjectDisposedError","ArgumentOutOfRangeError","NotSupportedError","NotImplementedError","notImplemented","notSupported","Symbol","iterator","Set","doneEnumerator","isIterable","isArrayLike","supportNodeClass","bindCallback","func","thisArg","argCount","arg","collection","funcClass","supportsArgsClass","propertyIsEnumerable","document","toLocaleString","valueOf","test","inherits","child","__","addProperties","obj","sources","idx","ln","prop","addRef","xs","r","getDisposable","isArray","isDisposable","CompositeDisposablePrototype","shouldDispose","splice","currentDisposables","Disposable","action","disposableCreate","disposableEmpty","empty","checkDisposed","disposable","current","old","ScheduledItem","RefCountDisposable","InnerDisposable","isInnerDisposed","underlyingDisposable","isPrimaryDisposed","state","comparer","invoke","invokeCore","compareTo","isCancelled","Scheduler","schedule","scheduleRelative","scheduleAbsolute","_schedule","_scheduleRelative","_scheduleAbsolute","invokeAction","schedulerProto","scheduleWithState","scheduleWithRelativeAndState","scheduleWithAbsoluteAndState","normalize","timeSpan","invokeRecImmediate","pair","innerAction","state2","scheduleWork","_","state3","isAdded","group","invokeRecDate","method","dueTime1","invokeRecDateRelative","invokeRecDateAbsolute","scheduleInnerRecursive","dt","scheduleRecursive","scheduleRecursiveWithState","scheduleRecursiveWithRelativeAndState","scheduleRecursiveWithAbsolute","schedulePeriodic","setInterval","clearInterval","scheduleMethod","clearMethod","immediateScheduler","immediate","scheduleNow","currentThread","runTrampoline","queue","si","currentScheduler","scheduleRequired","localTimer","SchedulePeriodicRecursive","tick","command","recurse","_period","_state","_action","_cancel","_scheduler","bind","localSetTimeout","localClearTimeout","setTimeout","clearTimeout","WScript","time","Sleep","runTask","handle","currentlyRunning","task","tasksByHandle","postMessageSupported","postMessage","importScripts","isAsync","oldHandler","onmessage","onGlobalPostMessage","event","data","substring","MSG_PREFIX","nextHandle","reNative","RegExp","replace","setImmediate","process","nextTick","random","attachEvent","MessageChannel","channel","port1","port2","createElement","scriptElement","onreadystatechange","parentNode","removeChild","documentElement","appendChild","observableProto","Notification","acceptObservable","_accept","_acceptObservable","observerOrOnNext","toObservable","notificationCreateOnNext","createOnNext","notificationCreateOnError","createOnError","notificationCreateOnCompleted","createOnCompleted","Observer","observerCreate","AnonymousObserver","AbstractObserver","__super__","completed","fail","_onNext","_onError","_onCompleted","Observable","makeSubscribe","oldOnError","_subscribe","isObservable","forEach","oOrOnNext","subscribeOnNext","subscribeOnError","subscribeOnCompleted","ScheduledObserver","isAcquired","hasFaulted","ensureActive","isOwner","work","ObservableBase","fixSubscriber","subscriber","ado","sub","subscribeCore","AutoDetachObserver","FlatMapObservable","_wrapResult","map","i2","fromPromise","from","Enumerable","ConcatEnumerableObservable","currentItem","currentValue","concat","CatchErrorObservable","lastException","catchError","catchErrorWhen","notificationHandler","exceptions","Subject","notifier","handled","notificationDisposable","outer","inner","exn","ex","RepeatEnumerable","v","c","RepeatEnumerator","l","enumerableRepeat","repeat","repeatCount","OfEnumerable","OfEnumerator","enumerableOf","of","ToArrayObservable","toArray","defer","observableFactory","EmptyObservable","EmptySink","scheduleItem","sink","run","EMPTY_OBSERVABLE","observableEmpty","FromObservable","iterable","mapper","FromSink","loopRecursive","list","pow","charAt","observableFrom","mapFn","observableFromArray","fromArray","NeverObservable","NEVER_OBSERVABLE","never","ofWithScheduler","PairsObservable","keys","pairs","RangeObservable","rangeCount","RangeSink","range","RepeatObservable","JustObservable","JustSink","ThrowObservable","just","ThrowSink","_o","handlerOrSecond","observableCatch","items","combineLatest","filter","j","subscriptions","sad","observableConcat","ConcatObservable","ConcatSink","concatAll","merge","MergeObservable","maxConcurrent","g","MergeObserver","activeCount","handleSubscribe","innerSource","maxConcurrentOrOther","observableMerge","mergeAll","CompositeError","errors","innerErrors","mergeDelayError","setCompletion","m","innerSubscription","MergeAllObservable","MergeAllObserver","skipUntil","isOpen","left","rightSubscription","SwitchObservable","SwitchObserver","stopped","latest","hasLatest","switchLatest","TakeUntilObservable","takeUntil","withLatestFrom","allValues","zip","queues","queuedValues","first","zipIterable","dematerialize","DistinctUntilChangedObservable","keyFn","DistinctUntilChangedObserver","hasCurrentKey","currentKey","comparerEquals","distinctUntilChanged","TapObservable","_oN","_oE","_oC","t","tap","doAction","doOnNext","tapOnNext","doOnError","tapOnError","doOnCompleted","tapOnCompleted","IgnoreElementsObservable","ignoreElements","retry","retryCount","retryWhen","ScanObservable","scan","skipLast","startWith","takeLast","flatMapConcat","concatMap","MapObservable","innerMap","internalMap","select","selectorFn","pluck","flatMap","selectMany","flatMapLatest","SkipObservable","skipCount","skip","skipWhile","predicate","take","remaining","takeWhile","FilterObservable","innerPredicate","internalFilter","shouldYield","where","fromCallback","fromNodeCallback","removeEventListener","useNativeEvents","fromEvent","element","addListener","fromEventPattern","h","removeListener","on","off","publish","refCount","addHandler","removeHandler","innerHandler","returnValue","FromPromiseObservable","promise","toPromise","promiseCtor","resolve","reject","startAsync","functionAsync","multicast","subjectOrSubjectSelector","connectable","connect","ConnectableObservable","share","publishLast","publishValue","initialValueOrSelector","initialValue","BehaviorSubject","shareValue","replay","bufferSize","windowSize","ReplaySubject","shareReplay","hasSubscription","sourceObservable","connectableSubscription","shouldConnect","observableinterval","interval","periodOrScheduler","getTime","sample","throttleLatest","intervalOrSampler","firstArg","windowDuration","duration","RangeError","lastOnNext","PausableObservable","conn","connection","pausable","pauser","controller","pause","resume","PausableBufferedObservable","drainQueue","previousShouldFire","shouldFire","pausableBuffered","ControlledObservable","enableQueue","ControlledSubject","request","numberOfItems","requestedCount","requestedDisposable","hasFailed","hasCompleted","disposeCurrentRequest","_processRequest","controlled","pipe","dest","onDrain","write","emit","_isStdio","end","transduce","transducer","transformForObserver","@@transducer/init","@@transducer/step","obs","input","@@transducer/result","xform","__subscribe","innerSubscribe","AutoDetachObserverPrototype","InnerSubscription","observers","hasError","hasObservers","os","AnonymousSubject","getValue","createRemovableDisposable","so","_trim","Pauser","define","amd"],"mappings":";CAEE,SAAUA,GAkDR,QAASC,GAAWC,GAElB,IAAI,GADAC,GAAMD,EAAIE,OAAQC,EAAI,GAAIC,OAAMH,GAC5BI,EAAI,EAAOJ,EAAJI,EAASA,IAAOF,EAAEE,GAAKL,EAAIK,EAC1C,OAAOF,GAIX,QAASG,GAAcC,GACrB,MAAO,YACL,IACE,MAAOA,GAAeC,MAAMC,KAAMC,WAClC,MAAOC,GAEP,MADAC,IAASD,EAAIA,EACNC,KAQb,QAASC,GAAQF,GACf,KAAMA,GAYR,QAASG,GAAmBC,EAAOC,GAGjC,GAAIC,IACAD,EAAWE,OACM,gBAAVH,IACG,OAAVA,GACAA,EAAMG,OACwC,KAA9CH,EAAMG,MAAMC,QAAQC,IACtB,CAEA,IAAK,GADDC,MACKC,EAAIN,EAAcM,EAAGA,EAAIA,EAAEC,OAC9BD,EAAEJ,OACJG,EAAOG,QAAQF,EAAEJ,MAGrBG,GAAOG,QAAQT,EAAMG,MAErB,IAAIO,GAAiBJ,EAAOK,KAAK,KAAON,GAAuB,KAC/DL,GAAMG,MAAQS,EAAkBF,IAIpC,QAASE,GAAkBC,GAEzB,IAAK,GADDC,GAAQD,EAAYE,MAAM,MAAOC,KAC5B1B,EAAI,EAAGJ,EAAM4B,EAAM3B,OAAYD,EAAJI,EAASA,IAAK,CAChD,GAAI2B,GAAOH,EAAMxB,EAEZ4B,GAAgBD,IAAUE,EAAYF,KAASA,GAClDD,EAAaI,KAAKH,GAGtB,MAAOD,GAAaL,KAAK,MAG3B,QAASO,GAAgBG,GACvB,GAAIC,GAAwBC,EAAyBF,EACrD,KAAKC,EACH,OAAO,CAET,IAAIE,GAAWF,EAAsB,GAAIG,EAAaH,EAAsB,EAE5E,OAAOE,KAAaE,IAClBD,GAAcE,IACAC,IAAdH,EAGJ,QAASN,GAAYE,GACnB,MAA4C,KAArCA,EAAUjB,QAAQ,gBACY,KAAnCiB,EAAUjB,QAAQ,aAGtB,QAASyB,KACP,GAAK3B,GAEL,IACE,KAAM,IAAI4B,OACV,MAAOlC,GACP,GAAIkB,GAAQlB,EAAEO,MAAMY,MAAM,MACtBgB,EAAYjB,EAAM,GAAGV,QAAQ,KAAO,EAAIU,EAAM,GAAKA,EAAM,GACzDQ,EAAwBC,EAAyBQ,EACrD,KAAKT,EAAyB,MAG9B,OADAI,IAAYJ,EAAsB,GAC3BA,EAAsB,IAIjC,QAASC,GAAyBF,GAEhC,GAAIW,GAAW,gCAAgCC,KAAKZ,EACpD,IAAIW,EAAY,OAAQA,EAAS,GAAIE,OAAOF,EAAS,IAGrD,IAAIG,GAAW,4BAA4BF,KAAKZ,EAChD,IAAIc,EAAY,OAAQA,EAAS,GAAID,OAAOC,EAAS,IAGrD,IAAIC,GAAW,iBAAiBH,KAAKZ,EACrC,OAAIe,IAAoBA,EAAS,GAAIF,OAAOE,EAAS,KAArD,OAkKF,QAASC,GAAOC,GACd,GAAIC,KACJ,KAAKC,GAASF,GACZ,MAAOC,EAELE,IAAQC,aAAeJ,EAAOnD,QAAUwD,GAAYL,KACtDA,EAASM,GAAMC,KAAKP,GAEtB,IAAIQ,GAAYL,GAAQM,gBAAmC,kBAAVT,GAC7CU,EAAiBP,GAAQQ,iBAAmBX,IAAWY,IAAcZ,YAAkBR,OAE3F,KAAK,GAAIqB,KAAOb,GACRQ,GAAoB,aAAPK,GACbH,IAA0B,WAAPG,GAA2B,QAAPA,IAC3CZ,EAAOnB,KAAK+B,EAIhB,IAAIV,GAAQW,gBAAkBd,IAAWe,GAAa,CACpD,GAAIC,GAAOhB,EAAOiB,YACdC,EAAQ,GACRrE,EAASsE,EAEb,IAAInB,KAAYgB,GAAQA,EAAKI,WAC3B,GAAIC,GAAYrB,IAAWsB,GAAcC,GAAcvB,IAAWY,GAAaY,GAAaC,GAASlB,KAAKP,GACtG0B,EAAUC,GAAaN,EAE7B,QAASH,EAAQrE,GACfgE,EAAMe,GAAUV,GACVQ,GAAWA,EAAQb,KAASgB,GAAetB,KAAKP,EAAQa,IAC5DZ,EAAOnB,KAAK+B,GAIlB,MAAOZ,GAGT,QAAS6B,GAAY9B,EAAQ+B,EAAUC,GAKrC,IAJA,GAAId,GAAQ,GACVe,EAAQD,EAAShC,GACjBnD,EAASoF,EAAMpF,SAERqE,EAAQrE,GAAQ,CACvB,GAAIgE,GAAMoB,EAAMf,EAChB,IAAIa,EAAS/B,EAAOa,GAAMA,EAAKb,MAAY,EACzC,MAGJ,MAAOA,GAGT,QAASkC,GAAclC,EAAQ+B,GAC7B,MAAOD,GAAY9B,EAAQ+B,EAAUhC,GAGvC,QAASoC,GAAOC,GAGd,MAAgC,kBAAlBA,GAAMX,UAAiD,iBAAfW,EAAQ,IAqBhE,QAASC,GAAWvF,EAAGwF,EAAGC,EAAQC,GAEhC,GAAI1F,IAAMwF,EAER,MAAa,KAANxF,GAAY,EAAIA,GAAK,EAAIwF,CAGlC,IAAIG,SAAc3F,GACd4F,QAAmBJ,EAGvB,IAAIxF,IAAMA,IAAW,MAALA,GAAkB,MAALwF,GAChB,YAARG,GAA8B,UAARA,GAAiC,YAAbC,GAAwC,UAAbA,GACxE,OAAO,CAIT,IAAIrB,GAAYI,GAASlB,KAAKzD,GAC1B6F,EAAalB,GAASlB,KAAK+B,EAQ/B,IANIjB,GAAauB,KACfvB,EAAYwB,IAEVF,GAAcC,KAChBD,EAAaE,IAEXxB,GAAasB,EACf,OAAO,CAET,QAAQtB,GACN,IAAKyB,IACL,IAAKC,IAGH,OAAQjG,IAAMwF,CAEhB,KAAKU,IAEH,MAAQlG,KAAMA,EACZwF,IAAMA,EAEA,GAALxF,EAAU,EAAIA,GAAK,EAAIwF,EAAKxF,IAAMwF,CAEvC,KAAKW,IACL,IAAK1B,IAGH,MAAOzE,IAAKoG,OAAOZ,GAEvB,GAAIa,GAAQ9B,GAAa+B,EACzB,KAAKD,EAAO,CAGV,GAAI9B,GAAawB,KAAiB1C,GAAQkD,YAAclB,EAAOrF,IAAMqF,EAAOG,IAC1E,OAAO,CAGT,IAAIgB,IAASnD,GAAQoD,YAAclD,GAAYvD,GAAK0G,OAAS1G,EAAEmE,YAC3DwC,GAAStD,GAAQoD,YAAclD,GAAYiC,GAAKkB,OAASlB,EAAErB,WAG/D,MAAIqC,GAASG,GACL5B,GAAetB,KAAKzD,EAAG,gBAAkB+E,GAAetB,KAAK+B,EAAG,gBAChEoB,GAAWJ,IAAUA,YAAiBA,IAASI,GAAWD,IAAUA,YAAiBA,MACtF,eAAiB3G,IAAK,eAAiBwF,KAE5C,OAAO,EAOXC,IAAWA,MACXC,IAAWA,KAGX,KADA,GAAI3F,GAAS0F,EAAO1F,OACbA,KACL,GAAI0F,EAAO1F,IAAWC,EACpB,MAAO0F,GAAO3F,IAAWyF,CAG7B,IAAIqB,GAAO,EACP1D,GAAS,CAOb,IAJAsC,EAAOzD,KAAKhC,GACZ0F,EAAO1D,KAAKwD,GAGRa,GAMF,GAJAtG,EAASC,EAAED,OACX8G,EAAOrB,EAAEzF,OACToD,EAAS0D,GAAQ9G,EAIf,KAAO8G,KAAQ,CACb,GACIvB,GAAQE,EAAEqB,EAEd,MAAM1D,EAASoC,EAAWvF,EAAE6G,GAAOvB,EAAOG,EAAQC,IAChD,WAQNN,GAAcI,EAAG,SAASF,EAAOvB,EAAKyB,GACpC,MAAIT,IAAetB,KAAK+B,EAAGzB,IAEzB8C,IAEQ1D,EAAS4B,GAAetB,KAAKzD,EAAG+D,IAAQwB,EAAWvF,EAAE+D,GAAMuB,EAAOG,EAAQC,IAJpF,SAQEvC,GAEFiC,EAAcpF,EAAG,SAASsF,EAAOvB,EAAK/D,GACpC,MAAI+E,IAAetB,KAAKzD,EAAG+D,GAEjBZ,IAAW0D,EAAO,GAF5B,QAUN,OAHApB,GAAOqB,MACPpB,EAAOoB,MAEA3D,EA6BT,QAAS4D,GAAgBC,EAAOC,GAE9B,IAAK,GADDjH,GAAI,GAAIC,OAAM+G,GACT9G,EAAI,EAAO8G,EAAJ9G,EAAWA,IACzBF,EAAEE,GAAK+G,GAET,OAAOjH,GAwmDT,QAASkH,GAAeC,GACtB7G,KAAK8G,GAAKD,EAOZ,QAASE,GAAeF,GACtB7G,KAAK8G,GAAKD,EACV7G,KAAKgH,GAAKH,EAAEpH,OACZO,KAAKiH,GAAK,EAWZ,QAASC,GAAcxH,GACrBM,KAAKmH,GAAKzH,EAOZ,QAAS0H,GAAc1H,GACrBM,KAAKmH,GAAKzH,EACVM,KAAKgH,GAAKK,EAAS3H,GACnBM,KAAKiH,GAAK,EAWZ,QAASK,GAAetC,GACtB,MAAwB,gBAAVA,IAAsBuC,GAAKC,SAASxC,GAOpD,QAASyC,GAAY5G,GACnB,GAAuB6G,GAAnB9H,EAAIiB,EAAE8G,GACV,KAAK/H,GAAkB,gBAANiB,GAEf,MADA6G,GAAK,GAAId,GAAe/F,GACjB6G,EAAGC,KAEZ,KAAK/H,GAAKiB,EAAEpB,SAAWJ,EAErB,MADAqI,GAAK,GAAIR,GAAcrG,GAChB6G,EAAGC,KAEZ,KAAK/H,EAAK,KAAM,IAAIgI,WAAU,yBAC9B,OAAO/G,GAAE8G,MAGX,QAASE,GAAK7C,GACZ,GAAI8C,IAAU9C,CACd,OAAe,KAAX8C,EAAuBA,EACvBC,MAAMD,GAAkBA,EACZ,EAATA,EAAa,GAAK,EAG3B,QAAST,GAASxG,GAChB,GAAIrB,IAAOqB,EAAEpB,MACb,OAAIsI,OAAMvI,GAAe,EACb,IAARA,GAAc8H,EAAe9H,IACjCA,EAAMqI,EAAKrI,GAAOwI,KAAKC,MAAMD,KAAKE,IAAI1I,IAC3B,GAAPA,EAAmB,EACnBA,EAAM2I,GAAyBA,GAC5B3I,GAJyCA,EA4ClD,QAAS4I,GAAcC,EAAUC,GAC/BtI,KAAKqI,SAAWA,EAChBrI,KAAKsI,OAASA,EAmDhB,QAASC,GAAcC,EAAWC,GAEhC,MADAC,IAAYF,KAAeA,EAAYG,IAChC,GAAIC,IAAoBH,EAAOD,GAyCxC,QAASK,GAAUR,EAAUC,GAC3BtI,KAAKqI,SAAWA,EAChBrI,KAAKsI,OAASA,EAkGhB,QAASQ,GAAWT,EAAUC,GAC5BtI,KAAKqI,SAAWA,EAChBrI,KAAKsI,OAASA,EA+IhB,QAASS,GAAuBjI,EAAQkI,GACtC,MAAO,IAAIC,IAAoB,SAAUpI,GACvC,GAAIqI,GAAK,GAAIC,IAA8BC,EAAe,GAAIC,GAG9D,OAFAD,GAAaE,cAAcJ,GAC3BA,EAAGI,cAAcxI,EAAOyI,UAAU,GAAIC,IAAc3I,EAAGuI,EAAcJ,KAC9DI,GACNtI,GAiDL,QAAS2I,KAAiB,OAAO,EACjC,QAASC,KAEP,IAAI,GADAlK,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,GACrCI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EACnD,OAAO+J,GA2oBT,QAASF,KAAiB,OAAO,EAgDjC,QAASA,KAAiB,OAAO,EACjC,QAASG,KAAsB,SAC/B,QAASF,KAEP,IAAI,GADAlK,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,GACrCI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EACnD,OAAO+J,GAoEX,QAASF,KAAiB,OAAO,EACjC,QAASG,KAAsB,SAC/B,QAASF,KAEP,IAAI,GADAlK,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,GACrCI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EACnD,OAAO+J,GAmDP,QAASE,GAAa/I,GACpB,MAAO,UAAmBD,GAAK,MAAOC,GAAOyI,UAAU1I,IA2UzD,QAASiJ,GAAcjJ,EAAGyH,GACxBtI,KAAKa,EAAIA,EACTb,KAAK+J,YAAczB,EAAOyB,YAC1B/J,KAAKgK,QAAU1B,EAAO0B,QACtBhK,KAAKiK,KAAO3B,EAAO2B,KACnBjK,KAAKkK,iBAAkB,EACvBlK,KAAKmK,aAAe,KACpBnK,KAAKoK,UAAW,EAChBpK,KAAKqK,WAAY,EA8LnB,QAASC,GAAQX,EAAMnK,GACrB,MAAO,UAAgB+K,GAErB,IAAK,GADDC,GAAcD,EACT3K,EAAI,EAAOJ,EAAJI,EAASA,IAAK,CAC5B,GAAI6K,GAAID,EAAYb,EAAK/J,GACzB,IAAiB,mBAAN6K,GAGT,MAAOpL,EAFPmL,GAAcC,EAKlB,MAAOD,IA4Ob,QAASE,GAAmBC,EAAIC,EAAKC,EAAUlB,GAC7C,GAAI9I,GAAI,GAAIiK,GAKZ,OAHAnB,GAAKjI,KAAKqJ,EAAgBlK,EAAG+J,EAAKC,IAClCF,EAAG5K,MAAM6K,EAAKjB,GAEP9I,EAAEgJ,eAGX,QAASkB,GAAgBlK,EAAG+J,EAAKC,GAC/B,MAAO,YAEL,IAAI,GADArL,GAAMS,UAAUR,OAAQuL,EAAU,GAAIrL,OAAMH,GACxCI,EAAI,EAAOJ,EAAJI,EAASA,IAAOoL,EAAQpL,GAAKK,UAAUL,EAEtD,IAAI0G,GAAWuE,GAAW,CAExB,GADAG,EAAUC,GAASJ,GAAU9K,MAAM6K,EAAKI,GACpCA,IAAY7K,GAAY,MAAOU,GAAEqK,QAAQF,EAAQ9K,EACrDW,GAAEsK,OAAOH,OAELA,GAAQvL,QAAU,EACpBoB,EAAEsK,OAAOH,EAAQ,IAEjBnK,EAAEsK,OAAOH,EAIbnK,GAAEuK,eAsBN,QAASC,GAAqBV,EAAIC,EAAKC,EAAUlB,GAC/C,GAAI9I,GAAI,GAAIiK,GAKZ,OAHAnB,GAAKjI,KAAK4J,EAAkBzK,EAAG+J,EAAKC,IACpCF,EAAG5K,MAAM6K,EAAKjB,GAEP9I,EAAEgJ,eAGX,QAASyB,GAAkBzK,EAAG+J,EAAKC,GACjC,MAAO,YACL,GAAIU,GAAMtL,UAAU,EACpB,IAAIsL,EAAO,MAAO1K,GAAEqK,QAAQK,EAG5B,KAAI,GADA/L,GAAMS,UAAUR,OAAQuL,KACpBpL,EAAI,EAAOJ,EAAJI,EAASA,IAAOoL,EAAQpL,EAAI,GAAKK,UAAUL,EAE1D,IAAI0G,GAAWuE,GAAW,CACxB,GAAIG,GAAUC,GAASJ,GAAU9K,MAAM6K,EAAKI,EAC5C,IAAIA,IAAY7K,GAAY,MAAOU,GAAEqK,QAAQF,EAAQ9K,EACrDW,GAAEsK,OAAOH,OAELA,GAAQvL,QAAU,EACpBoB,EAAEsK,OAAOH,EAAQ,IAEjBnK,EAAEsK,OAAOH,EAIbnK,GAAEuK,eAoBJ,QAASI,GAAiBtL,EAAGuL,EAAGd,GAC9B3K,KAAK0L,GAAKxL,EACVF,KAAK2L,GAAKF,EACVzL,KAAK4L,IAAMjB,EACX3K,KAAK0L,GAAGG,iBAAiB7L,KAAK2L,GAAI3L,KAAK4L,KAAK,GAC5C5L,KAAK8L,YAAa,EASpB,QAASC,GAAqBC,EAAIC,EAAWjD,GAC3C,GAAIkD,GAAc,GAAIC,IAGlBC,EAAehG,OAAOpC,UAAUK,SAASlB,KAAK6I,EAClD,IAAqB,sBAAjBI,GAAyD,4BAAjBA,EAC1C,IAAK,GAAIxM,GAAI,EAAGJ,EAAMwM,EAAGvM,OAAYD,EAAJI,EAASA,IACxCsM,EAAYG,IAAIN,EAAoBC,EAAGM,KAAK1M,GAAIqM,EAAWjD,QAEpDgD,IACTE,EAAYG,IAAI,GAAIb,GAAiBQ,EAAIC,EAAWjD,GAGtD,OAAOkD,GAQT,QAASK,GAAa1L,EAAGgK,GACvB,MAAO,YACL,GAAIG,GAAU/K,UAAU,EACxB,OAAIqG,IAAWuE,KACbG,EAAUC,GAASJ,GAAU9K,MAAM,KAAME,WACrC+K,IAAY7K,IAAmBU,EAAEqK,QAAQF,EAAQ9K,OAEvDW,GAAEsK,OAAOH,IAwTb,QAASwB,GAAoBC,EAASjE,GACpC,MAAO,IAAIS,IAAoB,SAAUZ,GACvC,MAAOG,GAAUkE,qBAAqBD,EAAS,WAC7CpE,EAAS8C,OAAO,GAChB9C,EAAS+C,kBAKf,QAASuB,GAA6BF,EAASG,EAAQpE,GACrD,MAAO,IAAIS,IAAoB,SAAUZ,GACvC,GAAIwE,GAAIJ,EAAShC,EAAIqC,GAAcF,EACnC,OAAOpE,GAAUuE,sCAAsC,EAAGF,EAAG,SAAUnG,EAAOsG,GAC5E,GAAIvC,EAAI,EAAG,CACT,GAAIwC,GAAMzE,EAAUyE,KACpBJ,IAAQpC,EACHwC,GAALJ,IAAaA,EAAII,EAAMxC,GAEzBpC,EAAS8C,OAAOzE,GAChBsG,EAAKtG,EAAQ,EAAGmG,OAKtB,QAASK,GAAwBT,EAASjE,GACxC,MAAO,IAAIS,IAAoB,SAAUZ,GACvC,MAAOG,GAAU2E,qBAAqBL,GAAcL,GAAU,WAC5DpE,EAAS8C,OAAO,GAChB9C,EAAS+C,kBAKf,QAASgC,GAAiCX,EAASG,EAAQpE,GACzD,MAAOiE,KAAYG,EACjB,GAAI3D,IAAoB,SAAUZ,GAChC,MAAOG,GAAU6E,0BAA0B,EAAGT,EAAQ,SAAUlG,GAE9D,MADA2B,GAAS8C,OAAOzE,GACTA,EAAQ,MAGnB4G,GAAgB,WACd,MAAOX,GAA6BnE,EAAUyE,MAAQR,EAASG,EAAQpE,KA6C7E,QAAS+E,GAAwBzM,EAAQ2L,EAASjE,GAChD,MAAO,IAAIS,IAAoB,SAAUpI,GACvC,GAKEuI,GALEoE,GAAS,EACXC,EAAa,GAAIpE,IACjBqE,EAAY,KACZC,KACAC,GAAU,CAsDZ,OApDAxE,GAAetI,EAAO+M,cAAcC,UAAUtF,GAAWe,UAAU,SAAUwE,GAC3E,GAAIlB,GAAGmB,CACyB,OAA5BD,EAAa/I,MAAMiJ,MACrBN,KACAA,EAAEjM,KAAKqM,GACPL,EAAYK,EAAa/I,MAAM0I,UAC/BM,GAAaJ,IAEbD,EAAEjM,MAAOsD,MAAO+I,EAAa/I,MAAO8I,UAAWC,EAAaD,UAAYrB,IACxEuB,GAAaR,EACbA,GAAS,GAEPQ,IACgB,OAAdN,EACF7M,EAAEqK,QAAQwC,IAEVb,EAAI,GAAI1D,IACRsE,EAAWnE,cAAcuD,GACzBA,EAAEvD,cAAcd,EAAU0F,8BAA8BzB,EAAS,SAAUO,GACzE,GAAI9M,GAAGiO,EAAgBtL,EAAQuL,CAC/B,IAAkB,OAAdV,EAAJ,CAGAE,GAAU,CACV,GACE/K,GAAS,KACL8K,EAAElO,OAAS,GAAKkO,EAAE,GAAGG,UAAYtF,EAAUyE,OAAS,IACtDpK,EAAS8K,EAAEU,QAAQrJ,OAEN,OAAXnC,GACFA,EAAOyL,OAAOzN,SAEE,OAAXgC,EACTuL,IAAgB,EAChBD,EAAiB,EACbR,EAAElO,OAAS,GACb2O,GAAgB,EAChBD,EAAiBnG,KAAKuG,IAAI,EAAGZ,EAAE,GAAGG,UAAYtF,EAAUyE,QAExDO,GAAS,EAEXtN,EAAIwN,EACJE,GAAU,EACA,OAAN1N,EACFW,EAAEqK,QAAQhL,GACDkO,GACTpB,EAAKmB,WAMR,GAAIhC,IAAoB/C,EAAcqE,IAC5C3M,GAGL,QAAS0N,GAAwB1N,EAAQ2L,EAASjE,GAChD,MAAO8E,IAAgB,WACrB,MAAOC,GAAwBzM,EAAQ2L,EAAUjE,EAAUyE,MAAOzE,KAItE,QAASiG,GAAkB3N,EAAQ4N,EAAmBC,GACpD,GAAIC,GAAU/D,CAOd,OANIvE,IAAWoI,GACb7D,EAAW6D,GAEXE,EAAWF,EACX7D,EAAW8D,GAEN,GAAI1F,IAAoB,SAAUpI,GAGvC,QAASgO,KACPzF,EAAaE,cAAcxI,EAAOyI,UAChC,SAAUgB,GACR,GAAIuE,GAAQ7D,GAASJ,GAAUN,EAC/B,IAAIuE,IAAU3O,GAAY,MAAOU,GAAEqK,QAAQ4D,EAAM5O,EACjD,IAAI2M,GAAI,GAAI1D,GACZ4F,GAAO1C,IAAIQ,GACXA,EAAEvD,cAAcwF,EAAMvF,UACpB,WACE1I,EAAEsK,OAAOZ,GACTwE,EAAOC,OAAOnC,GACdoC,KAEF,SAAU/O,GAAKW,EAAEqK,QAAQhL,IACzB,WACEW,EAAEsK,OAAOZ,GACTwE,EAAOC,OAAOnC,GACdoC,QAIN,SAAU/O,GAAKW,EAAEqK,QAAQhL,IACzB,WACEgP,GAAQ,EACR9F,EAAa+F,UACbF,OAKN,QAASA,KACPC,GAA2B,IAAlBH,EAAOtP,QAAgBoB,EAAEuK,cAjCpC,GAAI2D,GAAS,GAAI5C,IAAuB+C,GAAQ,EAAO9F,EAAe,GAAIC,GA0C1E,OANKuF,GAGHxF,EAAaE,cAAcsF,EAASrF,UAAUsF,EAAO,SAAU3O,GAAKW,EAAEqK,QAAQhL,IAAO2O,IAFrFA,IAKK,GAAI1C,IAAoB/C,EAAc2F,IAC5C/O,MAyBL,QAASoP,GAAStO,EAAQ2L,EAASjE,GAEjC,MADAE,IAAYF,KAAeA,EAAY6G,IAChC,GAAIpG,IAAoB,SAAUZ,GACvC,GAA2DrD,GAAvDyI,EAAa,GAAIpE,IAAoBiG,GAAW,EAAcC,EAAK,EACnEnG,EAAetI,EAAOyI,UACxB,SAAUgB,GACR+E,GAAW,EACXtK,EAAQuF,EACRgF,GACA,IAAIC,GAAYD,EACd1C,EAAI,GAAI1D,GACVsE,GAAWnE,cAAcuD,GACzBA,EAAEvD,cAAcd,EAAU2E,qBAAqBV,EAAS,WACtD6C,GAAYC,IAAOC,GAAanH,EAAS8C,OAAOnG,GAChDsK,GAAW,MAGf,SAAUpP,GACRuN,EAAW0B,UACX9G,EAAS6C,QAAQhL,GACjBoP,GAAW,EACXC,KAEF,WACE9B,EAAW0B,UACXG,GAAYjH,EAAS8C,OAAOnG,GAC5BqD,EAAS+C,cACTkE,GAAW,EACXC,KAEJ,OAAO,IAAIpD,IAAoB/C,EAAcqE,IAC5CzN,MAGL,QAASyP,GAAqB3O,EAAQ4O,GACpC,MAAO,IAAIzG,IAAoB,SAAUpI,GACvC,GAAImE,GAAOoF,GAAW,EAAOqD,EAAa,GAAIpE,IAAoBkG,EAAK,EACnEnG,EAAetI,EAAOyI,UACxB,SAAUgB,GACR,GAAIoF,GAAW1E,GAASyE,GAAkBnF,EAC1C,IAAIoF,IAAaxP,GAAY,MAAOU,GAAEqK,QAAQyE,EAASzP,EAEvD0P,IAAUD,KAAcA,EAAWE,GAAsBF,IAEzDvF,GAAW,EACXpF,EAAQuF,EACRgF,GACA,IAAIO,GAAYP,EAAI1C,EAAI,GAAI1D,GAC5BsE,GAAWnE,cAAcuD,GACzBA,EAAEvD,cAAcqG,EAASpG,UACvB,WACEa,GAAYmF,IAAOO,GAAajP,EAAEsK,OAAOnG,GACzCoF,GAAW,EACXyC,EAAEsC,WAEJ,SAAUjP,GAAKW,EAAEqK,QAAQhL,IACzB,WACEkK,GAAYmF,IAAOO,GAAajP,EAAEsK,OAAOnG,GACzCoF,GAAW,EACXyC,EAAEsC,cAIR,SAAUjP,GACRuN,EAAW0B,UACXtO,EAAEqK,QAAQhL,GACVkK,GAAW,EACXmF,KAEF,WACE9B,EAAW0B,UACX/E,GAAYvJ,EAAEsK,OAAOnG,GACrBnE,EAAEuK,cACFhB,GAAW,EACXmF,KAGJ,OAAO,IAAIpD,IAAoB/C,EAAcqE,IAC5C3M,GA8BL,QAASiP,GAAiBjP,EAAQkP,GAChC,MAAO,IAAI/G,IAAoB,SAAUpI,GAGvC,QAASoP,KACH7F,IACFA,GAAW,EACXvJ,EAAEsK,OAAOnG,IAEXkK,GAASrO,EAAEuK,cAPb,GAAmBpG,GAAfkK,GAAQ,EAAc9E,GAAW,EAUjC8F,EAAqB,GAAI/G,GAa7B,OAZA+G,GAAmB5G,cAAcxI,EAAOyI,UACtC,SAAU4G,GACR/F,GAAW,EACXpF,EAAQmL,GAEV,SAAUjQ,GAAKW,EAAEqK,QAAQhL,IACzB,WACEgP,GAAQ,EACRgB,EAAmBf,aAIhB,GAAIhD,IACT+D,EACAF,EAAQzG,UAAU0G,EAAiB,SAAU/P,GAAKW,EAAEqK,QAAQhL,IAAO+P,KAEpEnP,GA6BL,QAASsP,GAAoBtP,EAAQuP,EAAcC,EAAyBC,GAO1E,MANIjK,IAAW+J,KACbE,EAAQD,EACRA,EAA0BD,EAC1BA,EAAeG,MAEjBD,IAAUA,EAAQE,GAAgB,GAAIC,MAC/B,GAAIzH,IAAoB,SAAUpI,GAOvC,QAAS8P,GAASC,GAChB,GAAIC,GAAOtB,EAAI1C,EAAI,GAAI1D,GACvB2H,GAAMxH,cAAcuD,GACpBA,EAAEvD,cAAcsH,EAAQrH,UAAU,WAChCgG,IAAOsB,GAAQzH,EAAaE,cAAciH,EAAMhH,UAAU1I,IAC1DgM,EAAEsC,WACD,SAAUjP,GACXqP,IAAOsB,GAAQhQ,EAAEqK,QAAQhL,IACxB,WACDqP,IAAOsB,GAAQzH,EAAaE,cAAciH,EAAMhH,UAAU1I,OAM9D,QAASkQ,KACP,GAAIC,IAAOC,CAEX,OADID,IAAOzB,IACJyB,EAxBT,GAAI5H,GAAe,GAAIC,IAAoByH,EAAQ,GAAIzH,IAAoB6H,EAAW,GAAI/H,GAE1FC,GAAaE,cAAc4H,EAE3B,IAAI3B,GAAK,EAAG0B,GAAW,CAmCvB,OApBAN,GAASN,GAQTa,EAAS5H,cAAcxI,EAAOyI,UAAU,SAAUgB,GAChD,GAAIwG,IAAS,CACXlQ,EAAEsK,OAAOZ,EACT,IAAIqG,GAAU3F,GAASqF,GAAyB/F,EAChD,IAAIqG,IAAYzQ,GAAY,MAAOU,GAAEqK,QAAQ0F,EAAQ1Q,EACrDyQ,GAASf,GAAUgB,GAAWf,GAAsBe,GAAWA,KAEhE,SAAU1Q,GACX6Q,KAAWlQ,EAAEqK,QAAQhL,IACpB,WACD6Q,KAAWlQ,EAAEuK,iBAER,GAAIe,IAAoB/C,EAAc0H,IAC5ChQ,GAGL,QAAS8P,GAAQ9P,EAAQ2L,EAAS8D,EAAO/H,GACvC,GAAa,MAAT+H,EAAiB,KAAM,IAAInO,OAAM,uCACjCsG,IAAY6H,KACd/H,EAAY+H,EACZA,EAAQE,GAAgB,GAAIC,MAE1BH,YAAiBnO,SAASmO,EAAQE,GAAgBF,IACtD7H,GAAYF,KAAeA,EAAY6G,GAEvC,IAAI8B,GAAkB1E,YAAmB2E,MACvC,uBACA,sBAEF,OAAO,IAAInI,IAAoB,SAAUpI,GASvC,QAASwQ,KACP,GAAIR,GAAOtB,CACXuB,GAAMxH,cAAcd,EAAU2I,GAAiB1E,EAAS,WAClD8C,IAAOsB,IACTjB,GAAUW,KAAWA,EAAQV,GAAsBU,IACnDnH,EAAaE,cAAciH,EAAMhH,UAAU1I,QAbjD,GAAI0O,GAAK,EACP2B,EAAW,GAAI/H,IACfC,EAAe,GAAIC,IACnB4H,GAAW,EACXH,EAAQ,GAAIzH,GAiCd,OA/BAD,GAAaE,cAAc4H,GAY3BG,IAEAH,EAAS5H,cAAcxI,EAAOyI,UAAU,SAAUgB,GAC3C0G,IACH1B,IACA1O,EAAEsK,OAAOZ,GACT8G,MAED,SAAUnR,GACN+Q,IACH1B,IACA1O,EAAEqK,QAAQhL,KAEX,WACI+Q,IACH1B,IACA1O,EAAEuK,kBAGC,GAAIe,IAAoB/C,EAAc0H,IAC5ChQ,GAiGL,QAASwQ,IAAoBxQ,EAAQyQ,EAASC,GAC5C,MAAO,IAAIvI,IAAoB,SAAUpI,GAOvC,QAAS4Q,GAAKlH,EAAG3K,GAGf,GAFA8R,EAAO9R,GAAK2K,EACZH,EAASxK,IAAK,EACV+R,IAAgBA,EAAcvH,EAASwH,MAAMC,KAAY,CAC3D,GAAItG,EAAO,MAAO1K,GAAEqK,QAAQK,EAC5B,IAAIyF,GAAM/F,GAASuG,GAAgBzR,MAAM,KAAM2R,EAC/C,IAAIV,IAAQ7Q,GAAY,MAAOU,GAAEqK,QAAQ8F,EAAI9Q,EAC7CW,GAAEsK,OAAO6F,GAEXc,GAAUJ,EAAO,IAAM7Q,EAAEuK,cAf3B,GAIEG,GAJEnB,IAAY,GAAO,GACrBuH,GAAc,EACdG,GAAS,EACTJ,EAAS,GAAI/R,OAAM,EAerB,OAAO,IAAIwM,IACTrL,EAAOyI,UACL,SAAUgB,GACRkH,EAAKlH,EAAG,IAEV,SAAUrK,GACJwR,EAAO,GACT7Q,EAAEqK,QAAQhL,GAEVqL,EAAMrL,GAGV,WACE4R,GAAS,EACTJ,EAAO,IAAM7Q,EAAEuK,gBAEnBmG,EAAQhI,UACN,SAAUgB,GACRkH,EAAKlH,EAAG,IAEV,SAAUrK,GAAKW,EAAEqK,QAAQhL,IACzB,WACE4R,GAAS,EACTL,GAAK,EAAM,OAGhB3Q,GAvzKL,GAAIiR,KACFC,YAAY,EACZpP,QAAU,GAIVqP,GAAcF,SAAmBG,WAAYA,UAAYA,QAAQC,UAAYD,QAC7EE,GAAWL,SAAmB/E,QAASA,KAAK5G,QAAU4G,KACtDqF,GAAaN,SAAmBO,UAAWA,QAAUA,OAAOlM,QAAUkM,OACtEC,GAAaR,SAAmBS,UAAWA,SAAWA,OAAOL,UAAYK,OACzEC,GAAgBF,IAAcA,GAAWL,UAAYD,IAAeA,GACpES,GAAaT,IAAeM,IAA+B,gBAAVI,SAAsBA,QAAUA,OAAOvM,QAAUuM,OAEhGpL,GAAOA,GAAOmL,IAAgBL,MAAgBrS,MAAQA,KAAKsS,SAAYD,IAAeD,IAAYpS,KAElG4S,IACFC,aACAC,QACEC,QAASxL,GAAKwL,SAEhBC,YAIEC,GAAOL,GAAGI,QAAQC,KAAO,aAC3BpB,GAAWe,GAAGI,QAAQnB,SAAW,SAAUtH,GAAK,MAAOA,IACvD2I,GAAaN,GAAGI,QAAQE,WAAa9B,KAAKnE,IAC1CkG,GAAkBP,GAAGI,QAAQG,gBAAkB,SAAU5I,EAAG6I,GAAK,MAAOC,IAAQ9I,EAAG6I,IACnFE,GAAqBV,GAAGI,QAAQM,mBAAqB,SAAU/I,EAAG6I,GAAK,MAAO7I,GAAI6I,EAAI,EAASA,EAAJ7I,EAAQ,GAAK,GAExGgJ,IADuBX,GAAGI,QAAQQ,qBAAuB,SAAUjJ,GAAK,MAAOA,GAAElG,YAClEuO,GAAGI,QAAQO,aAAe,SAAUhI,GAAO,KAAMA,KAChEqE,GAAYgD,GAAGI,QAAQpD,UAAY,SAAUnF,GAAK,QAASA,GAA4B,kBAAhBA,GAAElB,WAA8C,kBAAXkB,GAAEgJ,MAC9GnN,GAAasM,GAAGI,QAAQ1M,WAAc,WAEpC,GAAIoN,GAAO,SAAU1O,GACnB,MAAuB,kBAATA,KAAuB,EAUvC,OANI0O,GAAK,OACPA,EAAO,SAAS1O,GACd,MAAuB,kBAATA,IAA+C,qBAAxBX,GAASlB,KAAK6B,KAIhD0O,KASPvT,IAAYD,MAWZ+K,GAAW2H,GAAGC,UAAU5H,SAAW,SAAkBN,GACvD,IAAKrE,GAAWqE,GAAO,KAAM,IAAI/C,WAAU,wBAC3C,OAAO/H,GAAc8K,GAMvBiI,IAAGE,OAAOa,kBAAmB,CAC7B,IAAInT,KAAY,EAAOI,GAASqK,GAAS,WAAc,KAAM,IAAI7I,UACjE5B,MAAcI,GAAOV,KAAOU,GAAOV,EAAEO,KAGrC,IAAmCuB,IAA/BC,GAAgBE,IAEhBxB,GAAuB,uBAoFvBiT,GAAahB,GAAGgB,WAAa,WAC/B5T,KAAK6T,QAAU,iCACf7T,KAAK8T,KAAO,aACZ1R,MAAMe,KAAKnD,MAEb4T,IAAW5P,UAAYoC,OAAO2N,OAAO3R,MAAM4B,UAE3C,IAAIgQ,IAAsBpB,GAAGoB,oBAAsB,WACjDhU,KAAK6T,QAAU,2BACf7T,KAAK8T,KAAO,sBACZ1R,MAAMe,KAAKnD,MAEbgU,IAAoBhQ,UAAYoC,OAAO2N,OAAO3R,MAAM4B,UAEpD,IAAIiQ,IAA0BrB,GAAGqB,wBAA0B,WACzDjU,KAAK6T,QAAU,wBACf7T,KAAK8T,KAAO,0BACZ1R,MAAMe,KAAKnD,MAEbiU,IAAwBjQ,UAAYoC,OAAO2N,OAAO3R,MAAM4B,UAExD,IAAIkQ,IAAoBtB,GAAGsB,kBAAoB,SAAUL,GACvD7T,KAAK6T,QAAUA,GAAW,kCAC1B7T,KAAK8T,KAAO,oBACZ1R,MAAMe,KAAKnD,MAEbkU,IAAkBlQ,UAAYoC,OAAO2N,OAAO3R,MAAM4B,UAElD,IAAImQ,IAAsBvB,GAAGuB,oBAAsB,SAAUN,GAC3D7T,KAAK6T,QAAUA,GAAW,oCAC1B7T,KAAK8T,KAAO,sBACZ1R,MAAMe,KAAKnD,MAEbmU,IAAoBnQ,UAAYoC,OAAO2N,OAAO3R,MAAM4B,UAEpD,IAAIoQ,IAAiBxB,GAAGI,QAAQoB,eAAiB,WAC/C,KAAM,IAAID,KAGRE,GAAezB,GAAGI,QAAQqB,aAAe,WAC3C,KAAM,IAAIH,KAIRvM,GAAgC,kBAAX2M,SAAyBA,OAAOC,UACvD,oBAEEhN,IAAKiN,KAA+C,mBAAjC,GAAIjN,IAAKiN,KAAM,gBACpC7M,GAAa,aAGf,IAAI8M,IAAiB7B,GAAG6B,gBAAmBxF,MAAM,EAAMjK,MAAO3F,GAE1DqV,GAAa9B,GAAGI,QAAQ0B,WAAa,SAAU7T,GACjD,MAAOA,GAAE8G,MAAgBtI,GAGvBsV,GAAc/B,GAAGI,QAAQ2B,YAAc,SAAU9T,GACnD,MAAOA,IAAKA,EAAEpB,SAAWJ,EAG3BuT,IAAGI,QAAQuB,SAAW5M,EAEtB,IAmDEiN,IAnDEC,GAAejC,GAAGC,UAAUgC,aAAe,SAAUC,EAAMC,EAASC,GACtE,GAAuB,mBAAZD,GAA2B,MAAOD,EAC7C,QAAOE,GACL,IAAK,GACH,MAAO,YACL,MAAOF,GAAK3R,KAAK4R,GAErB,KAAK,GACH,MAAO,UAASE,GACd,MAAOH,GAAK3R,KAAK4R,EAASE,GAE9B,KAAK,GACH,MAAO,UAASjQ,EAAOlB,GACrB,MAAOgR,GAAK3R,KAAK4R,EAAS/P,EAAOlB,GAErC,KAAK,GACH,MAAO,UAASkB,EAAOlB,EAAOoR,GAC5B,MAAOJ,GAAK3R,KAAK4R,EAAS/P,EAAOlB,EAAOoR,IAI9C,MAAO,YACL,MAAOJ,GAAK/U,MAAMgV,EAAS9U,aAK3BuE,IAAa,WACf,iBACA,UACA,iBACA,gBACA,uBACA,eACFT,GAAkBS,GAAU/E,OAGxB+F,GAAY,qBACdQ,GAAa,iBACbN,GAAY,mBACZC,GAAY,gBACZvB,GAAa,iBACb+Q,GAAY,oBACZvP,GAAc,kBACdH,GAAc,kBACdI,GAAc,kBACd1B,GAAc,kBAEZE,GAAW+B,OAAOpC,UAAUK,SAC9BI,GAAiB2B,OAAOpC,UAAUS,eAClC2Q,GAAoB/Q,GAASlB,KAAKlD,YAAcuF,GAEhDhC,GAAapB,MAAM4B,UACnBL,GAAcyC,OAAOpC,UACrBE,GAAc4B,OAAO9B,UACrBqR,GAAuB1R,GAAY0R,oBAErC,KACET,KAAqBvQ,GAASlB,KAAKmS,WAAa7P,OAAmBpB,SAAY,GAAM,KACrF,MAAOnE,IACP0U,IAAmB,EAGrB,GAAIrQ,MACJA,IAAayB,IAAczB,GAAaoB,IAAapB,GAAaqB,KAAiB/B,aAAe,EAAM0R,gBAAkB,EAAMlR,UAAY,EAAMmR,SAAW,GAC7JjR,GAAamB,IAAanB,GAAaJ,KAAiBN,aAAe,EAAMQ,UAAY,EAAMmR,SAAW,GAC1GjR,GAAaH,IAAcG,GAAa4Q,IAAa5Q,GAAasB,KAAiBhC,aAAe,EAAMQ,UAAY,GACpHE,GAAakB,KAAiB5B,aAAe,EAE7C,IAAId,QACH,WACC,GAAIa,GAAO,WAAa5D,KAAKuK,EAAI,GAC/B1F,IAEFjB,GAAKI,WAAcwR,QAAW,EAAGpC,EAAK,EACtC,KAAK,GAAI3P,KAAO,IAAIG,GAAQiB,EAAMnD,KAAK+B,EACvC,KAAKA,IAAOxD,YAGZ8C,GAAQQ,eAAiB8R,GAAqBlS,KAAKK,GAAY,YAAc6R,GAAqBlS,KAAKK,GAAY,QAGnHT,GAAQM,eAAiBgS,GAAqBlS,KAAKS,EAAM,aAGzDb,GAAQC,YAAqB,GAAPS,EAGtBV,GAAQW,gBAAkB,UAAU+R,KAAK5Q,IACzC,EAEF,IAAI/B,IAAW8P,GAAGC,UAAU/P,SAAW,SAASkC,GAC9C,GAAIK,SAAcL,EAClB,OAAOA,KAAkB,YAARK,GAA8B,UAARA,KAAqB,GAgE1DpC,GAAc,SAAS+B,GACzB,MAAQA,IAAyB,gBAATA,GAAqBX,GAASlB,KAAK6B,IAAUQ,IAAY,EAI9E4P,MACHnS,GAAc,SAAS+B,GACrB,MAAQA,IAAyB,gBAATA,GAAqBP,GAAetB,KAAK6B,EAAO,WAAY,GAIxF,IAAIqO,IAAUT,GAAGC,UAAUQ,QAAU,SAAU9I,EAAG6I,GAChD,MAAOnO,GAAWsF,EAAG6I,UA+InBlQ,OADauB,eACL9E,MAAMqE,UAAUd,OAExBwS,GAAW9C,GAAGC,UAAU6C,SAAW,SAAUC,EAAOrN,GACtD,QAASsN,KAAO5V,KAAK6D,YAAc8R,EACnCC,EAAG5R,UAAYsE,EAAOtE,UACtB2R,EAAM3R,UAAY,GAAI4R,IAGpBC,GAAgBjD,GAAGC,UAAUgD,cAAgB,SAAUC,GACzD,IAAI,GAAIC,MAAcnW,EAAI,EAAGJ,EAAMS,UAAUR,OAAYD,EAAJI,EAASA,IAAOmW,EAAQrU,KAAKzB,UAAUL,GAC5F,KAAK,GAAIoW,GAAM,EAAGC,EAAKF,EAAQtW,OAAcwW,EAAND,EAAUA,IAAO,CACtD,GAAIlV,GAASiV,EAAQC,EACrB,KAAK,GAAIE,KAAQpV,GACfgV,EAAII,GAAQpV,EAAOoV,KAwBrB/J,IAlBSyG,GAAGC,UAAUsD,OAAS,SAAUC,EAAIC,GAC/C,MAAO,IAAIpN,IAAoB,SAAUZ,GACvC,MAAO,IAAI8D,IAAoBkK,EAAEC,gBAAiBF,EAAG7M,UAAUlB,OAgBzCuK,GAAGzG,oBAAsB,WACjD,GAAevM,GAAGJ,EAAdmK,IACJ,IAAIhK,MAAM4W,QAAQtW,UAAU,IAC1B0J,EAAO1J,UAAU,GACjBT,EAAMmK,EAAKlK,WAIX,KAFAD,EAAMS,UAAUR,OAChBkK,EAAO,GAAIhK,OAAMH,GACbI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EAEjD,KAAIA,EAAI,EAAOJ,EAAJI,EAASA,IAClB,IAAK4W,GAAa7M,EAAK/J,IAAO,KAAM,IAAIgI,WAAU,mBAEpD5H,MAAKkM,YAAcvC,EACnB3J,KAAK8L,YAAa,EAClB9L,KAAKP,OAASkK,EAAKlK,SAGjBgX,GAA+BtK,GAAoBnI,SAMvDyS,IAA6BpK,IAAM,SAAUC,GACvCtM,KAAK8L,WACPQ,EAAK6C,WAELnP,KAAKkM,YAAYxK,KAAK4K,GACtBtM,KAAKP,WASTgX,GAA6BzH,OAAS,SAAU1C,GAC9C,GAAIoK,IAAgB,CACpB,KAAK1W,KAAK8L,WAAY,CACpB,GAAIkK,GAAMhW,KAAKkM,YAAYxL,QAAQ4L,EACvB,MAAR0J,IACFU,GAAgB,EAChB1W,KAAKkM,YAAYyK,OAAOX,EAAK,GAC7BhW,KAAKP,SACL6M,EAAK6C,WAGT,MAAOuH,IAMTD,GAA6BtH,QAAU,WACrC,IAAKnP,KAAK8L,WAAY,CACpB9L,KAAK8L,YAAa,CAElB,KAAI,GADAtM,GAAMQ,KAAKkM,YAAYzM,OAAQmX,EAAqB,GAAIjX,OAAMH,GAC1DI,EAAI,EAAOJ,EAAJI,EAASA,IAAOgX,EAAmBhX,GAAKI,KAAKkM,YAAYtM,EAIxE,KAHAI,KAAKkM,eACLlM,KAAKP,OAAS,EAETG,EAAI,EAAOJ,EAAJI,EAASA,IACnBgX,EAAmBhX,GAAGuP,WAS5B,IAAI0H,IAAajE,GAAGiE,WAAa,SAAUC,GACzC9W,KAAK8L,YAAa,EAClB9L,KAAK8W,OAASA,GAAU7D,GAI1B4D,IAAW7S,UAAUmL,QAAU,WACxBnP,KAAK8L,aACR9L,KAAK8W,SACL9W,KAAK8L,YAAa,GAStB,IAAIiL,IAAmBF,GAAW9C,OAAS,SAAU+C,GAAU,MAAO,IAAID,IAAWC,IAKjFE,GAAkBH,GAAWI,OAAU9H,QAAS8D,IAOhDuD,GAAeK,GAAWL,aAAe,SAAU3J,GACrD,MAAOA,IAAKvG,GAAWuG,EAAEsC,UAGvB+H,GAAgBL,GAAWK,cAAgB,SAAUC,GACvD,GAAIA,EAAWrL,WAAc,KAAM,IAAIkI,KAIrC7K,GAA6ByJ,GAAGzJ,2BAA6B,WAC/DnJ,KAAK8L,YAAa,EAClB9L,KAAKoX,QAAU,KAEjBjO,IAA2BnF,UAAUsS,cAAgB,WACnD,MAAOtW,MAAKoX,SAEdjO,GAA2BnF,UAAUsF,cAAgB,SAAUtE,GAC7D,GAAIhF,KAAKoX,QAAW,KAAM,IAAIhV,OAAM,uCACpC,IAAIsU,GAAgB1W,KAAK8L,YACxB4K,IAAkB1W,KAAKoX,QAAUpS,GAClC0R,GAAiB1R,GAASA,EAAMmK,WAElChG,GAA2BnF,UAAUmL,QAAU,WAC7C,IAAKnP,KAAK8L,WAAY,CACpB9L,KAAK8L,YAAa,CAClB,IAAIuL,GAAMrX,KAAKoX,OACfpX,MAAKoX,QAAU,KAEjBC,GAAOA,EAAIlI,UAIb,IAAI9F,IAAmBuJ,GAAGvJ,iBAAmB,WAC3CrJ,KAAK8L,YAAa,EAClB9L,KAAKoX,QAAU,KAEjB/N,IAAiBrF,UAAUsS,cAAgB,WACzC,MAAOtW,MAAKoX,SAEd/N,GAAiBrF,UAAUsF,cAAgB,SAAUtE,GACnD,GAAI0R,GAAgB1W,KAAK8L,UACzB,KAAK4K,EAAe,CAClB,GAAIW,GAAMrX,KAAKoX,OACfpX,MAAKoX,QAAUpS,EAEjBqS,GAAOA,EAAIlI,UACXuH,GAAiB1R,GAASA,EAAMmK,WAElC9F,GAAiBrF,UAAUmL,QAAU,WACnC,IAAKnP,KAAK8L,WAAY,CACpB9L,KAAK8L,YAAa,CAClB,IAAIuL,GAAMrX,KAAKoX,OACfpX,MAAKoX,QAAU,KAEjBC,GAAOA,EAAIlI,UAMb,IAuDImI,KAvDqB1E,GAAG2E,mBAAqB,WAE/C,QAASC,GAAgBL,GACvBnX,KAAKmX,WAAaA,EAClBnX,KAAKmX,WAAWzQ,QAChB1G,KAAKyX,iBAAkB,EAmBzB,QAASF,GAAmBJ,GAC1BnX,KAAK0X,qBAAuBP,EAC5BnX,KAAK8L,YAAa,EAClB9L,KAAK2X,mBAAoB,EACzB3X,KAAK0G,MAAQ,EAwBf,MA5CA8Q,GAAgBxT,UAAUmL,QAAU,WAC7BnP,KAAKmX,WAAWrL,YAAe9L,KAAKyX,kBACvCzX,KAAKyX,iBAAkB,EACvBzX,KAAKmX,WAAWzQ,QACc,IAA1B1G,KAAKmX,WAAWzQ,OAAe1G,KAAKmX,WAAWQ,oBACjD3X,KAAKmX,WAAWrL,YAAa,EAC7B9L,KAAKmX,WAAWO,qBAAqBvI,aAoB3CoI,EAAmBvT,UAAUmL,QAAU,WAChCnP,KAAK8L,YAAe9L,KAAK2X,oBAC5B3X,KAAK2X,mBAAoB,EACN,IAAf3X,KAAK0G,QACP1G,KAAK8L,YAAa,EAClB9L,KAAK0X,qBAAqBvI,aAShCoI,EAAmBvT,UAAUsS,cAAgB,WAC3C,MAAOtW,MAAK8L,WAAakL,GAAkB,GAAIQ,GAAgBxX,OAG1DuX,KAGW3E,GAAGC,UAAUyE,cAAgB,SAAU9O,EAAWoP,EAAOd,EAAQrK,EAASoL,GAC5F7X,KAAKwI,UAAYA,EACjBxI,KAAK4X,MAAQA,EACb5X,KAAK8W,OAASA,EACd9W,KAAKyM,QAAUA,EACfzM,KAAK6X,SAAWA,GAAYvE,GAC5BtT,KAAKmX,WAAa,GAAIhO,KAGxBmO,IAActT,UAAU8T,OAAS,WAC/B9X,KAAKmX,WAAW7N,cAActJ,KAAK+X,eAGrCT,GAActT,UAAUgU,UAAY,SAAUzH,GAC5C,MAAOvQ,MAAK6X,SAAS7X,KAAKyM,QAAS8D,EAAM9D,UAG3C6K,GAActT,UAAUiU,YAAc,WACpC,MAAOjY,MAAKmX,WAAWrL,YAGzBwL,GAActT,UAAU+T,WAAa,WACnC,MAAO/X,MAAK8W,OAAO9W,KAAKwI,UAAWxI,KAAK4X,OAI1C,IAAIM,IAAYtF,GAAGsF,UAAa,WAE9B,QAASA,GAAUjL,EAAKkL,EAAUC,EAAkBC,GAClDrY,KAAKiN,IAAMA,EACXjN,KAAKsY,UAAYH,EACjBnY,KAAKuY,kBAAoBH,EACzBpY,KAAKwY,kBAAoBH,EAQ3B,QAASI,GAAajQ,EAAWsO,GAE/B,MADAA,KACOE,GANTkB,EAAUxP,YAAc,SAAU7B,GAChC,MAAOA,aAAaqR,GAQtB,IAAIQ,GAAiBR,EAAUlU,SA4E/B,OArEA0U,GAAeP,SAAW,SAAUrB,GAClC,MAAO9W,MAAKsY,UAAUxB,EAAQ2B,IAShCC,EAAeC,kBAAoB,SAAUf,EAAOd,GAClD,MAAO9W,MAAKsY,UAAUV,EAAOd,IAS/B4B,EAAevL,qBAAuB,SAAUV,EAASqK,GACvD,MAAO9W,MAAKuY,kBAAkBzB,EAAQrK,EAASgM,IAUjDC,EAAeE,6BAA+B,SAAUhB,EAAOnL,EAASqK,GACtE,MAAO9W,MAAKuY,kBAAkBX,EAAOnL,EAASqK,IAShD4B,EAAehM,qBAAuB,SAAUD,EAASqK,GACvD,MAAO9W,MAAKwY,kBAAkB1B,EAAQrK,EAASgM,IAUjDC,EAAeG,6BAA+B,SAAUjB,EAAOnL,EAASqK,GACtE,MAAO9W,MAAKwY,kBAAkBZ,EAAOnL,EAASqK,IAIhDoB,EAAUjL,IAAMiG,GAOhBgF,EAAUY,UAAY,SAAUC,GAE9B,MADW,GAAXA,IAAiBA,EAAW,GACrBA,GAGFb,KAGLpL,GAAgBoL,GAAUY,UAAWpQ,GAAcwP,GAAUxP,aAEhE,SAAUgQ,GAET,QAASM,GAAmBxQ,EAAWyQ,GAKrC,QAASC,GAAYC,GASnB,QAASC,GAAaC,EAAGC,GAOvB,MANIC,GACFC,EAAMxK,OAAOnC,GAEbiF,GAAS,EAEXgF,EAAOwC,EAAQJ,GACRlC,GAfT,GAAIuC,IAAU,EAAOzH,GAAS,EAE1BjF,EAAIrE,EAAUmQ,kBAAkBQ,EAAQC,EACvCtH,KACH0H,EAAMnN,IAAIQ,GACV0M,GAAU,GAVd,GAAI3B,GAAQqB,EAAK,GAAInC,EAASmC,EAAK,GAAIO,EAAQ,GAAIrN,GAEnD,OADA2K,GAAOc,EAAOsB,GACPM,EAuBT,QAASC,GAAcjR,EAAWyQ,EAAMS,GAKtC,QAASR,GAAYC,EAAQQ,GAS3B,QAASP,GAAaC,EAAGC,GAOvB,MANIC,GACFC,EAAMxK,OAAOnC,GAEbiF,GAAS,EAEXgF,EAAOwC,EAAQJ,GACRlC,GAfT,GAAIuC,IAAU,EAAOzH,GAAS,EAE1BjF,EAAIrE,EAAUkR,GAAQP,EAAQQ,EAAUP,EACvCtH,KACH0H,EAAMnN,IAAIQ,GACV0M,GAAU,GAVd,GAAI3B,GAAQqB,EAAK,GAAInC,EAASmC,EAAK,GAAIO,EAAQ,GAAIrN,GAEnD,OADA2K,GAAOc,EAAOsB,GACPM,EAuBT,QAASI,GAAsB/S,EAAG4D,GAChC,MAAOgP,GAAc5S,EAAG4D,EAAG,gCAG7B,QAASoP,GAAsBhT,EAAG4D,GAChC,MAAOgP,GAAc5S,EAAG4D,EAAG,gCAG7B,QAASqP,GAAuBhD,EAAQ9J,GACtC8J,EAAO,SAASiD,GAAM/M,EAAK8J,EAAQiD,KAQrCrB,EAAesB,kBAAoB,SAAUlD,GAC3C,MAAO9W,MAAKia,2BAA2BnD,EAAQgD,IASjDpB,EAAeuB,2BAA6B,SAAUrC,EAAOd,GAC3D,MAAO9W,MAAK2Y,mBAAmBf,EAAOd,GAASkC,IASjDN,EAAexK,8BAAgC,SAAUzB,EAASqK,GAChE,MAAO9W,MAAKka,sCAAsCpD,EAAQrK,EAASqN,IAUrEpB,EAAewB,sCAAwC,SAAUtC,EAAOnL,EAASqK,GAC/E,MAAO9W,MAAKuY,mBAAmBX,EAAOd,GAASrK,EAASmN,IAS1DlB,EAAeyB,8BAAgC,SAAU1N,EAASqK,GAChE,MAAO9W,MAAK+M,sCAAsC+J,EAAQrK,EAASqN,IAUrEpB,EAAe3L,sCAAwC,SAAU6K,EAAOnL,EAASqK,GAC/E,MAAO9W,MAAKwY,mBAAmBZ,EAAOd,GAASrK,EAASoN,KAE1D3B,GAAUlU,WAEX,SAAU0U,GAQTR,GAAUlU,UAAUoW,iBAAmB,SAAUxN,EAAQkK,GACvD,MAAO9W,MAAKqN,0BAA0B,KAAMT,EAAQkK,IAUtDoB,GAAUlU,UAAUqJ,0BAA4B,SAASuK,EAAOhL,EAAQkK,GACtE,GAAgC,mBAArBvP,IAAK8S,YAA+B,KAAM,IAAInG,GACzDtH,GAASE,GAAcF,EACvB,IAAI/F,GAAI+Q,EAAOrI,EAAKhI,GAAK8S,YAAY,WAAcxT,EAAIiQ,EAAOjQ,IAAO+F,EACrE,OAAOmK,IAAiB,WAAcxP,GAAK+S,cAAc/K,OAG3D2I,GAAUlU,UAGZ,IAoEIuW,IAAgBC,GApEhBC,GAAqBvC,GAAUwC,UAAa,WAC9C,QAASC,GAAY/C,EAAOd,GAAU,MAAOA,GAAO9W,KAAM4X,GAC1D,MAAO,IAAIM,IAAUhF,GAAYyH,EAAatG,GAAcA,OAM1D1L,GAAyBuP,GAAU0C,cAAiB,WAGtD,QAASC,KACP,KAAOC,EAAMrb,OAAS,GAAG,CACvB,GAAI6M,GAAOwO,EAAMzM,SAChB/B,EAAK2L,eAAiB3L,EAAKwL,UAIhC,QAAS6C,GAAY/C,EAAOd,GAC1B,GAAIiE,GAAK,GAAIzD,IAActX,KAAM4X,EAAOd,EAAQ9W,KAAKiN,MAErD,IAAK6N,EAOHA,EAAMpZ,KAAKqZ,OAPD,CACVD,GAASC,EAET,IAAIlY,GAASoI,GAAS4P,IAEtB,IADAC,EAAQ,KACJjY,IAAW1C,GAAY,MAAOC,GAAQyC,EAAO3C,GAInD,MAAO6a,GAAG5D,WArBZ,GAAI2D,GAwBAE,EAAmB,GAAI9C,IAAUhF,GAAYyH,EAAatG,GAAcA,GAG5E,OAFA2G,GAAiBC,iBAAmB,WAAc,OAAQH,GAEnDE,KAkCLE,IA/B4BtI,GAAGC,UAAUsI,0BAA6B,WACxE,QAASC,GAAKC,EAASC,GACrBA,EAAQ,EAAGtb,KAAKub,QAChB,KACEvb,KAAKwb,OAASxb,KAAKyb,QAAQzb,KAAKwb,QAChC,MAAOtb,GAEP,KADAF,MAAK0b,QAAQvM,UACPjP,GAIV,QAASib,GAA0B3S,EAAWoP,EAAOhL,EAAQkK,GAC3D9W,KAAK2b,WAAanT,EAClBxI,KAAKwb,OAAS5D,EACd5X,KAAKub,QAAU3O,EACf5M,KAAKyb,QAAU3E,EAWjB,MARAqE,GAA0BnX,UAAU6K,MAAQ,WAC1C,GAAIhC,GAAI,GAAI1D,GAIZ,OAHAnJ,MAAK0b,QAAU7O,EACfA,EAAEvD,cAActJ,KAAK2b,WAAWzB,sCAAsC,EAAGla,KAAKub,QAASH,EAAKQ,KAAK5b,QAE1F6M,GAGFsO,KAKS,WAChB,GAAIU,GAAiBC,EAAoB7I,EACzC,IAAM1L,GAAKwU,WACTF,EAAkBtU,GAAKwU,WACvBD,EAAoBvU,GAAKyU,iBACpB,CAAA,IAAMzU,GAAK0U,QAMhB,KAAM,IAAI/H,GALV2H,GAAkB,SAAUlR,EAAIuR,GAC9B3U,GAAK0U,QAAQE,MAAMD,GACnBvR,KAMJ,OACEoR,WAAYF,EACZG,aAAcF,OAGdD,GAAkBX,GAAWa,WAC/BD,GAAoBZ,GAAWc,cAEhC,WAQC,QAASI,GAAQC,GACf,GAAIC,EACFT,GAAgB,WAAcO,EAAQC,IAAW,OAC5C,CACL,GAAIE,GAAOC,EAAcH,EACzB,IAAIE,EAAM,CACRD,GAAmB,CACnB,IAAIzZ,GAASoI,GAASsR,IAGtB,IAFA/B,GAAY6B,GACZC,GAAmB,EACfzZ,IAAW1C,GAAY,MAAOC,GAAQyC,EAAO3C,KAcvD,QAASuc,KAEP,IAAKlV,GAAKmV,aAAenV,GAAKoV,cAAiB,OAAO,CACtD,IAAIC,IAAU,EAAOC,EAAatV,GAAKuV,SAMvC,OAJAvV,IAAKuV,UAAY,WAAcF,GAAU,GACzCrV,GAAKmV,YAAY,GAAI,KACrBnV,GAAKuV,UAAYD,EAEVD,EAuBP,QAASG,GAAoBC,GAED,gBAAfA,GAAMC,MAAqBD,EAAMC,KAAKC,UAAU,EAAGC,EAAW1d,UAAY0d,GACnFf,EAAQY,EAAMC,KAAKC,UAAUC,EAAW1d,SAjE9C,GAAI2d,GAAa,EAAGZ,KAAoBF,GAAmB,CAE3D9B,IAAc,SAAU6B,SACfG,GAAcH,GAkBvB,IAAIgB,GAAWC,OAAO,IACpBxX,OAAOzB,IACJkZ,QAAQ,sBAAuB,QAC/BA,QAAQ,wBAAyB,OAAS,KAG3CC,EAAiG,mBAA1EA,EAAe9K,IAAcD,IAAiBC,GAAW8K,gBACjFH,EAAS5H,KAAK+H,IAAiBA,CAelC,IAAIlX,GAAWkX,GACbjD,GAAiB,SAAUzD,GACzB,GAAIvH,GAAK6N,GAIT,OAHAZ,GAAcjN,GAAMuH,EACpB0G,EAAa,WAAcpB,EAAQ7M,KAE5BA,OAEJ,IAAuB,mBAAZkO,UAAyD,wBAA3BpZ,SAASlB,KAAKsa,SAC5DlD,GAAiB,SAAUzD,GACzB,GAAIvH,GAAK6N,GAIT,OAHAZ,GAAcjN,GAAMuH,EACpB2G,QAAQC,SAAS,WAActB,EAAQ7M,KAEhCA,OAEJ,IAAIkN,IAAwB,CACjC,GAAIU,GAAa,iBAAmBnV,KAAK2V,QASrCpW,IAAKsE,iBACPtE,GAAKsE,iBAAiB,UAAWkR,GAAqB,GAC7CxV,GAAKqW,YACdrW,GAAKqW,YAAY,YAAab,GAE9BxV,GAAKuV,UAAYC,EAGnBxC,GAAiB,SAAUzD,GACzB,GAAIvH,GAAK6N,GAGT,OAFAZ,GAAcjN,GAAMuH,EACpBvP,GAAKmV,YAAYS,EAAa3N,UAAW,KAClCD,OAEJ,IAAMhI,GAAKsW,eAAgB,CAChC,GAAIC,GAAU,GAAIvW,IAAKsW,cAEvBC,GAAQC,MAAMjB,UAAY,SAAU5c,GAAKkc,EAAQlc,EAAE+c,OAEnD1C,GAAiB,SAAUzD,GACzB,GAAIvH,GAAK6N,GAGT,OAFAZ,GAAcjN,GAAMuH,EACpBgH,EAAQE,MAAMtB,YAAYnN,GACnBA,OAITgL,IAFS,YAAchT,KAAQ,sBAAwBA,IAAK+N,SAAS2I,cAAc,UAElE,SAAUnH,GACzB,GAAIoH,GAAgB3W,GAAK+N,SAAS2I,cAAc,UAC5C1O,EAAK6N,GAUT,OATAZ,GAAcjN,GAAMuH,EAEpBoH,EAAcC,mBAAqB,WACjC/B,EAAQ7M,GACR2O,EAAcC,mBAAqB,KACnCD,EAAcE,WAAWC,YAAYH,GACrCA,EAAgB,MAElB3W,GAAK+N,SAASgJ,gBAAgBC,YAAYL,GACnC3O,GAIQ,SAAUuH,GACzB,GAAIvH,GAAK6N,GAMT,OALAZ,GAAcjN,GAAMuH,EACpB+E,GAAgB,WACdO,EAAQ7M,IACP,GAEIA,KAQb,IA6PIiP,IA7PAnP,GAAmB6I,GAAUtH,QAAUsH,GAAU,WAAa,WAEhE,QAASyC,GAAY/C,EAAOd,GAC1B,GAAItO,GAAYxI,KAAMmX,EAAa,GAAIhO,IACnCoG,EAAKgL,GAAe,YACrBpD,EAAWrL,YAAcqL,EAAW7N,cAAcwN,EAAOtO,EAAWoP,KAEvE,OAAO,IAAIzL,IAAoBgL,EAAYJ,GAAiB,WAC1DyD,GAAYjL,MAIhB,QAAS6I,GAAiBR,EAAOnL,EAASqK,GACxC,GAAItO,GAAYxI,KAAM+Z,EAAK7B,GAAUY,UAAUrM,GAAU0K,EAAa,GAAIhO,GAC1E,IAAW,IAAP4Q,EAAY,MAAOvR,GAAUmQ,kBAAkBf,EAAOd,EAC1D,IAAIvH,GAAKsM,GAAgB,YACtB1E,EAAWrL,YAAcqL,EAAW7N,cAAcwN,EAAOtO,EAAWoP,KACpEmC,EACH,OAAO,IAAI5N,IAAoBgL,EAAYJ,GAAiB,WAC1D+E,GAAkBvM,MAItB,QAAS8I,GAAiBT,EAAOnL,EAASqK,GACxC,MAAO9W,MAAK4Y,6BAA6BhB,EAAOnL,EAAUzM,KAAKiN,MAAO6J,GAGxE,MAAO,IAAIoB,IAAUhF,GAAYyH,EAAavC,EAAkBC,MAM9DoG,GAAe7L,GAAG6L,aAAe,WACnC,QAASA,GAAaxQ,EAAMjJ,EAAO0I,EAAWY,EAAQoQ,EAAkBra,GACtErE,KAAKiO,KAAOA,EACZjO,KAAKgF,MAAQA,EACbhF,KAAK0N,UAAYA,EACjB1N,KAAK2e,QAAUrQ,EACftO,KAAK4e,kBAAoBF,EACzB1e,KAAKqE,SAAWA,EAoClB,MAxBAoa,GAAaza,UAAUsK,OAAS,SAAUuQ,EAAkB3T,EAASE,GACnE,MAAOyT,IAAgD,gBAArBA,GAChC7e,KAAK4e,kBAAkBC,GACvB7e,KAAK2e,QAAQE,EAAkB3T,EAASE,IAU5CqT,EAAaza,UAAU8a,aAAe,SAAUtW,GAC9C,GAAIwE,GAAOhN,IAEX,OADA0I,IAAYF,KAAeA,EAAYiS,IAChC,GAAIxR,IAAoB,SAAUZ,GACvC,MAAOG,GAAUmQ,kBAAkB3L,EAAM,SAAUqM,EAAGtL,GACpDA,EAAa6Q,kBAAkBvW,GACT,MAAtB0F,EAAaE,MAAgB5F,EAAS+C,mBAKrCqT,KAQLM,GAA2BN,GAAaO,aAAgB,WACxD,QAASL,GAAQxT,GAAU,MAAOA,GAAOnL,KAAKgF,OAC9C,QAAS4Z,GAAkBvW,GAAY,MAAOA,GAAS8C,OAAOnL,KAAKgF,OACnE,QAASX,KAAa,MAAO,UAAYrE,KAAKgF,MAAQ,IAEtD,MAAO,UAAUA,GACf,MAAO,IAAIyZ,IAAa,IAAKzZ,EAAO,KAAM2Z,EAASC,EAAmBva,OASxE4a,GAA4BR,GAAaS,cAAiB,WAC5D,QAASP,GAASxT,EAAQD,GAAW,MAAOA,GAAQlL,KAAK0N,WACzD,QAASkR,GAAkBvW,GAAY,MAAOA,GAAS6C,QAAQlL,KAAK0N,WACpE,QAASrJ,KAAc,MAAO,WAAarE,KAAK0N,UAAY,IAE5D,MAAO,UAAUxN,GACf,MAAO,IAAIue,IAAa,IAAK,KAAMve,EAAGye,EAASC,EAAmBva,OAQlE8a,GAAgCV,GAAaW,kBAAqB,WACpE,QAAST,GAASxT,EAAQD,EAASE,GAAe,MAAOA,KACzD,QAASwT,GAAkBvW,GAAY,MAAOA,GAAS+C,cACvD,QAAS/G,KAAc,MAAO,gBAE9B,MAAO,YACL,MAAO,IAAIoa,IAAa,IAAK,KAAM,KAAME,EAASC,EAAmBva,OAOrEgb,GAAWzM,GAAGyM,SAAW,aASzBC,GAAiBD,GAAStL,OAAS,SAAU5I,EAAQD,EAASE,GAIhE,MAHAD,KAAWA,EAAS8H,IACpB/H,IAAYA,EAAUqI,IACtBnI,IAAgBA,EAAc6H,IACvB,GAAIsM,IAAkBpU,EAAQD,EAASE,IAO5CoU,GAAmB5M,GAAGC,UAAU2M,iBAAoB,SAAUC,GAMhE,QAASD,KACPxf,KAAKqK,WAAY,EAoDnB,MA1DAqL,IAAS8J,EAAkBC,GAU3BD,EAAiBxb,UAAUyN,KAAO2C,GAClCoL,EAAiBxb,UAAU1D,MAAQ8T,GACnCoL,EAAiBxb,UAAU0b,UAAYtL,GAMvCoL,EAAiBxb,UAAUmH,OAAS,SAAUnG,IAC3ChF,KAAKqK,WAAarK,KAAKyR,KAAKzM,IAO/Bwa,EAAiBxb,UAAUkH,QAAU,SAAU5K,GACxCN,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAKM,MAAMA,KAOfkf,EAAiBxb,UAAUoH,YAAc,WAClCpL,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAK0f,cAOTF,EAAiBxb,UAAUmL,QAAU,WAAcnP,KAAKqK,WAAY,GAEpEmV,EAAiBxb,UAAU2b,KAAO,SAAUzf,GAC1C,MAAKF,MAAKqK,WAMH,GALLrK,KAAKqK,WAAY,EACjBrK,KAAKM,MAAMJ,IACJ,IAMJsf,GACPH,IAKEE,GAAoB3M,GAAG2M,kBAAqB,SAAUE,GASxD,QAASF,GAAkBpU,EAAQD,EAASE,GAC1CqU,EAAUtc,KAAKnD,MACfA,KAAK4f,QAAUzU,EACfnL,KAAK6f,SAAW3U,EAChBlL,KAAK8f,aAAe1U,EA0BtB,MAtCAsK,IAAS6J,EAAmBE,GAmB5BF,EAAkBvb,UAAUyN,KAAO,SAAUzM,GAC3ChF,KAAK4f,QAAQ5a,IAOfua,EAAkBvb,UAAU1D,MAAQ,SAAUA,GAC5CN,KAAK6f,SAASvf,IAMhBif,EAAkBvb,UAAU0b,UAAY,WACtC1f,KAAK8f,gBAGAP,GACPC,IAOEO,GAAanN,GAAGmN,WAAa,WAE/B,QAASC,GAAchT,EAAMzD,GAC3B,MAAO,UAAU1I,GACf,GAAIof,GAAapf,EAAEqK,OAMnB,OALArK,GAAEqK,QAAU,SAAUhL,GACpBG,EAAmBH,EAAG8M,GACtBiT,EAAW9c,KAAKtC,EAAGX,IAGdqJ,EAAUpG,KAAK6J,EAAMnM,IAIhC,QAASkf,GAAWxW,GAClB,GAAIqJ,GAAGE,OAAOa,kBAAoBnT,GAAW,CAC3C,GAAIN,GAAI+K,GAAS7K,GAAS,GAAIgC,QAASlC,CACvCF,MAAKS,MAAQP,EAAEO,MAAMyc,UAAUhd,EAAEO,MAAMC,QAAQ,MAAQ,GACvDV,KAAKkgB,WAAaF,EAAchgB,KAAMuJ,OAEtCvJ,MAAKkgB,WAAa3W,EA0DtB,MAtDAiV,IAAkBuB,EAAW/b,UAO7B+b,EAAWI,aAAe,SAAUtf,GAClC,MAAOA,IAAKyF,GAAWzF,EAAE0I,YAU3BiV,GAAgBjV,UAAYiV,GAAgB4B,QAAU,SAAUC,EAAWnV,EAASE,GAClF,MAAOpL,MAAKkgB,WAAgC,gBAAdG,GAC5BA,EACAf,GAAee,EAAWnV,EAASE,KASvCoT,GAAgB8B,gBAAkB,SAAUnV,EAAQ4J,GAClD,MAAO/U,MAAKkgB,WAAWZ,GAAkC,mBAAZvK,GAA0B,SAASxK,GAAKY,EAAOhI,KAAK4R,EAASxK,IAAQY,KASpHqT,GAAgB+B,iBAAmB,SAAUrV,EAAS6J,GACpD,MAAO/U,MAAKkgB,WAAWZ,GAAe,KAAyB,mBAAZvK,GAA0B,SAAS7U,GAAKgL,EAAQ/H,KAAK4R,EAAS7U,IAAQgL,KAS3HsT,GAAgBgC,qBAAuB,SAAUpV,EAAa2J,GAC5D,MAAO/U,MAAKkgB,WAAWZ,GAAe,KAAM,KAAyB,mBAAZvK,GAA0B,WAAa3J,EAAYjI,KAAK4R,IAAc3J,KAG1H2U,KAGLU,GAAoB7N,GAAGC,UAAU4N,kBAAqB,SAAUhB,GAGlE,QAASgB,GAAkBjY,EAAWH,GACpCoX,EAAUtc,KAAKnD,MACfA,KAAKwI,UAAYA,EACjBxI,KAAKqI,SAAWA,EAChBrI,KAAK0gB,YAAa,EAClB1gB,KAAK2gB,YAAa,EAClB3gB,KAAK8a,SACL9a,KAAKmX,WAAa,GAAI9N,IAiDxB,MA1DAqM,IAAS+K,EAAmBhB,GAY5BgB,EAAkBzc,UAAUyN,KAAO,SAAUzM,GAC3C,GAAIgI,GAAOhN,IACXA,MAAK8a,MAAMpZ,KAAK,WAAcsL,EAAK3E,SAAS8C,OAAOnG,MAGrDyb,EAAkBzc,UAAU1D,MAAQ,SAAUJ,GAC5C,GAAI8M,GAAOhN,IACXA,MAAK8a,MAAMpZ,KAAK,WAAcsL,EAAK3E,SAAS6C,QAAQhL,MAGtDugB,EAAkBzc,UAAU0b,UAAY,WACtC,GAAI1S,GAAOhN,IACXA,MAAK8a,MAAMpZ,KAAK,WAAcsL,EAAK3E,SAAS+C,iBAG9CqV,EAAkBzc,UAAU4c,aAAe,WACzC,GAAIC,IAAU,GACT7gB,KAAK2gB,YAAc3gB,KAAK8a,MAAMrb,OAAS,IAC1CohB,GAAW7gB,KAAK0gB,WAChB1gB,KAAK0gB,YAAa,GAEhBG,GACF7gB,KAAKmX,WAAW7N,cAActJ,KAAKwI,UAAUyR,2BAA2Bja,KAAM,SAAUsI,EAAQ0E,GAC9F,GAAI8T,EACJ,MAAIxY,EAAOwS,MAAMrb,OAAS,GAIxB,YADA6I,EAAOoY,YAAa,EAFpBI,GAAOxY,EAAOwS,MAAMzM,OAKtB,IAAI2C,GAAM/F,GAAS6V,IACnB,OAAI9P,KAAQ7Q,IACVmI,EAAOwS,SACPxS,EAAOqY,YAAa,EACbvgB,EAAQ4Q,EAAI9Q,QAErB8M,GAAK1E,OAKXmY,EAAkBzc,UAAUmL,QAAU,WACpCsQ,EAAUzb,UAAUmL,QAAQhM,KAAKnD,MACjCA,KAAKmX,WAAWhI,WAGXsR,GACPjB,IAEEuB,GAAiBnO,GAAGmO,eAAkB,SAAUtB,GAGlD,QAASuB,GAAcC,GACrB,MAAOA,IAAc3a,GAAW2a,EAAW9R,SAAW8R,EACpD3a,GAAW2a,GAAclK,GAAiBkK,GAAcjK,GAG5D,QAAS1N,GAAczC,EAAG+Q,GACxB,GAAIsJ,GAAMtJ,EAAM,GAAI5K,EAAO4K,EAAM,GAC7BuJ,EAAMlW,GAAS+B,EAAKoU,eAAeje,KAAK6J,EAAMkU,EAElD,OAAIC,KAAQhhB,IACN+gB,EAAIvB,KAAKxf,GAASD,OAExBghB,GAAI5X,cAAc0X,EAAcG,IAFK/gB,EAAQD,GAASD,GAKxD,QAASqJ,GAAUlB,GACjB,GAAI6Y,GAAM,GAAIG,IAAmBhZ,GAAWuP,GAASsJ,EAAKlhB,KAO1D,OALI2I,IAAuBsS,mBACzBtS,GAAuBgQ,kBAAkBf,EAAOtO,GAEhDA,EAAc,KAAMsO,GAEfsJ,EAGT,QAASH,KACPtB,EAAUtc,KAAKnD,KAAMuJ,GAKvB,MAlCAmM,IAASqL,EAAgBtB,GAgCzBsB,EAAe/c,UAAUod,cAAgBhN,GAElC2M,GACPhB,IAEAuB,GAAqB,SAAS7B,GAI9B,QAAS6B,GAAkBxgB,EAAQ+J,EAAU2G,EAAgBuD,GACzD/U,KAAKwR,eAAiBoB,GAAGI,QAAQ1M,WAAWkL,GACxCA,EAAiB,KAErBxR,KAAK6K,SAAW+H,GAAGC,UAAUgC,aAAajC,GAAGI,QAAQ1M,WAAWuE,GAAYA,EAAW,WAAa,MAAOA,IAAakK,EAAS,GACjI/U,KAAKc,OAASA,EAEd2e,EAAUtc,KAAKnD,MAQnB,QAAS8J,GAAczB,EAAUwC,EAAU2G,EAAgB1Q,GACvDd,KAAKJ,EAAI,EACTI,KAAK6K,SAAWA,EAChB7K,KAAKwR,eAAiBA,EACtBxR,KAAKc,OAASA,EACdd,KAAKqK,WAAY,EACjBrK,KAAKa,EAAIwH,EAmCb,MA1DAqN,IAAS4L,EAAmB7B,GAa5B6B,EAAkBtd,UAAUod,cAAgB,SAASvgB,GACjD,MAAOb,MAAKc,OAAOyI,UAAU,GAAIO,GAAcjJ,EAAGb,KAAK6K,SAAU7K,KAAKwR,eAAgBxR,QAY1F8J,EAAc9F,UAAUud,YAAc,SAAS1e,EAAQ0H,EAAG3K,GACtD,MAAOI,MAAKwR,eACR3O,EAAO2e,IAAI,SAASpO,EAAGqO,GAAM,MAAOzhB,MAAKwR,eAAejH,EAAG6I,EAAGxT,EAAG6hB,IAAQzhB,MACzE6C,GAGRiH,EAAc9F,UAAUmH,OAAS,SAASZ,GAEtC,IAAIvK,KAAKqK,UAAT,CAEA,GAAIzK,GAAII,KAAKJ,IACTiD,EAASoI,GAASjL,KAAK6K,UAAUN,EAAG3K,EAAGI,KAAKc,OAEhD,IAAI+B,IAAW1C,GACX,MAAOH,MAAKa,EAAEqK,QAAQrI,EAAO3C,EAGjC0S,IAAGI,QAAQpD,UAAU/M,KAAYA,EAAS+P,GAAGmN,WAAW2B,YAAY7e,KACnE+P,GAAGI,QAAQ2B,YAAY9R,IAAW+P,GAAGI,QAAQ0B,WAAW7R,MAAaA,EAAS+P,GAAGmN,WAAW4B,KAAK9e,IAElG7C,KAAKa,EAAEsK,OAAOnL,KAAKuhB,YAAY1e,EAAQ0H,EAAG3K,MAI9CkK,EAAc9F,UAAUkH,QAAU,SAAShL,GACnCF,KAAKqK,YAAarK,KAAKqK,WAAY,EAAMrK,KAAKa,EAAEqK,QAAQhL,KAGhE4J,EAAc9F,UAAUoH,YAAc,WAC7BpL,KAAKqK,YAAYrK,KAAKqK,WAAY,EAAMrK,KAAKa,EAAEuK,gBAGjDkW,GAETP,IAEIa,GAAahP,GAAGC,UAAU+O,WAAa,aAEvCC,GAA8B,SAASpC,GAEzC,QAASoC,GAA2B9L,GAClC/V,KAAK+V,QAAUA,EACf0J,EAAUtc,KAAKnD,MA4BjB,QAAS8J,GAAcjJ,EAAGgG,EAAG3G,GAC3BF,KAAKa,EAAIA,EACTb,KAAK6G,EAAIA,EACT7G,KAAKE,EAAIA,EACTF,KAAKqK,WAAY,EAyBnB,MA5DAqL,IAASmM,EAA4BpC,GAMrCoC,EAA2B7d,UAAUod,cAAgB,SAAUvgB,GAC7D,GAAIiL,GAAY1C,EAAe,GAAIC,IAC/BoE,EAAagN,GAAmBR,2BAA2Bja,KAAK+V,QAAQpO,MAAe,SAAUzH,EAAG8M,GACtG,IAAIlB,EAAJ,CACA,GAAIgW,GAAc7W,GAAS/K,EAAEuR,MAAMtO,KAAKjD,EACxC,IAAI4hB,IAAgB3hB,GAAY,MAAOU,GAAEqK,QAAQ4W,EAAY5hB,EAE7D,IAAI4hB,EAAY7S,KACd,MAAOpO,GAAEuK,aAIX,IAAI2W,GAAeD,EAAY9c,KAC/B4K,IAAUmS,KAAkBA,EAAelS,GAAsBkS,GAEjE,IAAIlV,GAAI,GAAI1D,GACZC,GAAaE,cAAcuD,GAC3BA,EAAEvD,cAAcyY,EAAaxY,UAAU,GAAIO,GAAcjJ,EAAGmM,EAAM9M,OAGpE,OAAO,IAAIiM,IAAoB/C,EAAcqE,EAAYsJ,GAAiB,WACxEjL,GAAa,MAUjBhC,EAAc9F,UAAUmH,OAAS,SAAUZ,GAASvK,KAAKqK,WAAarK,KAAKa,EAAEsK,OAAOZ,IACpFT,EAAc9F,UAAUkH,QAAU,SAAUK,GACrCvL,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQK,KAGnBzB,EAAc9F,UAAUoH,YAAc,WAC/BpL,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAK6G,EAAE7G,KAAKE,KAGhB4J,EAAc9F,UAAUmL,QAAU,WAAcnP,KAAKqK,WAAY,GACjEP,EAAc9F,UAAU2b,KAAO,SAAUpU,GACvC,MAAKvL,MAAKqK,WAKH,GAJLrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQK,IACR,IAKJsW,GACPd,GAEFa,IAAW5d,UAAUge,OAAS,WAC5B,MAAO,IAAIH,IAA2B7hB,MAGxC,IAAIiiB,IAAwB,SAASxC,GAEnC,QAASwC,GAAqBlM,GAC5B/V,KAAK+V,QAAUA,EACf0J,EAAUtc,KAAKnD,MAgCjB,MAnCA0V,IAASuM,EAAsBxC,GAM/BwC,EAAqBje,UAAUod,cAAgB,SAAUvgB,GACvD,GAEIiL,GAFA5L,EAAIF,KAAK+V,QAAQpO,MAELyB,EAAe,GAAIC,IAC/BoE,EAAagN,GAAmBR,2BAA2B,KAAM,SAAUiI,EAAelV,GAC5F,IAAIlB,EAAJ,CACA,GAAIgW,GAAc7W,GAAS/K,EAAEuR,MAAMtO,KAAKjD,EACxC,IAAI4hB,IAAgB3hB,GAAY,MAAOU,GAAEqK,QAAQ4W,EAAY5hB,EAE7D,IAAI4hB,EAAY7S,KACd,MAAyB,QAAlBiT,EAAyBrhB,EAAEqK,QAAQgX,GAAiBrhB,EAAEuK,aAI/D,IAAI2W,GAAeD,EAAY9c,KAC/B4K,IAAUmS,KAAkBA,EAAelS,GAAsBkS,GAEjE,IAAIlV,GAAI,GAAI1D,GACZC,GAAaE,cAAcuD,GAC3BA,EAAEvD,cAAcyY,EAAaxY,UAC3B,SAASgB,GAAK1J,EAAEsK,OAAOZ,IACvByC,EACA,WAAanM,EAAEuK,mBAEnB,OAAO,IAAIe,IAAoB/C,EAAcqE,EAAYsJ,GAAiB,WACxEjL,GAAa,MAIVmW,GACPlB,GAEFa,IAAW5d,UAAUme,WAAa,WAChC,MAAO,IAAIF,IAAqBjiB,OAGlC4hB,GAAW5d,UAAUoe,eAAiB,SAAUC,GAC9C,GAAItM,GAAU/V,IACd,OAAO,IAAIiJ,IAAoB,SAAUpI,GACvC,GAOIiL,GACFoW,EAREI,EAAa,GAAIC,IACnBC,EAAW,GAAID,IACfE,EAAUJ,EAAoBC,GAC9BI,EAAyBD,EAAQlZ,UAAUiZ,GAEzCtiB,EAAI6V,EAAQpO,MAIdyB,EAAe,GAAIC,IACjBoE,EAAagN,GAAmBT,kBAAkB,SAAUhN,GAC9D,IAAIlB,EAAJ,CACA,GAAIgW,GAAc7W,GAAS/K,EAAEuR,MAAMtO,KAAKjD,EACxC,IAAI4hB,IAAgB3hB,GAAY,MAAOU,GAAEqK,QAAQ4W,EAAY5hB,EAE7D,IAAI4hB,EAAY7S,KAMd,YALIiT,EACFrhB,EAAEqK,QAAQgX,GAEVrhB,EAAEuK,cAMN,IAAI2W,GAAeD,EAAY9c,KAC/B4K,IAAUmS,KAAkBA,EAAelS,GAAsBkS,GAEjE,IAAIY,GAAQ,GAAIxZ,IACZyZ,EAAQ,GAAIzZ,GAChBC,GAAaE,cAAc,GAAI6C,IAAoByW,EAAOD,IAC1DA,EAAMrZ,cAAcyY,EAAaxY,UAC/B,SAASgB,GAAK1J,EAAEsK,OAAOZ,IACvB,SAAUsY,GACRD,EAAMtZ,cAAckZ,EAASjZ,UAAUyD,EAAM,SAAS8V,GACpDjiB,EAAEqK,QAAQ4X,IACT,WACDjiB,EAAEuK,iBAGJkX,EAAWnX,OAAO0X,IAEpB,WAAahiB,EAAEuK,mBAGnB,OAAO,IAAIe,IAAoBuW,EAAwBtZ,EAAcqE,EAAYsJ,GAAiB,WAChGjL,GAAa,OAKnB,IAAIiX,IAAoB,SAAUtD,GAGhC,QAASsD,GAAiBC,EAAGC,GAC3BjjB,KAAKgjB,EAAIA,EACThjB,KAAKijB,EAAS,MAALA,EAAY,GAAKA,EAM5B,QAASC,GAAiBzY,GACxBzK,KAAKgjB,EAAIvY,EAAEuY,EACXhjB,KAAKmjB,EAAI1Y,EAAEwY,EAQb,MApBAvN,IAASqN,EAAkBtD,GAM3BsD,EAAiB/e,UAAU2D,IAAc,WACvC,MAAO,IAAIub,GAAiBljB,OAO9BkjB,EAAiBlf,UAAUyN,KAAO,WAChC,MAAe,KAAXzR,KAAKmjB,EAAkB1O,IACvBzU,KAAKmjB,EAAI,GAAKnjB,KAAKmjB,KACdlU,MAAM,EAAOjK,MAAOhF,KAAKgjB,KAG7BD,GACPnB,IAEEwB,GAAmBxB,GAAWyB,OAAS,SAAUre,EAAOse,GAC1D,MAAO,IAAIP,IAAiB/d,EAAOse,IAGjCC,GAAgB,SAAS9D,GAE3B,QAAS8D,GAAa1c,EAAG8D,EAAIoK,GAC3B/U,KAAK6G,EAAIA,EACT7G,KAAK2K,GAAKA,EAAKkK,GAAalK,EAAIoK,EAAS,GAAK,KAMhD,QAASyO,GAAa/Y,GACpBzK,KAAKJ,EAAI,GACTI,KAAK6G,EAAI4D,EAAE5D,EACX7G,KAAKmjB,EAAInjB,KAAK6G,EAAEpH,OAChBO,KAAK2K,GAAKF,EAAEE,GAQd,MArBA+K,IAAS6N,EAAc9D,GAKvB8D,EAAavf,UAAU2D,IAAc,WACnC,MAAO,IAAI6b,GAAaxjB,OAS1BwjB,EAAaxf,UAAUyN,KAAO,WAC7B,QAASzR,KAAKJ,EAAII,KAAKmjB,GACnBlU,MAAM,EAAOjK,MAAQhF,KAAK2K,GAAsB3K,KAAK2K,GAAG3K,KAAK6G,EAAE7G,KAAKJ,GAAII,KAAKJ,EAAGI,KAAK6G,GAAtD7G,KAAK6G,EAAE7G,KAAKJ,IAC7C6U,IAGI8O,GACP3B,IAEE6B,GAAe7B,GAAW8B,GAAK,SAAU5iB,EAAQ+J,EAAUkK;AAC7D,MAAO,IAAIwO,IAAaziB,EAAQ+J,EAAUkK,IAGxC4O,GAAqB,SAASlE,GAEhC,QAASkE,GAAkB7iB,GACzBd,KAAKc,OAASA,EACd2e,EAAUtc,KAAKnD,MAOjB,QAAS8J,GAAcjJ,GACrBb,KAAKa,EAAIA,EACTb,KAAKN,KACLM,KAAKqK,WAAY,EA2BnB,MAxCAqL,IAASiO,EAAmBlE,GAM5BkE,EAAkB3f,UAAUod,cAAgB,SAASvgB,GACnD,MAAOb,MAAKc,OAAOyI,UAAU,GAAIO,GAAcjJ,KAQjDiJ,EAAc9F,UAAUmH,OAAS,SAAUZ,GAASvK,KAAKqK,WAAarK,KAAKN,EAAEgC,KAAK6I,IAClFT,EAAc9F,UAAUkH,QAAU,SAAUhL,GACrCF,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,KAGnB4J,EAAc9F,UAAUoH,YAAc,WAC/BpL,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEsK,OAAOnL,KAAKN,GACnBM,KAAKa,EAAEuK,gBAGXtB,EAAc9F,UAAUmL,QAAU,WAAcnP,KAAKqK,WAAY,GACjEP,EAAc9F,UAAU2b,KAAO,SAAUzf,GACvC,MAAKF,MAAKqK,WAMH,GALLrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,IACR,IAMJyjB,GACP5C,GAMFvC,IAAgBoF,QAAU,WACxB,MAAO,IAAID,IAAkB3jB,OAY/B+f,GAAWhM,OAAS,SAAUxK,EAAWjB,GACvC,MAAO,IAAIW,IAAoBM,EAAWjB,GAW5C,IAAIgF,IAAkByS,GAAW8D,MAAQ,SAAUC,GACjD,MAAO,IAAI7a,IAAoB,SAAUZ,GACvC,GAAIxF,EACJ,KACEA,EAASihB,IACT,MAAO5jB,GACP,MAAOuQ,IAAgBvQ,GAAGqJ,UAAUlB,GAGtC,MADAuH,IAAU/M,KAAYA,EAASgN,GAAsBhN,IAC9CA,EAAO0G,UAAUlB,MAIxB0b,GAAmB,SAAStE,GAE9B,QAASsE,GAAgBvb,GACvBxI,KAAKwI,UAAYA,EACjBiX,EAAUtc,KAAKnD,MAQjB,QAASgkB,GAAU3b,EAAUG,GAC3BxI,KAAKqI,SAAWA,EAChBrI,KAAKwI,UAAYA,EAGnB,QAASyb,GAAapd,EAAG+Q,GAEvB,MADAA,GAAMxM,cACC4L,GAOT,MAzBAtB,IAASqO,EAAiBtE,GAM1BsE,EAAgB/f,UAAUod,cAAgB,SAAU/Y,GAClD,GAAI6b,GAAO,GAAIF,GAAU3b,EAAUrI,KAAKwI,UACxC,OAAO0b,GAAKC,OAadH,EAAUhgB,UAAUmgB,IAAM,WACxB,MAAOnkB,MAAKwI,UAAUmQ,kBAAkB3Y,KAAKqI,SAAU4b,IAGlDF,GACPhD,IAEEqD,GAAmB,GAAIL,IAAgBtJ,IAWvC4J,GAAkBtE,GAAW9I,MAAQ,SAAUzO,GAEjD,MADAE,IAAYF,KAAeA,EAAYiS,IAChCjS,IAAciS,GAAqB2J,GAAmB,GAAIL,IAAgBvb,IAG/E8b,GAAkB,SAAS7E,GAE7B,QAAS6E,GAAeC,EAAUC,EAAQhc,GACxCxI,KAAKukB,SAAWA,EAChBvkB,KAAKwkB,OAASA,EACdxkB,KAAKwI,UAAYA,EACjBiX,EAAUtc,KAAKnD,MAQjB,MAbA0V,IAAS4O,EAAgB7E,GAQzB6E,EAAetgB,UAAUod,cAAgB,SAAUvgB,GACjD,GAAIqjB,GAAO,GAAIO,IAAS5jB,EAAGb,KAC3B,OAAOkkB,GAAKC,OAGPG,GACPvD,IAEE0D,GAAY,WACd,QAASA,GAAS5jB,EAAGyH,GACnBtI,KAAKa,EAAIA,EACTb,KAAKsI,OAASA,EA4BhB,MAzBAmc,GAASzgB,UAAUmgB,IAAM,WAMvB,QAASO,GAAc9kB,EAAG0b,GACxB,GAAI7J,GAAOxG,GAASvD,EAAG+J,MAAMtO,KAAKuE,EAClC,IAAI+J,IAAStR,GAAY,MAAOU,GAAEqK,QAAQuG,EAAKvR,EAC/C,IAAIuR,EAAKxC,KAAQ,MAAOpO,GAAEuK,aAE1B,IAAIvI,GAAS4O,EAAKzM,KAElB,OAAIsB,IAAWke,KACb3hB,EAASoI,GAASuZ,GAAQ3hB,EAAQjD,GAC9BiD,IAAW1C,IAAmBU,EAAEqK,QAAQrI,EAAO3C,IAGrDW,EAAEsK,OAAOtI,OACTyY,GAAQ1b,EAAI,IAlBd,GAAI+kB,GAAOve,OAAOpG,KAAKsI,OAAOic,UAC1B7c,EAAKD,EAAYkd,GACjB9jB,EAAIb,KAAKa,EACT2jB,EAASxkB,KAAKsI,OAAOkc,MAkBzB,OAAOxkB,MAAKsI,OAAOE,UAAUyR,2BAA2B,EAAGyK,IAGtDD,KAGLtc,GAAiBH,KAAK4c,IAAI,EAAG,IAAM,CAMvChe,GAAe5C,UAAU2D,IAAc,WACrC,MAAO,IAAIZ,GAAe/G,KAAK8G,KASjCC,EAAe/C,UAAU2D,IAAc,WACrC,MAAO3H,OAGT+G,EAAe/C,UAAUyN,KAAO,WAC9B,MAAOzR,MAAKiH,GAAKjH,KAAKgH,IAAOiI,MAAM,EAAOjK,MAAOhF,KAAK8G,GAAG+d,OAAO7kB,KAAKiH,OAAUwN,IAOjFvN,EAAclD,UAAU2D,IAAc,WACpC,MAAO,IAAIP,GAAcpH,KAAKmH,KAShCC,EAAcpD,UAAU2D,IAAc,WACpC,MAAO3H,OAGToH,EAAcpD,UAAUyN,KAAO,WAC7B,MAAOzR,MAAKiH,GAAKjH,KAAKgH,IAAOiI,MAAM,EAAOjK,MAAOhF,KAAKmH,GAAGnH,KAAKiH,OAAUwN,GAiD1E,IAAIqQ,IAAiB/E,GAAW4B,KAAO,SAAU4C,EAAUQ,EAAOhQ,EAASvM,GACzE,GAAgB,MAAZ+b,EACF,KAAM,IAAIniB,OAAM,2BAElB,IAAI2iB,IAAUze,GAAWye,GACvB,KAAM,IAAI3iB,OAAM,yCAElB,IAAI2iB,EACF,GAAIP,GAAS3P,GAAakQ,EAAOhQ,EAAS,EAG5C,OADArM,IAAYF,KAAeA,EAAYG,IAChC,GAAI2b,IAAeC,EAAUC,EAAQhc,IAG1CI,GAAuB,SAAS6W,GAElC,QAAS7W,GAAoBe,EAAMnB,GACjCxI,KAAK2J,KAAOA,EACZ3J,KAAKwI,UAAYA,EACjBiX,EAAUtc,KAAKnD,MAQjB,MAZA0V,IAAS9M,EAAqB6W,GAO9B7W,EAAoB5E,UAAUod,cAAgB,SAAU/Y,GACtD,GAAI6b,GAAO,GAAI9b,GAAcC,EAAUrI,KACvC,OAAOkkB,GAAKC,OAGPvb,GACPmY,GAOF3Y,GAAcpE,UAAUmgB,IAAM,WAE5B,QAASO,GAAc9kB,EAAG0b,GAChB9b,EAAJI,GACFyI,EAAS8C,OAAOxB,EAAK/J,IACrB0b,EAAQ1b,EAAI,IAEZyI,EAAS+C,cANb,GAAI/C,GAAWrI,KAAKqI,SAAUsB,EAAO3J,KAAKsI,OAAOqB,KAAMnK,EAAMmK,EAAKlK,MAUlE,OAAOO,MAAKsI,OAAOE,UAAUyR,2BAA2B,EAAGyK,GAS7D,IAAIM,IAAsBjF,GAAWkF,UAAY,SAAUxc,EAAOD,GAEhE,MADAE,IAAYF,KAAeA,EAAYG,IAChC,GAAIC,IAAoBH,EAAOD,IAGpC0c,GAAmB,SAASzF,GAE9B,QAASyF,KACPzF,EAAUtc,KAAKnD,MAOjB,MATA0V,IAASwP,EAAiBzF,GAK1ByF,EAAgBlhB,UAAUod,cAAgB,SAAU/Y,GAClD,MAAO2O,KAGFkO,GACPnE,IAEEoE,GAAmB,GAAID,IAMvB1U,GAAkBuP,GAAWqF,MAAQ,WACvC,MAAOD,IAYTpF,IAAW2D,GAAK,WAEd,IAAI,GADAlkB,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,GACrCI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EACnD,OAAO,IAAIgJ,IAAoBe,EAAMhB,KAQvCoX,GAAWsF,gBAAkB,SAAU7c,GAErC,IAAI,GADAhJ,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,EAAM,GAC3CI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,EAAI,GAAKK,UAAUL,EACvD,OAAO,IAAIgJ,IAAoBe,EAAMnB,GAGvC,IAAI8c,IAAmB,SAAS7F,GAE9B,QAAS6F,GAAgBxP,EAAKtN,GAC5BxI,KAAK8V,IAAMA,EACX9V,KAAKulB,KAAOnf,OAAOmf,KAAKzP,GACxB9V,KAAKwI,UAAYA,EACjBiX,EAAUtc,KAAKnD,MAQjB,MAbA0V,IAAS4P,EAAiB7F,GAQ1B6F,EAAgBthB,UAAUod,cAAgB,SAAU/Y,GAClD,GAAI6b,GAAO,GAAIrb,GAAUR,EAAUrI,KACnC,OAAOkkB,GAAKC,OAGPmB,GACPvE,GAOFlY,GAAU7E,UAAUmgB,IAAM,WAExB,QAASO,GAAc9kB,EAAG0b,GACxB,GAAQ9b,EAAJI,EAAS,CACX,GAAI6D,GAAM8hB,EAAK3lB,EACfyI,GAAS8C,QAAQ1H,EAAKqS,EAAIrS,KAC1B6X,EAAQ1b,EAAI,OAEZyI,GAAS+C,cAPb,GAAI/C,GAAWrI,KAAKqI,SAAUyN,EAAM9V,KAAKsI,OAAOwN,IAAKyP,EAAOvlB,KAAKsI,OAAOid,KAAM/lB,EAAM+lB,EAAK9lB,MAWzF,OAAOO,MAAKsI,OAAOE,UAAUyR,2BAA2B,EAAGyK,IAS7D3E,GAAWyF,MAAQ,SAAU1P,EAAKtN,GAEhC,MADAA,KAAcA,EAAYG,IACnB,GAAI2c,IAAgBxP,EAAKtN,GAGhC,IAAIid,IAAmB,SAAShG,GAEhC,QAASgG,GAAgB5W,EAAOnI,EAAO8B,GACrCxI,KAAK6O,MAAQA,EACb7O,KAAK0lB,WAAahf,EAClB1G,KAAKwI,UAAYA,EACjBiX,EAAUtc,KAAKnD,MAQjB,MAbA0V,IAAS+P,EAAiBhG,GAQ1BgG,EAAgBzhB,UAAUod,cAAgB,SAAU/Y,GAClD,GAAI6b,GAAO,GAAIyB,IAAUtd,EAAUrI,KACnC,OAAOkkB,GAAKC,OAGPsB,GACP1E,IAEE4E,GAAa,WACf,QAASA,GAAUtd,EAAUC,GAC3BtI,KAAKqI,SAAWA,EAChBrI,KAAKsI,OAASA,EAiBhB,MAdAqd,GAAU3hB,UAAUmgB,IAAM,WAExB,QAASO,GAAc9kB,EAAG0b,GAChB5U,EAAJ9G,GACFyI,EAAS8C,OAAO0D,EAAQjP,GACxB0b,EAAQ1b,EAAI,IAEZyI,EAAS+C,cANb,GAAIyD,GAAQ7O,KAAKsI,OAAOuG,MAAOnI,EAAQ1G,KAAKsI,OAAOod,WAAYrd,EAAWrI,KAAKqI,QAU/E,OAAOrI,MAAKsI,OAAOE,UAAUyR,2BAA2B,EAAGyK,IAGtDiB,IAUT5F,IAAW6F,MAAQ,SAAU/W,EAAOnI,EAAO8B,GAEzC,MADAE,IAAYF,KAAeA,EAAYG,IAChC,GAAI8c,IAAgB5W,EAAOnI,EAAO8B,GAG3C,IAAIqd,IAAoB,SAASpG,GAE/B,QAASoG,GAAiB7gB,EAAOse,EAAa9a,GAC5CxI,KAAKgF,MAAQA,EACbhF,KAAKsjB,YAA6B,MAAfA,EAAsB,GAAKA,EAC9CtjB,KAAKwI,UAAYA,EACjBiX,EAAUtc,KAAKnD,MAQjB,MAbA0V,IAASmQ,EAAkBpG,GAQ3BoG,EAAiB7hB,UAAUod,cAAgB,SAAU/Y,GACnD,GAAI6b,GAAO,GAAIpb,GAAWT,EAAUrI,KACpC,OAAOkkB,GAAKC,OAGP0B,GACP9E,GAOFjY,GAAW9E,UAAUmgB,IAAM,WAEzB,QAASO,GAAc9kB,EAAG0b,GAKxB,OAJU,KAAN1b,GAAYA,EAAI,KAClByI,EAAS8C,OAAOnG,GAChBpF,EAAI,GAAKA,KAED,IAANA,EAAkByI,EAAS+C,kBAC/BkQ,GAAQ1b,GAPV,GAAIyI,GAAWrI,KAAKqI,SAAUrD,EAAQhF,KAAKsI,OAAOtD,KAUlD,OAAOhF,MAAKsI,OAAOE,UAAUyR,2BAA2Bja,KAAKsI,OAAOgb,YAAaoB,IAUnF3E,GAAWsD,OAAS,SAAUre,EAAOse,EAAa9a,GAEhD,MADAE,IAAYF,KAAeA,EAAYG,IAChC,GAAIkd,IAAiB7gB,EAAOse,EAAa9a,GAGlD,IAAIsd,IAAkB,SAASrG,GAE7B,QAASqG,GAAe9gB,EAAOwD,GAC7BxI,KAAKgF,MAAQA,EACbhF,KAAKwI,UAAYA,EACjBiX,EAAUtc,KAAKnD,MAQjB,QAAS+lB,GAAS1d,EAAUrD,EAAOwD,GACjCxI,KAAKqI,SAAWA,EAChBrI,KAAKgF,MAAQA,EACbhF,KAAKwI,UAAYA,EAGnB,QAASyb,GAAapd,EAAG+Q,GACvB,GAAI5S,GAAQ4S,EAAM,GAAIvP,EAAWuP,EAAM,EAGvC,OAFAvP,GAAS8C,OAAOnG,GAChBqD,EAAS+C,cACF4L,GAUT,MAhCAtB,IAASoQ,EAAgBrG,GAOzBqG,EAAe9hB,UAAUod,cAAgB,SAAU/Y,GACjD,GAAI6b,GAAO,GAAI6B,GAAS1d,EAAUrI,KAAKgF,MAAOhF,KAAKwI,UACnD,OAAO0b,GAAKC,OAgBd4B,EAAS/hB,UAAUmgB,IAAM,WACvB,GAAIvM,IAAS5X,KAAKgF,MAAOhF,KAAKqI,SAC9B,OAAOrI,MAAKwI,YAAciS,GACxBwJ,EAAa,KAAMrM,GACnB5X,KAAKwI,UAAUmQ,kBAAkBf,EAAOqM,IAGrC6B,GACP/E,IAcEiF,IALmBjG,GAAW,UAAYA,GAAWkG,KAAO,SAAUjhB,EAAOwD,GAE/E,MADAE,IAAYF,KAAeA,EAAYiS,IAChC,GAAIqL,IAAe9gB,EAAOwD,IAGZ,SAASiX,GAE9B,QAASuG,GAAgB1lB,EAAOkI,GAC9BxI,KAAKM,MAAQA,EACbN,KAAKwI,UAAYA,EACjBiX,EAAUtc,KAAKnD,MAQjB,QAASkmB,GAAUrlB,EAAG4J,GACpBzK,KAAKa,EAAIA,EACTb,KAAKyK,EAAIA,EAGX,QAASwZ,GAAapd,EAAG+Q,GACvB,GAAI1X,GAAI0X,EAAM,GAAI/W,EAAI+W,EAAM,EAC5B/W,GAAEqK,QAAQhL,GAOZ,MA1BAwV,IAASsQ,EAAiBvG,GAO1BuG,EAAgBhiB,UAAUod,cAAgB,SAAUvgB,GAClD,GAAIqjB,GAAO,GAAIgC,GAAUrlB,EAAGb,KAC5B,OAAOkkB,GAAKC,OAad+B,EAAUliB,UAAUmgB,IAAM,WACxB,MAAOnkB,MAAKyK,EAAEjC,UAAUmQ,mBAAmB3Y,KAAKyK,EAAEnK,MAAON,KAAKa,GAAIojB,IAG7D+B,GACPjF,KASEtQ,GAAkBsP,GAAW,SAAW,SAAUzf,EAAOkI,GAE3D,MADAE,IAAYF,KAAeA,EAAYiS,IAChC,GAAIuL,IAAgB1lB,EAAOkI,IAGhCgB,GAAiB,SAASiW,GAE5B,QAASjW,GAAc3I,EAAGgG,EAAG8D,GAC3B3K,KAAKmmB,GAAKtlB,EACVb,KAAK8G,GAAKD,EACV7G,KAAK4L,IAAMjB,EACX8U,EAAUtc,KAAKnD,MAejB,MApBA0V,IAASlM,EAAeiW,GAQxBjW,EAAcxF,UAAUyN,KAAO,SAAUlH,GAAKvK,KAAKmmB,GAAGhb,OAAOZ,IAC7Df,EAAcxF,UAAU0b,UAAY,WAAc,MAAO1f,MAAKmmB,GAAG/a,eACjE5B,EAAcxF,UAAU1D,MAAQ,SAAUJ,GACxC,GAAI2C,GAASoI,GAASjL,KAAK4L,KAAK1L,EAChC,IAAI2C,IAAW1C,GAAY,MAAOH,MAAKmmB,GAAGjb,QAAQrI,EAAO3C,EACzD0P,IAAU/M,KAAYA,EAASgN,GAAsBhN,GAErD,IAAIgK,GAAI,GAAI1D,GACZnJ,MAAK8G,GAAGwC,cAAcuD,GACtBA,EAAEvD,cAAczG,EAAO0G,UAAUvJ,KAAKmmB,MAGjC3c,GACPgW,GAgBFhB,IAAgB,SAAW,SAAU4H,GACnC,MAAO9f,IAAW8f,GAAmBrd,EAAuB/I,KAAMomB,GAAmBC,IAAiBrmB,KAAMomB,IAQ9G,IAAIC,IAAkBtG,GAAW,SAAW,WAC1C,GAAIuG,EACJ,IAAI3mB,MAAM4W,QAAQtW,UAAU,IAC1BqmB,EAAQrmB,UAAU,OACb,CACL,GAAIT,GAAMS,UAAUR,MACpB6mB,GAAQ,GAAI3mB,OAAMH,EAClB,KAAI,GAAII,GAAI,EAAOJ,EAAJI,EAASA,IAAO0mB,EAAM1mB,GAAKK,UAAUL,GAEtD,MAAO6jB,IAAa6C,GAAOnE,aAY7B3D,IAAgB+H,cAAgB,WAE9B,IAAI,GADA/mB,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,GACrCI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EAMnD,OALID,OAAM4W,QAAQ5M,EAAK,IACrBA,EAAK,GAAG5I,QAAQf,MAEhB2J,EAAK5I,QAAQf,MAERumB,GAAcxmB,MAAMC,KAAM2J,GAkBnC,IAAI4c,IAAgBxG,GAAWwG,cAAgB,WAE7C,IAAI,GADA/mB,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,GACrCI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EACnD,IAAI4R,GAAiBlL,GAAWqD,EAAKnK,EAAM,IAAMmK,EAAKnD,MAAQkD,CAG9D,OAFA/J,OAAM4W,QAAQ5M,EAAK,MAAQA,EAAOA,EAAK,IAEhC,GAAIV,IAAoB,SAAUpI,GAOvC,QAAS4Q,GAAK7R,GAEZ,GADAwK,EAASxK,IAAK,EACV+R,IAAgBA,EAAcvH,EAASwH,MAAMC,KAAY,CAC3D,IACE,GAAIb,GAAMQ,EAAezR,MAAM,KAAM2R,GACrC,MAAOxR,GACP,MAAOW,GAAEqK,QAAQhL,GAEnBW,EAAEsK,OAAO6F,OACAc,GAAO0U,OAAO,SAAUjc,EAAGkc,GAAK,MAAOA,KAAM7mB,IAAMgS,MAAMC,KAClEhR,EAAEuK,cAIN,QAAS6D,GAAMrP,GACbkS,EAAOlS,IAAK,EACZkS,EAAOF,MAAMC,KAAahR,EAAEuK,cAI9B,IAAK,GA1BDK,GAAI9B,EAAKlK,OACX2K,EAAW3D,EAAgBgF,EAAGhC,GAC9BkI,GAAc,EACdG,EAASrL,EAAgBgF,EAAGhC,GAC5BiI,EAAS,GAAI/R,OAAM8L,GAqBjBib,EAAgB,GAAI/mB,OAAM8L,GACrBuK,EAAM,EAASvK,EAANuK,EAASA,KACxB,SAAUpW,GACT,GAAIkB,GAAS6I,EAAK/J,GAAI+mB,EAAM,GAAIxd,GAChCyG,IAAU9O,KAAYA,EAAS+O,GAAsB/O,IACrD6lB,EAAIrd,cAAcxI,EAAOyI,UAAU,SAAUgB,GACzCmH,EAAO9R,GAAK2K,EACZkH,EAAK7R,IAEP,SAASM,GAAKW,EAAEqK,QAAQhL,IACxB,WAAc+O,EAAKrP,MAErB8mB,EAAc9mB,GAAK+mB,GACnB3Q,EAGJ,OAAO,IAAI7J,IAAoBua,IAC9B1mB,MAOLwe,IAAgBwD,OAAS,WACvB,IAAI,GAAIrY,MAAW/J,EAAI,EAAGJ,EAAMS,UAAUR,OAAYD,EAAJI,EAASA,IAAO+J,EAAKjI,KAAKzB,UAAUL,GAEtF,OADA+J,GAAK5I,QAAQf,MACN4mB,GAAiB7mB,MAAM,KAAM4J,GAGtC,IAAIkd,IAAoB,SAASpH,GAE/B,QAASoH,GAAiB9Q,GACxB/V,KAAK+V,QAAUA,EACf0J,EAAUtc,KAAKnD,MAQjB,QAAS8mB,GAAW/Q,EAASlV,GAC3Bb,KAAK+V,QAAUA,EACf/V,KAAKa,EAAIA,EA6BX,MA1CA6U,IAASmR,EAAkBpH,GAM3BoH,EAAiB7iB,UAAUod,cAAgB,SAASvgB,GAClD,GAAIqjB,GAAO,GAAI4C,GAAW9mB,KAAK+V,QAASlV,EACxC,OAAOqjB,GAAKC,OAOd2C,EAAW9iB,UAAUmgB,IAAM,WACzB,GAAIrY,GAAY1C,EAAe,GAAIC,IAAoB0M,EAAU/V,KAAK+V,QAAStW,EAASsW,EAAQtW,OAAQoB,EAAIb,KAAKa,EAC7G4M,EAAagN,GAAmBR,2BAA2B,EAAG,SAAUra,EAAGoN,GAC7E,IAAIlB,EAAJ,CACA,GAAIlM,IAAMH,EACR,MAAOoB,GAAEuK,aAIX,IAAI2W,GAAehM,EAAQnW,EAC3BgQ,IAAUmS,KAAkBA,EAAelS,GAAsBkS,GAEjE,IAAIlV,GAAI,GAAI1D,GACZC,GAAaE,cAAcuD,GAC3BA,EAAEvD,cAAcyY,EAAaxY,UAC3B,SAAUgB,GAAK1J,EAAEsK,OAAOZ,IACxB,SAAUrK,GAAKW,EAAEqK,QAAQhL,IACzB,WAAc8M,EAAKpN,EAAI,QAI3B,OAAO,IAAIuM,IAAoB/C,EAAcqE,EAAYsJ,GAAiB,WACxEjL,GAAa,MAKV+a,GACP9F,IAOE6F,GAAmB7G,GAAWiC,OAAS,WACzC,GAAIrY,EACJ,IAAIhK,MAAM4W,QAAQtW,UAAU,IAC1B0J,EAAO1J,UAAU,OACZ,CACL0J,EAAO,GAAIhK,OAAMM,UAAUR,OAC3B,KAAI,GAAIG,GAAI,EAAGJ,EAAMS,UAAUR,OAAYD,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,GAE7E,MAAO,IAAIinB,IAAiBld,GAO9B6U,IAAgBuI,UAAY,WAC1B,MAAO/mB,MAAKgnB,MAAM,GAGpB,IAAIC,IAAmB,SAAUxH,GAG/B,QAASwH,GAAgBnmB,EAAQomB,GAC/BlnB,KAAKc,OAASA,EACdd,KAAKknB,cAAgBA,EACrBzH,EAAUtc,KAAKnD,MASjB,MAdA0V,IAASuR,EAAiBxH,GAQ1BwH,EAAgBjjB,UAAUod,cAAgB,SAAS/Y,GACjD,GAAI8e,GAAI,GAAIhb,GAEZ,OADAgb,GAAE9a,IAAIrM,KAAKc,OAAOyI,UAAU,GAAI6d,IAAc/e,EAAUrI,KAAKknB,cAAeC,KACrEA,GAGFF,GAEPlG,IAEEqG,GAAiB,WACnB,QAASA,GAAcvmB,EAAG0N,EAAK4Y,GAC7BnnB,KAAKa,EAAIA,EACTb,KAAKuO,IAAMA,EACXvO,KAAKmnB,EAAIA,EACTnnB,KAAKiP,MAAO,EACZjP,KAAK2N,KACL3N,KAAKqnB,YAAc,EACnBrnB,KAAKqK,WAAY,EAyCjB,QAASP,GAAcxB,EAAQqe,GAC7B3mB,KAAKsI,OAASA,EACdtI,KAAK2mB,IAAMA,EACX3mB,KAAKqK,WAAY,EAiCnB,MA3EF+c,GAAcpjB,UAAUsjB,gBAAkB,SAAUlR,GAClD,GAAIuQ,GAAM,GAAIxd,GACdnJ,MAAKmnB,EAAE9a,IAAIsa,GACX/W,GAAUwG,KAAQA,EAAKvG,GAAsBuG,IAC7CuQ,EAAIrd,cAAc8M,EAAG7M,UAAU,GAAIO,GAAc9J,KAAM2mB,MAEzDS,EAAcpjB,UAAUmH,OAAS,SAAUoc,GACrCvnB,KAAKqK,YACJrK,KAAKqnB,YAAcrnB,KAAKuO,KACzBvO,KAAKqnB,cACLrnB,KAAKsnB,gBAAgBC,IAErBvnB,KAAK2N,EAAEjM,KAAK6lB,KAGhBH,EAAcpjB,UAAUkH,QAAU,SAAUhL,GACrCF,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,KAGnBknB,EAAcpjB,UAAUoH,YAAc,WAC/BpL,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAKiP,MAAO,EACS,IAArBjP,KAAKqnB,aAAqBrnB,KAAKa,EAAEuK,gBAGrCgc,EAAcpjB,UAAUmL,QAAU,WAAanP,KAAKqK,WAAY,GAChE+c,EAAcpjB,UAAU2b,KAAO,SAAUzf,GACvC,MAAKF,MAAKqK,WAMH,GALLrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,IACR,IAWX4J,EAAc9F,UAAUmH,OAAS,SAAUZ,GAASvK,KAAKqK,WAAarK,KAAKsI,OAAOzH,EAAEsK,OAAOZ,IAC3FT,EAAc9F,UAAUkH,QAAU,SAAUhL,GACrCF,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAKsI,OAAOzH,EAAEqK,QAAQhL,KAG1B4J,EAAc9F,UAAUoH,YAAc,WACpC,IAAIpL,KAAKqK,UAAW,CAClBrK,KAAKqK,WAAY,CACjB,IAAI/B,GAAStI,KAAKsI,MAClBA,GAAO6e,EAAEnY,OAAOhP,KAAK2mB,KACjBre,EAAOqF,EAAElO,OAAS,EACpB6I,EAAOgf,gBAAgBhf,EAAOqF,EAAEU,UAEhC/F,EAAO+e,cACP/e,EAAO2G,MAA+B,IAAvB3G,EAAO+e,aAAqB/e,EAAOzH,EAAEuK,iBAI1DtB,EAAc9F,UAAUmL,QAAU,WAAanP,KAAKqK,WAAY,GAChEP,EAAc9F,UAAU2b,KAAO,SAAUzf,GACvC,MAAKF,MAAKqK,WAMH,GALLrK,KAAKqK,WAAY,EACjBrK,KAAKsI,OAAOzH,EAAEqK,QAAQhL,IACf,IAMJknB,IAiBX5I,IAAgBwI,MAAQ,SAAUQ,GAChC,MAAuC,gBAAzBA,GACZC,GAAgBznB,KAAMwnB,GACtB,GAAIP,IAAgBjnB,KAAMwnB,GAQ9B,IAAIC,IAAkB1H,GAAWiH,MAAQ,WACvC,GAAIxe,GAAyB5I,EAAdmW,KAAiBvW,EAAMS,UAAUR,MAChD,IAAKQ,UAAU,GAGR,GAAIyI,GAAYzI,UAAU,IAE/B,IADAuI,EAAYvI,UAAU,GAClBL,EAAI,EAAOJ,EAAJI,EAASA,IAAOmW,EAAQrU,KAAKzB,UAAUL,QAGlD,KADA4I,EAAYiS,GACR7a,EAAI,EAAOJ,EAAJI,EAASA,IAAOmW,EAAQrU,KAAKzB,UAAUL,QANlD,KADA4I,EAAYiS,GACR7a,EAAI,EAAOJ,EAAJI,EAASA,IAAOmW,EAAQrU,KAAKzB,UAAUL,GAWpD,OAHID,OAAM4W,QAAQR,EAAQ,MACxBA,EAAUA,EAAQ,IAEbxN,EAAaC,EAAWuN,GAAS2R,YAGtCC,GAAiB/U,GAAG+U,eAAiB,SAASC,GAChD5nB,KAAK8T,KAAO,sBACZ9T,KAAK6nB,YAAcD,EACnB5nB,KAAK6T,QAAU,uDACfzR,MAAMe,KAAKnD,MAEb2nB,IAAe3jB,UAAY5B,MAAM4B,UAajC+b,GAAW+H,gBAAkB,WAC3B,GAAIne,EACJ,IAAIhK,MAAM4W,QAAQtW,UAAU,IAC1B0J,EAAO1J,UAAU,OACZ,CACL,GAAIT,GAAMS,UAAUR,MACpBkK,GAAO,GAAIhK,OAAMH,EACjB,KAAI,GAAII,GAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,GAErD,GAAIkB,GAASyH,EAAa,KAAMoB,EAEhC,OAAO,IAAIV,IAAoB,SAAUpI,GAMvC,QAASknB,KACe,IAAlBH,EAAOnoB,OACToB,EAAEuK,cACyB,IAAlBwc,EAAOnoB,OAChBoB,EAAEqK,QAAQ0c,EAAO,IAEjB/mB,EAAEqK,QAAQ,GAAIyc,IAAeC,IAXjC,GAAIpO,GAAQ,GAAIrN,IACd6b,EAAI,GAAI7e,IACRkB,GAAY,EACZud,IA2CF,OA/BApO,GAAMnN,IAAI2b,GAEVA,EAAE1e,cAAcxI,EAAOyI,UACrB,SAAUge,GACR,GAAIU,GAAoB,GAAI9e,GAC5BqQ,GAAMnN,IAAI4b,GAGVrY,GAAU2X,KAAiBA,EAAc1X,GAAsB0X,IAE/DU,EAAkB3e,cAAcie,EAAYhe,UAC1C,SAAUgB,GAAK1J,EAAEsK,OAAOZ,IACxB,SAAUrK,GACR0nB,EAAOlmB,KAAKxB,GACZsZ,EAAMxK,OAAOiZ,GACb5d,GAA8B,IAAjBmP,EAAM/Z,QAAgBsoB,KAErC,WACEvO,EAAMxK,OAAOiZ,GACb5d,GAA8B,IAAjBmP,EAAM/Z,QAAgBsoB,QAGzC,SAAU7nB,GACR0nB,EAAOlmB,KAAKxB,GACZmK,GAAY,EACK,IAAjBmP,EAAM/Z,QAAgBsoB,KAExB,WACE1d,GAAY,EACK,IAAjBmP,EAAM/Z,QAAgBsoB,OAEnBvO,IAIX,IAAI0O,IAAsB,SAAUzI,GAGlC,QAASyI,GAAmBpnB,GAC1Bd,KAAKc,OAASA,EACd2e,EAAUtc,KAAKnD,MAUjB,QAASmoB,GAAiBtnB,EAAGsmB,GAC3BnnB,KAAKa,EAAIA,EACTb,KAAKmnB,EAAIA,EACTnnB,KAAKqK,WAAY,EACjBrK,KAAKiP,MAAO,EAmCd,QAASnF,GAAcxB,EAAQqe,GAC7B3mB,KAAKsI,OAASA,EACdtI,KAAK2mB,IAAMA,EACX3mB,KAAKqK,WAAY,EA4BnB,MApFAqL,IAASwS,EAAoBzI,GAO7ByI,EAAmBlkB,UAAUod,cAAgB,SAAU/Y,GACrD,GAAI8e,GAAI,GAAIhb,IAAuB6b,EAAI,GAAI7e,GAG3C,OAFAge,GAAE9a,IAAI2b,GACNA,EAAE1e,cAActJ,KAAKc,OAAOyI,UAAU,GAAI4e,GAAiB9f,EAAU8e,KAC9DA,GASTgB,EAAiBnkB,UAAUmH,OAAS,SAASoc,GAC3C,IAAGvnB,KAAKqK,UAAR,CACA,GAAIsc,GAAM,GAAIxd,GACdnJ,MAAKmnB,EAAE9a,IAAIsa,GAEX/W,GAAU2X,KAAiBA,EAAc1X,GAAsB0X,IAE/DZ,EAAIrd,cAAcie,EAAYhe,UAAU,GAAIO,GAAc9J,KAAM2mB,OAElEwB,EAAiBnkB,UAAUkH,QAAU,SAAUhL,GACzCF,KAAKqK,YACPrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,KAGnBioB,EAAiBnkB,UAAUoH,YAAc,WACnCpL,KAAKqK,YACPrK,KAAKqK,WAAY,EACjBrK,KAAKiP,MAAO,EACM,IAAlBjP,KAAKmnB,EAAE1nB,QAAgBO,KAAKa,EAAEuK,gBAGlC+c,EAAiBnkB,UAAUmL,QAAU,WAAanP,KAAKqK,WAAY,GACnE8d,EAAiBnkB,UAAU2b,KAAO,SAAUzf,GAC1C,MAAKF,MAAKqK,WAMH,GALLrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,IACR,IAWX4J,EAAc9F,UAAUmH,OAAS,SAAUZ,GAAUvK,KAAKqK,WAAarK,KAAKsI,OAAOzH,EAAEsK,OAAOZ,IAC5FT,EAAc9F,UAAUkH,QAAU,SAAUhL,GACtCF,KAAKqK,YACPrK,KAAKqK,WAAY,EACjBrK,KAAKsI,OAAOzH,EAAEqK,QAAQhL,KAG1B4J,EAAc9F,UAAUoH,YAAc,WACpC,IAAIpL,KAAKqK,UAAW,CAClB,GAAI/B,GAAStI,KAAKsI,MAClBtI,MAAKqK,WAAY,EACjB/B,EAAO6e,EAAEnY,OAAOhP,KAAK2mB,KACrBre,EAAO2G,MAA4B,IAApB3G,EAAO6e,EAAE1nB,QAAgB6I,EAAOzH,EAAEuK,gBAGrDtB,EAAc9F,UAAUmL,QAAU,WAAanP,KAAKqK,WAAY,GAChEP,EAAc9F,UAAU2b,KAAO,SAAUzf,GACvC,MAAKF,MAAKqK,WAMH,GALLrK,KAAKqK,WAAY,EACjBrK,KAAKsI,OAAOzH,EAAEqK,QAAQhL,IACf,IAMJgoB,GACPnH,GAMFvC,IAAgBkJ,SAAW,WACzB,MAAO,IAAIQ,IAAmBloB,OAQhCwe,GAAgB4J,UAAY,SAAU7X,GACpC,GAAIzP,GAASd,IACb,OAAO,IAAIiJ,IAAoB,SAAUpI,GACvC,GAAIwnB,IAAS,EACTnc,EAAc,GAAIC,IAAoBrL,EAAOyI,UAAU,SAAU+e,GACnED,GAAUxnB,EAAEsK,OAAOmd,IAClB,SAAUpoB,GAAKW,EAAEqK,QAAQhL,IAAO,WACjCmoB,GAAUxnB,EAAEuK,gBAGdwE,IAAUW,KAAWA,EAAQV,GAAsBU,GAEnD,IAAIgY,GAAoB,GAAIpf,GAS5B,OARA+C,GAAYG,IAAIkc,GAChBA,EAAkBjf,cAAciH,EAAMhH,UAAU,WAC9C8e,GAAS,EACTE,EAAkBpZ,WACjB,SAAUjP,GAAKW,EAAEqK,QAAQhL,IAAO,WACjCqoB,EAAkBpZ,aAGbjD,GACNpL,GAGL,IAAI0nB,IAAoB,SAAS/I,GAE/B,QAAS+I,GAAiB1nB,GACxBd,KAAKc,OAASA,EACd2e,EAAUtc,KAAKnD,MAQjB,QAASyoB,GAAe5nB,EAAG+hB,GACzB5iB,KAAKa,EAAIA,EACTb,KAAK4iB,MAAQA,EACb5iB,KAAK0oB,SAAU,EACf1oB,KAAK2oB,OAAS,EACd3oB,KAAK4oB,WAAY,EACjB5oB,KAAKqK,WAAY,EAiCnB,QAASP,GAAcxB,EAAQiH,GAC7BvP,KAAKsI,OAASA,EACdtI,KAAKuP,GAAKA,EACVvP,KAAKqK,WAAY,EA+BnB,MApFAqL,IAAS8S,EAAkB/I,GAM3B+I,EAAiBxkB,UAAUod,cAAgB,SAAUvgB,GACnD,GAAI+hB,GAAQ,GAAIvZ,IAAoBxC,EAAI7G,KAAKc,OAAOyI,UAAU,GAAIkf,GAAe5nB,EAAG+hB,GACpF,OAAO,IAAIzW,IAAoBtF,EAAG+b,IAWpC6F,EAAezkB,UAAUmH,OAAS,SAAUoc,GAC1C,IAAIvnB,KAAKqK,UAAT,CACA,GAAIwC,GAAI,GAAI1D,IAA8BoG,IAAOvP,KAAK2oB,MACtD3oB,MAAK4oB,WAAY,EACjB5oB,KAAK4iB,MAAMtZ,cAAcuD,GACzB+C,GAAU2X,KAAiBA,EAAc1X,GAAsB0X,IAC/D1a,EAAEvD,cAAcie,EAAYhe,UAAU,GAAIO,GAAc9J,KAAMuP,OAEhEkZ,EAAezkB,UAAUkH,QAAU,SAAUhL,GACtCF,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,KAGnBuoB,EAAezkB,UAAUoH,YAAc,WAChCpL,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAK0oB,SAAU,GACd1oB,KAAK4oB,WAAa5oB,KAAKa,EAAEuK,gBAG9Bqd,EAAezkB,UAAUmL,QAAU,WAAcnP,KAAKqK,WAAY,GAClEoe,EAAezkB,UAAU2b,KAAO,SAAUzf,GACxC,MAAIF,MAAKqK,WAKF,GAJLrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,IACR,IAUX4J,EAAc9F,UAAUmH,OAAS,SAAUZ,GACrCvK,KAAKqK,WACTrK,KAAKsI,OAAOqgB,SAAW3oB,KAAKuP,IAAMvP,KAAKsI,OAAOzH,EAAEsK,OAAOZ,IAEzDT,EAAc9F,UAAUkH,QAAU,SAAUhL,GACrCF,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAKsI,OAAOqgB,SAAW3oB,KAAKuP,IAAMvP,KAAKsI,OAAOzH,EAAEqK,QAAQhL,KAG5D4J,EAAc9F,UAAUoH,YAAc,WAC/BpL,KAAKqK,YACRrK,KAAKqK,WAAY,EACbrK,KAAKsI,OAAOqgB,SAAW3oB,KAAKuP,KAC9BvP,KAAKsI,OAAOsgB,WAAY,EACxB5oB,KAAKsI,OAAO+B,WAAarK,KAAKsI,OAAOzH,EAAEuK,iBAI7CtB,EAAc9F,UAAUmL,QAAU,WAAcnP,KAAKqK,WAAY,GACjEP,EAAc9F,UAAU2b,KAAO,SAAUzf,GACvC,MAAIF,MAAKqK,WAKF,GAJLrK,KAAKqK,WAAY,EACjBrK,KAAKsI,OAAOzH,EAAEqK,QAAQhL,IACf,IAKJsoB,GACPzH,GAMFvC,IAAgB,UAAYA,GAAgBqK,aAAe,WACzD,MAAO,IAAIL,IAAiBxoB,MAG9B,IAAI8oB,IAAuB,SAASrJ,GAGlC,QAASqJ,GAAoBhoB,EAAQyP,GACnCvQ,KAAKc,OAASA,EACdd,KAAKuQ,MAAQX,GAAUW,GAASV,GAAsBU,GAASA,EAC/DkP,EAAUtc,KAAKnD,MAUjB,QAAS8J,GAAcjJ,GACrBb,KAAKa,EAAIA,EACTb,KAAKqK,WAAY,EAyBnB,MA1CAqL,IAASoT,EAAqBrJ,GAQ9BqJ,EAAoB9kB,UAAUod,cAAgB,SAASvgB,GACrD,MAAO,IAAIsL,IACTnM,KAAKc,OAAOyI,UAAU1I,GACtBb,KAAKuQ,MAAMhH,UAAU,GAAIO,GAAcjJ,MAQ3CiJ,EAAc9F,UAAUmH,OAAS,SAAUZ,GACrCvK,KAAKqK,WACTrK,KAAKa,EAAEuK,eAETtB,EAAc9F,UAAUkH,QAAU,SAAUK,GACrCvL,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQK,KAGnBzB,EAAc9F,UAAUoH,YAAc,YACnCpL,KAAKqK,YAAcrK,KAAKqK,WAAY,IAEvCP,EAAc9F,UAAUmL,QAAU,WAAanP,KAAKqK,WAAY,GAChEP,EAAc9F,UAAU2b,KAAO,SAAUzf,GACvC,MAAKF,MAAKqK,WAKH,GAJLrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,IACR,IAKJ4oB,GACP/H,GAOFvC,IAAgBuK,UAAY,SAAUxY,GACpC,MAAO,IAAIuY,IAAoB9oB,KAAMuQ,IASvCiO,GAAgBwK,eAAiB,WAE/B,IAAI,GADAxpB,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,GACrCI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EACnD,IAAI4R,GAAiB7H,EAAKnD,MAAO1F,EAASd,IAG1C,OAFAL,OAAM4W,QAAQ5M,EAAK,MAAQA,EAAOA,EAAK,IAEhC,GAAIV,IAAoB,SAAUZ,GAOvC,IAAK,GANDoD,GAAI9B,EAAKlK,OACX2K,EAAW3D,EAAgBgF,EAAGhC,GAC9BkI,GAAc,EACdD,EAAS,GAAI/R,OAAM8L,GAEjBib,EAAgB,GAAI/mB,OAAM8L,EAAI,GACzBuK,EAAM,EAASvK,EAANuK,EAASA,KACxB,SAAUpW,GACT,GAAI2Q,GAAQ5G,EAAK/J,GAAI+mB,EAAM,GAAIxd,GAC/ByG,IAAUW,KAAWA,EAAQV,GAAsBU,IACnDoW,EAAIrd,cAAciH,EAAMhH,UAAU,SAAUgB,GAC1CmH,EAAO9R,GAAK2K,EACZH,EAASxK,IAAK,EACd+R,EAAcvH,EAASwH,MAAMC,KAC5B,SAAU3R,GAAKmI,EAAS6C,QAAQhL,IAAO+S,KAC1CyT,EAAc9mB,GAAK+mB,GACnB3Q,EAGJ,IAAI2Q,GAAM,GAAIxd,GAYd,OAXAwd,GAAIrd,cAAcxI,EAAOyI,UAAU,SAAUgB,GAC3C,GAAI0e,IAAa1e,GAAGyX,OAAOtQ,EAC3B,IAAKC,EAAL,CACA,GAAIX,GAAM/F,GAASuG,GAAgBzR,MAAM,KAAMkpB,EAC/C,OAAIjY,KAAQ7Q,GAAmBkI,EAAS6C,QAAQ8F,EAAI9Q,OACpDmI,GAAS8C,OAAO6F,KACf,SAAU9Q,GAAKmI,EAAS6C,QAAQhL,IAAO,WACxCmI,EAAS+C,iBAEXsb,EAAcjb,GAAKkb,EAEZ,GAAIxa,IAAoBua,IAC9B1mB,OAgBLwe,GAAgB0K,IAAM,WACpB,GAAyB,IAArBjpB,UAAUR,OAAgB,KAAM,IAAI2C,OAAM,oBAG9C,KAAI,GADA5C,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,GACrCI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EACnD,IAAI4R,GAAiBlL,GAAWqD,EAAKnK,EAAM,IAAMmK,EAAKnD,MAAQkD,CAC9D/J,OAAM4W,QAAQ5M,EAAK,MAAQA,EAAOA,EAAK,GAEvC,IAAIrB,GAAStI,IAEb,OADA2J,GAAK5I,QAAQuH,GACN,GAAIW,IAAoB,SAAUpI,GAMvC,IAAK,GALD4K,GAAI9B,EAAKlK,OACX0pB,EAAS1iB,EAAgBgF,EAAG7B,GAC5BkI,EAASrL,EAAgBgF,EAAGhC,GAE1Bid,EAAgB,GAAI/mB,OAAM8L,GACrBuK,EAAM,EAASvK,EAANuK,EAASA,KACzB,SAAWpW,GACT,GAAIkB,GAAS6I,EAAK/J,GAAI+mB,EAAM,GAAIxd,GAEhCyG,IAAU9O,KAAYA,EAAS+O,GAAsB/O,IAErD6lB,EAAIrd,cAAcxI,EAAOyI,UAAU,SAAUgB,GAE3C,GADA4e,EAAOvpB,GAAG8B,KAAK6I,GACX4e,EAAOvX,MAAM,SAAUrH,GAAK,MAAOA,GAAE9K,OAAS,IAAO,CACvD,GAAI2pB,GAAeD,EAAO3H,IAAI,SAAUjX,GAAK,MAAOA,GAAE8D,UAClD2C,EAAM/F,GAASuG,GAAgBzR,MAAMuI,EAAQ8gB,EACjD,IAAIpY,IAAQ7Q,GAAY,MAAOU,GAAEqK,QAAQ8F,EAAI9Q,EAC7CW,GAAEsK,OAAO6F,OACAc,GAAO0U,OAAO,SAAUjc,EAAGkc,GAAK,MAAOA,KAAM7mB,IAAMgS,MAAMC,KAClEhR,EAAEuK,eAEH,SAAUlL,GAAKW,EAAEqK,QAAQhL,IAAO,WACjC4R,EAAOlS,IAAK,EACZkS,EAAOF,MAAMC,KAAahR,EAAEuK,iBAE9Bsb,EAAc9mB,GAAK+mB,GAClB3Q,EAGL,OAAO,IAAI7J,IAAoBua,IAC9Bpe,IASLyX,GAAWmJ,IAAM,WAEf,IAAI,GADA1pB,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,GACrCI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EAC/CD,OAAM4W,QAAQ5M,EAAK,MACrBA,EAAOrD,GAAWqD,EAAK,IAAMA,EAAK,GAAGqY,OAAOrY,EAAK,IAAMA,EAAK,GAE9D,IAAI0f,GAAQ1f,EAAK0E,OACjB,OAAOgb,GAAMH,IAAInpB,MAAMspB,EAAO1f,IAgBlC6U,GAAgB8K,YAAc,WAC5B,GAAyB,IAArBrpB,UAAUR,OAAgB,KAAM,IAAI2C,OAAM,oBAG9C,KAAI,GADA5C,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,GACrCI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EACnD,IAAI4R,GAAiBlL,GAAWqD,EAAKnK,EAAM,IAAMmK,EAAKnD,MAAQkD,EAE1DpB,EAAStI,IAEb,OADA2J,GAAK5I,QAAQuH,GACN,GAAIW,IAAoB,SAAUpI,GAMvC,IAAK,GALD4K,GAAI9B,EAAKlK,OACX0pB,EAAS1iB,EAAgBgF,EAAG7B,GAC5BkI,EAASrL,EAAgBgF,EAAGhC,GAE1Bid,EAAgB,GAAI/mB,OAAM8L,GACrBuK,EAAM,EAASvK,EAANuK,EAASA,KACzB,SAAWpW,GACT,GAAIkB,GAAS6I,EAAK/J,GAAI+mB,EAAM,GAAIxd,KAE/BwL,GAAY7T,IAAW4T,GAAW5T,MAAaA,EAASgkB,GAAehkB,IAExE6lB,EAAIrd,cAAcxI,EAAOyI,UAAU,SAAUgB,GAE3C,GADA4e,EAAOvpB,GAAG8B,KAAK6I,GACX4e,EAAOvX,MAAM,SAAUrH,GAAK,MAAOA,GAAE9K,OAAS,IAAO,CACvD,GAAI2pB,GAAeD,EAAO3H,IAAI,SAAUjX,GAAK,MAAOA,GAAE8D,UAClD2C,EAAM/F,GAASuG,GAAgBzR,MAAMuI,EAAQ8gB,EACjD,IAAIpY,IAAQ7Q,GAAY,MAAOU,GAAEqK,QAAQ8F,EAAI9Q,EAC7CW,GAAEsK,OAAO6F,OACAc,GAAO0U,OAAO,SAAUjc,EAAGkc,GAAK,MAAOA,KAAM7mB,IAAMgS,MAAMC,KAClEhR,EAAEuK,eAEH,SAAUlL,GAAKW,EAAEqK,QAAQhL,IAAO,WACjC4R,EAAOlS,IAAK,EACZkS,EAAOF,MAAMC,KAAahR,EAAEuK,iBAE9Bsb,EAAc9mB,GAAK+mB,GAClB3Q,EAGL,OAAO,IAAI7J,IAAoBua,IAC9Bpe,IAWHkW,GAAgB3U,aAAe,WAC7B,MAAO,IAAIZ,IAAoBY,EAAa7J,MAAOA,OAOrDwe,GAAgB+K,cAAgB,WAC9B,GAAIzoB,GAASd,IACb,OAAO,IAAIiJ,IAAoB,SAAUpI,GACvC,MAAOC,GAAOyI,UAAU,SAAUgB,GAAK,MAAOA,GAAE+D,OAAOzN,IAAO,SAASX,GAAKW,EAAEqK,QAAQhL,IAAO,WAAcW,EAAEuK,iBAC5GpL,MAGL,IAAIwpB,IAAkC,SAAS/J,GAE7C,QAAS+J,GAA+B1oB,EAAQ2oB,EAAO5R,GACrD7X,KAAKc,OAASA,EACdd,KAAKypB,MAAQA,EACbzpB,KAAK6X,SAAWA,EAChB4H,EAAUtc,KAAKnD,MAOjB,MAZA0V,IAAS8T,EAAgC/J,GAQzC+J,EAA+BxlB,UAAUod,cAAgB,SAAUvgB,GACjE,MAAOb,MAAKc,OAAOyI,UAAU,GAAImgB,IAA6B7oB,EAAGb,KAAKypB,MAAOzpB,KAAK6X,YAG7E2R,GACPzI,IAEE2I,GAAgC,SAASjK,GAE3C,QAASiK,GAA6B7oB,EAAG4oB,EAAO5R,GAC9C7X,KAAKa,EAAIA,EACTb,KAAKypB,MAAQA,EACbzpB,KAAK6X,SAAWA,EAChB7X,KAAK2pB,eAAgB,EACrB3pB,KAAK4pB,WAAa,KAClBnK,EAAUtc,KAAKnD,MA0BjB,MAjCA0V,IAASgU,EAA8BjK,GAUvCiK,EAA6B1lB,UAAUyN,KAAO,SAAUlH,GACtD,GAAasf,GAATpmB,EAAM8G,CACV,OAAIjE,IAAWtG,KAAKypB,SAClBhmB,EAAMwH,GAASjL,KAAKypB,OAAOlf,GACvB9G,IAAQtD,IAAmBH,KAAKa,EAAEqK,QAAQzH,EAAIvD,GAEhDF,KAAK2pB,gBACPE,EAAiB5e,GAASjL,KAAK6X,UAAU7X,KAAK4pB,WAAYnmB,GACtDomB,IAAmB1pB,IAAmBH,KAAKa,EAAEqK,QAAQ2e,EAAe3pB,QAErEF,KAAK2pB,eAAkBE,IAC1B7pB,KAAK2pB,eAAgB,EACrB3pB,KAAK4pB,WAAanmB,EAClBzD,KAAKa,EAAEsK,OAAOZ,MAGlBmf,EAA6B1lB,UAAU1D,MAAQ,SAASJ,GACtDF,KAAKa,EAAEqK,QAAQhL,IAEjBwpB,EAA6B1lB,UAAU0b,UAAY,WACjD1f,KAAKa,EAAEuK,eAGFse,GACPlK,GAQFhB,IAAgBsL,qBAAuB,SAAUL,EAAO5R,GAEtD,MADAA,KAAaA,EAAW1E,IACjB,GAAIqW,IAA+BxpB,KAAMypB,EAAO5R,GAGzD,IAAIkS,IAAiB,SAAStK,GAE5B,QAASsK,GAAcjpB,EAAQ+d,EAAkB3T,EAASE,GACxDpL,KAAKc,OAASA,EACdd,KAAKgqB,IAAMnL,EACX7e,KAAKiqB,IAAM/e,EACXlL,KAAKkqB,IAAM9e,EACXqU,EAAUtc,KAAKnD,MAOjB,QAAS8J,GAAcjJ,EAAG4J,GACxBzK,KAAKa,EAAIA,EACTb,KAAKmqB,GAAK1f,EAAEuf,KAAO1jB,GAAWmE,EAAEuf,KAC9B1K,GAAe7U,EAAEuf,KAAO/W,GAAMxI,EAAEwf,KAAOhX,GAAMxI,EAAEyf,KAAOjX,IACtDxI,EAAEuf,IACJhqB,KAAKqK,WAAY,EAkCnB,MApDAqL,IAASqU,EAActK,GASvBsK,EAAc/lB,UAAUod,cAAgB,SAASvgB,GAC/C,MAAOb,MAAKc,OAAOyI,UAAU,GAAIO,GAAcjJ,EAAGb,QAUpD8J,EAAc9F,UAAUmH,OAAS,SAASZ,GACxC,IAAIvK,KAAKqK,UAAT,CACA,GAAI2G,GAAM/F,GAASjL,KAAKmqB,EAAEhf,QAAQhI,KAAKnD,KAAKmqB,EAAG5f,EAC3CyG,KAAQ7Q,IAAYH,KAAKa,EAAEqK,QAAQ8F,EAAI9Q,GAC3CF,KAAKa,EAAEsK,OAAOZ,KAEhBT,EAAc9F,UAAUkH,QAAU,SAASK,GACzC,IAAKvL,KAAKqK,UAAW,CACnBrK,KAAKqK,WAAY,CACjB,IAAI2G,GAAM/F,GAASjL,KAAKmqB,EAAEjf,SAAS/H,KAAKnD,KAAKmqB,EAAG5e,EAChD,IAAIyF,IAAQ7Q,GAAY,MAAOH,MAAKa,EAAEqK,QAAQ8F,EAAI9Q,EAClDF,MAAKa,EAAEqK,QAAQK,KAGnBzB,EAAc9F,UAAUoH,YAAc,WACpC,IAAKpL,KAAKqK,UAAW,CACnBrK,KAAKqK,WAAY,CACjB,IAAI2G,GAAM/F,GAASjL,KAAKmqB,EAAE/e,aAAajI,KAAKnD,KAAKmqB,EACjD,IAAInZ,IAAQ7Q,GAAY,MAAOH,MAAKa,EAAEqK,QAAQ8F,EAAI9Q,EAClDF,MAAKa,EAAEuK,gBAGXtB,EAAc9F,UAAUmL,QAAU,WAAanP,KAAKqK,WAAY,GAChEP,EAAc9F,UAAU2b,KAAO,SAAUzf,GACvC,MAAKF,MAAKqK,WAKH,GAJLrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,IACR,IAKJ6pB,GACPhJ,GAUFvC,IAAgB,MAAQA,GAAgB4L,IAAM5L,GAAgB6L,SAAW,SAAUxL,EAAkB3T,EAASE,GAC5G,MAAO,IAAI2e,IAAc/pB,KAAM6e,EAAkB3T,EAASE,IAU5DoT,GAAgB8L,SAAW9L,GAAgB+L,UAAY,SAAUpf,EAAQ4J,GACvE,MAAO/U,MAAKoqB,IAAuB,mBAAZrV,GAA0B,SAAUxK,GAAKY,EAAOhI,KAAK4R,EAASxK,IAAQY,IAU/FqT,GAAgBgM,UAAYhM,GAAgBiM,WAAa,SAAUvf,EAAS6J,GAC1E,MAAO/U,MAAKoqB,IAAInX,GAAyB,mBAAZ8B,GAA0B,SAAU7U,GAAKgL,EAAQ/H,KAAK4R,EAAS7U,IAAQgL,IAUtGsT,GAAgBkM,cAAgBlM,GAAgBmM,eAAiB,SAAUvf,EAAa2J,GACtF,MAAO/U,MAAKoqB,IAAInX,GAAM,KAAyB,mBAAZ8B,GAA0B,WAAc3J,EAAYjI,KAAK4R,IAAc3J,IAQ5GoT,GAAgB,WAAa,SAAU1H,GACrC,GAAIhW,GAASd,IACb,OAAO,IAAIiJ,IAAoB,SAAUZ,GACvC,GAAIe,GAAe6B,GAASnK,EAAOyI,WAAWpG,KAAKrC,EAAQuH,EAC3D,OAAIe,KAAiBjJ,IACnB2W,IACO1W,EAAQgJ,EAAalJ,IAEvB6W,GAAiB,WACtB,GAAIV,GAAIpL,GAAS7B,EAAa+F,SAAShM,KAAKiG,EAC5C0N,KACAT,IAAMlW,IAAYC,EAAQiW,EAAEnW,MAE7BF,MAGL,IAAI4qB,IAA4B,SAASnL,GAGvC,QAASmL,GAAyB9pB,GAChCd,KAAKc,OAASA,EACd2e,EAAUtc,KAAKnD,MAOjB,QAAS8J,GAAcjJ,GACrBb,KAAKa,EAAIA,EACTb,KAAKqK,WAAY,EA0BnB,MAvCAqL,IAASkV,EAA0BnL,GAOnCmL,EAAyB5mB,UAAUod,cAAgB,SAAUvgB,GAC3D,MAAOb,MAAKc,OAAOyI,UAAU,GAAIO,GAAcjJ,KAOjDiJ,EAAc9F,UAAUmH,OAAS8H,GACjCnJ,EAAc9F,UAAUkH,QAAU,SAAUK,GACtCvL,KAAKqK,YACPrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQK,KAGnBzB,EAAc9F,UAAUoH,YAAc,WAChCpL,KAAKqK,YACPrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEuK,gBAGXtB,EAAc9F,UAAUmL,QAAU,WAAanP,KAAKqK,WAAY,GAChEP,EAAc9F,UAAU2b,KAAO,SAAUzf,GACvC,MAAKF,MAAKqK,WAMH,GALLrK,KAAKqK,WAAY,EACjBrK,KAAKqI,SAAS6C,QAAQhL,IACf,IAMJ0qB,GACP7J,GAMFvC,IAAgBqM,eAAiB,WAC/B,MAAO,IAAID,IAAyB5qB,OAOtCwe,GAAgB3Q,YAAc,WAC5B,GAAI/M,GAASd,IACb,OAAO,IAAIiJ,IAAoB,SAAUZ,GACvC,MAAOvH,GAAOyI,UAAU,SAAUvE,GAChCqD,EAAS8C,OAAO4T,GAAyB/Z,KACxC,SAAU9E,GACXmI,EAAS8C,OAAO8T,GAA0B/e,IAC1CmI,EAAS+C,eACR,WACD/C,EAAS8C,OAAOgU,MAChB9W,EAAS+C,iBAEVtK,IAQL0d,GAAgB6E,OAAS,SAAUC,GACjC,MAAOF,IAAiBpjB,KAAMsjB,GAAatB,UAa7CxD,GAAgBsM,MAAQ,SAAUC,GAChC,MAAO3H,IAAiBpjB,KAAM+qB,GAAY5I,cAa5C3D,GAAgBwM,UAAY,SAAUxI,GACpC,MAAOY,IAAiBpjB,MAAMoiB,eAAeI,GAE/C,IAAIyI,IAAkB,SAASxL,GAE7B,QAASwL,GAAenqB,EAAQiJ,EAAaC,EAASC,GACpDjK,KAAKc,OAASA,EACdd,KAAK+J,YAAcA,EACnB/J,KAAKgK,QAAUA,EACfhK,KAAKiK,KAAOA,EACZwV,EAAUtc,KAAKnD,MAOjB,MAbA0V,IAASuV,EAAgBxL,GASzBwL,EAAejnB,UAAUod,cAAgB,SAASvgB,GAChD,MAAOb,MAAKc,OAAOyI,UAAU,GAAIO,GAAcjJ,EAAEb,QAG5CirB,GACPlK,GAYFjX,GAAc9F,WACZmH,OAAQ,SAAUZ,GAChB,MAAIvK,MAAKqK,UAAT,SACCrK,KAAKoK,WAAapK,KAAKoK,UAAW,GAC/BpK,KAAKkK,gBACPlK,KAAKmK,aAAec,GAASjL,KAAK+J,aAAa/J,KAAKmK,aAAcI,IAElEvK,KAAKmK,aAAenK,KAAKgK,QAAUiB,GAASjL,KAAK+J,aAAa/J,KAAKiK,KAAMM,GAAKA,EAC9EvK,KAAKkK,iBAAkB,GAErBlK,KAAKmK,eAAiBhK,GAAmBH,KAAKa,EAAEqK,QAAQlL,KAAKmK,aAAajK,OAC9EF,MAAKa,EAAEsK,OAAOnL,KAAKmK,gBAErBe,QAAS,SAAUhL,GACZF,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,KAGnBkL,YAAa,WACNpL,KAAKqK,YACRrK,KAAKqK,WAAY,GAChBrK,KAAKoK,UAAYpK,KAAKgK,SAAWhK,KAAKa,EAAEsK,OAAOnL,KAAKiK,MACrDjK,KAAKa,EAAEuK,gBAGX+D,QAAS,WAAanP,KAAKqK,WAAY,GACvCsV,KAAM,SAAUzf,GACd,MAAKF,MAAKqK,WAKH,GAJLrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,IACR,KAabse,GAAgB0M,KAAO,WACrB,GAAqBjhB,GAAjBD,GAAU,EAAaD,EAAc9J,UAAU,EAKnD,OAJyB,KAArBA,UAAUR,SACZuK,GAAU,EACVC,EAAOhK,UAAU,IAEZ,GAAIgrB,IAAejrB,KAAM+J,EAAaC,EAASC,IAWxDuU,GAAgB2M,SAAW,SAAUzkB,GACnC,GAAY,EAARA,EAAa,KAAM,IAAIuN,GAC3B,IAAInT,GAASd,IACb,OAAO,IAAIiJ,IAAoB,SAAUpI,GACvC,GAAI8M,KACJ,OAAO7M,GAAOyI,UAAU,SAAUgB,GAChCoD,EAAEjM,KAAK6I,GACPoD,EAAElO,OAASiH,GAAS7F,EAAEsK,OAAOwC,EAAEU,UAC9B,SAAUnO,GAAKW,EAAEqK,QAAQhL,IAAO,WAAcW,EAAEuK,iBAClDtK,IAWL0d,GAAgB4M,UAAY,WAC1B,GAAY5iB,GAAWqG,EAAQ,CACzB5O,WAAUR,QAAUiJ,GAAYzI,UAAU,KAC9CuI,EAAYvI,UAAU,GACtB4O,EAAQ,GAERrG,EAAYiS,EAEd,KAAI,GAAI9Q,MAAW/J,EAAIiP,EAAOrP,EAAMS,UAAUR,OAAYD,EAAJI,EAASA,IAAO+J,EAAKjI,KAAKzB,UAAUL,GAC1F,OAAO6jB,KAAcuB,GAAoBrb,EAAMnB,GAAYxI,OAAOgiB,UAWpExD,GAAgB6M,SAAW,SAAU3kB,GACnC,GAAY,EAARA,EAAa,KAAM,IAAIuN,GAC3B,IAAInT,GAASd,IACb,OAAO,IAAIiJ,IAAoB,SAAUpI,GACvC,GAAI8M,KACJ,OAAO7M,GAAOyI,UAAU,SAAUgB,GAChCoD,EAAEjM,KAAK6I,GACPoD,EAAElO,OAASiH,GAASiH,EAAEU,SACrB,SAAUnO,GAAKW,EAAEqK,QAAQhL,IAAO,WACjC,KAAOyN,EAAElO,OAAS,GAAKoB,EAAEsK,OAAOwC,EAAEU,QAClCxN,GAAEuK,iBAEHtK,IAGP0d,GAAgB8M,cAAgB9M,GAAgB+M,UAAY,SAAS1gB,EAAU2G,EAAgBuD,GAC3F,MAAO,IAAIuM,IAAkBthB,KAAM6K,EAAU2G,EAAgBuD,GAASiS,MAAM,GAE9E,IAAIwE,IAAiB,SAAU/L,GAG7B,QAAS+L,GAAc1qB,EAAQ+J,EAAUkK,GACvC/U,KAAKc,OAASA,EACdd,KAAK6K,SAAWgK,GAAahK,EAAUkK,EAAS,GAChD0K,EAAUtc,KAAKnD,MAGjB,QAASyrB,GAAS5gB,EAAUmC,GAC1B,MAAO,UAAUzC,EAAG3K,EAAGiB,GAAK,MAAOgK,GAAS1H,KAAKnD,KAAMgN,EAAKnC,SAASN,EAAG3K,EAAGiB,GAAIjB,EAAGiB,IAWpF,QAASiJ,GAAcjJ,EAAGgK,EAAU/J,GAClCd,KAAKa,EAAIA,EACTb,KAAK6K,SAAWA,EAChB7K,KAAKc,OAASA,EACdd,KAAKJ,EAAI,EACTI,KAAKqK,WAAY,EA0BnB,MAnDAqL,IAAS8V,EAAe/L,GAYxB+L,EAAcxnB,UAAU0nB,YAAc,SAAU7gB,EAAUkK,GACxD,MAAO,IAAIyW,GAAcxrB,KAAKc,OAAQ2qB,EAAS5gB,EAAU7K,MAAO+U,IAGlEyW,EAAcxnB,UAAUod,cAAgB,SAAUvgB,GAChD,MAAOb,MAAKc,OAAOyI,UAAU,GAAIO,GAAcjJ,EAAGb,KAAK6K,SAAU7K,QAWnE8J,EAAc9F,UAAUmH,OAAS,SAASZ,GACxC,IAAIvK,KAAKqK,UAAT,CACA,GAAIxH,GAASoI,GAASjL,KAAK6K,UAAUN,EAAGvK,KAAKJ,IAAKI,KAAKc,OACvD,OAAI+B,KAAW1C,GAAmBH,KAAKa,EAAEqK,QAAQrI,EAAO3C,OACxDF,MAAKa,EAAEsK,OAAOtI,KAEhBiH,EAAc9F,UAAUkH,QAAU,SAAUhL,GACtCF,KAAKqK,YAAarK,KAAKqK,WAAY,EAAMrK,KAAKa,EAAEqK,QAAQhL,KAE9D4J,EAAc9F,UAAUoH,YAAc,WAChCpL,KAAKqK,YAAarK,KAAKqK,WAAY,EAAMrK,KAAKa,EAAEuK,gBAEtDtB,EAAc9F,UAAUmL,QAAU,WAAanP,KAAKqK,WAAY,GAChEP,EAAc9F,UAAU2b,KAAO,SAAUzf,GACvC,MAAKF,MAAKqK,WAMH,GALLrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,IACR,IAMJsrB,GAEPzK,GAQFvC,IAAgBgD,IAAMhD,GAAgBmN,OAAS,SAAU9gB,EAAUkK,GACjE,GAAI6W,GAAiC,kBAAb/gB,GAA0BA,EAAW,WAAc,MAAOA,GAClF,OAAO7K,gBAAgBwrB,IACrBxrB,KAAK0rB,YAAYE,EAAY7W,GAC7B,GAAIyW,IAAcxrB,KAAM4rB,EAAY7W,IAwBxCyJ,GAAgBqN,MAAQ,WACtB,GAAIrsB,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,EAC7C,IAAY,IAARA,EAAa,KAAM,IAAI4C,OAAM,sCACjC,KAAI,GAAIxC,GAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EACnD,OAAOI,MAAKwhB,IAAIlX,EAAQX,EAAMnK,KAGlCgf,GAAgBsN,QAAUtN,GAAgBuN,WAAa,SAASlhB,EAAU2G,EAAgBuD,GACtF,MAAO,IAAIuM,IAAkBthB,KAAM6K,EAAU2G,EAAgBuD,GAAS2S,YAU1E9U,GAAGmN,WAAW/b,UAAUgoB,cAAgB,SAASnhB,EAAU2G,EAAgBuD,GACvE,MAAO,IAAIuM,IAAkBthB,KAAM6K,EAAU2G,EAAgBuD,GAAS8T,eAExE,IAAIoD,IAAkB,SAASxM,GAE7B,QAASwM,GAAenrB,EAAQ4F,GAC9B1G,KAAKc,OAASA,EACdd,KAAKksB,UAAYxlB,EACjB+Y,EAAUtc,KAAKnD,MAOjB,QAAS8J,GAAcjJ,EAAGoiB,GACxBjjB,KAAKijB,EAAIA,EACTjjB,KAAKqW,EAAI4M,EACTjjB,KAAKa,EAAIA,EACTb,KAAKqK,WAAY,EA0BnB,MAzCAqL,IAASuW,EAAgBxM,GAOzBwM,EAAejoB,UAAUod,cAAgB,SAAUvgB,GACjD,MAAOb,MAAKc,OAAOyI,UAAU,GAAIO,GAAcjJ,EAAGb,KAAKksB,aASzDpiB,EAAc9F,UAAUmH,OAAS,SAAUZ,GACrCvK,KAAKqK,YACLrK,KAAKqW,GAAK,EACZrW,KAAKa,EAAEsK,OAAOZ,GAEdvK,KAAKqW,MAGTvM,EAAc9F,UAAUkH,QAAU,SAAShL,GACpCF,KAAKqK,YAAarK,KAAKqK,WAAY,EAAMrK,KAAKa,EAAEqK,QAAQhL,KAE/D4J,EAAc9F,UAAUoH,YAAc,WAC/BpL,KAAKqK,YAAarK,KAAKqK,WAAY,EAAMrK,KAAKa,EAAEuK,gBAEvDtB,EAAc9F,UAAUmL,QAAU,WAAanP,KAAKqK,WAAY,GAChEP,EAAc9F,UAAU2b,KAAO,SAASzf,GACtC,MAAKF,MAAKqK,WAKH,GAJLrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,IACR,IAKJ+rB,GACPlL,GAOFvC,IAAgB2N,KAAO,SAAUzlB,GAC/B,GAAY,EAARA,EAAa,KAAM,IAAIuN,GAC3B,OAAO,IAAIgY,IAAejsB,KAAM0G,IAYlC8X,GAAgB4N,UAAY,SAAUC,EAAWtX,GAC/C,GAAIjU,GAASd,KACT2E,EAAWkQ,GAAawX,EAAWtX,EAAS,EAChD,OAAO,IAAI9L,IAAoB,SAAUpI,GACvC,GAAIjB,GAAI,EAAGgO,GAAU,CACrB,OAAO9M,GAAOyI,UAAU,SAAUgB,GAChC,IAAKqD,EACH,IACEA,GAAWjJ,EAAS4F,EAAG3K,IAAKkB,GAC5B,MAAOZ,GAEP,WADAW,GAAEqK,QAAQhL,GAId0N,GAAW/M,EAAEsK,OAAOZ,IACnB,SAAUrK,GAAKW,EAAEqK,QAAQhL,IAAO,WAAcW,EAAEuK,iBAClDtK,IAYL0d,GAAgB8N,KAAO,SAAU5lB,EAAO8B,GACtC,GAAY,EAAR9B,EAAa,KAAM,IAAIuN,GAC3B,IAAc,IAAVvN,EAAe,MAAO2d,IAAgB7b,EAC1C,IAAI1H,GAASd,IACb,OAAO,IAAIiJ,IAAoB,SAAUpI,GACvC,GAAI0rB,GAAY7lB,CAChB,OAAO5F,GAAOyI,UAAU,SAAUgB,GAC5BgiB,IAAc,IAChB1rB,EAAEsK,OAAOZ,GACI,GAAbgiB,GAAkB1rB,EAAEuK,gBAErB,SAAUlL,GAAKW,EAAEqK,QAAQhL,IAAO,WAAcW,EAAEuK,iBAClDtK,IAUL0d,GAAgBgO,UAAY,SAAUH,EAAWtX,GAC/C,GAAIjU,GAASd,KACT2E,EAAWkQ,GAAawX,EAAWtX,EAAS,EAChD,OAAO,IAAI9L,IAAoB,SAAUpI,GACvC,GAAIjB,GAAI,EAAGgO,GAAU,CACrB,OAAO9M,GAAOyI,UAAU,SAAUgB,GAChC,GAAIqD,EAAS,CACX,IACEA,EAAUjJ,EAAS4F,EAAG3K,IAAKkB,GAC3B,MAAOZ,GAEP,WADAW,GAAEqK,QAAQhL,GAGR0N,EACF/M,EAAEsK,OAAOZ,GAET1J,EAAEuK,gBAGL,SAAUlL,GAAKW,EAAEqK,QAAQhL,IAAO,WAAcW,EAAEuK,iBAClDtK,GAGL,IAAI2rB,IAAoB,SAAUhN,GAGhC,QAASgN,GAAiB3rB,EAAQurB,EAAWtX,GAC3C/U,KAAKc,OAASA,EACdd,KAAKqsB,UAAYxX,GAAawX,EAAWtX,EAAS,GAClD0K,EAAUtc,KAAKnD,MAOjB,QAAS0sB,GAAeL,EAAWrf,GACjC,MAAO,UAASzC,EAAG3K,EAAGiB,GAAK,MAAOmM,GAAKqf,UAAU9hB,EAAG3K,EAAGiB,IAAMwrB,EAAUlpB,KAAKnD,KAAMuK,EAAG3K,EAAGiB,IAO1F,QAASiJ,GAAcjJ,EAAGwrB,EAAWvrB,GACnCd,KAAKa,EAAIA,EACTb,KAAKqsB,UAAYA,EACjBrsB,KAAKc,OAASA,EACdd,KAAKJ,EAAI,EACTI,KAAKqK,WAAY,EA2BnB,MApDAqL,IAAS+W,EAAkBhN,GAQ3BgN,EAAiBzoB,UAAUod,cAAgB,SAAUvgB,GACnD,MAAOb,MAAKc,OAAOyI,UAAU,GAAIO,GAAcjJ,EAAGb,KAAKqsB,UAAWrsB,QAOpEysB,EAAiBzoB,UAAU2oB,eAAiB,SAASN,EAAWtX,GAC9D,MAAO,IAAI0X,GAAiBzsB,KAAKc,OAAQ4rB,EAAeL,EAAWrsB,MAAO+U,IAW5EjL,EAAc9F,UAAUmH,OAAS,SAASZ,GACxC,IAAIvK,KAAKqK,UAAT,CACA,GAAIuiB,GAAc3hB,GAASjL,KAAKqsB,WAAW9hB,EAAGvK,KAAKJ,IAAKI,KAAKc,OAC7D,OAAI8rB,KAAgBzsB,GACXH,KAAKa,EAAEqK,QAAQ0hB,EAAY1sB,QAEpC0sB,GAAe5sB,KAAKa,EAAEsK,OAAOZ,MAE/BT,EAAc9F,UAAUkH,QAAU,SAAUhL,GACtCF,KAAKqK,YAAarK,KAAKqK,WAAY,EAAMrK,KAAKa,EAAEqK,QAAQhL,KAE9D4J,EAAc9F,UAAUoH,YAAc,WAChCpL,KAAKqK,YAAarK,KAAKqK,WAAY,EAAMrK,KAAKa,EAAEuK,gBAEtDtB,EAAc9F,UAAUmL,QAAU,WAAanP,KAAKqK,WAAY,GAChEP,EAAc9F,UAAU2b,KAAO,SAAUzf,GACvC,MAAKF,MAAKqK,WAKH,GAJLrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,IACR,IAKJusB,GAEP1L,GAQFvC,IAAgBgI,OAAShI,GAAgBqO,MAAQ,SAAUR,EAAWtX,GACpE,MAAO/U,gBAAgBysB,IAAmBzsB,KAAK2sB,eAAeN,EAAWtX,GACvE,GAAI0X,IAAiBzsB,KAAMqsB,EAAWtX,IAyC5CgL,GAAW+M,aAAe,SAAUniB,EAAIC,EAAKC,GAC3C,MAAO,YACU,mBAARD,KAAwBA,EAAM5K,KAGrC,KAAI,GADAR,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,GACrCI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EACnD,OAAO8K,GAAmBC,EAAIC,EAAKC,EAAUlB,KA4CjDoW,GAAWgN,iBAAmB,SAAUpiB,EAAIC,EAAKC,GAC/C,MAAO,YACU,mBAARD,KAAwBA,EAAM5K,KAErC,KAAI,GADAR,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,GACrCI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EACnD,OAAOyL,GAAqBV,EAAIC,EAAKC,EAAUlB,KAWjD6B,EAAiBxH,UAAUmL,QAAU,WAC9BnP,KAAK8L,aACR9L,KAAK0L,GAAGshB,oBAAoBhtB,KAAK2L,GAAI3L,KAAK4L,KAAK,GAC/C5L,KAAK8L,YAAa,IAuBtB8G,GAAGE,OAAOma,iBAAkB,EAoB5BlN,GAAWmN,UAAY,SAAUC,EAASlhB,EAAWpB,GAEnD,MAAIsiB,GAAQC,YACHC,GACL,SAAUC,GAAKH,EAAQC,YAAYnhB,EAAWqhB,IAC9C,SAAUA,GAAKH,EAAQI,eAAethB,EAAWqhB,IACjDziB,GAIC+H,GAAGE,OAAOma,iBAEa,kBAAfE,GAAQK,IAA4C,kBAAhBL,GAAQM,IAQlD,GAAIxkB,IAAoB,SAAUpI,GACvC,MAAOkL,GACLohB,EACAlhB,EACAM,EAAa1L,EAAGgK,MACjB6iB,UAAUC,WAZFN,GACL,SAAUC,GAAKH,EAAQK,GAAGvhB,EAAWqhB,IACrC,SAAUA,GAAKH,EAAQM,IAAIxhB,EAAWqhB,IACtCziB,GAoBR,IAAIwiB,IAAmBtN,GAAWsN,iBAAmB,SAAUO,EAAYC,EAAehjB,EAAUrC,GAElG,MADAE,IAAYF,KAAeA,EAAYiS,IAChC,GAAIxR,IAAoB,SAAUpI,GACvC,QAASitB,KACP,GAAIjrB,GAAS5C,UAAU,EACvB,OAAIqG,IAAWuE,KACbhI,EAASoI,GAASJ,GAAU9K,MAAM,KAAME,WACpC4C,IAAW1C,IAAmBU,EAAEqK,QAAQrI,EAAO3C,OAErDW,GAAEsK,OAAOtI,GAGX,GAAIkrB,GAAcH,EAAWE,EAC7B,OAAO/W,IAAiB,WACtBzQ,GAAWunB,IAAkBA,EAAcC,EAAcC,OAE1DL,UAAUC,YAGXK,GAAyB,SAASvO,GAEpC,QAASuO,GAAsBvjB,GAC7BzK,KAAKyK,EAAIA,EACTgV,EAAUtc,KAAKnD,MAWjB,MAdA0V,IAASsY,EAAuBvO,GAMhCuO,EAAsBhqB,UAAUod,cAAgB,SAASvgB,GAKvD,MAJAb,MAAKyK,EAAEgJ,KAAK,SAAUwJ,GACpBpc,EAAEsK,OAAO8R,GACTpc,EAAEuK,eACD,SAAUG,GAAO1K,EAAEqK,QAAQK,KACvByL,IAGFgX,GACPjN,IAOElR,GAAwBkQ,GAAW2B,YAAc,SAAUuM,GAC7D,MAAO,IAAID,IAAsBC,GAanCzP,IAAgB0P,UAAY,SAAUC,GAEpC,GADAA,IAAgBA,EAAcvb,GAAGE,OAAOC,UACnCob,EAAe,KAAM,IAAIja,IAAkB,qDAChD,IAAIpT,GAASd,IACb,OAAO,IAAImuB,GAAY,SAAUC,EAASC,GAExC,GAAIrpB,GAAOoF,GAAW,CACtBtJ,GAAOyI,UAAU,SAAUyZ,GACzBhe,EAAQge,EACR5Y,GAAW,GACVikB,EAAQ,WACTjkB,GAAYgkB,EAAQppB,QAU1B+a,GAAWuO,WAAa,SAAUC,GAChC,GAAIN,EACJ,KACEA,EAAUM,IACV,MAAOruB,GACP,MAAOuQ,IAAgBvQ,GAEzB,MAAO2P,IAAsBoe,IAoB/BzP,GAAgBgQ,UAAY,SAAUC,EAA0B5jB,GAC9D,GAAI/J,GAASd,IACb,OAA2C,kBAA7ByuB,GACZ,GAAIxlB,IAAoB,SAAUZ,GAChC,GAAIqmB,GAAc5tB,EAAO0tB,UAAUC,IACnC,OAAO,IAAItiB,IAAoBtB,EAAS6jB,GAAanlB,UAAUlB,GAAWqmB,EAAYC,YACrF7tB,GACH,GAAI8tB,IAAsB9tB,EAAQ2tB,IActCjQ,GAAgBkP,QAAU,SAAU7iB,GAClC,MAAOA,IAAYvE,GAAWuE,GAC5B7K,KAAKwuB,UAAU,WAAc,MAAO,IAAIjM,KAAc1X,GACtD7K,KAAKwuB,UAAU,GAAIjM,MAQvB/D,GAAgBqQ,MAAQ,WACtB,MAAO7uB,MAAK0tB,UAAUC,YAcxBnP,GAAgBsQ,YAAc,SAAUjkB,GACtC,MAAOA,IAAYvE,GAAWuE,GAC5B7K,KAAKwuB,UAAU,WAAc,MAAO,IAAI1jB,KAAmBD,GAC3D7K,KAAKwuB,UAAU,GAAI1jB,MAevB0T,GAAgBuQ,aAAe,SAAUC,EAAwBC,GAC/D,MAA4B,KAArBhvB,UAAUR,OACfO,KAAKwuB,UAAU,WACb,MAAO,IAAIU,IAAgBD,IAC1BD,GACHhvB,KAAKwuB,UAAU,GAAIU,IAAgBF,KASvCxQ,GAAgB2Q,WAAa,SAAUF,GACrC,MAAOjvB,MAAK+uB,aAAaE,GAActB,YAmBzCnP,GAAgB4Q,OAAS,SAAUvkB,EAAUwkB,EAAYC,EAAY9mB,GACnE,MAAOqC,IAAYvE,GAAWuE,GAC5B7K,KAAKwuB,UAAU,WAAc,MAAO,IAAIe,IAAcF,EAAYC,EAAY9mB,IAAeqC,GAC7F7K,KAAKwuB,UAAU,GAAIe,IAAcF,EAAYC,EAAY9mB,KAkB7DgW,GAAgBgR,YAAc,SAAUH,EAAYC,EAAY9mB,GAC9D,MAAOxI,MAAKovB,OAAO,KAAMC,EAAYC,EAAY9mB,GAAWmlB,WAG9D,IAAIiB,IAAwBhc,GAAGgc,sBAAyB,SAAUnP,GAGhE,QAASmP,GAAsB9tB,EAAQyQ,GACrC,GACEnI,GADEqmB,GAAkB,EAEpBC,EAAmB5uB,EAAO+I,cAE5B7J,MAAK2uB,QAAU,WAOb,MANKc,KACHA,GAAkB,EAClBrmB,EAAe,GAAI+C,IAAoBujB,EAAiBnmB,UAAUgI,GAAUwF,GAAiB,WAC3F0Y,GAAkB,MAGfrmB,GAGTqW,EAAUtc,KAAKnD,KAAM,SAAUa,GAAK,MAAO0Q,GAAQhI,UAAU1I,KAgB/D,MAjCA6U,IAASkZ,EAAuBnP,GAoBhCmP,EAAsB5qB,UAAU2pB,SAAW,WACzC,GAAIgC,GAAyBjpB,EAAQ,EAAG5F,EAASd,IACjD,OAAO,IAAIiJ,IAAoB,SAAUZ,GACrC,GAAIunB,GAA4B,MAAVlpB,EACpB0C,EAAetI,EAAOyI,UAAUlB,EAElC,OADAunB,KAAkBD,EAA0B7uB,EAAO6tB,WAC5C,WACLvlB,EAAa+F,UACD,MAAVzI,GAAeipB,EAAwBxgB,cAK1Cyf,GACP7O,IA2DE8P,GAAqB9P,GAAW+P,SAAW,SAAUljB,EAAQpE,GAC/D,MAAO4E,GAAiCR,EAAQA,EAAQlE,GAAYF,GAAaA,EAAY6G,IAUzE0Q,IAAWjP,MAAQ,SAAUrE,EAASsjB,EAAmBvnB,GAC7E,GAAIoE,EAOJ,OANAlE,IAAYF,KAAeA,EAAY6G,IACd,MAArB0gB,GAA0D,gBAAtBA,GACtCnjB,EAASmjB,EACArnB,GAAYqnB,KACrBvnB,EAAYunB,GAEVtjB,YAAmB2E,OAAQxE,IAAWvN,EACjCmN,EAAoBC,EAAQujB,UAAWxnB,GAE5CiE,YAAmB2E,OAAQxE,IAAWvN,EACjCsN,EAA6BF,EAAQujB,UAAWD,EAAmBvnB,GAErEoE,IAAWvN,EAChB6N,EAAwBT,EAASjE,GACjC4E,EAAiCX,EAASG,EAAQpE,GAwItDgW,IAAgB1P,MAAQ,WACtB,GAA4B,gBAAjB7O,WAAU,IAAmBA,UAAU,YAAcmR,MAAM,CACpE,GAAI3E,GAAUxM,UAAU,GAAIuI,EAAYvI,UAAU,EAElD,OADAyI,IAAYF,KAAeA,EAAY6G,IAChC5C,YAAmB2E,MACxB5C,EAAwBxO,KAAMyM,EAASjE,GACvC+E,EAAwBvN,KAAMyM,EAASjE,GACpC,GAAIlC,GAAWrG,UAAU,IAC9B,MAAOwO,GAAkBzO,KAAMC,UAAU,GAAIA,UAAU,GAEvD,MAAM,IAAImC,OAAM,sBAqFpBoc,GAAgBpP,SAAW,WACzB,GAAI9I,GAAYrG,UAAU,IACxB,MAAOwP,GAAqBzP,KAAMC,UAAU,GACvC,IAA4B,gBAAjBA,WAAU,GAC1B,MAAOmP,GAASpP,KAAMC,UAAU,GAAIA,UAAU,GAE9C,MAAM,IAAImC,OAAM,sBAcpBoc,GAAgB1Q,UAAY,SAAUtF,GAEpC,MADAE,IAAYF,KAAeA,EAAY6G,IAChCrP,KAAKwhB,IAAI,SAAUjX,GACxB,OAASvF,MAAOuF,EAAGuD,UAAWtF,EAAUyE,UAgD5CuR,GAAgByR,OAASzR,GAAgB0R,eAAiB,SAAUC,EAAmB3nB,GAErF,MADAE,IAAYF,KAAeA,EAAY6G,IACH,gBAAtB8gB,GACZpgB,EAAiB/P,KAAM6vB,GAAmBM,EAAmB3nB,IAC7DuH,EAAiB/P,KAAMmwB,GAG3B,IAAIzf,IAAekC,GAAGlC,aAAe,SAASmD,GAC5C7T,KAAK6T,QAAUA,GAAW,uBAC1B7T,KAAK8T,KAAO,eACZ1R,MAAMe,KAAKnD,MAEb0Q,IAAa1M,UAAYoC,OAAO2N,OAAO3R,MAAM4B,WA4G7Cwa,GAAgB5N,QAAU,WACxB,GAAIwf,GAAWnwB,UAAU,EACzB,IAAImwB,YAAoBhf,OAA4B,gBAAbgf,GACrC,MAAOxf,GAAQ5Q,KAAMowB,EAAUnwB,UAAU,GAAIA,UAAU,GAClD,IAAI8f,GAAWI,aAAaiQ,IAAa9pB,GAAW8pB,GACzD,MAAOhgB,GAAoBpQ,KAAMowB,EAAUnwB,UAAU,GAAIA,UAAU,GAEnE,MAAM,IAAImC,OAAM,sBAUpBoc,GAAgB7O,SAAW,SAAU0gB,EAAgB7nB,GACnDE,GAAYF,KAAeA,EAAY6G,GACvC,IAAIihB,IAAYD,GAAkB,CAClC,IAAgB,GAAZC,EAAiB,KAAM,IAAIC,YAAW,+CAC1C,IAAIzvB,GAASd,IACb,OAAO,IAAIiJ,IAAoB,SAAUpI,GACvC,GAAI2vB,GAAa,CACjB,OAAO1vB,GAAOyI,UACZ,SAAUgB,GACR,GAAI0C,GAAMzE,EAAUyE,OACD,IAAfujB,GAAoBvjB,EAAMujB,GAAcF,KAC1CE,EAAavjB,EACbpM,EAAEsK,OAAOZ,KAEX,SAAUrK,GAAKW,EAAEqK,QAAQhL,IAAO,WAAcW,EAAEuK,iBAEnDtK,GAGL,IAAI2vB,IAAsB,SAAUhR,GAIlC,QAASlW,GAAUlB,GACjB,GAAIqoB,GAAO1wB,KAAKc,OAAO4sB,UACrBtkB,EAAesnB,EAAKnnB,UAAUlB,GAC9BsoB,EAAa3Z,GAEX4Z,EAAW5wB,KAAK6wB,OAAO/G,uBAAuBvgB,UAAU,SAAUrE,GAChEA,EACFyrB,EAAaD,EAAK/B,WAElBgC,EAAWxhB,UACXwhB,EAAa3Z,KAIjB,OAAO,IAAI7K,IAAoB/C,EAAcunB,EAAYC,GAG3D,QAASH,GAAmB3vB,EAAQ+vB,GAClC7wB,KAAKc,OAASA,EACdd,KAAK8wB,WAAa,GAAIvO,IAElBsO,GAAUA,EAAOtnB,UACnBvJ,KAAK6wB,OAAS7wB,KAAK8wB,WAAW9J,MAAM6J,GAEpC7wB,KAAK6wB,OAAS7wB,KAAK8wB,WAGrBrR,EAAUtc,KAAKnD,KAAMuJ,EAAWzI,GAWlC,MAxCA4U,IAAS+a,EAAoBhR,GAgC7BgR,EAAmBzsB,UAAU+sB,MAAQ,WACnC/wB,KAAK8wB,WAAW3lB,QAAO,IAGzBslB,EAAmBzsB,UAAUgtB,OAAS,WACpChxB,KAAK8wB,WAAW3lB,QAAO,IAGlBslB,GAEP1Q,GAUFvB,IAAgBoS,SAAW,SAAUC,GACnC,MAAO,IAAIJ,IAAmBzwB,KAAM6wB,GAoDtC,IAAII,IAA8B,SAAUxR,GAI1C,QAASlW,GAAU1I,GAGjB,QAASqwB,KAAe,KAAOvjB,EAAElO,OAAS,GAAKoB,EAAEsK,OAAOwC,EAAEU,SAF1D,GAAY8iB,GAARxjB,KAIAvE,EACFkI,GACEtR,KAAKc,OACLd,KAAK6wB,OAAOzF,WAAU,GAAOtB,uBAC7B,SAAU7M,EAAMmU,GACd,OAASnU,KAAMA,EAAMmU,WAAYA,KAElC7nB,UACC,SAAUyB;AACJmmB,IAAuB9xB,GAAa2L,EAAQomB,YAAcD,GAC5DA,EAAqBnmB,EAAQomB,WAEzBpmB,EAAQomB,YAAcF,MAE1BC,EAAqBnmB,EAAQomB,WAEzBpmB,EAAQomB,WACVvwB,EAAEsK,OAAOH,EAAQiS,MAEjBtP,EAAEjM,KAAKsJ,EAAQiS,QAIrB,SAAU1R,GACR2lB,IACArwB,EAAEqK,QAAQK,IAEZ,WACE2lB,IACArwB,EAAEuK,eAGV,OAAOhC,GAGT,QAAS6nB,GAA2BnwB,EAAQ+vB,GAC1C7wB,KAAKc,OAASA,EACdd,KAAK8wB,WAAa,GAAIvO,IAElBsO,GAAUA,EAAOtnB,UACnBvJ,KAAK6wB,OAAS7wB,KAAK8wB,WAAW9J,MAAM6J,GAEpC7wB,KAAK6wB,OAAS7wB,KAAK8wB,WAGrBrR,EAAUtc,KAAKnD,KAAMuJ,EAAWzI,GAWlC,MA/DA4U,IAASub,EAA4BxR,GAuDrCwR,EAA2BjtB,UAAU+sB,MAAQ,WAC3C/wB,KAAK8wB,WAAW3lB,QAAO,IAGzB8lB,EAA2BjtB,UAAUgtB,OAAS,WAC5ChxB,KAAK8wB,WAAW3lB,QAAO,IAGlB8lB,GAEPlR,GAWFvB,IAAgB6S,iBAAmB,SAAU9f,GAC3C,MAAO,IAAI0f,IAA2BjxB,KAAMuR,GAGhD,IAAI+f,IAAwB,SAAU7R,GAIpC,QAASlW,GAAWlB,GAClB,MAAOrI,MAAKc,OAAOyI,UAAUlB,GAG/B,QAASipB,GAAsBxwB,EAAQywB,EAAa/oB,GAClDiX,EAAUtc,KAAKnD,KAAMuJ,EAAWzI,GAChCd,KAAKuR,QAAU,GAAIigB,IAAkBD,EAAa/oB,GAClDxI,KAAKc,OAASA,EAAO0tB,UAAUxuB,KAAKuR,SAASoc,WAO/C,MAhBAjY,IAAS4b,EAAsB7R,GAY/B6R,EAAqBttB,UAAUytB,QAAU,SAAUC,GACjD,MAAO1xB,MAAKuR,QAAQkgB,QAAyB,MAAjBC,EAAwB,GAAKA,IAGpDJ,GAEPvR,IAEEyR,GAAqB,SAAU/R,GAEjC,QAASlW,GAAWlB,GAClB,MAAOrI,MAAKuR,QAAQhI,UAAUlB,GAKhC,QAASmpB,GAAkBD,EAAa/oB,GACvB,MAAf+oB,IAAwBA,GAAc,GAEtC9R,EAAUtc,KAAKnD,KAAMuJ,GACrBvJ,KAAKuR,QAAU,GAAIgR,IACnBviB,KAAKuxB,YAAcA,EACnBvxB,KAAK8a,MAAQyW,KAAmB,KAChCvxB,KAAK2xB,eAAiB,EACtB3xB,KAAK4xB,oBAAsB,KAC3B5xB,KAAKM,MAAQ,KACbN,KAAK6xB,WAAY,EACjB7xB,KAAK8xB,cAAe,EACpB9xB,KAAKwI,UAAYA,GAAaG,GA6EhC,MA3FA+M,IAAS8b,EAAmB/R,GAiB5B5J,GAAc2b,EAAkBxtB,UAAWqb,IACzCjU,YAAa,WACXpL,KAAK8xB,cAAe,EACf9xB,KAAKuxB,aAAqC,IAAtBvxB,KAAK8a,MAAMrb,OAIlCO,KAAK8a,MAAMpZ,KAAK+c,GAAaW,sBAH7Bpf,KAAKuR,QAAQnG,cACbpL,KAAK+xB,0BAKT7mB,QAAS,SAAU5K,GACjBN,KAAK6xB,WAAY,EACjB7xB,KAAKM,MAAQA,EACRN,KAAKuxB,aAAqC,IAAtBvxB,KAAK8a,MAAMrb,OAIlCO,KAAK8a,MAAMpZ,KAAK+c,GAAaS,cAAc5e,KAH3CN,KAAKuR,QAAQrG,QAAQ5K,GACrBN,KAAK+xB,0BAKT5mB,OAAQ,SAAUnG,GACZhF,KAAK2xB,gBAAkB,EACzB3xB,KAAKuxB,aAAevxB,KAAK8a,MAAMpZ,KAAK+c,GAAaO,aAAaha,KAEnC,IAA1BhF,KAAK2xB,kBAA2B3xB,KAAK+xB,wBACtC/xB,KAAKuR,QAAQpG,OAAOnG,KAGxBgtB,gBAAiB,SAAUN,GACzB,GAAI1xB,KAAKuxB,YACP,KAAOvxB,KAAK8a,MAAMrb,OAAS,IAAMiyB,EAAgB,GAA4B,MAAvB1xB,KAAK8a,MAAM,GAAG7M,OAAe,CACjF,GAAIob,GAAQrpB,KAAK8a,MAAMzM,OACvBgb,GAAM/a,OAAOtO,KAAKuR,SACC,MAAf8X,EAAMpb,KACRyjB,KAEA1xB,KAAK+xB,wBACL/xB,KAAK8a,UAKX,MAAO4W,IAETD,QAAS,SAAU3pB,GACjB9H,KAAK+xB,uBACL,IAAI/kB,GAAOhN,IAkBX,OAhBAA,MAAK4xB,oBAAsB5xB,KAAKwI,UAAUmQ,kBAAkB7Q,EAC5D,SAASjB,EAAGjH,GACV,GAAI2sB,GAAYvf,EAAKglB,gBAAgBpyB,GACjC8oB,EAAU1b,EAAK8kB,cAAgB9kB,EAAK6kB,SACxC,QAAKnJ,GAAW6D,EAAY,GAC1Bvf,EAAK2kB,eAAiBpF,EAEfxV,GAAiB,WACtB/J,EAAK2kB,eAAiB,KAJ1B,SAYK3xB,KAAK4xB,qBAEdG,sBAAuB,WACjB/xB,KAAK4xB,sBACP5xB,KAAK4xB,oBAAoBziB,UACzBnP,KAAK4xB,oBAAsB,SAK1BJ,GACPzR,GAWFvB,IAAgByT,WAAa,SAAUV,EAAa/oB,GAQlD,MANI+oB,IAAe7oB,GAAY6oB,KAC3B/oB,EAAY+oB,EACZA,GAAc,GAGC,MAAfA,IAAwBA,GAAc,GACnC,GAAID,IAAqBtxB,KAAMuxB,EAAa/oB,IAQnDgW,GAAgB0T,KAAO,SAAUC,GAG/B,QAASC,KACPtxB,EAAOkwB,SAHT,GAAIlwB,GAASd,KAAKqxB,kBAuBlB,OAjBAc,GAAK/E,YAAY,QAASgF,GAE1BtxB,EAAOyI,UACL,SAAUgB,IACP4nB,EAAKE,MAAMvsB,OAAOyE,KAAOzJ,EAAOiwB,SAEnC,SAAUxlB,GACR4mB,EAAKG,KAAK,QAAS/mB,IAErB,YAEG4mB,EAAKI,UAAYJ,EAAKK,MACvBL,EAAK5E,eAAe,QAAS6E,KAGjCtxB,EAAOkwB,SAEAmB,GAQT3T,GAAgBiU,UAAY,SAASC,GAGnC,QAASC,GAAqB9xB,GAC5B,OACE+xB,oBAAqB,WACnB,MAAO/xB,IAETgyB,oBAAqB,SAASC,EAAKC,GACjC,MAAOD,GAAI3nB,OAAO4nB,IAEpBC,sBAAuB,SAASF,GAC9B,MAAOA,GAAI1nB,gBAXjB,GAAItK,GAASd,IAgBb,OAAO,IAAIiJ,IAAoB,SAASpI,GACtC,GAAIoyB,GAAQP,EAAWC,EAAqB9xB,GAC5C,OAAOC,GAAOyI,UACZ,SAASyZ,GACP,GAAIhS,GAAM/F,GAASgoB,EAAM,sBAAsB9vB,KAAK8vB,EAAOpyB,EAAGmiB,EAC1DhS,KAAQ7Q,IAAYU,EAAEqK,QAAQ8F,EAAI9Q,IAExC,SAAUA,GAAKW,EAAEqK,QAAQhL,IACzB,WAAa+yB,EAAM,uBAAuBpyB,MAE3CC,GAGL,IAAImI,IAAsB2J,GAAG3J,oBAAuB,SAAUwW,GAI5D,QAASuB,GAAcC,GACrB,MAAOA,IAAc3a,GAAW2a,EAAW9R,SAAW8R,EACpD3a,GAAW2a,GAAclK,GAAiBkK,GAAcjK,GAG5D,QAAS1N,GAAczC,EAAG+Q,GACxB,GAAIsJ,GAAMtJ,EAAM,GAAI5K,EAAO4K,EAAM,GAC7BuJ,EAAMlW,GAAS+B,EAAKkmB,aAAa/vB,KAAK6J,EAAMkU,EAEhD,OAAIC,KAAQhhB,IACN+gB,EAAIvB,KAAKxf,GAASD,OAExBghB,GAAI5X,cAAc0X,EAAcG,IAFK/gB,EAAQD,GAASD,GAKxD,QAASizB,GAAe9qB,GACtB,GAAI6Y,GAAM,GAAIG,IAAmBhZ,GAAWuP,GAASsJ,EAAKlhB,KAO1D,OALI2I,IAAuBsS,mBACzBtS,GAAuBgQ,kBAAkBf,EAAOtO,GAEhDA,EAAc,KAAMsO,GAEfsJ,EAGT,QAASjY,GAAoBM,EAAWjB,GACtCtI,KAAKc,OAASwH,EACdtI,KAAKkzB,YAAc3pB,EACnBkW,EAAUtc,KAAKnD,KAAMmzB,GAGvB,MAnCAzd,IAASzM,EAAqBwW,GAmCvBxW,GAEP8W,IAEEsB,GAAsB,SAAU5B,GAGlC,QAAS4B,GAAmBhZ,GAC1BoX,EAAUtc,KAAKnD,MACfA,KAAKqI,SAAWA,EAChBrI,KAAKgoB,EAAI,GAAI7e,IALfuM,GAAS2L,EAAoB5B,EAQ7B,IAAI2T,GAA8B/R,EAAmBrd,SA8BrD,OA5BAovB,GAA4B3hB,KAAO,SAAUzM,GAC3C,GAAInC,GAASoI,GAASjL,KAAKqI,SAAS8C,QAAQhI,KAAKnD,KAAKqI,SAAUrD,EAC5DnC,KAAW1C,KACbH,KAAKmP,UACL/O,EAAQyC,EAAO3C,KAInBkzB,EAA4B9yB,MAAQ,SAAUiL,GAC5C,GAAI1I,GAASoI,GAASjL,KAAKqI,SAAS6C,SAAS/H,KAAKnD,KAAKqI,SAAUkD,EACjEvL,MAAKmP,UACLtM,IAAW1C,IAAYC,EAAQyC,EAAO3C,IAGxCkzB,EAA4B1T,UAAY,WACtC,GAAI7c,GAASoI,GAASjL,KAAKqI,SAAS+C,aAAajI,KAAKnD,KAAKqI,SAC3DrI,MAAKmP,UACLtM,IAAW1C,IAAYC,EAAQyC,EAAO3C,IAGxCkzB,EAA4B9pB,cAAgB,SAAUtE,GAAShF,KAAKgoB,EAAE1e,cAActE,IACpFouB,EAA4B9c,cAAgB,WAAc,MAAOtW,MAAKgoB,EAAE1R,iBAExE8c,EAA4BjkB,QAAU,WACpCsQ,EAAUzb,UAAUmL,QAAQhM,KAAKnD,MACjCA,KAAKgoB,EAAE7Y,WAGFkS,GACP7B,IAEE6T,GAAoB,SAAU9hB,EAASlJ,GACzCrI,KAAKuR,QAAUA,EACfvR,KAAKqI,SAAWA,EAGlBgrB,IAAkBrvB,UAAUmL,QAAU,WACpC,IAAKnP,KAAKuR,QAAQzF,YAAgC,OAAlB9L,KAAKqI,SAAmB,CACtD,GAAI2N,GAAMhW,KAAKuR,QAAQ+hB,UAAU5yB,QAAQV,KAAKqI,SAC9CrI,MAAKuR,QAAQ+hB,UAAU3c,OAAOX,EAAK,GACnChW,KAAKqI,SAAW,MAQpB,IAAIka,IAAU3P,GAAG2P,QAAW,SAAU9C,GACpC,QAASlW,GAAUlB,GAEjB,MADA6O,IAAclX,MACTA,KAAKqK,UAINrK,KAAKuzB,UACPlrB,EAAS6C,QAAQlL,KAAKM,OACf0W,KAET3O,EAAS+C,cACF4L,KARLhX,KAAKszB,UAAU5xB,KAAK2G,GACb,GAAIgrB,IAAkBrzB,KAAMqI,IAevC,QAASka,KACP9C,EAAUtc,KAAKnD,KAAMuJ,GACrBvJ,KAAK8L,YAAa,EAClB9L,KAAKqK,WAAY,EACjBrK,KAAKszB,aACLtzB,KAAKuzB,UAAW,EAuElB,MAjFA7d,IAAS6M,EAAS9C,GAalB5J,GAAc0M,EAAQve,UAAWqb,GAASrb,WAKxCwvB,aAAc,WAAc,MAAOxzB,MAAKszB,UAAU7zB,OAAS,GAI3D2L,YAAa,WAEX,GADA8L,GAAclX,OACTA,KAAKqK,UAAW,CACnBrK,KAAKqK,WAAY,CACjB,KAAK,GAAIzK,GAAI,EAAG6zB,EAAKn0B,EAAWU,KAAKszB,WAAY9zB,EAAMi0B,EAAGh0B,OAAYD,EAAJI,EAASA,IACzE6zB,EAAG7zB,GAAGwL,aAGRpL,MAAKszB,UAAU7zB,OAAS,IAO5ByL,QAAS,SAAU5K,GAEjB,GADA4W,GAAclX,OACTA,KAAKqK,UAAW,CACnBrK,KAAKqK,WAAY,EACjBrK,KAAKM,MAAQA,EACbN,KAAKuzB,UAAW,CAChB,KAAK,GAAI3zB,GAAI,EAAG6zB,EAAKn0B,EAAWU,KAAKszB,WAAY9zB,EAAMi0B,EAAGh0B,OAAYD,EAAJI,EAASA,IACzE6zB,EAAG7zB,GAAGsL,QAAQ5K,EAGhBN,MAAKszB,UAAU7zB,OAAS,IAO5B0L,OAAQ,SAAUnG,GAEhB,GADAkS,GAAclX,OACTA,KAAKqK,UACR,IAAK,GAAIzK,GAAI,EAAG6zB,EAAKn0B,EAAWU,KAAKszB,WAAY9zB,EAAMi0B,EAAGh0B,OAAYD,EAAJI,EAASA,IACzE6zB,EAAG7zB,GAAGuL,OAAOnG,IAOnBmK,QAAS,WACPnP,KAAK8L,YAAa,EAClB9L,KAAKszB,UAAY,QAUrB/Q,EAAQxO,OAAS,SAAU1L,EAAU9H,GACnC,MAAO,IAAImzB,IAAiBrrB,EAAU9H,IAGjCgiB,GACPxC,IAMEjV,GAAe8H,GAAG9H,aAAgB,SAAU2U,GAE9C,QAASlW,GAAUlB,GAGjB,MAFA6O,IAAclX,MAETA,KAAKqK,WAKNrK,KAAKuzB,SACPlrB,EAAS6C,QAAQlL,KAAKM,OACbN,KAAKoK,UACd/B,EAAS8C,OAAOnL,KAAKgF,OACrBqD,EAAS+C,eAET/C,EAAS+C,cAGJ4L,KAbLhX,KAAKszB,UAAU5xB,KAAK2G,GACb,GAAIgrB,IAAkBrzB,KAAMqI,IAqBvC,QAASyC,KACP2U,EAAUtc,KAAKnD,KAAMuJ,GAErBvJ,KAAK8L,YAAa,EAClB9L,KAAKqK,WAAY,EACjBrK,KAAKoK,UAAW,EAChBpK,KAAKszB,aACLtzB,KAAKuzB,UAAW,EA4ElB,MAzFA7d,IAAS5K,EAAc2U,GAgBvB5J,GAAc/K,EAAa9G,UAAWqb,IAKpCmU,aAAc,WAEZ,MADAtc,IAAclX,MACPA,KAAKszB,UAAU7zB,OAAS,GAKjC2L,YAAa,WACX,GAAIxL,GAAGJ,CAEP,IADA0X,GAAclX,OACTA,KAAKqK,UAAW,CACnBrK,KAAKqK,WAAY,CACjB,IAAIopB,GAAKn0B,EAAWU,KAAKszB,WAAY9zB,EAAMi0B,EAAGh0B,MAE9C,IAAIO,KAAKoK,SACP,IAAKxK,EAAI,EAAOJ,EAAJI,EAASA,IAAK,CACxB,GAAIiB,GAAI4yB,EAAG7zB,EACXiB,GAAEsK,OAAOnL,KAAKgF,OACdnE,EAAEuK,kBAGJ,KAAKxL,EAAI,EAAOJ,EAAJI,EAASA,IACnB6zB,EAAG7zB,GAAGwL,aAIVpL,MAAKszB,UAAU7zB,OAAS,IAO5ByL,QAAS,SAAU5K,GAEjB,GADA4W,GAAclX,OACTA,KAAKqK,UAAW,CACnBrK,KAAKqK,WAAY,EACjBrK,KAAKuzB,UAAW,EAChBvzB,KAAKM,MAAQA,CAEb,KAAK,GAAIV,GAAI,EAAG6zB,EAAKn0B,EAAWU,KAAKszB,WAAY9zB,EAAMi0B,EAAGh0B,OAAYD,EAAJI,EAASA,IACzE6zB,EAAG7zB,GAAGsL,QAAQ5K,EAGhBN,MAAKszB,UAAU7zB,OAAS,IAO5B0L,OAAQ,SAAUnG,GAChBkS,GAAclX,MACVA,KAAKqK,YACTrK,KAAKgF,MAAQA,EACbhF,KAAKoK,UAAW,IAKlB+E,QAAS,WACPnP,KAAK8L,YAAa,EAClB9L,KAAKszB,UAAY,KACjBtzB,KAAK0N,UAAY,KACjB1N,KAAKgF,MAAQ,QAIV8F,GACPiV,IAEE2T,GAAmB9gB,GAAG8gB,iBAAoB,SAAUjU,GAGtD,QAASlW,GAAUlB,GACjB,MAAOrI,MAAKO,WAAWgJ,UAAUlB,GAGnC,QAASqrB,GAAiBrrB,EAAU9H,GAClCP,KAAKqI,SAAWA,EAChBrI,KAAKO,WAAaA,EAClBkf,EAAUtc,KAAKnD,KAAMuJ,GAevB,MAxBAmM,IAASge,EAAkBjU,GAY3B5J,GAAc6d,EAAiB1vB,UAAWqb,GAASrb,WACjDoH,YAAa,WACXpL,KAAKqI,SAAS+C,eAEhBF,QAAS,SAAU5K,GACjBN,KAAKqI,SAAS6C,QAAQ5K,IAExB6K,OAAQ,SAAUnG,GAChBhF,KAAKqI,SAAS8C,OAAOnG,MAIlB0uB,GACP3T,IAMEmP,GAAkBtc,GAAGsc,gBAAmB,SAAUzP,GACpD,QAASlW,GAAUlB,GAEjB,MADA6O,IAAclX,MACTA,KAAKqK,WAKNrK,KAAKuzB,SACPlrB,EAAS6C,QAAQlL,KAAKM,OAEtB+H,EAAS+C,cAEJ4L,KATLhX,KAAKszB,UAAU5xB,KAAK2G,GACpBA,EAAS8C,OAAOnL,KAAKgF,OACd,GAAIquB,IAAkBrzB,KAAMqI,IAgBvC,QAAS6mB,GAAgBlqB,GACvBya,EAAUtc,KAAKnD,KAAMuJ,GACrBvJ,KAAKgF,MAAQA,EACbhF,KAAKszB,aACLtzB,KAAK8L,YAAa,EAClB9L,KAAKqK,WAAY,EACjBrK,KAAKuzB,UAAW,EA4ElB,MAxFA7d,IAASwZ,EAAiBzP,GAe1B5J,GAAcqZ,EAAgBlrB,UAAWqb,IAQvCsU,SAAU,WAEN,GADAzc,GAAclX,MACVA,KAAKuzB,SACL,KAAMvzB,MAAKM,KAEf,OAAON,MAAKgF,OAMhBwuB,aAAc,WAAc,MAAOxzB,MAAKszB,UAAU7zB,OAAS,GAI3D2L,YAAa,WAEX,GADA8L,GAAclX,OACVA,KAAKqK,UAAT,CACArK,KAAKqK,WAAY,CACjB,KAAK,GAAIzK,GAAI,EAAG6zB,EAAKn0B,EAAWU,KAAKszB,WAAY9zB,EAAMi0B,EAAGh0B,OAAYD,EAAJI,EAASA,IACzE6zB,EAAG7zB,GAAGwL,aAGRpL,MAAKszB,UAAU7zB,OAAS,IAM1ByL,QAAS,SAAU5K,GAEjB,GADA4W,GAAclX,OACVA,KAAKqK,UAAT,CACArK,KAAKqK,WAAY,EACjBrK,KAAKuzB,UAAW,EAChBvzB,KAAKM,MAAQA,CAEb,KAAK,GAAIV,GAAI,EAAG6zB,EAAKn0B,EAAWU,KAAKszB,WAAY9zB,EAAMi0B,EAAGh0B,OAAYD,EAAJI,EAASA,IACzE6zB,EAAG7zB,GAAGsL,QAAQ5K,EAGhBN,MAAKszB,UAAU7zB,OAAS,IAM1B0L,OAAQ,SAAUnG,GAEhB,GADAkS,GAAclX,OACVA,KAAKqK,UAAT,CACArK,KAAKgF,MAAQA,CACb,KAAK,GAAIpF,GAAI,EAAG6zB,EAAKn0B,EAAWU,KAAKszB,WAAY9zB,EAAMi0B,EAAGh0B,OAAYD,EAAJI,EAASA,IACzE6zB,EAAG7zB,GAAGuL,OAAOnG,KAMjBmK,QAAS,WACPnP,KAAK8L,YAAa,EAClB9L,KAAKszB,UAAY,KACjBtzB,KAAKgF,MAAQ,KACbhF,KAAK0N,UAAY,QAIdwhB,GACPnP,IAMEwP,GAAgB3c,GAAG2c,cAAiB,SAAU9P,GAIhD,QAASmU,GAA0BriB,EAASlJ,GAC1C,MAAO0O,IAAiB,WACtB1O,EAAS8G,WACRoC,EAAQzF,YAAcyF,EAAQ+hB,UAAU3c,OAAOpF,EAAQ+hB,UAAU5yB,QAAQ2H,GAAW,KAIzF,QAASkB,GAAUlB,GACjB,GAAIwrB,GAAK,GAAIpT,IAAkBzgB,KAAKwI,UAAWH,GAC7Ce,EAAewqB,EAA0B5zB,KAAM6zB,EACjD3c,IAAclX,MACdA,KAAK8zB,MAAM9zB,KAAKwI,UAAUyE,OAC1BjN,KAAKszB,UAAU5xB,KAAKmyB,EAEpB,KAAK,GAAIj0B,GAAI,EAAGJ,EAAMQ,KAAK2N,EAAElO,OAAYD,EAAJI,EAASA,IAC5Ci0B,EAAG1oB,OAAOnL,KAAK2N,EAAE/N,GAAGoF,MAUtB,OAPIhF,MAAKuzB,SACPM,EAAG3oB,QAAQlL,KAAKM,OACPN,KAAKqK,WACdwpB,EAAGzoB,cAGLyoB,EAAGjT,eACIxX,EAWT,QAASmmB,GAAcF,EAAYC,EAAY9mB,GAC7CxI,KAAKqvB,WAA2B,MAAdA,EAAqBlnB,EAAiBknB,EACxDrvB,KAAKsvB,WAA2B,MAAdA,EAAqBnnB,EAAiBmnB,EACxDtvB,KAAKwI,UAAYA,GAAaG,GAC9B3I,KAAK2N,KACL3N,KAAKszB,aACLtzB,KAAKqK,WAAY,EACjBrK,KAAK8L,YAAa,EAClB9L,KAAKuzB,UAAW,EAChBvzB,KAAKM,MAAQ,KACbmf,EAAUtc,KAAKnD,KAAMuJ,GAhDvB,GAAIpB,GAAiBH,KAAK4c,IAAI,EAAG,IAAM,CAgIvC,OAlGAlP,IAAS6Z,EAAe9P,GAqBxB5J,GAAc0Z,EAAcvrB,UAAWqb,GAASrb,WAK9CwvB,aAAc,WACZ,MAAOxzB,MAAKszB,UAAU7zB,OAAS,GAEjCq0B,MAAO,SAAU7mB,GACf,KAAOjN,KAAK2N,EAAElO,OAASO,KAAKqvB,YAC1BrvB,KAAK2N,EAAEU,OAET,MAAOrO,KAAK2N,EAAElO,OAAS,GAAMwN,EAAMjN,KAAK2N,EAAE,GAAGmiB,SAAY9vB,KAAKsvB,YAC5DtvB,KAAK2N,EAAEU,SAOXlD,OAAQ,SAAUnG,GAEhB,GADAkS,GAAclX,OACVA,KAAKqK,UAAT,CACA,GAAI4C,GAAMjN,KAAKwI,UAAUyE,KACzBjN,MAAK2N,EAAEjM,MAAOouB,SAAU7iB,EAAKjI,MAAOA,IACpChF,KAAK8zB,MAAM7mB,EAEX,KAAK,GAAIrN,GAAI,EAAG6zB,EAAKn0B,EAAWU,KAAKszB,WAAY9zB,EAAMi0B,EAAGh0B,OAAYD,EAAJI,EAASA,IAAK,CAC9E,GAAIyI,GAAWorB,EAAG7zB,EAClByI,GAAS8C,OAAOnG,GAChBqD,EAASuY,kBAOb1V,QAAS,SAAU5K,GAEjB,GADA4W,GAAclX,OACVA,KAAKqK,UAAT,CACArK,KAAKqK,WAAY,EACjBrK,KAAKM,MAAQA,EACbN,KAAKuzB,UAAW,CAChB,IAAItmB,GAAMjN,KAAKwI,UAAUyE,KACzBjN,MAAK8zB,MAAM7mB,EACX,KAAK,GAAIrN,GAAI,EAAG6zB,EAAKn0B,EAAWU,KAAKszB,WAAY9zB,EAAMi0B,EAAGh0B,OAAYD,EAAJI,EAASA,IAAK,CAC9E,GAAIyI,GAAWorB,EAAG7zB,EAClByI,GAAS6C,QAAQ5K,GACjB+H,EAASuY,eAEX5gB,KAAKszB,UAAU7zB,OAAS,IAK1B2L,YAAa,WAEX,GADA8L,GAAclX,OACVA,KAAKqK,UAAT,CACArK,KAAKqK,WAAY,CACjB,IAAI4C,GAAMjN,KAAKwI,UAAUyE,KACzBjN,MAAK8zB,MAAM7mB,EACX,KAAK,GAAIrN,GAAI,EAAG6zB,EAAKn0B,EAAWU,KAAKszB,WAAY9zB,EAAMi0B,EAAGh0B,OAAYD,EAAJI,EAASA,IAAK,CAC9E,GAAIyI,GAAWorB,EAAG7zB,EAClByI,GAAS+C,cACT/C,EAASuY,eAEX5gB,KAAKszB,UAAU7zB,OAAS,IAK1B0P,QAAS,WACPnP,KAAK8L,YAAa,EAClB9L,KAAKszB,UAAY,QAId/D,GACPxP,GAKFnN,IAAGmhB,OAAU,SAAUtU,GAGrB,QAASsU,KACPtU,EAAUtc,KAAKnD,MAajB,MAhBA0V,IAASqe,EAAQtU,GASjBsU,EAAO/vB,UAAU+sB,MAAQ,WAAc/wB,KAAKmL,QAAO,IAKnD4oB,EAAO/vB,UAAUgtB,OAAS,WAAchxB,KAAKmL,QAAO,IAE7C4oB,GACPxR,IAEmB,kBAAVyR,SAA6C,gBAAdA,QAAOC,KAAmBD,OAAOC,KACzE1sB,GAAKqL,GAAKA,GAEVohB,OAAO,WACL,MAAOphB,OAEAX,IAAeM,GAEpBE,IACDF,GAAWL,QAAUU,IAAIA,GAAKA,GAE/BX,GAAYW,GAAKA,GAInBrL,GAAKqL,GAAKA,EAIZ,IAAI1Q,IAAcC,MAElBgB,KAAKnD"} \ No newline at end of file diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/rx-lite/rx.lite.min.js b/node_modules/eslint/node_modules/inquirer/node_modules/rx-lite/rx.lite.min.js deleted file mode 100644 index ed43db2..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/rx-lite/rx.lite.min.js +++ /dev/null @@ -1,5 +0,0 @@ -/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/ -(function(a){function b(a){for(var b=a.length,c=new Array(b),d=0;b>d;d++)c[d]=a[d];return c}function c(a){return function(){try{return a.apply(this,arguments)}catch(b){return sa.e=b,sa}}}function d(a){throw a}function e(a,b){if(ua&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(ya)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var e=c.join("\n"+ya+"\n");a.stack=f(e)}}function f(a){for(var b=a.split("\n"),c=[],d=0,e=b.length;e>d;d++){var f=b[d];g(f)||h(f)||!f||c.push(f)}return c.join("\n")}function g(a){var b=j(a);if(!b)return!1;var c=b[0],d=b[1];return c===wa&&d>=xa&&ed>=d}function h(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function i(){if(ua)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=j(c);if(!d)return;return wa=d[0],d[1]}}function j(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function k(a){var b=[];if(!gb(a))return b;fb.nonEnumArgs&&a.length&&hb(a)&&(a=jb.call(a));var c=fb.enumPrototypes&&"function"==typeof a,d=fb.enumErrorProps&&(a===_a||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(fb.nonEnumShadows&&a!==ab){var f=a.constructor,g=-1,h=Na;if(a===(f&&f.prototype))var i=a===bb?Xa:a===_a?Sa:Ya.call(a),j=eb[i];for(;++g-1:void 0});return c.pop(),d.pop(),q}function p(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function q(a){this._s=a}function r(a){this._s=a,this._l=a.length,this._i=0}function s(a){this._a=a}function t(a){this._a=a,this._l=x(a),this._i=0}function u(a){return"number"==typeof a&&ia.isFinite(a)}function v(b){var c,d=b[Ga];if(!d&&"string"==typeof b)return c=new q(b),c[Ga]();if(!d&&b.length!==a)return c=new s(b),c[Ga]();if(!d)throw new TypeError("Object is not iterable");return b[Ga]()}function w(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function x(a){var b=+a.length;return isNaN(b)?0:0!==b&&u(b)?(b=w(b)*Math.floor(Math.abs(b)),0>=b?0:b>gc?gc:b):b}function y(a,b){this.observer=a,this.parent=b}function z(a,b){return yb(a)||(a=Cb),new ic(b,a)}function A(a,b){this.observer=a,this.parent=b}function B(a,b){this.observer=a,this.parent=b}function C(a,b){return new Yc(function(c){var d=new tb,e=new ub;return e.setDisposable(d),d.setDisposable(a.subscribe(new uc(c,e,b))),e},a)}function D(){return!1}function E(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function D(){return!1}function D(){return!1}function F(){return[]}function E(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function D(){return!1}function F(){return[]}function E(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function G(a){return function(b){return a.subscribe(b)}}function H(a,b){this.o=a,this.accumulator=b.accumulator,this.hasSeed=b.hasSeed,this.seed=b.seed,this.hasAccumulation=!1,this.accumulation=null,this.hasValue=!1,this.isStopped=!1}function I(b,c){return function(d){for(var e=d,f=0;c>f;f++){var g=e[b[f]];if("undefined"==typeof g)return a;e=g}return e}}function J(a,b,c,d){var e=new ad;return d.push(K(e,b,c)),a.apply(b,d),e.asObservable()}function K(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];if(ra(c)){if(e=ta(c).apply(b,e),e===sa)return a.onError(e.e);a.onNext(e)}else e.length<=1?a.onNext(e[0]):a.onNext(e);a.onCompleted()}}function L(a,b,c,d){var e=new ad;return d.push(M(e,b,c)),a.apply(b,d),e.asObservable()}function M(a,b,c){return function(){var d=arguments[0];if(d)return a.onError(d);for(var e=arguments.length,f=[],g=1;e>g;g++)f[g-1]=arguments[g];if(ra(c)){var f=ta(c).apply(b,f);if(f===sa)return a.onError(f.e);a.onNext(f)}else f.length<=1?a.onNext(f[0]):a.onNext(f);a.onCompleted()}}function N(a,b,c){this._e=a,this._n=b,this._fn=c,this._e.addEventListener(this._n,this._fn,!1),this.isDisposed=!1}function O(a,b,c){var d=new mb,e=Object.prototype.toString.call(a);if("[object NodeList]"===e||"[object HTMLCollection]"===e)for(var f=0,g=a.length;g>f;f++)d.add(O(a.item(f),b,c));else a&&d.add(new N(a,b,c));return d}function P(a,b){return function(){var c=arguments[0];return ra(b)&&(c=ta(b).apply(null,arguments),c===sa)?a.onError(c.e):void a.onNext(c)}}function Q(a,b){return new Yc(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function R(a,b,c){return new Yc(function(d){var e=a,f=xb(b);return c.scheduleRecursiveWithAbsoluteAndState(0,e,function(a,b){if(f>0){var g=c.now();e+=f,g>=e&&(e=g+f)}d.onNext(a),b(a+1,e)})})}function S(a,b){return new Yc(function(c){return b.scheduleWithRelative(xb(a),function(){c.onNext(0),c.onCompleted()})})}function T(a,b,c){return a===b?new Yc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):ac(function(){return R(c.now()+a,b,c)})}function U(a,b,c){return new Yc(function(d){var e,f=!1,g=new ub,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new tb,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new mb(e,g)},a)}function V(a,b,c){return ac(function(){return U(a,b-c.now(),c)})}function W(a,b,c){var d,e;return ra(b)?e=b:(d=b,e=c),new Yc(function(b){function c(){i.setDisposable(a.subscribe(function(a){var c=ta(e)(a);if(c===sa)return b.onError(c.e);var d=new tb;g.add(d),d.setDisposable(c.subscribe(function(){b.onNext(a),g.remove(d),f()},function(a){b.onError(a)},function(){b.onNext(a),g.remove(d),f()}))},function(a){b.onError(a)},function(){h=!0,i.dispose(),f()}))}function f(){h&&0===g.length&&b.onCompleted()}var g=new mb,h=!1,i=new ub;return d?i.setDisposable(d.subscribe(c,function(a){b.onError(a)},c)):c(),new mb(i,g)},this)}function X(a,b,c){return yb(c)||(c=Hb),new Yc(function(d){var e,f=new ub,g=!1,h=0,i=a.subscribe(function(a){g=!0,e=a,h++;var i=h,j=new tb;f.setDisposable(j),j.setDisposable(c.scheduleWithRelative(b,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new mb(i,f)},this)}function Y(a,b){return new Yc(function(c){var d,e=!1,f=new ub,g=0,h=a.subscribe(function(a){var h=ta(b)(a);if(h===sa)return c.onError(h.e);qa(h)&&(h=Qc(h)),e=!0,d=a,g++;var i=g,j=new tb;f.setDisposable(j),j.setDisposable(h.subscribe(function(){e&&g===i&&c.onNext(d),e=!1,j.dispose()},function(a){c.onError(a)},function(){e&&g===i&&c.onNext(d),e=!1,j.dispose()}))},function(a){f.dispose(),c.onError(a),e=!1,g++},function(){f.dispose(),e&&c.onNext(d),c.onCompleted(),e=!1,g++});return new mb(h,f)},a)}function Z(a,b){return new Yc(function(c){function d(){g&&(g=!1,c.onNext(e)),f&&c.onCompleted()}var e,f=!1,g=!1,h=new tb;return h.setDisposable(a.subscribe(function(a){g=!0,e=a},function(a){c.onError(a)},function(){f=!0,h.dispose()})),new mb(h,b.subscribe(d,function(a){c.onError(a)},d))},a)}function $(a,b,c,d){return ra(b)&&(d=c,c=b,b=mc()),d||(d=tc(new Tc)),new Yc(function(e){function f(a){var b=k,c=new tb;i.setDisposable(c),c.setDisposable(a.subscribe(function(){k===b&&h.setDisposable(d.subscribe(e)),c.dispose()},function(a){k===b&&e.onError(a)},function(){k===b&&h.setDisposable(d.subscribe(e))}))}function g(){var a=!l;return a&&k++,a}var h=new ub,i=new ub,j=new tb;h.setDisposable(j);var k=0,l=!1;return f(b),j.setDisposable(a.subscribe(function(a){if(g()){e.onNext(a);var b=ta(c)(a);if(b===sa)return e.onError(b.e);f(qa(b)?Qc(b):b)}},function(a){g()&&e.onError(a)},function(){g()&&e.onCompleted()})),new mb(h,i)},a)}function _(a,b,c,d){if(null==c)throw new Error("other or scheduler must be specified");yb(c)&&(d=c,c=tc(new Tc)),c instanceof Error&&(c=tc(c)),yb(d)||(d=Hb);var e=b instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Yc(function(f){function g(){var a=h;l.setDisposable(d[e](b,function(){h===a&&(qa(c)&&(c=Qc(c)),j.setDisposable(c.subscribe(f)))}))}var h=0,i=new tb,j=new ub,k=!1,l=new ub;return j.setDisposable(i),g(),i.setDisposable(a.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new mb(j,l)},a)}function aa(a,b,c){return new Yc(function(d){function e(a,b){if(j[b]=a,g[b]=!0,h||(h=g.every(la))){if(f)return d.onError(f);var e=ta(c).apply(null,j);if(e===sa)return d.onError(e.e);d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new mb(a.subscribe(function(a){e(a,0)},function(a){j[1]?d.onError(a):f=a},function(){i=!0,j[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},function(a){d.onError(a)},function(){i=!0,e(!0,1)}))},a)}var ba={"function":!0,object:!0},ca=ba[typeof exports]&&exports&&!exports.nodeType&&exports,da=ba[typeof self]&&self.Object&&self,ea=ba[typeof window]&&window&&window.Object&&window,fa=ba[typeof module]&&module&&!module.nodeType&&module,ga=fa&&fa.exports===ca&&ca,ha=ca&&fa&&"object"==typeof global&&global&&global.Object&&global,ia=ia=ha||ea!==(this&&this.window)&&ea||da||this,ja={internals:{},config:{Promise:ia.Promise},helpers:{}},ka=ja.helpers.noop=function(){},la=ja.helpers.identity=function(a){return a},ma=ja.helpers.defaultNow=Date.now,na=ja.helpers.defaultComparer=function(a,b){return ib(a,b)},oa=ja.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},pa=(ja.helpers.defaultKeySerializer=function(a){return a.toString()},ja.helpers.defaultError=function(a){throw a}),qa=ja.helpers.isPromise=function(a){return!!a&&"function"!=typeof a.subscribe&&"function"==typeof a.then},ra=ja.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Ya.call(a)}),a}(),sa={e:{}},ta=ja.internals.tryCatch=function(a){if(!ra(a))throw new TypeError("fn must be a function");return c(a)};ja.config.longStackSupport=!1;var ua=!1,va=ta(function(){throw new Error})();ua=!!va.e&&!!va.e.stack;var wa,xa=i(),ya="From previous event:",za=ja.EmptyError=function(){this.message="Sequence contains no elements.",this.name="EmptyError",Error.call(this)};za.prototype=Object.create(Error.prototype);var Aa=ja.ObjectDisposedError=function(){this.message="Object has been disposed",this.name="ObjectDisposedError",Error.call(this)};Aa.prototype=Object.create(Error.prototype);var Ba=ja.ArgumentOutOfRangeError=function(){this.message="Argument out of range",this.name="ArgumentOutOfRangeError",Error.call(this)};Ba.prototype=Object.create(Error.prototype);var Ca=ja.NotSupportedError=function(a){this.message=a||"This operation is not supported",this.name="NotSupportedError",Error.call(this)};Ca.prototype=Object.create(Error.prototype);var Da=ja.NotImplementedError=function(a){this.message=a||"This operation is not implemented",this.name="NotImplementedError",Error.call(this)};Da.prototype=Object.create(Error.prototype);var Ea=ja.helpers.notImplemented=function(){throw new Da},Fa=ja.helpers.notSupported=function(){throw new Ca},Ga="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";ia.Set&&"function"==typeof(new ia.Set)["@@iterator"]&&(Ga="@@iterator");var Ha=ja.doneEnumerator={done:!0,value:a},Ia=ja.helpers.isIterable=function(b){return b[Ga]!==a},Ja=ja.helpers.isArrayLike=function(b){return b&&b.length!==a};ja.helpers.iterator=Ga;var Ka,La=ja.internals.bindCallback=function(a,b,c){if("undefined"==typeof b)return a;switch(c){case 0:return function(){return a.call(b)};case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}},Ma=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Na=Ma.length,Oa="[object Arguments]",Pa="[object Array]",Qa="[object Boolean]",Ra="[object Date]",Sa="[object Error]",Ta="[object Function]",Ua="[object Number]",Va="[object Object]",Wa="[object RegExp]",Xa="[object String]",Ya=Object.prototype.toString,Za=Object.prototype.hasOwnProperty,$a=Ya.call(arguments)==Oa,_a=Error.prototype,ab=Object.prototype,bb=String.prototype,cb=ab.propertyIsEnumerable;try{Ka=!(Ya.call(document)==Va&&!({toString:0}+""))}catch(db){Ka=!0}var eb={};eb[Pa]=eb[Ra]=eb[Ua]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},eb[Qa]=eb[Xa]={constructor:!0,toString:!0,valueOf:!0},eb[Sa]=eb[Ta]=eb[Wa]={constructor:!0,toString:!0},eb[Va]={constructor:!0};var fb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);fb.enumErrorProps=cb.call(_a,"message")||cb.call(_a,"name"),fb.enumPrototypes=cb.call(a,"prototype"),fb.nonEnumArgs=0!=c,fb.nonEnumShadows=!/valueOf/.test(b)}(1);var gb=ja.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},hb=function(a){return a&&"object"==typeof a?Ya.call(a)==Oa:!1};$a||(hb=function(a){return a&&"object"==typeof a?Za.call(a,"callee"):!1});var ib=ja.internals.isEqual=function(a,b){return o(a,b,[],[])},jb=({}.hasOwnProperty,Array.prototype.slice),kb=ja.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},lb=ja.internals.addProperties=function(a){for(var b=[],c=1,d=arguments.length;d>c;c++)b.push(arguments[c]);for(var e=0,f=b.length;f>e;e++){var g=b[e];for(var h in g)a[h]=g[h]}},mb=(ja.internals.addRef=function(a,b){return new Yc(function(c){return new mb(b.getDisposable(),a.subscribe(c))})},ja.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0],b=c.length;else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];for(a=0;b>a;a++)if(!rb(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.length}),nb=mb.prototype;nb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},nb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},nb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var ob=ja.Disposable=function(a){this.isDisposed=!1,this.action=a||ka};ob.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var pb=ob.create=function(a){return new ob(a)},qb=ob.empty={dispose:ka},rb=ob.isDisposable=function(a){return a&&ra(a.dispose)},sb=ob.checkDisposed=function(a){if(a.isDisposed)throw new Aa},tb=ja.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};tb.prototype.getDisposable=function(){return this.current},tb.prototype.setDisposable=function(a){if(this.current)throw new Error("Disposable has already been assigned");var b=this.isDisposed;!b&&(this.current=a),b&&a&&a.dispose()},tb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var ub=ja.SerialDisposable=function(){this.isDisposed=!1,this.current=null};ub.prototype.getDisposable=function(){return this.current},ub.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},ub.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var vb=(ja.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?qb:new a(this)},b}(),ja.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||oa,this.disposable=new tb});vb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},vb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},vb.prototype.isCancelled=function(){return this.disposable.isDisposed},vb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var wb=ja.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),qb}a.isScheduler=function(b){return b instanceof a};var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=ma,a.normalize=function(a){return 0>a&&(a=0),a},a}(),xb=wb.normalize,yb=wb.isScheduler;!function(a){function b(a,b){function c(b){function d(a,b){return g?f.remove(i):h=!0,e(b,c),qb}var g=!1,h=!1,i=a.scheduleWithState(b,d);h||(f.add(i),g=!0)}var d=b[0],e=b[1],f=new mb;return e(d,c),f}function c(a,b,c){function d(b,e){function h(a,b){return i?g.remove(k):j=!0,f(b,d),qb}var i=!1,j=!1,k=a[c](b,e,h);j||(g.add(k),i=!0)}var e=b[0],f=b[1],g=new mb;return f(e,d),g}function d(a,b){return c(a,b,"scheduleWithRelativeAndState")}function e(a,b){return c(a,b,"scheduleWithAbsoluteAndState")}function f(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,f)},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState([a,c],b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,f)},a.scheduleRecursiveWithRelativeAndState=function(a,b,c){return this._scheduleRelative([a,c],b,d)},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,f)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute([a,c],b,e)}}(wb.prototype),function(a){wb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},wb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof ia.setInterval)throw new Ca;b=xb(b);var d=a,e=ia.setInterval(function(){d=c(d)},b);return pb(function(){ia.clearInterval(e)})}}(wb.prototype);var zb,Ab,Bb=wb.immediate=function(){function a(a,b){return b(this,a)}return new wb(ma,a,Fa,Fa)}(),Cb=wb.currentThread=function(){function a(){for(;c.length>0;){var a=c.shift();!a.isCancelled()&&a.invoke()}}function b(b,e){var f=new vb(this,b,e,this.now());if(c)c.push(f);else{c=[f];var g=ta(a)();if(c=null,g===sa)return d(g.e)}return f.disposable}var c,e=new wb(ma,b,Fa,Fa);return e.scheduleRequired=function(){return!c},e}(),Db=(ja.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new tb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),function(){var a,b=ka;if(ia.setTimeout)a=ia.setTimeout,b=ia.clearTimeout;else{if(!ia.WScript)throw new Ca;a=function(a,b){ia.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}()),Eb=Db.setTimeout,Fb=Db.clearTimeout;!function(){function a(b){if(g)Eb(function(){a(b)},0);else{var c=f[b];if(c){g=!0;var e=ta(c)();if(Ab(b),g=!1,e===sa)return d(e.e)}}}function b(){if(!ia.postMessage||ia.importScripts)return!1;var a=!1,b=ia.onmessage;return ia.onmessage=function(){a=!0},ia.postMessage("","*"),ia.onmessage=b,a}function c(b){"string"==typeof b.data&&b.data.substring(0,j.length)===j&&a(b.data.substring(j.length))}var e=1,f={},g=!1;Ab=function(a){delete f[a]};var h=RegExp("^"+String(Ya).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),i="function"==typeof(i=ha&&ga&&ha.setImmediate)&&!h.test(i)&&i;if(ra(i))zb=function(b){var c=e++;return f[c]=b,i(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))zb=function(b){var c=e++;return f[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var j="ms.rx.schedule"+Math.random();ia.addEventListener?ia.addEventListener("message",c,!1):ia.attachEvent?ia.attachEvent("onmessage",c):ia.onmessage=c,zb=function(a){var b=e++;return f[b]=a,ia.postMessage(j+currentId,"*"),b}}else if(ia.MessageChannel){var k=new ia.MessageChannel;k.port1.onmessage=function(b){a(b.data)},zb=function(a){var b=e++;return f[b]=a,k.port2.postMessage(b),b}}else zb="document"in ia&&"onreadystatechange"in ia.document.createElement("script")?function(b){var c=ia.document.createElement("script"),d=e++;return f[d]=b,c.onreadystatechange=function(){a(d),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},ia.document.documentElement.appendChild(c),d}:function(b){var c=e++;return f[c]=b,Eb(function(){a(c)},0),c}}();var Gb,Hb=wb.timeout=wb["default"]=function(){function a(a,b){var c=this,d=new tb,e=zb(function(){!d.isDisposed&&d.setDisposable(b(c,a))});return new mb(d,pb(function(){Ab(e)}))}function b(a,b,c){var d=this,e=wb.normalize(b),f=new tb;if(0===e)return d.scheduleWithState(a,c);var g=Eb(function(){!f.isDisposed&&f.setDisposable(c(d,a))},e);return new mb(f,pb(function(){Fb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new wb(ma,a,b,c)}(),Ib=ja.Notification=function(){function a(a,b,c,d,e,f){this.kind=a,this.value=b,this.exception=c,this._accept=d,this._acceptObservable=e,this.toString=f}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return yb(a)||(a=Bb),new Yc(function(c){return a.scheduleWithState(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Jb=Ib.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){return new Ib("N",d,null,a,b,c)}}(),Kb=Ib.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){return new Ib("E",null,d,a,b,c)}}(),Lb=Ib.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new Ib("C",null,null,a,b,c)}}(),Mb=ja.Observer=function(){},Nb=Mb.create=function(a,b,c){return a||(a=ka),b||(b=pa),c||(c=ka),new Pb(a,b,c)},Ob=ja.internals.AbstractObserver=function(a){function b(){this.isStopped=!1}return kb(b,a),b.prototype.next=Ea,b.prototype.error=Ea,b.prototype.completed=Ea,b.prototype.onNext=function(a){!this.isStopped&&this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(Mb),Pb=ja.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return kb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(Ob),Qb=ja.Observable=function(){function a(a,b){return function(c){var d=c.onError;return c.onError=function(b){e(b,a),d.call(c,b)},b.call(a,c)}}function b(b){if(ja.config.longStackSupport&&ua){var c=ta(d)(new Error).e;this.stack=c.stack.substring(c.stack.indexOf("\n")+1),this._subscribe=a(this,b)}else this._subscribe=b}return Gb=b.prototype,b.isObservable=function(a){return a&&ra(a.subscribe)},Gb.subscribe=Gb.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Nb(a,b,c))},Gb.subscribeOnNext=function(a,b){return this._subscribe(Nb("undefined"!=typeof b?function(c){a.call(b,c)}:a))},Gb.subscribeOnError=function(a,b){return this._subscribe(Nb(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},Gb.subscribeOnCompleted=function(a,b){return this._subscribe(Nb(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},b}(),Rb=ja.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new ub}return kb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursiveWithState(this,function(a,b){var c;if(!(a.queue.length>0))return void(a.isAcquired=!1);c=a.queue.shift();var e=ta(c)();return e===sa?(a.queue=[],a.hasFaulted=!0,d(e.e)):void b(a)}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(Ob),Sb=ja.ObservableBase=function(a){function b(a){return a&&ra(a.dispose)?a:ra(a)?pb(a):qb}function c(a,c){var e=c[0],f=c[1],g=ta(f.subscribeCore).call(f,e);return g!==sa||e.fail(sa.e)?void e.setDisposable(b(g)):d(sa.e)}function e(a){var b=new Zc(a),d=[b,this];return Cb.scheduleRequired()?Cb.scheduleWithState(d,c):c(null,d),b}function f(){a.call(this,e)}return kb(f,a),f.prototype.subscribeCore=Ea,f}(Qb),Tb=function(a){function b(b,c,d,e){this.resultSelector=ja.helpers.isFunction(d)?d:null,this.selector=ja.internals.bindCallback(ja.helpers.isFunction(c)?c:function(){return c},e,3),this.source=b,a.call(this)}function c(a,b,c,d){this.i=0,this.selector=b,this.resultSelector=c,this.source=d,this.isStopped=!1,this.o=a}return kb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.selector,this.resultSelector,this))},c.prototype._wrapResult=function(a,b,c){return this.resultSelector?a.map(function(a,d){return this.resultSelector(b,a,c,d)},this):a},c.prototype.onNext=function(a){if(!this.isStopped){var b=this.i++,c=ta(this.selector)(a,b,this.source);if(c===sa)return this.o.onError(c.e);ja.helpers.isPromise(c)&&(c=ja.Observable.fromPromise(c)),(ja.helpers.isArrayLike(c)||ja.helpers.isIterable(c))&&(c=ja.Observable.from(c)),this.o.onNext(this._wrapResult(c,a,b))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},b}(Sb),Ub=ja.internals.Enumerable=function(){},Vb=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b,c){this.o=a,this.s=b,this.e=c,this.isStopped=!1}return kb(b,a),b.prototype.subscribeCore=function(a){var b,d=new ub,e=Bb.scheduleRecursiveWithState(this.sources[Ga](),function(e,f){if(!b){var g=ta(e.next).call(e);if(g===sa)return a.onError(g.e);if(g.done)return a.onCompleted();var h=g.value;qa(h)&&(h=Qc(h));var i=new tb;d.setDisposable(i),i.setDisposable(h.subscribe(new c(a,f,e)))}});return new mb(d,e,pb(function(){b=!0}))},c.prototype.onNext=function(a){this.isStopped||this.o.onNext(a)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.s(this.e))},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Sb);Ub.prototype.concat=function(){return new Vb(this)};var Wb=function(a){function b(b){this.sources=b,a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){var b,c=this.sources[Ga](),d=new ub,e=Bb.scheduleRecursiveWithState(null,function(e,f){if(!b){var g=ta(c.next).call(c);if(g===sa)return a.onError(g.e);if(g.done)return null!==e?a.onError(e):a.onCompleted();var h=g.value;qa(h)&&(h=Qc(h));var i=new tb;d.setDisposable(i),i.setDisposable(h.subscribe(function(b){a.onNext(b)},f,function(){a.onCompleted()}))}});return new mb(d,e,pb(function(){b=!0}))},b}(Sb);Ub.prototype.catchError=function(){return new Wb(this)},Ub.prototype.catchErrorWhen=function(a){var b=this;return new Yc(function(c){var d,e,f=new _c,g=new _c,h=a(f),i=h.subscribe(g),j=b[Ga](),k=new ub,l=Bb.scheduleRecursive(function(a){if(!d){var b=ta(j.next).call(j);if(b===sa)return c.onError(b.e);if(b.done)return void(e?c.onError(e):c.onCompleted());var h=b.value;qa(h)&&(h=Qc(h));var i=new tb,l=new tb;k.setDisposable(new mb(l,i)),i.setDisposable(h.subscribe(function(a){c.onNext(a)},function(b){l.setDisposable(g.subscribe(a,function(a){c.onError(a)},function(){c.onCompleted()})),f.onNext(b)},function(){c.onCompleted()}))}});return new mb(i,k,l,pb(function(){d=!0}))})};var Xb=function(a){function b(a,b){this.v=a,this.c=null==b?-1:b}function c(a){this.v=a.v,this.l=a.c}return kb(b,a),b.prototype[Ga]=function(){return new c(this)},c.prototype.next=function(){return 0===this.l?Ha:(this.l>0&&this.l--,{done:!1,value:this.v})},b}(Ub),Yb=Ub.repeat=function(a,b){return new Xb(a,b)},Zb=function(a){function b(a,b,c){this.s=a,this.fn=b?La(b,c,3):null}function c(a){this.i=-1,this.s=a.s,this.l=this.s.length,this.fn=a.fn}return kb(b,a),b.prototype[Ga]=function(){return new c(this)},c.prototype.next=function(){return++this.ia?(b.onNext(c[a]),e(a+1)):b.onCompleted()}var b=this.observer,c=this.parent.args,d=c.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)};var jc=Qb.fromArray=function(a,b){return yb(b)||(b=Cb),new ic(a,b)},kc=function(a){function b(){a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){return qb},b}(Sb),lc=new kc,mc=Qb.never=function(){return lc};Qb.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new ic(b,Cb)},Qb.ofWithScheduler=function(a){for(var b=arguments.length,c=new Array(b-1),d=1;b>d;d++)c[d-1]=arguments[d];return new ic(c,a)};var nc=function(a){function b(b,c){this.obj=b,this.keys=Object.keys(b),this.scheduler=c,a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){var b=new A(a,this);return b.run()},b}(Sb);A.prototype.run=function(){function a(a,f){if(e>a){var g=d[a];b.onNext([g,c[g]]),f(a+1)}else b.onCompleted()}var b=this.observer,c=this.parent.obj,d=this.parent.keys,e=d.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},Qb.pairs=function(a,b){return b||(b=Cb),new nc(a,b)};var oc=function(a){function b(b,c,d){this.start=b,this.rangeCount=c,this.scheduler=d,a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){var b=new pc(a,this);return b.run()},b}(Sb),pc=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,e){c>a?(d.onNext(b+a),e(a+1)):d.onCompleted()}var b=this.parent.start,c=this.parent.rangeCount,d=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}();Qb.range=function(a,b,c){return yb(c)||(c=Cb),new oc(a,b,c)};var qc=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){var b=new B(a,this);return b.run()},b}(Sb);B.prototype.run=function(){function a(a,d){return(-1===a||a>0)&&(b.onNext(c),a>0&&a--),0===a?b.onCompleted():void d(a)}var b=this.observer,c=this.parent.value;return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount,a)},Qb.repeat=function(a,b,c){return yb(c)||(c=Cb),new qc(a,b,c)};var rc=function(a){function b(b,c){this.value=b,this.scheduler=c,a.call(this)}function c(a,b,c){this.observer=a,this.value=b,this.scheduler=c}function d(a,b){var c=b[0],d=b[1];return d.onNext(c),d.onCompleted(),qb}return kb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this.value,this.scheduler);return b.run()},c.prototype.run=function(){var a=[this.value,this.observer];return this.scheduler===Bb?d(null,a):this.scheduler.scheduleWithState(a,d)},b}(Sb),sc=(Qb["return"]=Qb.just=function(a,b){return yb(b)||(b=Bb),new rc(a,b)},function(a){function b(b,c){this.error=b,this.scheduler=c,a.call(this)}function c(a,b){this.o=a,this.p=b}function d(a,b){var c=b[0],d=b[1];d.onError(c)}return kb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.p.scheduler.scheduleWithState([this.p.error,this.o],d)},b}(Sb)),tc=Qb["throw"]=function(a,b){return yb(b)||(b=Bb),new sc(a,b)},uc=function(a){function b(b,c,d){this._o=b,this._s=c,this._fn=d,a.call(this)}return kb(b,a),b.prototype.next=function(a){this._o.onNext(a)},b.prototype.completed=function(){return this._o.onCompleted()},b.prototype.error=function(a){var b=ta(this._fn)(a);if(b===sa)return this._o.onError(b.e);qa(b)&&(b=Qc(b));var c=new tb;this._s.setDisposable(c),c.setDisposable(b.subscribe(this._o))},b}(Ob);Gb["catch"]=function(a){return ra(a)?C(this,a):vc([this,a])};var vc=Qb["catch"]=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return $b(a).catchError()};Gb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),wc.apply(this,b)};var wc=Qb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=ra(b[a-1])?b.pop():E;return Array.isArray(b[0])&&(b=b[0]),new Yc(function(a){function c(b){if(g[b]=!0,h||(h=g.every(la))){try{var c=d.apply(null,j)}catch(e){return a.onError(e)}a.onNext(c)}else i.filter(function(a,c){return c!==b}).every(la)&&a.onCompleted()}function e(b){i[b]=!0,i.every(la)&&a.onCompleted()}for(var f=b.length,g=p(f,D),h=!1,i=p(f,D),j=new Array(f),k=new Array(f),l=0;f>l;l++)!function(d){var f=b[d],g=new tb;qa(f)&&(f=Qc(f)),g.setDisposable(f.subscribe(function(a){j[d]=a,c(d)},function(b){a.onError(b)},function(){e(d)})),k[d]=g}(l);return new mb(k)},this)};Gb.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),yc.apply(null,a)};var xc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){this.sources=a,this.o=b}return kb(b,a),b.prototype.subscribeCore=function(a){var b=new c(this.sources,a);return b.run()},c.prototype.run=function(){var a,b=new ub,c=this.sources,d=c.length,e=this.o,f=Bb.scheduleRecursiveWithState(0,function(f,g){if(!a){if(f===d)return e.onCompleted();var h=c[f];qa(h)&&(h=Qc(h));var i=new tb;b.setDisposable(i),i.setDisposable(h.subscribe(function(a){e.onNext(a)},function(a){e.onError(a)},function(){g(f+1)}))}});return new mb(b,f,pb(function(){a=!0}))},b}(Sb),yc=Qb.concat=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(arguments.length);for(var b=0,c=arguments.length;c>b;b++)a[b]=arguments[b]}return new xc(a)};Gb.concatAll=function(){return this.merge(1)};var zc=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){var b=new mb;return b.add(this.source.subscribe(new Ac(a,this.maxConcurrent,b))),b},b}(Sb),Ac=function(){function a(a,b,c){this.o=a,this.max=b,this.g=c,this.done=!1,this.q=[],this.activeCount=0,this.isStopped=!1}function b(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return a.prototype.handleSubscribe=function(a){var c=new tb;this.g.add(c),qa(a)&&(a=Qc(a)),c.setDisposable(a.subscribe(new b(this,c)))},a.prototype.onNext=function(a){this.isStopped||(this.activeCount0?a.handleSubscribe(a.q.shift()):(a.activeCount--,a.done&&0===a.activeCount&&a.o.onCompleted())}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();Gb.merge=function(a){return"number"!=typeof a?Bc(this,a):new zc(this,a)};var Bc=Qb.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(yb(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=Bb,b=0;d>b;b++)c.push(arguments[b]);else for(a=Bb,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),z(a,c).mergeAll()},Cc=ja.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};Cc.prototype=Error.prototype,Qb.mergeDelayError=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}var d=z(null,a);return new Yc(function(a){function b(){0===g.length?a.onCompleted():1===g.length?a.onError(g[0]):a.onError(new Cc(g))}var c=new mb,e=new tb,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new tb;c.add(e),qa(d)&&(d=Qc(d)),e.setDisposable(d.subscribe(function(b){a.onNext(b)},function(a){g.push(a),c.remove(e),f&&1===c.length&&b()},function(){c.remove(e),f&&1===c.length&&b()}))},function(a){g.push(a),f=!0,1===c.length&&b()},function(){f=!0,1===c.length&&b()})),c})};var Dc=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.g=b,this.isStopped=!1,this.done=!1}function d(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return kb(b,a),b.prototype.subscribeCore=function(a){var b=new mb,d=new tb;return b.add(d),d.setDisposable(this.source.subscribe(new c(a,b))),b},c.prototype.onNext=function(a){if(!this.isStopped){var b=new tb;this.g.add(b),qa(a)&&(a=Qc(a)),b.setDisposable(a.subscribe(new d(this,b)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,1===this.g.length&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},d.prototype.onCompleted=function(){if(!this.isStopped){var a=this.parent;this.isStopped=!0,a.g.remove(this.sad),a.done&&1===a.g.length&&a.o.onCompleted()}},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(Sb);Gb.mergeAll=function(){return new Dc(this)},Gb.skipUntil=function(a){var b=this;return new Yc(function(c){var d=!1,e=new mb(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));qa(a)&&(a=Qc(a));var f=new tb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)};var Ec=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.inner=b,this.stopped=!1,this.latest=0,this.hasLatest=!1,this.isStopped=!1}function d(a,b){this.parent=a,this.id=b,this.isStopped=!1}return kb(b,a),b.prototype.subscribeCore=function(a){var b=new ub,d=this.source.subscribe(new c(a,b));return new mb(d,b)},c.prototype.onNext=function(a){if(!this.isStopped){var b=new tb,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),qa(a)&&(a=Qc(a)),b.setDisposable(a.subscribe(new d(this,c)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.stopped=!0,!this.hasLatest&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.latest===this.id&&this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&this.parent.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&(this.parent.hasLatest=!1,this.parent.isStopped&&this.parent.o.onCompleted()))},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(Sb);Gb["switch"]=Gb.switchLatest=function(){return new Ec(this)};var Fc=function(a){function b(b,c){this.source=b,this.other=qa(c)?Qc(c):c,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return kb(b,a),b.prototype.subscribeCore=function(a){return new mb(this.source.subscribe(a),this.other.subscribe(new c(a)))},c.prototype.onNext=function(a){this.isStopped||this.o.onCompleted()},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){!this.isStopped&&(this.isStopped=!0)},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Sb);Gb.takeUntil=function(a){return new Fc(this,a)},Gb.withLatestFrom=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop(),e=this;return Array.isArray(b[0])&&(b=b[0]),new Yc(function(a){for(var c=b.length,f=p(c,D),g=!1,h=new Array(c),i=new Array(c+1),j=0;c>j;j++)!function(c){var d=b[c],e=new tb;qa(d)&&(d=Qc(d)),e.setDisposable(d.subscribe(function(a){h[c]=a,f[c]=!0,g=f.every(la)},function(b){a.onError(b)},ka)),i[c]=e}(j);var k=new tb;return k.setDisposable(e.subscribe(function(b){var c=[b].concat(h);if(g){var e=ta(d).apply(null,c);return e===sa?a.onError(e.e):void a.onNext(e)}},function(b){a.onError(b)},function(){a.onCompleted()})),i[c]=k,new mb(i)},this)},Gb.zip=function(){if(0===arguments.length)throw new Error("invalid arguments");for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=ra(b[a-1])?b.pop():E;Array.isArray(b[0])&&(b=b[0]);var e=this;return b.unshift(e),new Yc(function(a){for(var c=b.length,f=p(c,F),g=p(c,D),h=new Array(c),i=0;c>i;i++)!function(c){var i=b[c],j=new tb;qa(i)&&(i=Qc(i)),j.setDisposable(i.subscribe(function(b){if(f[c].push(b),f.every(function(a){return a.length>0})){var h=f.map(function(a){return a.shift()}),i=ta(d).apply(e,h);if(i===sa)return a.onError(i.e);a.onNext(i)}else g.filter(function(a,b){return b!==c}).every(la)&&a.onCompleted()},function(b){a.onError(b)},function(){g[c]=!0,g.every(la)&&a.onCompleted()})),h[c]=j}(i);return new mb(h)},e)},Qb.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];Array.isArray(b[0])&&(b=ra(b[1])?b[0].concat(b[1]):b[0]);var d=b.shift();return d.zip.apply(d,b)},Gb.zipIterable=function(){if(0===arguments.length)throw new Error("invalid arguments");for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=ra(b[a-1])?b.pop():E,e=this;return b.unshift(e),new Yc(function(a){for(var c=b.length,f=p(c,F),g=p(c,D),h=new Array(c),i=0;c>i;i++)!function(c){var i=b[c],j=new tb;(Ja(i)||Ia(i))&&(i=hc(i)),j.setDisposable(i.subscribe(function(b){if(f[c].push(b),f.every(function(a){return a.length>0})){var h=f.map(function(a){return a.shift()}),i=ta(d).apply(e,h);if(i===sa)return a.onError(i.e);a.onNext(i)}else g.filter(function(a,b){return b!==c}).every(la)&&a.onCompleted()},function(b){a.onError(b)},function(){g[c]=!0,g.every(la)&&a.onCompleted()})),h[c]=j}(i);return new mb(h)},e)},Gb.asObservable=function(){return new Yc(G(this),this)},Gb.dematerialize=function(){var a=this;return new Yc(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)};var Gc=function(a){function b(b,c,d){this.source=b,this.keyFn=c,this.comparer=d,a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Hc(a,this.keyFn,this.comparer))},b}(Sb),Hc=function(a){function b(b,c,d){this.o=b,this.keyFn=c,this.comparer=d,this.hasCurrentKey=!1,this.currentKey=null,a.call(this)}return kb(b,a),b.prototype.next=function(a){var b,c=a;return ra(this.keyFn)&&(c=ta(this.keyFn)(a),c===sa)?this.o.onError(c.e):this.hasCurrentKey&&(b=ta(this.comparer)(this.currentKey,c),b===sa)?this.o.onError(b.e):void(this.hasCurrentKey&&b||(this.hasCurrentKey=!0,this.currentKey=c,this.o.onNext(a)))},b.prototype.error=function(a){this.o.onError(a)},b.prototype.completed=function(){this.o.onCompleted()},b}(Ob);Gb.distinctUntilChanged=function(a,b){return b||(b=na),new Gc(this,a,b)};var Ic=function(a){function b(b,c,d,e){this.source=b,this._oN=c,this._oE=d,this._oC=e,a.call(this)}function c(a,b){this.o=a,this.t=!b._oN||ra(b._oN)?Nb(b._oN||ka,b._oE||ka,b._oC||ka):b._oN,this.isStopped=!1}return kb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this))},c.prototype.onNext=function(a){if(!this.isStopped){var b=ta(this.t.onNext).call(this.t,a);b===sa&&this.o.onError(b.e),this.o.onNext(a)}},c.prototype.onError=function(a){if(!this.isStopped){this.isStopped=!0;var b=ta(this.t.onError).call(this.t,a);if(b===sa)return this.o.onError(b.e);this.o.onError(a)}},c.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=ta(this.t.onCompleted).call(this.t);if(a===sa)return this.o.onError(a.e);this.o.onCompleted()}},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Sb);Gb["do"]=Gb.tap=Gb.doAction=function(a,b,c){return new Ic(this,a,b,c)},Gb.doOnNext=Gb.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},Gb.doOnError=Gb.tapOnError=function(a,b){return this.tap(ka,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},Gb.doOnCompleted=Gb.tapOnCompleted=function(a,b){return this.tap(ka,null,"undefined"!=typeof b?function(){a.call(b)}:a)},Gb["finally"]=function(a){var b=this;return new Yc(function(c){var e=ta(b.subscribe).call(b,c);return e===sa?(a(),d(e.e)):pb(function(){var b=ta(e.dispose).call(e);a(),b===sa&&d(b.e)})},this)};var Jc=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return kb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=ka,c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},b}(Sb);Gb.ignoreElements=function(){return new Jc(this)},Gb.materialize=function(){var a=this;return new Yc(function(b){return a.subscribe(function(a){b.onNext(Jb(a))},function(a){b.onNext(Kb(a)),b.onCompleted()},function(){b.onNext(Lb()),b.onCompleted()})},a)},Gb.repeat=function(a){return Yb(this,a).concat()},Gb.retry=function(a){return Yb(this,a).catchError()},Gb.retryWhen=function(a){return Yb(this).catchErrorWhen(a)};var Kc=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new H(a,this))},b}(Sb);H.prototype={onNext:function(a){return this.isStopped?void 0:(!this.hasValue&&(this.hasValue=!0),this.hasAccumulation?this.accumulation=ta(this.accumulator)(this.accumulation,a):(this.accumulation=this.hasSeed?ta(this.accumulator)(this.seed,a):a,this.hasAccumulation=!0),this.accumulation===sa?this.o.onError(this.accumulation.e):void this.o.onNext(this.accumulation))},onError:function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},onCompleted:function(){this.isStopped||(this.isStopped=!0,!this.hasValue&&this.hasSeed&&this.o.onNext(this.seed),this.o.onCompleted())},dispose:function(){this.isStopped=!0},fail:function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)}},Gb.scan=function(){var a,b=!1,c=arguments[0];return 2===arguments.length&&(b=!0,a=arguments[1]),new Kc(this,c,b,a)},Gb.skipLast=function(a){if(0>a)throw new Ba;var b=this;return new Yc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},function(a){c.onError(a)},function(){c.onCompleted()})},b)},Gb.startWith=function(){var a,b=0;arguments.length&&yb(arguments[0])?(a=arguments[0],b=1):a=Bb;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return $b([jc(c,a),this]).concat()},Gb.takeLast=function(a){if(0>a)throw new Ba;var b=this;return new Yc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})},b)},Gb.flatMapConcat=Gb.concatMap=function(a,b,c){return new Tb(this,a,b,c).merge(1)};var Lc=function(a){function b(b,c,d){this.source=b,this.selector=La(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return a.call(this,b.selector(c,d,e),d,e)}}function d(a,b,c){this.o=a,this.selector=b,this.source=c,this.i=0,this.isStopped=!1}return kb(b,a),b.prototype.internalMap=function(a,d){return new b(this.source,c(a,this),d)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.selector,this))},d.prototype.onNext=function(a){if(!this.isStopped){var b=ta(this.selector)(a,this.i++,this.source);return b===sa?this.o.onError(b.e):void this.o.onNext(b)}},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Sb);Gb.map=Gb.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof Lc?this.internalMap(c,b):new Lc(this,c,b)},Gb.pluck=function(){var a=arguments.length,b=new Array(a);if(0===a)throw new Error("List of properties cannot be empty.");for(var c=0;a>c;c++)b[c]=arguments[c];return this.map(I(b,a))},Gb.flatMap=Gb.selectMany=function(a,b,c){return new Tb(this,a,b,c).mergeAll()},ja.Observable.prototype.flatMapLatest=function(a,b,c){return new Tb(this,a,b,c).switchLatest()};var Mc=function(a){function b(b,c){this.source=b,this.skipCount=c,a.call(this)}function c(a,b){this.c=b,this.r=b,this.o=a,this.isStopped=!1}return kb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.skipCount))},c.prototype.onNext=function(a){this.isStopped||(this.r<=0?this.o.onNext(a):this.r--)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Sb);Gb.skip=function(a){if(0>a)throw new Ba;return new Mc(this,a)},Gb.skipWhile=function(a,b){var c=this,d=La(a,b,3);return new Yc(function(a){var b=0,e=!1;return c.subscribe(function(f){if(!e)try{e=!d(f,b++,c)}catch(g){return void a.onError(g)}e&&a.onNext(f)},function(b){a.onError(b)},function(){a.onCompleted()})},c)},Gb.take=function(a,b){if(0>a)throw new Ba;if(0===a)return dc(b);var c=this;return new Yc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0>=d&&b.onCompleted())},function(a){b.onError(a)},function(){b.onCompleted()})},c)},Gb.takeWhile=function(a,b){var c=this,d=La(a,b,3);return new Yc(function(a){var b=0,e=!0;return c.subscribe(function(f){if(e){try{e=d(f,b++,c)}catch(g){return void a.onError(g)}e?a.onNext(f):a.onCompleted()}},function(b){a.onError(b)},function(){a.onCompleted()})},c)};var Nc=function(a){function b(b,c,d){this.source=b,this.predicate=La(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return b.predicate(c,d,e)&&a.call(this,c,d,e)}}function d(a,b,c){this.o=a,this.predicate=b,this.source=c,this.i=0,this.isStopped=!1}return kb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.predicate,this))},b.prototype.internalFilter=function(a,d){return new b(this.source,c(a,this),d)},d.prototype.onNext=function(a){if(!this.isStopped){var b=ta(this.predicate)(a,this.i++,this.source);return b===sa?this.o.onError(b.e):void(b&&this.o.onNext(a))}},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Sb);Gb.filter=Gb.where=function(a,b){return this instanceof Nc?this.internalFilter(a,b):new Nc(this,a,b)},Qb.fromCallback=function(a,b,c){return function(){"undefined"==typeof b&&(b=this);for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return J(a,b,c,e)}},Qb.fromNodeCallback=function(a,b,c){return function(){"undefined"==typeof b&&(b=this);for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return L(a,b,c,e)}},N.prototype.dispose=function(){this.isDisposed||(this._e.removeEventListener(this._n,this._fn,!1),this.isDisposed=!0)},ja.config.useNativeEvents=!1,Qb.fromEvent=function(a,b,c){return a.addListener?Oc(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c):ja.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new Yc(function(d){return O(a,b,P(d,c))}).publish().refCount():Oc(function(c){a.on(b,c)},function(c){a.off(b,c)},c)};var Oc=Qb.fromEventPattern=function(a,b,c,d){return yb(d)||(d=Bb),new Yc(function(d){function e(){var a=arguments[0];return ra(c)&&(a=ta(c).apply(null,arguments),a===sa)?d.onError(a.e):void d.onNext(a)}var f=a(e);return pb(function(){ra(b)&&b(e,f)})}).publish().refCount()},Pc=function(a){function b(b){this.p=b,a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){return this.p.then(function(b){a.onNext(b),a.onCompleted()},function(b){a.onError(b)}),qb},b}(Sb),Qc=Qb.fromPromise=function(a){return new Pc(a)};Gb.toPromise=function(a){if(a||(a=ja.config.Promise),!a)throw new Ca("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},Qb.startAsync=function(a){var b;try{b=a()}catch(c){return tc(c)}return Qc(b)},Gb.multicast=function(a,b){var c=this;return"function"==typeof a?new Yc(function(d){var e=c.multicast(a());return new mb(b(e).subscribe(d),e.connect())},c):new Rc(c,a)},Gb.publish=function(a){return a&&ra(a)?this.multicast(function(){return new _c},a):this.multicast(new _c)},Gb.share=function(){return this.publish().refCount()},Gb.publishLast=function(a){return a&&ra(a)?this.multicast(function(){return new ad},a):this.multicast(new ad)},Gb.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new cd(b)},a):this.multicast(new cd(a))},Gb.shareValue=function(a){return this.publishValue(a).refCount()},Gb.replay=function(a,b,c,d){return a&&ra(a)?this.multicast(function(){return new dd(b,c,d)},a):this.multicast(new dd(b,c,d))},Gb.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var Rc=ja.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new mb(f.subscribe(c),pb(function(){e=!1}))),d},a.call(this,function(a){return c.subscribe(a)})}return kb(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Yc(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(Qb),Sc=Qb.interval=function(a,b){return T(a,a,yb(b)?b:Hb)};Qb.timer=function(b,c,d){var e;return yb(d)||(d=Hb),null!=c&&"number"==typeof c?e=c:yb(c)&&(d=c),b instanceof Date&&e===a?Q(b.getTime(),d):b instanceof Date&&e!==a?R(b.getTime(),c,d):e===a?S(b,d):T(b,e,d)};Gb.delay=function(){if("number"==typeof arguments[0]||arguments[0]instanceof Date){var a=arguments[0],b=arguments[1];return yb(b)||(b=Hb),a instanceof Date?V(this,a,b):U(this,a,b)}if(ra(arguments[0]))return W(this,arguments[0],arguments[1]);throw new Error("Invalid arguments")},Gb.debounce=function(){if(ra(arguments[0]))return Y(this,arguments[0]);if("number"==typeof arguments[0])return X(this,arguments[0],arguments[1]);throw new Error("Invalid arguments")},Gb.timestamp=function(a){return yb(a)||(a=Hb),this.map(function(b){return{value:b,timestamp:a.now()}})},Gb.sample=Gb.throttleLatest=function(a,b){return yb(b)||(b=Hb),"number"==typeof a?Z(this,Sc(a,b)):Z(this,a)};var Tc=ja.TimeoutError=function(a){this.message=a||"Timeout has occurred",this.name="TimeoutError",Error.call(this)};Tc.prototype=Object.create(Error.prototype),Gb.timeout=function(){var a=arguments[0];if(a instanceof Date||"number"==typeof a)return _(this,a,arguments[1],arguments[2]);if(Qb.isObservable(a)||ra(a))return $(this,a,arguments[1],arguments[2]);throw new Error("Invalid arguments")},Gb.throttle=function(a,b){yb(b)||(b=Hb);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Yc(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},function(b){a.onError(b)},function(){a.onCompleted()})},d)};var Uc=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=qb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=qb)});return new mb(c,d,e)}function c(c,d){this.source=c,this.controller=new _c,d&&d.subscribe?this.pauser=this.controller.merge(d):this.pauser=this.controller,a.call(this,b,c)}return kb(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(Qb);Gb.pausable=function(a){return new Uc(this,a)};var Vc=function(b){function c(b){function c(){for(;e.length>0;)b.onNext(e.shift())}var d,e=[],f=aa(this.source,this.pauser.startWith(!1).distinctUntilChanged(),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(f){ -d!==a&&f.shouldFire!=d?(d=f.shouldFire,f.shouldFire&&c()):(d=f.shouldFire,f.shouldFire?b.onNext(f.data):e.push(f.data))},function(a){c(),b.onError(a)},function(){c(),b.onCompleted()});return f}function d(a,d){this.source=a,this.controller=new _c,d&&d.subscribe?this.pauser=this.controller.merge(d):this.pauser=this.controller,b.call(this,c,a)}return kb(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(Qb);Gb.pausableBuffered=function(a){return new Vc(this,a)};var Wc=function(a){function b(a){return this.source.subscribe(a)}function c(c,d,e){a.call(this,b,c),this.subject=new Xc(d,e),this.source=c.multicast(this.subject).refCount()}return kb(c,a),c.prototype.request=function(a){return this.subject.request(null==a?-1:a)},c}(Qb),Xc=function(a){function b(a){return this.subject.subscribe(a)}function c(c,d){null==c&&(c=!0),a.call(this,b),this.subject=new _c,this.enableQueue=c,this.queue=c?[]:null,this.requestedCount=0,this.requestedDisposable=null,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.scheduler=d||Cb}return kb(c,a),lb(c.prototype,Mb,{onCompleted:function(){this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length?this.queue.push(Ib.createOnCompleted()):(this.subject.onCompleted(),this.disposeCurrentRequest())},onError:function(a){this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length?this.queue.push(Ib.createOnError(a)):(this.subject.onError(a),this.disposeCurrentRequest())},onNext:function(a){this.requestedCount<=0?this.enableQueue&&this.queue.push(Ib.createOnNext(a)):(0===this.requestedCount--&&this.disposeCurrentRequest(),this.subject.onNext(a))},_processRequest:function(a){if(this.enableQueue)for(;this.queue.length>0&&(a>0||"N"!==this.queue[0].kind);){var b=this.queue.shift();b.accept(this.subject),"N"===b.kind?a--:(this.disposeCurrentRequest(),this.queue=[])}return a},request:function(a){this.disposeCurrentRequest();var b=this;return this.requestedDisposable=this.scheduler.scheduleWithState(a,function(a,c){var d=b._processRequest(c),e=b.hasCompleted||b.hasFailed;return!e&&d>0?(b.requestedCount=d,pb(function(){b.requestedCount=0})):void 0}),this.requestedDisposable},disposeCurrentRequest:function(){this.requestedDisposable&&(this.requestedDisposable.dispose(),this.requestedDisposable=null)}}),c}(Qb);Gb.controlled=function(a,b){return a&&yb(a)&&(b=a,a=!0),null==a&&(a=!0),new Wc(this,a,b)},Gb.pipe=function(a){function b(){c.resume()}var c=this.pausableBuffered();return a.addListener("drain",b),c.subscribe(function(b){!a.write(String(b))&&c.pause()},function(b){a.emit("error",b)},function(){!a._isStdio&&a.end(),a.removeListener("drain",b)}),c.resume(),a},Gb.transduce=function(a){function b(a){return{"@@transducer/init":function(){return a},"@@transducer/step":function(a,b){return a.onNext(b)},"@@transducer/result":function(a){return a.onCompleted()}}}var c=this;return new Yc(function(d){var e=a(b(d));return c.subscribe(function(a){var b=ta(e["@@transducer/step"]).call(e,d,a);b===sa&&d.onError(b.e)},function(a){d.onError(a)},function(){e["@@transducer/result"](d)})},c)};var Yc=ja.AnonymousObservable=function(a){function b(a){return a&&ra(a.dispose)?a:ra(a)?pb(a):qb}function c(a,c){var e=c[0],f=c[1],g=ta(f.__subscribe).call(f,e);return g!==sa||e.fail(sa.e)?void e.setDisposable(b(g)):d(sa.e)}function e(a){var b=new Zc(a),d=[b,this];return Cb.scheduleRequired()?Cb.scheduleWithState(d,c):c(null,d),b}function f(b,c){this.source=c,this.__subscribe=b,a.call(this,e)}return kb(f,a),f}(Qb),Zc=function(a){function b(b){a.call(this),this.observer=b,this.m=new tb}kb(b,a);var c=b.prototype;return c.next=function(a){var b=ta(this.observer.onNext).call(this.observer,a);b===sa&&(this.dispose(),d(b.e))},c.error=function(a){var b=ta(this.observer.onError).call(this.observer,a);this.dispose(),b===sa&&d(b.e)},c.completed=function(){var a=ta(this.observer.onCompleted).call(this.observer);this.dispose(),a===sa&&d(a.e)},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(Ob),$c=function(a,b){this.subject=a,this.observer=b};$c.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var _c=ja.Subject=function(a){function c(a){return sb(this),this.isStopped?this.hasError?(a.onError(this.error),qb):(a.onCompleted(),qb):(this.observers.push(a),new $c(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return kb(d,a),lb(d.prototype,Mb.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(sb(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(sb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(sb(this),!this.isStopped)for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new bd(a,b)},d}(Qb),ad=ja.AsyncSubject=function(a){function c(a){return sb(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),qb):(this.observers.push(a),new $c(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return kb(d,a),lb(d.prototype,Mb,{hasObservers:function(){return sb(this),this.observers.length>0},onCompleted:function(){var a,c;if(sb(this),!this.isStopped){this.isStopped=!0;var d=b(this.observers),c=d.length;if(this.hasValue)for(a=0;c>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;c>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(sb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){sb(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(Qb),bd=ja.AnonymousSubject=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){this.observer=c,this.observable=d,a.call(this,b)}return kb(c,a),lb(c.prototype,Mb.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Qb),cd=ja.BehaviorSubject=function(a){function c(a){return sb(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),qb):(this.observers.push(a),a.onNext(this.value),new $c(this,a))}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return kb(d,a),lb(d.prototype,Mb,{getValue:function(){if(sb(this),this.hasError)throw this.error;return this.value},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(sb(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(sb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(sb(this),!this.isStopped){this.value=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(Qb),dd=ja.ReplaySubject=function(a){function c(a,b){return pb(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var b=new Rb(this.scheduler,a),d=c(this,b);sb(this),this._trim(this.scheduler.now()),this.observers.push(b);for(var e=0,f=this.q.length;f>e;e++)b.onNext(this.q[e].value);return this.hasError?b.onError(this.error):this.isStopped&&b.onCompleted(),b.ensureActive(),d}function e(b,c,e){this.bufferSize=null==b?f:b,this.windowSize=null==c?f:c,this.scheduler=e||Cb,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}var f=Math.pow(2,53)-1;return kb(e,a),lb(e.prototype,Mb.prototype,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(sb(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=0,e=b(this.observers),f=e.length;f>d;d++){var g=e[d];g.onNext(a),g.ensureActive()}}},onError:function(a){if(sb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=0,e=b(this.observers),f=e.length;f>d;d++){var g=e[d];g.onError(a),g.ensureActive()}this.observers.length=0}},onCompleted:function(){if(sb(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=0,d=b(this.observers),e=d.length;e>c;c++){var f=d[c];f.onCompleted(),f.ensureActive()}this.observers.length=0}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(Qb);ja.Pauser=function(a){function b(){a.call(this)}return kb(b,a),b.prototype.pause=function(){this.onNext(!1)},b.prototype.resume=function(){this.onNext(!0)},b}(_c),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(ia.Rx=ja,define(function(){return ja})):ca&&fa?ga?(fa.exports=ja).Rx=ja:ca.Rx=ja:ia.Rx=ja;var ed=i()}).call(this); -//# sourceMappingURL=rx.lite.map \ No newline at end of file diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/index.js b/node_modules/eslint/node_modules/inquirer/node_modules/string-width/index.js deleted file mode 100644 index aa2f839..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/index.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; -var stripAnsi = require('strip-ansi'); -var codePointAt = require('code-point-at'); -var isFullwidthCodePoint = require('is-fullwidth-code-point'); - -// https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1345 -module.exports = function (str) { - if (typeof str !== 'string' || str.length === 0) { - return 0; - } - - var width = 0; - - str = stripAnsi(str); - - for (var i = 0; i < str.length; i++) { - var code = codePointAt(str, i); - - // surrogates - if (code >= 0x10000) { - i++; - } - - if (isFullwidthCodePoint(code)) { - width += 2; - } else { - width++; - } - } - - return width; -}; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/license b/node_modules/eslint/node_modules/inquirer/node_modules/string-width/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/code-point-at/index.js b/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/code-point-at/index.js deleted file mode 100644 index 0335117..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/code-point-at/index.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; -var numberIsNan = require('number-is-nan'); - -module.exports = function (str, pos) { - if (str === null || str === undefined) { - throw TypeError(); - } - - str = String(str); - - var size = str.length; - var i = pos ? Number(pos) : 0; - - if (numberIsNan(i)) { - i = 0; - } - - if (i < 0 || i >= size) { - return undefined; - } - - var first = str.charCodeAt(i); - - if (first >= 0xD800 && first <= 0xDBFF && size > i + 1) { - var second = str.charCodeAt(i + 1); - - if (second >= 0xDC00 && second <= 0xDFFF) { - return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; - } - } - - return first; -}; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/code-point-at/license b/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/code-point-at/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/code-point-at/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/index.js b/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/index.js deleted file mode 100644 index 79be4b9..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -module.exports = Number.isNaN || function (x) { - return x !== x; -}; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/license b/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/package.json b/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/package.json deleted file mode 100644 index 05df0e0..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "number-is-nan", - "version": "1.0.0", - "description": "ES6 Number.isNaN() ponyfill", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/number-is-nan.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "node test.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "es6", - "es2015", - "ecmascript", - "harmony", - "ponyfill", - "polyfill", - "shim", - "number", - "is", - "nan", - "not" - ], - "devDependencies": { - "ava": "0.0.4" - }, - "gitHead": "0f394b1bc33185c40304363b209e3f0588dbeeb3", - "bugs": { - "url": "https://github.com/sindresorhus/number-is-nan/issues" - }, - "homepage": "https://github.com/sindresorhus/number-is-nan#readme", - "_id": "number-is-nan@1.0.0", - "_shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", - "_from": "number-is-nan@>=1.0.0 <2.0.0", - "_npmVersion": "2.10.0", - "_nodeVersion": "0.12.3", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", - "tarball": "http://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/readme.md b/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/readme.md deleted file mode 100644 index 93d851a..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/readme.md +++ /dev/null @@ -1,30 +0,0 @@ -# number-is-nan [![Build Status](https://travis-ci.org/sindresorhus/number-is-nan.svg?branch=master)](https://travis-ci.org/sindresorhus/number-is-nan) - -> ES6 [`Number.isNaN()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) ponyfill - -> Ponyfill: A polyfill that doesn't overwrite the native method - - -## Install - -``` -$ npm install --save number-is-nan -``` - - -## Usage - -```js -var numberIsNan = require('number-is-nan'); - -numberIsNan(NaN); -//=> true - -numberIsNan('unicorn'); -//=> false -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/code-point-at/package.json b/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/code-point-at/package.json deleted file mode 100644 index 7df3c55..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/code-point-at/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "code-point-at", - "version": "1.0.0", - "description": "ES2015 String#codePointAt() ponyfill", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/code-point-at.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "node test.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "es2015", - "es6", - "ponyfill", - "polyfill", - "shim", - "string", - "str", - "code", - "point", - "at", - "codepoint", - "unicode" - ], - "dependencies": { - "number-is-nan": "^1.0.0" - }, - "devDependencies": { - "ava": "0.0.4" - }, - "gitHead": "c2ffa4064718b37c84c73a633abeeed5b486a469", - "bugs": { - "url": "https://github.com/sindresorhus/code-point-at/issues" - }, - "homepage": "https://github.com/sindresorhus/code-point-at", - "_id": "code-point-at@1.0.0", - "_shasum": "f69b192d3f7d91e382e4b71bddb77878619ab0c6", - "_from": "code-point-at@>=1.0.0 <2.0.0", - "_npmVersion": "2.11.2", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "f69b192d3f7d91e382e4b71bddb77878619ab0c6", - "tarball": "http://registry.npmjs.org/code-point-at/-/code-point-at-1.0.0.tgz" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/code-point-at/readme.md b/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/code-point-at/readme.md deleted file mode 100644 index 71e7d09..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/code-point-at/readme.md +++ /dev/null @@ -1,34 +0,0 @@ -# code-point-at [![Build Status](https://travis-ci.org/sindresorhus/code-point-at.svg?branch=master)](https://travis-ci.org/sindresorhus/code-point-at) - -> ES2015 [`String#codePointAt()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt) ponyfill - -> Ponyfill: A polyfill that doesn't overwrite the native method - - -## Install - -``` -$ npm install --save code-point-at -``` - - -## Usage - -```js -var codePointAt = require('code-point-at'); - -codePointAt('🐴'); -//=> 128052 - -codePointAt('abc', 2); -//=> 99 -``` - -## API - -### codePointAt(input, [position]) - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js b/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js deleted file mode 100644 index a7d3e38..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; -var numberIsNan = require('number-is-nan'); - -module.exports = function (x) { - if (numberIsNan(x)) { - return false; - } - - // https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1369 - - // code points are derived from: - // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt - if (x >= 0x1100 && ( - x <= 0x115f || // Hangul Jamo - 0x2329 === x || // LEFT-POINTING ANGLE BRACKET - 0x232a === x || // RIGHT-POINTING ANGLE BRACKET - // CJK Radicals Supplement .. Enclosed CJK Letters and Months - (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || - // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A - 0x3250 <= x && x <= 0x4dbf || - // CJK Unified Ideographs .. Yi Radicals - 0x4e00 <= x && x <= 0xa4c6 || - // Hangul Jamo Extended-A - 0xa960 <= x && x <= 0xa97c || - // Hangul Syllables - 0xac00 <= x && x <= 0xd7a3 || - // CJK Compatibility Ideographs - 0xf900 <= x && x <= 0xfaff || - // Vertical Forms - 0xfe10 <= x && x <= 0xfe19 || - // CJK Compatibility Forms .. Small Form Variants - 0xfe30 <= x && x <= 0xfe6b || - // Halfwidth and Fullwidth Forms - 0xff01 <= x && x <= 0xff60 || - 0xffe0 <= x && x <= 0xffe6 || - // Kana Supplement - 0x1b000 <= x && x <= 0x1b001 || - // Enclosed Ideographic Supplement - 0x1f200 <= x && x <= 0x1f251 || - // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane - 0x20000 <= x && x <= 0x3fffd)) { - return true; - } - - return false; -} diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/is-fullwidth-code-point/license b/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/is-fullwidth-code-point/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/is-fullwidth-code-point/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/index.js b/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/index.js deleted file mode 100644 index 79be4b9..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -module.exports = Number.isNaN || function (x) { - return x !== x; -}; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/license b/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/package.json b/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/package.json deleted file mode 100644 index 05df0e0..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "number-is-nan", - "version": "1.0.0", - "description": "ES6 Number.isNaN() ponyfill", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/number-is-nan.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "node test.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "es6", - "es2015", - "ecmascript", - "harmony", - "ponyfill", - "polyfill", - "shim", - "number", - "is", - "nan", - "not" - ], - "devDependencies": { - "ava": "0.0.4" - }, - "gitHead": "0f394b1bc33185c40304363b209e3f0588dbeeb3", - "bugs": { - "url": "https://github.com/sindresorhus/number-is-nan/issues" - }, - "homepage": "https://github.com/sindresorhus/number-is-nan#readme", - "_id": "number-is-nan@1.0.0", - "_shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", - "_from": "number-is-nan@>=1.0.0 <2.0.0", - "_npmVersion": "2.10.0", - "_nodeVersion": "0.12.3", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", - "tarball": "http://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/readme.md b/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/readme.md deleted file mode 100644 index 93d851a..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/readme.md +++ /dev/null @@ -1,30 +0,0 @@ -# number-is-nan [![Build Status](https://travis-ci.org/sindresorhus/number-is-nan.svg?branch=master)](https://travis-ci.org/sindresorhus/number-is-nan) - -> ES6 [`Number.isNaN()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) ponyfill - -> Ponyfill: A polyfill that doesn't overwrite the native method - - -## Install - -``` -$ npm install --save number-is-nan -``` - - -## Usage - -```js -var numberIsNan = require('number-is-nan'); - -numberIsNan(NaN); -//=> true - -numberIsNan('unicorn'); -//=> false -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json b/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json deleted file mode 100644 index 6ada832..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "is-fullwidth-code-point", - "version": "1.0.0", - "description": "Check if the character represented by a given Unicode code point is fullwidth", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/is-fullwidth-code-point.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "node test.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "fullwidth", - "full-width", - "full", - "width", - "unicode", - "character", - "char", - "string", - "str", - "codepoint", - "code", - "point", - "is", - "detect", - "check" - ], - "dependencies": { - "number-is-nan": "^1.0.0" - }, - "devDependencies": { - "ava": "0.0.4", - "code-point-at": "^1.0.0" - }, - "gitHead": "f2152d357f41f82785436d428e4f8ede143b7548", - "bugs": { - "url": "https://github.com/sindresorhus/is-fullwidth-code-point/issues" - }, - "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point", - "_id": "is-fullwidth-code-point@1.0.0", - "_shasum": "ef9e31386f031a7f0d643af82fde50c457ef00cb", - "_from": "is-fullwidth-code-point@>=1.0.0 <2.0.0", - "_npmVersion": "2.11.2", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "ef9e31386f031a7f0d643af82fde50c457ef00cb", - "tarball": "http://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/is-fullwidth-code-point/readme.md b/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/is-fullwidth-code-point/readme.md deleted file mode 100644 index 4936464..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/node_modules/is-fullwidth-code-point/readme.md +++ /dev/null @@ -1,39 +0,0 @@ -# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) - -> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) - - -## Install - -``` -$ npm install --save is-fullwidth-code-point -``` - - -## Usage - -```js -var isFullwidthCodePoint = require('is-fullwidth-code-point'); - -isFullwidthCodePoint('谢'.codePointAt()); -//=> true - -isFullwidthCodePoint('a'.codePointAt()); -//=> false -``` - - -## API - -### isFullwidthCodePoint(input) - -#### input - -Type: `number` - -[Code point](https://en.wikipedia.org/wiki/Code_point) of a character. - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/package.json b/node_modules/eslint/node_modules/inquirer/node_modules/string-width/package.json deleted file mode 100644 index 9d68b5c..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "name": "string-width", - "version": "1.0.1", - "description": "Get the visual width of a string - the number of columns required to display it", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/string-width.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "node test.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "string", - "str", - "character", - "char", - "unicode", - "width", - "visual", - "column", - "columns", - "fullwidth", - "full-width", - "full", - "ansi", - "escape", - "codes", - "cli", - "command-line", - "terminal", - "console", - "cjk", - "chinese", - "japanese", - "korean", - "fixed-width" - ], - "dependencies": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - }, - "devDependencies": { - "ava": "0.0.4" - }, - "gitHead": "f279cfd14835f0a3c8df69ba18e9a3960156e135", - "bugs": { - "url": "https://github.com/sindresorhus/string-width/issues" - }, - "homepage": "https://github.com/sindresorhus/string-width", - "_id": "string-width@1.0.1", - "_shasum": "c92129b6f1d7f52acf9af424a26e3864a05ceb0a", - "_from": "string-width@>=1.0.1 <2.0.0", - "_npmVersion": "2.11.2", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "c92129b6f1d7f52acf9af424a26e3864a05ceb0a", - "tarball": "http://registry.npmjs.org/string-width/-/string-width-1.0.1.tgz" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/readme.md b/node_modules/eslint/node_modules/inquirer/node_modules/string-width/readme.md deleted file mode 100644 index a7737a9..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/string-width/readme.md +++ /dev/null @@ -1,41 +0,0 @@ -# string-width [![Build Status](https://travis-ci.org/sindresorhus/string-width.svg?branch=master)](https://travis-ci.org/sindresorhus/string-width) - -> Get the visual width of a string - the number of columns required to display it - -Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. - -Useful to be able to measure the actual width of command-line output. - - -## Install - -``` -$ npm install --save string-width -``` - - -## Usage - -```js -var stringWidth = require('string-width'); - -stringWidth('古'); -//=> 2 - -stringWidth('\u001b[1m古\u001b[22m'); -//=> 2 - -stringWidth('a'); -//=> 1 -``` - - -## Related - -- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module -- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/index.js b/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/index.js deleted file mode 100644 index 099480f..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/index.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; -var ansiRegex = require('ansi-regex')(); - -module.exports = function (str) { - return typeof str === 'string' ? str.replace(ansiRegex, '') : str; -}; diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/license b/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/package.json b/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/package.json deleted file mode 100644 index 2871d03..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "name": "strip-ansi", - "version": "3.0.0", - "description": "Strip ANSI escape codes", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/strip-ansi.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - } - ], - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "node test.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "strip", - "trim", - "remove", - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "devDependencies": { - "ava": "0.0.4" - }, - "gitHead": "3f05b9810e1438f946e2eb84ee854cc00b972e9e", - "bugs": { - "url": "https://github.com/sindresorhus/strip-ansi/issues" - }, - "homepage": "https://github.com/sindresorhus/strip-ansi", - "_id": "strip-ansi@3.0.0", - "_shasum": "7510b665567ca914ccb5d7e072763ac968be3724", - "_from": "strip-ansi@>=3.0.0 <4.0.0", - "_npmVersion": "2.11.2", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "7510b665567ca914ccb5d7e072763ac968be3724", - "tarball": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/readme.md b/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/readme.md deleted file mode 100644 index 7609151..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/strip-ansi/readme.md +++ /dev/null @@ -1,33 +0,0 @@ -# strip-ansi [![Build Status](https://travis-ci.org/sindresorhus/strip-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-ansi) - -> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) - - -## Install - -``` -$ npm install --save strip-ansi -``` - - -## Usage - -```js -var stripAnsi = require('strip-ansi'); - -stripAnsi('\u001b[4mcake\u001b[0m'); -//=> 'cake' -``` - - -## Related - -- [strip-ansi-cli](https://github.com/sindresorhus/strip-ansi-cli) - CLI for this module -- [has-ansi](https://github.com/sindresorhus/has-ansi) - Check if a string has ANSI escape codes -- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes -- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/through/.travis.yml b/node_modules/eslint/node_modules/inquirer/node_modules/through/.travis.yml deleted file mode 100644 index c693a93..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/through/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 - - "0.10" diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/through/LICENSE.APACHE2 b/node_modules/eslint/node_modules/inquirer/node_modules/through/LICENSE.APACHE2 deleted file mode 100644 index 6366c04..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/through/LICENSE.APACHE2 +++ /dev/null @@ -1,15 +0,0 @@ -Apache License, Version 2.0 - -Copyright (c) 2011 Dominic Tarr - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/through/LICENSE.MIT b/node_modules/eslint/node_modules/inquirer/node_modules/through/LICENSE.MIT deleted file mode 100644 index 6eafbd7..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/through/LICENSE.MIT +++ /dev/null @@ -1,24 +0,0 @@ -The MIT License - -Copyright (c) 2011 Dominic Tarr - -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. diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/through/index.js b/node_modules/eslint/node_modules/inquirer/node_modules/through/index.js deleted file mode 100644 index ca5fc59..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/through/index.js +++ /dev/null @@ -1,108 +0,0 @@ -var Stream = require('stream') - -// through -// -// a stream that does nothing but re-emit the input. -// useful for aggregating a series of changing but not ending streams into one stream) - -exports = module.exports = through -through.through = through - -//create a readable writable stream. - -function through (write, end, opts) { - write = write || function (data) { this.queue(data) } - end = end || function () { this.queue(null) } - - var ended = false, destroyed = false, buffer = [], _ended = false - var stream = new Stream() - stream.readable = stream.writable = true - stream.paused = false - -// stream.autoPause = !(opts && opts.autoPause === false) - stream.autoDestroy = !(opts && opts.autoDestroy === false) - - stream.write = function (data) { - write.call(this, data) - return !stream.paused - } - - function drain() { - while(buffer.length && !stream.paused) { - var data = buffer.shift() - if(null === data) - return stream.emit('end') - else - stream.emit('data', data) - } - } - - stream.queue = stream.push = function (data) { -// console.error(ended) - if(_ended) return stream - if(data === null) _ended = true - buffer.push(data) - drain() - return stream - } - - //this will be registered as the first 'end' listener - //must call destroy next tick, to make sure we're after any - //stream piped from here. - //this is only a problem if end is not emitted synchronously. - //a nicer way to do this is to make sure this is the last listener for 'end' - - stream.on('end', function () { - stream.readable = false - if(!stream.writable && stream.autoDestroy) - process.nextTick(function () { - stream.destroy() - }) - }) - - function _end () { - stream.writable = false - end.call(stream) - if(!stream.readable && stream.autoDestroy) - stream.destroy() - } - - stream.end = function (data) { - if(ended) return - ended = true - if(arguments.length) stream.write(data) - _end() // will emit or queue - return stream - } - - stream.destroy = function () { - if(destroyed) return - destroyed = true - ended = true - buffer.length = 0 - stream.writable = stream.readable = false - stream.emit('close') - return stream - } - - stream.pause = function () { - if(stream.paused) return - stream.paused = true - return stream - } - - stream.resume = function () { - if(stream.paused) { - stream.paused = false - stream.emit('resume') - } - drain() - //may have become paused again, - //as drain emits 'data'. - if(!stream.paused) - stream.emit('drain') - return stream - } - return stream -} - diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/through/package.json b/node_modules/eslint/node_modules/inquirer/node_modules/through/package.json deleted file mode 100644 index 4736b48..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/through/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "name": "through", - "version": "2.3.8", - "description": "simplified stream construction", - "main": "index.js", - "scripts": { - "test": "set -e; for t in test/*.js; do node $t; done" - }, - "devDependencies": { - "stream-spec": "~0.3.5", - "tape": "~2.3.2", - "from": "~0.1.3" - }, - "keywords": [ - "stream", - "streams", - "user-streams", - "pipe" - ], - "author": { - "name": "Dominic Tarr", - "email": "dominic.tarr@gmail.com", - "url": "dominictarr.com" - }, - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/dominictarr/through.git" - }, - "homepage": "https://github.com/dominictarr/through", - "testling": { - "browsers": [ - "ie/8..latest", - "ff/15..latest", - "chrome/20..latest", - "safari/5.1..latest" - ], - "files": "test/*.js" - }, - "gitHead": "2c5a6f9a0cc54da759b6e10964f2081c358e49dc", - "bugs": { - "url": "https://github.com/dominictarr/through/issues" - }, - "_id": "through@2.3.8", - "_shasum": "0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5", - "_from": "through@>=2.3.6 <3.0.0", - "_npmVersion": "2.12.0", - "_nodeVersion": "2.3.1", - "_npmUser": { - "name": "dominictarr", - "email": "dominic.tarr@gmail.com" - }, - "maintainers": [ - { - "name": "dominictarr", - "email": "dominic.tarr@gmail.com" - } - ], - "dist": { - "shasum": "0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5", - "tarball": "http://registry.npmjs.org/through/-/through-2.3.8.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/through/readme.markdown b/node_modules/eslint/node_modules/inquirer/node_modules/through/readme.markdown deleted file mode 100644 index cb34c81..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/through/readme.markdown +++ /dev/null @@ -1,64 +0,0 @@ -#through - -[![build status](https://secure.travis-ci.org/dominictarr/through.png)](http://travis-ci.org/dominictarr/through) -[![testling badge](https://ci.testling.com/dominictarr/through.png)](https://ci.testling.com/dominictarr/through) - -Easy way to create a `Stream` that is both `readable` and `writable`. - -* Pass in optional `write` and `end` methods. -* `through` takes care of pause/resume logic if you use `this.queue(data)` instead of `this.emit('data', data)`. -* Use `this.pause()` and `this.resume()` to manage flow. -* Check `this.paused` to see current flow state. (`write` always returns `!this.paused`). - -This function is the basis for most of the synchronous streams in -[event-stream](http://github.com/dominictarr/event-stream). - -``` js -var through = require('through') - -through(function write(data) { - this.queue(data) //data *must* not be null - }, - function end () { //optional - this.queue(null) - }) -``` - -Or, can also be used _without_ buffering on pause, use `this.emit('data', data)`, -and this.emit('end') - -``` js -var through = require('through') - -through(function write(data) { - this.emit('data', data) - //this.pause() - }, - function end () { //optional - this.emit('end') - }) -``` - -## Extended Options - -You will probably not need these 99% of the time. - -### autoDestroy=false - -By default, `through` emits close when the writable -and readable side of the stream has ended. -If that is not desired, set `autoDestroy=false`. - -``` js -var through = require('through') - -//like this -var ts = through(write, end, {autoDestroy: false}) -//or like this -var ts = through(write, end) -ts.autoDestroy = false -``` - -## License - -MIT / Apache2 diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/through/test/async.js b/node_modules/eslint/node_modules/inquirer/node_modules/through/test/async.js deleted file mode 100644 index 46bdbae..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/through/test/async.js +++ /dev/null @@ -1,28 +0,0 @@ -var from = require('from') -var through = require('../') - -var tape = require('tape') - -tape('simple async example', function (t) { - - var n = 0, expected = [1,2,3,4,5], actual = [] - from(expected) - .pipe(through(function(data) { - this.pause() - n ++ - setTimeout(function(){ - console.log('pushing data', data) - this.push(data) - this.resume() - }.bind(this), 300) - })).pipe(through(function(data) { - console.log('pushing data second time', data); - this.push(data) - })).on('data', function (d) { - actual.push(d) - }).on('end', function() { - t.deepEqual(actual, expected) - t.end() - }) - -}) diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/through/test/auto-destroy.js b/node_modules/eslint/node_modules/inquirer/node_modules/through/test/auto-destroy.js deleted file mode 100644 index 9a8fd00..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/through/test/auto-destroy.js +++ /dev/null @@ -1,30 +0,0 @@ -var test = require('tape') -var through = require('../') - -// must emit end before close. - -test('end before close', function (assert) { - var ts = through() - ts.autoDestroy = false - var ended = false, closed = false - - ts.on('end', function () { - assert.ok(!closed) - ended = true - }) - ts.on('close', function () { - assert.ok(ended) - closed = true - }) - - ts.write(1) - ts.write(2) - ts.write(3) - ts.end() - assert.ok(ended) - assert.notOk(closed) - ts.destroy() - assert.ok(closed) - assert.end() -}) - diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/through/test/buffering.js b/node_modules/eslint/node_modules/inquirer/node_modules/through/test/buffering.js deleted file mode 100644 index b0084bf..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/through/test/buffering.js +++ /dev/null @@ -1,71 +0,0 @@ -var test = require('tape') -var through = require('../') - -// must emit end before close. - -test('buffering', function(assert) { - var ts = through(function (data) { - this.queue(data) - }, function () { - this.queue(null) - }) - - var ended = false, actual = [] - - ts.on('data', actual.push.bind(actual)) - ts.on('end', function () { - ended = true - }) - - ts.write(1) - ts.write(2) - ts.write(3) - assert.deepEqual(actual, [1, 2, 3]) - ts.pause() - ts.write(4) - ts.write(5) - ts.write(6) - assert.deepEqual(actual, [1, 2, 3]) - ts.resume() - assert.deepEqual(actual, [1, 2, 3, 4, 5, 6]) - ts.pause() - ts.end() - assert.ok(!ended) - ts.resume() - assert.ok(ended) - assert.end() -}) - -test('buffering has data in queue, when ends', function (assert) { - - /* - * If stream ends while paused with data in the queue, - * stream should still emit end after all data is written - * on resume. - */ - - var ts = through(function (data) { - this.queue(data) - }, function () { - this.queue(null) - }) - - var ended = false, actual = [] - - ts.on('data', actual.push.bind(actual)) - ts.on('end', function () { - ended = true - }) - - ts.pause() - ts.write(1) - ts.write(2) - ts.write(3) - ts.end() - assert.deepEqual(actual, [], 'no data written yet, still paused') - assert.ok(!ended, 'end not emitted yet, still paused') - ts.resume() - assert.deepEqual(actual, [1, 2, 3], 'resumed, all data should be delivered') - assert.ok(ended, 'end should be emitted once all data was delivered') - assert.end(); -}) diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/through/test/end.js b/node_modules/eslint/node_modules/inquirer/node_modules/through/test/end.js deleted file mode 100644 index fa113f5..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/through/test/end.js +++ /dev/null @@ -1,45 +0,0 @@ -var test = require('tape') -var through = require('../') - -// must emit end before close. - -test('end before close', function (assert) { - var ts = through() - var ended = false, closed = false - - ts.on('end', function () { - assert.ok(!closed) - ended = true - }) - ts.on('close', function () { - assert.ok(ended) - closed = true - }) - - ts.write(1) - ts.write(2) - ts.write(3) - ts.end() - assert.ok(ended) - assert.ok(closed) - assert.end() -}) - -test('end only once', function (t) { - - var ts = through() - var ended = false, closed = false - - ts.on('end', function () { - t.equal(ended, false) - ended = true - }) - - ts.queue(null) - ts.queue(null) - ts.queue(null) - - ts.resume() - - t.end() -}) diff --git a/node_modules/eslint/node_modules/inquirer/node_modules/through/test/index.js b/node_modules/eslint/node_modules/inquirer/node_modules/through/test/index.js deleted file mode 100644 index 96da82f..0000000 --- a/node_modules/eslint/node_modules/inquirer/node_modules/through/test/index.js +++ /dev/null @@ -1,133 +0,0 @@ - -var test = require('tape') -var spec = require('stream-spec') -var through = require('../') - -/* - I'm using these two functions, and not streams and pipe - so there is less to break. if this test fails it must be - the implementation of _through_ -*/ - -function write(array, stream) { - array = array.slice() - function next() { - while(array.length) - if(stream.write(array.shift()) === false) - return stream.once('drain', next) - - stream.end() - } - - next() -} - -function read(stream, callback) { - var actual = [] - stream.on('data', function (data) { - actual.push(data) - }) - stream.once('end', function () { - callback(null, actual) - }) - stream.once('error', function (err) { - callback(err) - }) -} - -test('simple defaults', function(assert) { - - var l = 1000 - , expected = [] - - while(l--) expected.push(l * Math.random()) - - var t = through() - var s = spec(t).through().pausable() - - read(t, function (err, actual) { - assert.ifError(err) - assert.deepEqual(actual, expected) - assert.end() - }) - - t.on('close', s.validate) - - write(expected, t) -}); - -test('simple functions', function(assert) { - - var l = 1000 - , expected = [] - - while(l--) expected.push(l * Math.random()) - - var t = through(function (data) { - this.emit('data', data*2) - }) - var s = spec(t).through().pausable() - - - read(t, function (err, actual) { - assert.ifError(err) - assert.deepEqual(actual, expected.map(function (data) { - return data*2 - })) - assert.end() - }) - - t.on('close', s.validate) - - write(expected, t) -}) - -test('pauses', function(assert) { - - var l = 1000 - , expected = [] - - while(l--) expected.push(l) //Math.random()) - - var t = through() - - var s = spec(t) - .through() - .pausable() - - t.on('data', function () { - if(Math.random() > 0.1) return - t.pause() - process.nextTick(function () { - t.resume() - }) - }) - - read(t, function (err, actual) { - assert.ifError(err) - assert.deepEqual(actual, expected) - }) - - t.on('close', function () { - s.validate() - assert.end() - }) - - write(expected, t) -}) - -test('does not soft-end on `undefined`', function(assert) { - var stream = through() - , count = 0 - - stream.on('data', function (data) { - count++ - }) - - stream.write(undefined) - stream.write(undefined) - - assert.equal(count, 2) - - assert.end() -}) diff --git a/node_modules/eslint/node_modules/inquirer/package.json b/node_modules/eslint/node_modules/inquirer/package.json deleted file mode 100644 index 3487ca3..0000000 --- a/node_modules/eslint/node_modules/inquirer/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "name": "inquirer", - "version": "0.11.4", - "description": "A collection of common interactive command line user interfaces.", - "main": "lib/inquirer.js", - "scripts": { - "test": "grunt --verbose" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/sboudrias/Inquirer.js.git" - }, - "keywords": [ - "command", - "prompt", - "stdin", - "cli", - "tty", - "menu" - ], - "author": { - "name": "Simon Boudrias", - "email": "admin@simonboudrias.com" - }, - "license": "MIT", - "files": [ - "lib" - ], - "dependencies": { - "ansi-escapes": "^1.1.0", - "ansi-regex": "^2.0.0", - "chalk": "^1.0.0", - "cli-cursor": "^1.0.1", - "cli-width": "^1.0.1", - "figures": "^1.3.5", - "lodash": "^3.3.1", - "readline2": "^1.0.1", - "run-async": "^0.1.0", - "rx-lite": "^3.1.2", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.0", - "through": "^2.3.6" - }, - "devDependencies": { - "chai": "^3.0.0", - "cmdify": "^0.0.4", - "grunt": "^0.4.1", - "grunt-cli": "^0.1.8", - "grunt-contrib-jshint": "^0.11.1", - "grunt-mocha-test": "^0.12.7", - "mocha": "^2.2.1", - "mockery": "^1.4.0", - "sinon": "^1.12.1" - }, - "gitHead": "932457f47007d24686a7f019754f8fc695e4c94b", - "bugs": { - "url": "https://github.com/sboudrias/Inquirer.js/issues" - }, - "homepage": "https://github.com/sboudrias/Inquirer.js#readme", - "_id": "inquirer@0.11.4", - "_shasum": "81e3374e8361beaff2d97016206d359d0b32fa4d", - "_from": "inquirer@>=0.11.0 <0.12.0", - "_npmVersion": "3.5.3", - "_nodeVersion": "5.5.0", - "_npmUser": { - "name": "sboudrias", - "email": "admin@simonboudrias.com" - }, - "dist": { - "shasum": "81e3374e8361beaff2d97016206d359d0b32fa4d", - "tarball": "http://registry.npmjs.org/inquirer/-/inquirer-0.11.4.tgz" - }, - "maintainers": [ - { - "name": "sboudrias", - "email": "admin@simonboudrias.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.11.4.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/is-my-json-valid/.npmignore b/node_modules/eslint/node_modules/is-my-json-valid/.npmignore deleted file mode 100644 index dbb0721..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -cosmicrealms.com diff --git a/node_modules/eslint/node_modules/is-my-json-valid/.travis.yml b/node_modules/eslint/node_modules/is-my-json-valid/.travis.yml deleted file mode 100644 index 6e5919d..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "0.10" diff --git a/node_modules/eslint/node_modules/is-my-json-valid/LICENSE b/node_modules/eslint/node_modules/is-my-json-valid/LICENSE deleted file mode 100644 index 757562e..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Mathias Buus - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/eslint/node_modules/is-my-json-valid/README.md b/node_modules/eslint/node_modules/is-my-json-valid/README.md deleted file mode 100644 index cbf2b20..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/README.md +++ /dev/null @@ -1,173 +0,0 @@ -# is-my-json-valid - -A [JSONSchema](http://json-schema.org/) validator that uses code generation -to be extremely fast - -``` -npm install is-my-json-valid -``` - -It passes the entire JSONSchema v4 test suite except for `remoteRefs` and `maxLength`/`minLength` when using unicode surrogate pairs. - -[![build status](http://img.shields.io/travis/mafintosh/is-my-json-valid.svg?style=flat)](http://travis-ci.org/mafintosh/is-my-json-valid) - -## Usage - -Simply pass a schema to compile it - -``` js -var validator = require('is-my-json-valid') - -var validate = validator({ - required: true, - type: 'object', - properties: { - hello: { - required: true, - type: 'string' - } - } -}) - -console.log('should be valid', validate({hello: 'world'})) -console.log('should not be valid', validate({})) - -// get the last list of errors by checking validate.errors -// the following will print [{field: 'data.hello', message: 'is required'}] -console.log(validate.errors) -``` - -You can also pass the schema as a string - -``` js -var validate = validate('{"type": ... }') -``` - -Optionally you can use the require submodule to load a schema from `__dirname` - -``` js -var validator = require('is-my-json-valid/require') -var validate = validator('my-schema.json') -``` - -## Custom formats - -is-my-json-valid supports the formats specified in JSON schema v4 (such as date-time). -If you want to add your own custom formats pass them as the formats options to the validator - -``` js -var validate = validator({ - type: 'string', - required: true, - format: 'only-a' -}, { - formats: { - 'only-a': /^a+$/ - } -}) - -console.log(validate('aa')) // true -console.log(validate('ab')) // false -``` - -## External schemas - -You can pass in external schemas that you reference using the `$ref` attribute as the `schemas` option - -``` js -var ext = { - required: true, - type: 'string' -} - -var schema = { - $ref: '#ext' // references another schema called ext -} - -// pass the external schemas as an option -var validate = validator(schema, {schemas: {ext: ext}}) - -validate('hello') // returns true -validate(42) // return false -``` - -## Filtering away additional properties - -is-my-json-valid supports filtering away properties not in the schema - -``` js -var filter = validator.filter({ - required: true, - type: 'object', - properties: { - hello: {type: 'string', required: true} - }, - additionalProperties: false -}) - -var doc = {hello: 'world', notInSchema: true} -console.log(filter(doc)) // {hello: 'world'} -``` - -## Verbose mode outputs the value on errors - -is-my-json-valid outputs the value causing an error when verbose is set to true - -``` js -var validate = validator({ - required: true, - type: 'object', - properties: { - hello: { - required: true, - type: 'string' - } - } -}, { - verbose: true -}) - -validate({hello: 100}); -console.log(validate.errors) // {field: 'data.hello', message: 'is the wrong type', value: 100} -``` - -## Greedy mode tries to validate as much as possible - -By default is-my-json-valid bails on first validation error but when greedy is -set to true it tries to validate as much as possible: - -``` js -var validate = validator({ - type: 'object', - properties: { - x: { - type: 'number' - } - }, - required: ['x', 'y'] -}, { - greedy: true -}); - -validate({x: 'string'}); -console.log(validate.errors) // [{field: 'data.y', message: 'is required'}, - // {field: 'data.x', message: 'is the wrong type'}] -``` - -## Performance - -is-my-json-valid uses code generation to turn your JSON schema into basic javascript code that is easily optimizeable by v8. - -At the time of writing, is-my-json-valid is the __fastest validator__ when running - -* [json-schema-benchmark](https://github.com/Muscula/json-schema-benchmark) -* [cosmicreals.com benchmark](http://cosmicrealms.com/blog/2014/08/29/benchmark-of-node-dot-js-json-validation-modules-part-3/) -* [jsck benchmark](https://github.com/pandastrike/jsck/issues/72#issuecomment-70992684) -* [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html) -* [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html) - -If you know any other relevant benchmarks open a PR and I'll add them. - -## License - -MIT diff --git a/node_modules/eslint/node_modules/is-my-json-valid/example.js b/node_modules/eslint/node_modules/is-my-json-valid/example.js deleted file mode 100644 index f70f4df..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/example.js +++ /dev/null @@ -1,18 +0,0 @@ -var validator = require('./') - -var validate = validator({ - type: 'object', - properties: { - hello: { - required: true, - type: 'string' - } - } -}) - -console.log('should be valid', validate({hello: 'world'})) -console.log('should not be valid', validate({})) - -// get the last error message by checking validate.error -// the following will print "data.hello is required" -console.log('the errors were:', validate.errors) diff --git a/node_modules/eslint/node_modules/is-my-json-valid/formats.js b/node_modules/eslint/node_modules/is-my-json-valid/formats.js deleted file mode 100644 index 9cb8380..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/formats.js +++ /dev/null @@ -1,14 +0,0 @@ -exports['date-time'] = /^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-[0-9]{2}[tT ]\d{2}:\d{2}:\d{2}(\.\d+)?([zZ]|[+-]\d{2}:\d{2})$/ -exports['date'] = /^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-[0-9]{2}$/ -exports['time'] = /^\d{2}:\d{2}:\d{2}$/ -exports['email'] = /^\S+@\S+$/ -exports['ip-address'] = exports['ipv4'] = /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/ -exports['ipv6'] = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/ -exports['uri'] = /^[a-zA-Z][a-zA-Z0-9+-.]*:[^\s]*$/ -exports['color'] = /(#?([0-9A-Fa-f]{3,6})\b)|(aqua)|(black)|(blue)|(fuchsia)|(gray)|(green)|(lime)|(maroon)|(navy)|(olive)|(orange)|(purple)|(red)|(silver)|(teal)|(white)|(yellow)|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\))/ -exports['hostname'] = /^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$/ -exports['alpha'] = /^[a-zA-Z]+$/ -exports['alphanumeric'] = /^[a-zA-Z0-9]+$/ -exports['style'] = /\s*(.+?):\s*([^;]+);?/g -exports['phone'] = /^\+(?:[0-9] ?){6,14}[0-9]$/ -exports['utc-millisec'] = /^[0-9]{1,15}\.?[0-9]{0,15}$/ diff --git a/node_modules/eslint/node_modules/is-my-json-valid/index.js b/node_modules/eslint/node_modules/is-my-json-valid/index.js deleted file mode 100644 index f24db9b..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/index.js +++ /dev/null @@ -1,575 +0,0 @@ -var genobj = require('generate-object-property') -var genfun = require('generate-function') -var jsonpointer = require('jsonpointer') -var xtend = require('xtend') -var formats = require('./formats') - -var get = function(obj, additionalSchemas, ptr) { - if (/^https?:\/\//.test(ptr)) return null - - var visit = function(sub) { - if (sub && sub.id === ptr) return sub - if (typeof sub !== 'object' || !sub) return null - return Object.keys(sub).reduce(function(res, k) { - return res || visit(sub[k]) - }, null) - } - - var res = visit(obj) - if (res) return res - - ptr = ptr.replace(/^#/, '') - ptr = ptr.replace(/\/$/, '') - - try { - return jsonpointer.get(obj, decodeURI(ptr)) - } catch (err) { - var end = ptr.indexOf('#') - var other - // external reference - if (end !== 0) { - // fragment doesn't exist. - if (end === -1) { - other = additionalSchemas[ptr] - } else { - var ext = ptr.slice(0, end) - other = additionalSchemas[ext] - var fragment = ptr.slice(end).replace(/^#/, '') - try { - return jsonpointer.get(other, fragment) - } catch (err) {} - } - } else { - other = additionalSchemas[ptr] - } - return other || null - } -} - -var formatName = function(field) { - field = JSON.stringify(field) - var pattern = /\[([^\[\]"]+)\]/ - while (pattern.test(field)) field = field.replace(pattern, '."+$1+"') - return field -} - -var types = {} - -types.any = function() { - return 'true' -} - -types.null = function(name) { - return name+' === null' -} - -types.boolean = function(name) { - return 'typeof '+name+' === "boolean"' -} - -types.array = function(name) { - return 'Array.isArray('+name+')' -} - -types.object = function(name) { - return 'typeof '+name+' === "object" && '+name+' && !Array.isArray('+name+')' -} - -types.number = function(name) { - return 'typeof '+name+' === "number"' -} - -types.integer = function(name) { - return 'typeof '+name+' === "number" && (Math.floor('+name+') === '+name+' || '+name+' > 9007199254740992 || '+name+' < -9007199254740992)' -} - -types.string = function(name) { - return 'typeof '+name+' === "string"' -} - -var unique = function(array) { - var list = [] - for (var i = 0; i < array.length; i++) { - list.push(typeof array[i] === 'object' ? JSON.stringify(array[i]) : array[i]) - } - for (var i = 1; i < list.length; i++) { - if (list.indexOf(list[i]) !== i) return false - } - return true -} - -var toType = function(node) { - return node.type -} - -var compile = function(schema, cache, root, reporter, opts) { - var fmts = opts ? xtend(formats, opts.formats) : formats - var scope = {unique:unique, formats:fmts} - var verbose = opts ? !!opts.verbose : false; - var greedy = opts && opts.greedy !== undefined ? - opts.greedy : false; - - var syms = {} - var gensym = function(name) { - return name+(syms[name] = (syms[name] || 0)+1) - } - - var reversePatterns = {} - var patterns = function(p) { - if (reversePatterns[p]) return reversePatterns[p] - var n = gensym('pattern') - scope[n] = new RegExp(p) - reversePatterns[p] = n - return n - } - - var vars = ['i','j','k','l','m','n','o','p','q','r','s','t','u','v','x','y','z'] - var genloop = function() { - var v = vars.shift() - vars.push(v+v[0]) - return v - } - - var visit = function(name, node, reporter, filter) { - var properties = node.properties - var type = node.type - var tuple = false - - if (Array.isArray(node.items)) { // tuple type - properties = {} - node.items.forEach(function(item, i) { - properties[i] = item - }) - type = 'array' - tuple = true - } - - var indent = 0 - var error = function(msg, prop, value) { - validate('errors++') - if (reporter === true) { - validate('if (validate.errors === null) validate.errors = []') - if (verbose) { - validate('validate.errors.push({field:%s,message:%s,value:%s})', formatName(prop || name), JSON.stringify(msg), value || name) - } else { - validate('validate.errors.push({field:%s,message:%s})', formatName(prop || name), JSON.stringify(msg)) - } - } - } - - if (node.required === true) { - indent++ - validate('if (%s === undefined) {', name) - error('is required') - validate('} else {') - } else { - indent++ - validate('if (%s !== undefined) {', name) - } - - var valid = [].concat(type) - .map(function(t) { - return types[t || 'any'](name) - }) - .join(' || ') || 'true' - - if (valid !== 'true') { - indent++ - validate('if (!(%s)) {', valid) - error('is the wrong type') - validate('} else {') - } - - if (tuple) { - if (node.additionalItems === false) { - validate('if (%s.length > %d) {', name, node.items.length) - error('has additional items') - validate('}') - } else if (node.additionalItems) { - var i = genloop() - validate('for (var %s = %d; %s < %s.length; %s++) {', i, node.items.length, i, name, i) - visit(name+'['+i+']', node.additionalItems, reporter, filter) - validate('}') - } - } - - if (node.format && fmts[node.format]) { - if (type !== 'string' && formats[node.format]) validate('if (%s) {', types.string(name)) - var n = gensym('format') - scope[n] = fmts[node.format] - - if (typeof scope[n] === 'function') validate('if (!%s(%s)) {', n, name) - else validate('if (!%s.test(%s)) {', n, name) - error('must be '+node.format+' format') - validate('}') - if (type !== 'string' && formats[node.format]) validate('}') - } - - if (Array.isArray(node.required)) { - var isUndefined = function(req) { - return genobj(name, req) + ' === undefined' - } - - var checkRequired = function (req) { - var prop = genobj(name, req); - validate('if (%s === undefined) {', prop) - error('is required', prop) - validate('missing++') - validate('}') - } - validate('if ((%s)) {', type !== 'object' ? types.object(name) : 'true') - validate('var missing = 0') - node.required.map(checkRequired) - validate('}'); - if (!greedy) { - validate('if (missing === 0) {') - indent++ - } - } - - if (node.uniqueItems) { - if (type !== 'array') validate('if (%s) {', types.array(name)) - validate('if (!(unique(%s))) {', name) - error('must be unique') - validate('}') - if (type !== 'array') validate('}') - } - - if (node.enum) { - var complex = node.enum.some(function(e) { - return typeof e === 'object' - }) - - var compare = complex ? - function(e) { - return 'JSON.stringify('+name+')'+' !== JSON.stringify('+JSON.stringify(e)+')' - } : - function(e) { - return name+' !== '+JSON.stringify(e) - } - - validate('if (%s) {', node.enum.map(compare).join(' && ') || 'false') - error('must be an enum value') - validate('}') - } - - if (node.dependencies) { - if (type !== 'object') validate('if (%s) {', types.object(name)) - - Object.keys(node.dependencies).forEach(function(key) { - var deps = node.dependencies[key] - if (typeof deps === 'string') deps = [deps] - - var exists = function(k) { - return genobj(name, k) + ' !== undefined' - } - - if (Array.isArray(deps)) { - validate('if (%s !== undefined && !(%s)) {', genobj(name, key), deps.map(exists).join(' && ') || 'true') - error('dependencies not set') - validate('}') - } - if (typeof deps === 'object') { - validate('if (%s !== undefined) {', genobj(name, key)) - visit(name, deps, reporter, filter) - validate('}') - } - }) - - if (type !== 'object') validate('}') - } - - if (node.additionalProperties || node.additionalProperties === false) { - if (type !== 'object') validate('if (%s) {', types.object(name)) - - var i = genloop() - var keys = gensym('keys') - - var toCompare = function(p) { - return keys+'['+i+'] !== '+JSON.stringify(p) - } - - var toTest = function(p) { - return '!'+patterns(p)+'.test('+keys+'['+i+'])' - } - - var additionalProp = Object.keys(properties || {}).map(toCompare) - .concat(Object.keys(node.patternProperties || {}).map(toTest)) - .join(' && ') || 'true' - - validate('var %s = Object.keys(%s)', keys, name) - ('for (var %s = 0; %s < %s.length; %s++) {', i, i, keys, i) - ('if (%s) {', additionalProp) - - if (node.additionalProperties === false) { - if (filter) validate('delete %s', name+'['+keys+'['+i+']]') - error('has additional properties', null, JSON.stringify(name+'.') + ' + ' + keys + '['+i+']') - } else { - visit(name+'['+keys+'['+i+']]', node.additionalProperties, reporter, filter) - } - - validate - ('}') - ('}') - - if (type !== 'object') validate('}') - } - - if (node.$ref) { - var sub = get(root, opts && opts.schemas || {}, node.$ref) - if (sub) { - var fn = cache[node.$ref] - if (!fn) { - cache[node.$ref] = function proxy(data) { - return fn(data) - } - fn = compile(sub, cache, root, false, opts) - } - var n = gensym('ref') - scope[n] = fn - validate('if (!(%s(%s))) {', n, name) - error('referenced schema does not match') - validate('}') - } - } - - if (node.not) { - var prev = gensym('prev') - validate('var %s = errors', prev) - visit(name, node.not, false, filter) - validate('if (%s === errors) {', prev) - error('negative schema matches') - validate('} else {') - ('errors = %s', prev) - ('}') - } - - if (node.items && !tuple) { - if (type !== 'array') validate('if (%s) {', types.array(name)) - - var i = genloop() - validate('for (var %s = 0; %s < %s.length; %s++) {', i, i, name, i) - visit(name+'['+i+']', node.items, reporter, filter) - validate('}') - - if (type !== 'array') validate('}') - } - - if (node.patternProperties) { - if (type !== 'object') validate('if (%s) {', types.object(name)) - var keys = gensym('keys') - var i = genloop() - validate - ('var %s = Object.keys(%s)', keys, name) - ('for (var %s = 0; %s < %s.length; %s++) {', i, i, keys, i) - - Object.keys(node.patternProperties).forEach(function(key) { - var p = patterns(key) - validate('if (%s.test(%s)) {', p, keys+'['+i+']') - visit(name+'['+keys+'['+i+']]', node.patternProperties[key], reporter, filter) - validate('}') - }) - - validate('}') - if (type !== 'object') validate('}') - } - - if (node.pattern) { - var p = patterns(node.pattern) - if (type !== 'string') validate('if (%s) {', types.string(name)) - validate('if (!(%s.test(%s))) {', p, name) - error('pattern mismatch') - validate('}') - if (type !== 'string') validate('}') - } - - if (node.allOf) { - node.allOf.forEach(function(sch) { - visit(name, sch, reporter, filter) - }) - } - - if (node.anyOf && node.anyOf.length) { - var prev = gensym('prev') - - node.anyOf.forEach(function(sch, i) { - if (i === 0) { - validate('var %s = errors', prev) - } else { - validate('if (errors !== %s) {', prev) - ('errors = %s', prev) - } - visit(name, sch, false, false) - }) - node.anyOf.forEach(function(sch, i) { - if (i) validate('}') - }) - validate('if (%s !== errors) {', prev) - error('no schemas match') - validate('}') - } - - if (node.oneOf && node.oneOf.length) { - var prev = gensym('prev') - var passes = gensym('passes') - - validate - ('var %s = errors', prev) - ('var %s = 0', passes) - - node.oneOf.forEach(function(sch, i) { - visit(name, sch, false, false) - validate('if (%s === errors) {', prev) - ('%s++', passes) - ('} else {') - ('errors = %s', prev) - ('}') - }) - - validate('if (%s !== 1) {', passes) - error('no (or more than one) schemas match') - validate('}') - } - - if (node.multipleOf !== undefined) { - if (type !== 'number' && type !== 'integer') validate('if (%s) {', types.number(name)) - - var factor = ((node.multipleOf | 0) !== node.multipleOf) ? Math.pow(10, node.multipleOf.toString().split('.').pop().length) : 1 - if (factor > 1) validate('if ((%d*%s) % %d) {', factor, name, factor*node.multipleOf) - else validate('if (%s % %d) {', name, node.multipleOf) - - error('has a remainder') - validate('}') - - if (type !== 'number' && type !== 'integer') validate('}') - } - - if (node.maxProperties !== undefined) { - if (type !== 'object') validate('if (%s) {', types.object(name)) - - validate('if (Object.keys(%s).length > %d) {', name, node.maxProperties) - error('has more properties than allowed') - validate('}') - - if (type !== 'object') validate('}') - } - - if (node.minProperties !== undefined) { - if (type !== 'object') validate('if (%s) {', types.object(name)) - - validate('if (Object.keys(%s).length < %d) {', name, node.minProperties) - error('has less properties than allowed') - validate('}') - - if (type !== 'object') validate('}') - } - - if (node.maxItems !== undefined) { - if (type !== 'array') validate('if (%s) {', types.array(name)) - - validate('if (%s.length > %d) {', name, node.maxItems) - error('has more items than allowed') - validate('}') - - if (type !== 'array') validate('}') - } - - if (node.minItems !== undefined) { - if (type !== 'array') validate('if (%s) {', types.array(name)) - - validate('if (%s.length < %d) {', name, node.minItems) - error('has less items than allowed') - validate('}') - - if (type !== 'array') validate('}') - } - - if (node.maxLength !== undefined) { - if (type !== 'string') validate('if (%s) {', types.string(name)) - - validate('if (%s.length > %d) {', name, node.maxLength) - error('has longer length than allowed') - validate('}') - - if (type !== 'string') validate('}') - } - - if (node.minLength !== undefined) { - if (type !== 'string') validate('if (%s) {', types.string(name)) - - validate('if (%s.length < %d) {', name, node.minLength) - error('has less length than allowed') - validate('}') - - if (type !== 'string') validate('}') - } - - if (node.minimum !== undefined) { - validate('if (%s %s %d) {', name, node.exclusiveMinimum ? '<=' : '<', node.minimum) - error('is less than minimum') - validate('}') - } - - if (node.maximum !== undefined) { - validate('if (%s %s %d) {', name, node.exclusiveMaximum ? '>=' : '>', node.maximum) - error('is more than maximum') - validate('}') - } - - if (properties) { - Object.keys(properties).forEach(function(p) { - if (Array.isArray(type) && type.indexOf('null') !== -1) validate('if (%s !== null) {', name) - - visit(genobj(name, p), properties[p], reporter, filter) - - if (Array.isArray(type) && type.indexOf('null') !== -1) validate('}') - }) - } - - while (indent--) validate('}') - } - - var validate = genfun - ('function validate(data) {') - ('validate.errors = null') - ('var errors = 0') - - visit('data', schema, reporter, opts && opts.filter) - - validate - ('return errors === 0') - ('}') - - validate = validate.toFunction(scope) - validate.errors = null - - if (Object.defineProperty) { - Object.defineProperty(validate, 'error', { - get: function() { - if (!validate.errors) return '' - return validate.errors.map(function(err) { - return err.field + ' ' + err.message; - }).join('\n') - } - }) - } - - validate.toJSON = function() { - return schema - } - - return validate -} - -module.exports = function(schema, opts) { - if (typeof schema === 'string') schema = JSON.parse(schema) - return compile(schema, {}, schema, true, opts) -} - -module.exports.filter = function(schema, opts) { - var validate = module.exports(schema, xtend(opts, {filter: true})) - return function(sch) { - validate(sch) - return sch - } -} diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-function/.npmignore b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-function/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-function/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-function/.travis.yml b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-function/.travis.yml deleted file mode 100644 index 6e5919d..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-function/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "0.10" diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-function/README.md b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-function/README.md deleted file mode 100644 index 693bff8..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-function/README.md +++ /dev/null @@ -1,72 +0,0 @@ -# generate-function - -Module that helps you write generated functions in Node - -``` -npm install generate-function -``` - -[![build status](http://img.shields.io/travis/mafintosh/generate-function.svg?style=flat)](http://travis-ci.org/mafintosh/generate-function) - -## Disclamer - -Writing code that generates code is hard. -You should only use this if you really, really, really need this for performance reasons (like schema validators / parsers etc). - -## Usage - -``` js -var genfun = require('generate-function') - -var addNumber = function(val) { - var fn = genfun() - ('function add(n) {') - ('return n + %d', val) // supports format strings to insert values - ('}') - - return fn.toFunction() // will compile the function -} - -var add2 = addNumber(2) - -console.log('1+2=', add2(1)) -console.log(add2.toString()) // prints the generated function -``` - -If you need to close over variables in your generated function pass them to `toFunction(scope)` - -``` js -var multiply = function(a, b) { - return a * b -} - -var addAndMultiplyNumber = function(val) { - var fn = genfun() - ('function(n) {') - ('if (typeof n !== "number") {') // ending a line with { will indent the source - ('throw new Error("argument should be a number")') - ('}') - ('var result = multiply(%d, n+%d)', val, val) - ('return result') - ('}') - - // use fn.toString() if you want to see the generated source - - return fn.toFunction({ - multiply: multiply - }) -} - -var addAndMultiply2 = addAndMultiplyNumber(2) - -console.log('(3 + 2) * 2 =', addAndMultiply2(3)) -``` - -## Related - -See [generate-object-property](https://github.com/mafintosh/generate-object-property) if you need to safely generate code that -can be used to reference an object property - -## License - -MIT \ No newline at end of file diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-function/example.js b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-function/example.js deleted file mode 100644 index 8d1fee1..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-function/example.js +++ /dev/null @@ -1,27 +0,0 @@ -var genfun = require('./') - -var multiply = function(a, b) { - return a * b -} - -var addAndMultiplyNumber = function(val) { - var fn = genfun() - ('function(n) {') - ('if (typeof n !== "number") {') // ending a line with { will indent the source - ('throw new Error("argument should be a number")') - ('}') - ('var result = multiply(%d, n+%d)', val, val) - ('return result') - ('}') - - // use fn.toString() if you want to see the generated source - - return fn.toFunction({ - multiply: multiply - }) -} - -var addAndMultiply2 = addAndMultiplyNumber(2) - -console.log(addAndMultiply2.toString()) -console.log('(3 + 2) * 2 =', addAndMultiply2(3)) \ No newline at end of file diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-function/index.js b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-function/index.js deleted file mode 100644 index 37e064b..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-function/index.js +++ /dev/null @@ -1,61 +0,0 @@ -var util = require('util') - -var INDENT_START = /[\{\[]/ -var INDENT_END = /[\}\]]/ - -module.exports = function() { - var lines = [] - var indent = 0 - - var push = function(str) { - var spaces = '' - while (spaces.length < indent*2) spaces += ' ' - lines.push(spaces+str) - } - - var line = function(fmt) { - if (!fmt) return line - - if (INDENT_END.test(fmt.trim()[0]) && INDENT_START.test(fmt[fmt.length-1])) { - indent-- - push(util.format.apply(util, arguments)) - indent++ - return line - } - if (INDENT_START.test(fmt[fmt.length-1])) { - push(util.format.apply(util, arguments)) - indent++ - return line - } - if (INDENT_END.test(fmt.trim()[0])) { - indent-- - push(util.format.apply(util, arguments)) - return line - } - - push(util.format.apply(util, arguments)) - return line - } - - line.toString = function() { - return lines.join('\n') - } - - line.toFunction = function(scope) { - var src = 'return ('+line.toString()+')' - - var keys = Object.keys(scope || {}).map(function(key) { - return key - }) - - var vals = keys.map(function(key) { - return scope[key] - }) - - return Function.apply(null, keys.concat(src)).apply(null, vals) - } - - if (arguments.length) line.apply(null, arguments) - - return line -} diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-function/package.json b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-function/package.json deleted file mode 100644 index db1ac2a..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-function/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "generate-function", - "version": "2.0.0", - "description": "Module that helps you write generated functions in Node", - "main": "index.js", - "scripts": { - "test": "tape test.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/mafintosh/generate-function.git" - }, - "keywords": [ - "generate", - "code", - "generation", - "function", - "performance" - ], - "author": { - "name": "Mathias Buus" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/mafintosh/generate-function/issues" - }, - "homepage": "https://github.com/mafintosh/generate-function", - "devDependencies": { - "tape": "^2.13.4" - }, - "gitHead": "3d5fc8de5859be95f58e3af9bfb5f663edd95149", - "_id": "generate-function@2.0.0", - "_shasum": "6858fe7c0969b7d4e9093337647ac79f60dfbe74", - "_from": "generate-function@>=2.0.0 <3.0.0", - "_npmVersion": "1.4.23", - "_npmUser": { - "name": "mafintosh", - "email": "mathiasbuus@gmail.com" - }, - "maintainers": [ - { - "name": "mafintosh", - "email": "mathiasbuus@gmail.com" - } - ], - "dist": { - "shasum": "6858fe7c0969b7d4e9093337647ac79f60dfbe74", - "tarball": "http://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-function/test.js b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-function/test.js deleted file mode 100644 index 2768893..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-function/test.js +++ /dev/null @@ -1,33 +0,0 @@ -var tape = require('tape') -var genfun = require('./') - -tape('generate add function', function(t) { - var fn = genfun() - ('function add(n) {') - ('return n + %d', 42) - ('}') - - t.same(fn.toString(), 'function add(n) {\n return n + 42\n}', 'code is indented') - t.same(fn.toFunction()(10), 52, 'function works') - t.end() -}) - -tape('generate function + closed variables', function(t) { - var fn = genfun() - ('function add(n) {') - ('return n + %d + number', 42) - ('}') - - var notGood = fn.toFunction() - var good = fn.toFunction({number:10}) - - try { - notGood(10) - t.ok(false, 'function should not work') - } catch (err) { - t.same(err.message, 'number is not defined', 'throws reference error') - } - - t.same(good(11), 63, 'function with closed var works') - t.end() -}) \ No newline at end of file diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/.npmignore b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/.travis.yml b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/.travis.yml deleted file mode 100644 index 6e5919d..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "0.10" diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/LICENSE b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/LICENSE deleted file mode 100644 index 757562e..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Mathias Buus - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/README.md b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/README.md deleted file mode 100644 index 0ee0461..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# generate-object-property - -Generate safe JS code that can used to reference a object property - - npm install generate-object-property - -[![build status](http://img.shields.io/travis/mafintosh/generate-object-property.svg?style=flat)](http://travis-ci.org/mafintosh/generate-object-property) - -## Usage - -``` js -var gen = require('generate-object-property'); -console.log(gen('a','b')); // prints a.b -console.log(gen('a', 'foo-bar')); // prints a["foo-bar"] -``` - -## License - -MIT \ No newline at end of file diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js deleted file mode 100644 index 5dc9f77..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js +++ /dev/null @@ -1,12 +0,0 @@ -var isProperty = require('is-property') - -var gen = function(obj, prop) { - return isProperty(prop) ? obj+'.'+prop : obj+'['+JSON.stringify(prop)+']' -} - -gen.valid = isProperty -gen.property = function (prop) { - return isProperty(prop) ? prop : JSON.stringify(prop) -} - -module.exports = gen diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/.npmignore b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/.npmignore deleted file mode 100644 index 8ecfa25..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/.npmignore +++ /dev/null @@ -1,17 +0,0 @@ -lib-cov -*.seed -*.log -*.csv -*.dat -*.out -*.pid -*.gz - -pids -logs -results - -npm-debug.log -node_modules/* -*.DS_Store -test/* \ No newline at end of file diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/LICENSE b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/LICENSE deleted file mode 100644 index 8ce206a..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ - -The MIT License (MIT) - -Copyright (c) 2013 Mikola Lysenko - -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. diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md deleted file mode 100644 index ef1d00b..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md +++ /dev/null @@ -1,28 +0,0 @@ -is-property -=========== -Tests if a property of a JavaScript object can be accessed using the dot (.) notation or if it must be enclosed in brackets, (ie use x[" ... "]) - -Example -------- - -```javascript -var isProperty = require("is-property") - -console.log(isProperty("foo")) //Prints true -console.log(isProperty("0")) //Prints false -``` - -Install -------- - - npm install is-property - -### `require("is-property")(str)` -Checks if str is a property - -* `str` is a string which we will test if it is a property or not - -**Returns** true or false depending if str is a property - -## Credits -(c) 2013 Mikola Lysenko. MIT License \ No newline at end of file diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/is-property.js b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/is-property.js deleted file mode 100644 index db58b47..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/is-property.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict" -function isProperty(str) { - return /^[$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(str) -} -module.exports = isProperty \ No newline at end of file diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json deleted file mode 100644 index 9f23619..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "is-property", - "version": "1.0.2", - "description": "Tests if a JSON property can be accessed using . syntax", - "main": "is-property.js", - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tape": "~1.0.4" - }, - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/mikolalysenko/is-property.git" - }, - "keywords": [ - "is", - "property", - "json", - "dot", - "bracket", - ".", - "[]" - ], - "author": { - "name": "Mikola Lysenko" - }, - "license": "MIT", - "gitHead": "0a85ea5b6b1264ea1cdecc6e5cf186adbb3ffc50", - "bugs": { - "url": "https://github.com/mikolalysenko/is-property/issues" - }, - "homepage": "https://github.com/mikolalysenko/is-property", - "_id": "is-property@1.0.2", - "_shasum": "57fe1c4e48474edd65b09911f26b1cd4095dda84", - "_from": "is-property@>=1.0.0 <2.0.0", - "_npmVersion": "2.1.4", - "_nodeVersion": "0.10.26", - "_npmUser": { - "name": "mikolalysenko", - "email": "mikolalysenko@gmail.com" - }, - "maintainers": [ - { - "name": "mikolalysenko", - "email": "mikolalysenko@gmail.com" - } - ], - "dist": { - "shasum": "57fe1c4e48474edd65b09911f26b1cd4095dda84", - "tarball": "http://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz" - }, - "_resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json deleted file mode 100644 index 8bc73da..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "generate-object-property", - "version": "1.2.0", - "description": "Generate safe JS code that can used to reference a object property", - "repository": { - "type": "git", - "url": "git+https://github.com/mafintosh/generate-object-property.git" - }, - "devDependencies": { - "tape": "^2.13.0" - }, - "scripts": { - "test": "tape test.js" - }, - "dependencies": { - "is-property": "^1.0.0" - }, - "bugs": { - "url": "https://github.com/mafintosh/generate-object-property/issues" - }, - "homepage": "https://github.com/mafintosh/generate-object-property", - "main": "index.js", - "author": { - "name": "Mathias Buus", - "url": "@mafintosh" - }, - "license": "MIT", - "gitHead": "0dd7d411018de54b2eae63b424c15b3e50bd678c", - "_id": "generate-object-property@1.2.0", - "_shasum": "9c0e1c40308ce804f4783618b937fa88f99d50d0", - "_from": "generate-object-property@>=1.1.0 <2.0.0", - "_npmVersion": "2.9.0", - "_nodeVersion": "2.0.1", - "_npmUser": { - "name": "mafintosh", - "email": "mathiasbuus@gmail.com" - }, - "maintainers": [ - { - "name": "mafintosh", - "email": "mathiasbuus@gmail.com" - } - ], - "dist": { - "shasum": "9c0e1c40308ce804f4783618b937fa88f99d50d0", - "tarball": "http://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/test.js b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/test.js deleted file mode 100644 index 6c299c6..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/test.js +++ /dev/null @@ -1,12 +0,0 @@ -var tape = require('tape') -var gen = require('./') - -tape('valid', function(t) { - t.same(gen('a', 'b'), 'a.b') - t.end() -}) - -tape('invalid', function(t) { - t.same(gen('a', '-b'), 'a["-b"]') - t.end() -}) \ No newline at end of file diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/.travis.yml b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/.travis.yml deleted file mode 100644 index 9338bf1..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: "node_js" -node_js: - - 0.6 - - 0.8 - - 0.10 - - 0.11 - - 0.12 - - iojs-v1.0 - - iojs-v2.0 - - iojs diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/README.md b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/README.md deleted file mode 100644 index e096dfa..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# JSON Pointer for nodejs - -This is an implementation of [JSON Pointer](http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08). - -## Usage - - var jsonpointer = require("jsonpointer"); - var obj = { foo: 1, bar: { baz: 2}, qux: [3, 4, 5]}; - var one = jsonpointer.get(obj, "/foo"); - var two = jsonpointer.get(obj, "/bar/baz"); - var three = jsonpointer.get(obj, "/qux/0"); - var four = jsonpointer.get(obj, "/qux/1"); - var five = jsonpointer.get(obj, "/qux/2"); - var notfound = jsonpointer.get(obj, "/quo"); // returns null - - jsonpointer.set(obj, "/foo", 6); // obj.foo = 6; - -## Testing - - $ node test.js - All tests pass. - $ - -[![Build Status](https://travis-ci.org/janl/node-jsonpointer.png?branch=master)](https://travis-ci.org/janl/node-jsonpointer) - -## Author - -(c) 2011 Jan Lehnardt - -## License - -MIT License. diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/jsonpointer.js b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/jsonpointer.js deleted file mode 100644 index 006f85e..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/jsonpointer.js +++ /dev/null @@ -1,76 +0,0 @@ -var untilde = function(str) { - return str.replace(/~./g, function(m) { - switch (m) { - case "~0": - return "~"; - case "~1": - return "/"; - } - throw new Error("Invalid tilde escape: " + m); - }); -} - -var traverse = function(obj, pointer, value) { - // assert(isArray(pointer)) - var part = untilde(pointer.shift()); - if(!obj.hasOwnProperty(part)) { - return null; - } - if(pointer.length !== 0) { // keep traversin! - return traverse(obj[part], pointer, value); - } - // we're done - if(typeof value === "undefined") { - // just reading - return obj[part]; - } - // set new value, return old value - var old_value = obj[part]; - if(value === null) { - delete obj[part]; - } else { - obj[part] = value; - } - return old_value; -} - -var validate_input = function(obj, pointer) { - if(typeof obj !== "object") { - throw new Error("Invalid input object."); - } - - if(pointer === "") { - return []; - } - - if(!pointer) { - throw new Error("Invalid JSON pointer."); - } - - pointer = pointer.split("/"); - var first = pointer.shift(); - if (first !== "") { - throw new Error("Invalid JSON pointer."); - } - - return pointer; -} - -var get = function(obj, pointer) { - pointer = validate_input(obj, pointer); - if (pointer.length === 0) { - return obj; - } - return traverse(obj, pointer); -} - -var set = function(obj, pointer, value) { - pointer = validate_input(obj, pointer); - if (pointer.length === 0) { - throw new Error("Invalid JSON pointer for set.") - } - return traverse(obj, pointer, value); -} - -exports.get = get -exports.set = set diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json deleted file mode 100644 index 4b06776..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "jsonpointer", - "description": "Simple JSON Addressing.", - "tags": [ - "util", - "simple", - "util", - "utility" - ], - "version": "2.0.0", - "author": { - "name": "Jan Lehnardt", - "email": "jan@apache.org" - }, - "contributors": [ - { - "name": "Joe Hildebrand", - "email": "joe-github@cursive.net" - } - ], - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/janl/node-jsonpointer.git" - }, - "bugs": { - "url": "http://github.com/janl/node-jsonpointer/issues" - }, - "engines": { - "node": ">=0.6.0" - }, - "main": "./jsonpointer", - "scripts": { - "test": "node test.js" - }, - "license": "MIT", - "gitHead": "26ea4a5c0fcb6d9a2e87f733403791dd05637af8", - "homepage": "https://github.com/janl/node-jsonpointer#readme", - "_id": "jsonpointer@2.0.0", - "_shasum": "3af1dd20fe85463910d469a385e33017d2a030d9", - "_from": "jsonpointer@2.0.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "0.10.36", - "_npmUser": { - "name": "marcbachmann", - "email": "marc.brookman@gmail.com" - }, - "maintainers": [ - { - "name": "jan", - "email": "jan@apache.org" - }, - { - "name": "marcbachmann", - "email": "marc.brookman@gmail.com" - } - ], - "dist": { - "shasum": "3af1dd20fe85463910d469a385e33017d2a030d9", - "tarball": "http://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/test.js b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/test.js deleted file mode 100644 index 1c67d7f..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/test.js +++ /dev/null @@ -1,98 +0,0 @@ -var assert = require("assert"); -var jsonpointer = require("./jsonpointer"); - -var obj = { - a: 1, - b: { - c: 2 - }, - d: { - e: [{a:3}, {b:4}, {c:5}] - } -}; - -assert.equal(jsonpointer.get(obj, "/a"), 1); -assert.equal(jsonpointer.get(obj, "/b/c"), 2); -assert.equal(jsonpointer.get(obj, "/d/e/0/a"), 3); -assert.equal(jsonpointer.get(obj, "/d/e/1/b"), 4); -assert.equal(jsonpointer.get(obj, "/d/e/2/c"), 5); - -// set returns old value -assert.equal(jsonpointer.set(obj, "/a", 2), 1); -assert.equal(jsonpointer.set(obj, "/b/c", 3), 2); -assert.equal(jsonpointer.set(obj, "/d/e/0/a", 4), 3); -assert.equal(jsonpointer.set(obj, "/d/e/1/b", 5), 4); -assert.equal(jsonpointer.set(obj, "/d/e/2/c", 6), 5); - -assert.equal(jsonpointer.get(obj, "/a"), 2); -assert.equal(jsonpointer.get(obj, "/b/c"), 3); -assert.equal(jsonpointer.get(obj, "/d/e/0/a"), 4); -assert.equal(jsonpointer.get(obj, "/d/e/1/b"), 5); -assert.equal(jsonpointer.get(obj, "/d/e/2/c"), 6); - -assert.equal(jsonpointer.get(obj, ""), obj); -assert.throws(function(){ jsonpointer.get(obj, "a"); }, validateError); -assert.throws(function(){ jsonpointer.get(obj, "a/"); }, validateError); - -function validateError(err) { - if ( (err instanceof Error) && /Invalid JSON pointer/.test(err.message) ) { - return true; - } -} - -var complexKeys = { - "a/b": { - c: 1 - }, - d: { - "e/f": 2 - }, - "~1": 3, - "01": 4 -} - -assert.equal(jsonpointer.get(complexKeys, "/a~1b/c"), 1); -assert.equal(jsonpointer.get(complexKeys, "/d/e~1f"), 2); -assert.equal(jsonpointer.get(complexKeys, "/~01"), 3); -assert.equal(jsonpointer.get(complexKeys, "/01"), 4); -assert.equal(jsonpointer.get(complexKeys, "/a/b/c"), null); -assert.equal(jsonpointer.get(complexKeys, "/~1"), null); - -// draft-ietf-appsawg-json-pointer-08 has special array rules -var ary = [ "zero", "one", "two" ]; -assert.equal(jsonpointer.get(ary, "/01"), null); - -//assert.equal(jsonpointer.set(ary, "/-", "three"), null); -//assert.equal(ary[3], "three"); - -// Examples from the draft: -var example = { - "foo": ["bar", "baz"], - "": 0, - "a/b": 1, - "c%d": 2, - "e^f": 3, - "g|h": 4, - "i\\j": 5, - "k\"l": 6, - " ": 7, - "m~n": 8 -}; - -assert.equal(jsonpointer.get(example, ""), example); -var ans = jsonpointer.get(example, "/foo"); -assert.equal(ans.length, 2); -assert.equal(ans[0], "bar"); -assert.equal(ans[1], "baz"); -assert.equal(jsonpointer.get(example, "/foo/0"), "bar"); -assert.equal(jsonpointer.get(example, "/"), 0); -assert.equal(jsonpointer.get(example, "/a~1b"), 1); -assert.equal(jsonpointer.get(example, "/c%d"), 2); -assert.equal(jsonpointer.get(example, "/e^f"), 3); -assert.equal(jsonpointer.get(example, "/g|h"), 4); -assert.equal(jsonpointer.get(example, "/i\\j"), 5); -assert.equal(jsonpointer.get(example, "/k\"l"), 6); -assert.equal(jsonpointer.get(example, "/ "), 7); -assert.equal(jsonpointer.get(example, "/m~0n"), 8); - -console.log("All tests pass."); diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/.jshintrc b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/.jshintrc deleted file mode 100644 index 77887b5..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/.jshintrc +++ /dev/null @@ -1,30 +0,0 @@ -{ - "maxdepth": 4, - "maxstatements": 200, - "maxcomplexity": 12, - "maxlen": 80, - "maxparams": 5, - - "curly": true, - "eqeqeq": true, - "immed": true, - "latedef": false, - "noarg": true, - "noempty": true, - "nonew": true, - "undef": true, - "unused": "vars", - "trailing": true, - - "quotmark": true, - "expr": true, - "asi": true, - - "browser": false, - "esnext": true, - "devel": false, - "node": false, - "nonstandard": false, - - "predef": ["require", "module", "__dirname", "__filename"] -} diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/.npmignore b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/LICENCE b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/LICENCE deleted file mode 100644 index 1a14b43..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/LICENCE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012-2014 Raynos. - -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. diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/Makefile b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/Makefile deleted file mode 100644 index d583fcf..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -browser: - node ./support/compile - -.PHONY: browser \ No newline at end of file diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/README.md b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/README.md deleted file mode 100644 index 093cb29..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# xtend - -[![browser support][3]][4] - -[![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges) - -Extend like a boss - -xtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes precedence. - -## Examples - -```js -var extend = require("xtend") - -// extend returns a new object. Does not mutate arguments -var combination = extend({ - a: "a", - b: 'c' -}, { - b: "b" -}) -// { a: "a", b: "b" } -``` - -## Stability status: Locked - -## MIT Licenced - - - [3]: http://ci.testling.com/Raynos/xtend.png - [4]: http://ci.testling.com/Raynos/xtend diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/immutable.js b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/immutable.js deleted file mode 100644 index 94889c9..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/immutable.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = extend - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -function extend() { - var target = {} - - for (var i = 0; i < arguments.length; i++) { - var source = arguments[i] - - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - target[key] = source[key] - } - } - } - - return target -} diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/mutable.js b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/mutable.js deleted file mode 100644 index 72debed..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/mutable.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = extend - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -function extend(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] - - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - target[key] = source[key] - } - } - } - - return target -} diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/package.json b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/package.json deleted file mode 100644 index 6f380f0..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "name": "xtend", - "version": "4.0.1", - "description": "extend like a boss", - "keywords": [ - "extend", - "merge", - "options", - "opts", - "object", - "array" - ], - "author": { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - "repository": { - "type": "git", - "url": "git://github.com/Raynos/xtend.git" - }, - "main": "immutable", - "scripts": { - "test": "node test" - }, - "dependencies": {}, - "devDependencies": { - "tape": "~1.1.0" - }, - "homepage": "https://github.com/Raynos/xtend", - "contributors": [ - { - "name": "Jake Verbaten" - }, - { - "name": "Matt Esch" - } - ], - "bugs": { - "url": "https://github.com/Raynos/xtend/issues", - "email": "raynos2@gmail.com" - }, - "license": "MIT", - "testling": { - "files": "test.js", - "browsers": [ - "ie/7..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest" - ] - }, - "engines": { - "node": ">=0.4" - }, - "gitHead": "23dc302a89756da89c1897bc732a752317e35390", - "_id": "xtend@4.0.1", - "_shasum": "a5c6d532be656e23db820efb943a1f04998d63af", - "_from": "xtend@>=4.0.0 <5.0.0", - "_npmVersion": "2.14.1", - "_nodeVersion": "0.10.32", - "_npmUser": { - "name": "raynos", - "email": "raynos2@gmail.com" - }, - "dist": { - "shasum": "a5c6d532be656e23db820efb943a1f04998d63af", - "tarball": "http://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" - }, - "maintainers": [ - { - "name": "raynos", - "email": "raynos2@gmail.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/test.js b/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/test.js deleted file mode 100644 index 093a2b0..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/node_modules/xtend/test.js +++ /dev/null @@ -1,83 +0,0 @@ -var test = require("tape") -var extend = require("./") -var mutableExtend = require("./mutable") - -test("merge", function(assert) { - var a = { a: "foo" } - var b = { b: "bar" } - - assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) - assert.end() -}) - -test("replace", function(assert) { - var a = { a: "foo" } - var b = { a: "bar" } - - assert.deepEqual(extend(a, b), { a: "bar" }) - assert.end() -}) - -test("undefined", function(assert) { - var a = { a: undefined } - var b = { b: "foo" } - - assert.deepEqual(extend(a, b), { a: undefined, b: "foo" }) - assert.deepEqual(extend(b, a), { a: undefined, b: "foo" }) - assert.end() -}) - -test("handle 0", function(assert) { - var a = { a: "default" } - var b = { a: 0 } - - assert.deepEqual(extend(a, b), { a: 0 }) - assert.deepEqual(extend(b, a), { a: "default" }) - assert.end() -}) - -test("is immutable", function (assert) { - var record = {} - - extend(record, { foo: "bar" }) - assert.equal(record.foo, undefined) - assert.end() -}) - -test("null as argument", function (assert) { - var a = { foo: "bar" } - var b = null - var c = void 0 - - assert.deepEqual(extend(b, a, c), { foo: "bar" }) - assert.end() -}) - -test("mutable", function (assert) { - var a = { foo: "bar" } - - mutableExtend(a, { bar: "baz" }) - - assert.equal(a.bar, "baz") - assert.end() -}) - -test("null prototype", function(assert) { - var a = { a: "foo" } - var b = Object.create(null) - b.b = "bar"; - - assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) - assert.end() -}) - -test("null prototype mutable", function (assert) { - var a = { foo: "bar" } - var b = Object.create(null) - b.bar = "baz"; - - mutableExtend(a, b) - - assert.equal(a.bar, "baz") - assert.end() -}) diff --git a/node_modules/eslint/node_modules/is-my-json-valid/package.json b/node_modules/eslint/node_modules/is-my-json-valid/package.json deleted file mode 100644 index ab23490..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "is-my-json-valid", - "version": "2.12.4", - "description": "A JSONSchema validator that uses code generation to be extremely fast", - "main": "index.js", - "dependencies": { - "generate-function": "^2.0.0", - "generate-object-property": "^1.1.0", - "jsonpointer": "2.0.0", - "xtend": "^4.0.0" - }, - "devDependencies": { - "tape": "^2.13.4" - }, - "scripts": { - "test": "tape test/*.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/mafintosh/is-my-json-valid.git" - }, - "keywords": [ - "json", - "schema", - "orderly", - "jsonschema" - ], - "author": { - "name": "Mathias Buus" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/mafintosh/is-my-json-valid/issues" - }, - "homepage": "https://github.com/mafintosh/is-my-json-valid", - "gitHead": "8978aa8f40eef4ac47a5d18270c13abd48927ddb", - "_id": "is-my-json-valid@2.12.4", - "_shasum": "d4ed2bc1d7f88daf8d0f763b3e3e39a69bd37880", - "_from": "is-my-json-valid@>=2.10.0 <3.0.0", - "_npmVersion": "2.14.7", - "_nodeVersion": "4.2.3", - "_npmUser": { - "name": "mafintosh", - "email": "mathiasbuus@gmail.com" - }, - "dist": { - "shasum": "d4ed2bc1d7f88daf8d0f763b3e3e39a69bd37880", - "tarball": "http://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.4.tgz" - }, - "maintainers": [ - { - "name": "freeall", - "email": "freeall@gmail.com" - }, - { - "name": "mafintosh", - "email": "mathiasbuus@gmail.com" - }, - { - "name": "watson", - "email": "w@tson.dk" - }, - { - "name": "yoshuawuyts", - "email": "i@yoshuawuyts.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.4.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/is-my-json-valid/require.js b/node_modules/eslint/node_modules/is-my-json-valid/require.js deleted file mode 100644 index 0bfb8a2..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/require.js +++ /dev/null @@ -1,12 +0,0 @@ -var fs = require('fs') -var path = require('path') -var compile = require('./') - -delete require.cache[require.resolve(__filename)] - -module.exports = function(file, opts) { - file = path.join(path.dirname(module.parent.filename), file) - if (!fs.existsSync(file) && fs.existsSync(file+'.schema')) file += '.schema' - if (!fs.existsSync(file) && fs.existsSync(file+'.json')) file += '.json' - return compile(fs.readFileSync(file, 'utf-8'), opts) -} diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/fixtures/cosmic.js b/node_modules/eslint/node_modules/is-my-json-valid/test/fixtures/cosmic.js deleted file mode 100644 index 4e0a34b..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/fixtures/cosmic.js +++ /dev/null @@ -1,84 +0,0 @@ -exports.valid = { - fullName : "John Doe", - age : 47, - state : "Massachusetts", - city : "Boston", - zip : 16417, - married : false, - dozen : 12, - dozenOrBakersDozen : 13, - favoriteEvenNumber : 14, - topThreeFavoriteColors : [ "red", "blue", "green" ], - favoriteSingleDigitWholeNumbers : [ 7 ], - favoriteFiveLetterWord : "coder", - emailAddresses : - [ - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@letters-in-local.org", - "01234567890@numbers-in-local.net", - "&'*+-./=?^_{}~@other-valid-characters-in-local.net", - "mixed-1234-in-{+^}-local@sld.net", - "a@single-character-in-local.org", - "\"quoted\"@sld.com", - "\"\\e\\s\\c\\a\\p\\e\\d\"@sld.com", - "\"quoted-at-sign@sld.org\"@sld.com", - "\"escaped\\\"quote\"@sld.com", - "\"back\\slash\"@sld.com", - "one-character-third-level@a.example.com", - "single-character-in-sld@x.org", - "local@dash-in-sld.com", - "letters-in-sld@123.com", - "one-letter-sld@x.org", - "uncommon-tld@sld.museum", - "uncommon-tld@sld.travel", - "uncommon-tld@sld.mobi", - "country-code-tld@sld.uk", - "country-code-tld@sld.rw", - "local@sld.newTLD", - "the-total-length@of-an-entire-address.cannot-be-longer-than-two-hundred-and-fifty-four-characters.and-this-address-is-254-characters-exactly.so-it-should-be-valid.and-im-going-to-add-some-more-words-here.to-increase-the-lenght-blah-blah-blah-blah-bla.org", - "the-character-limit@for-each-part.of-the-domain.is-sixty-three-characters.this-is-exactly-sixty-three-characters-so-it-is-valid-blah-blah.com", - "local@sub.domains.com" - ], - ipAddresses : [ "127.0.0.1", "24.48.64.2", "192.168.1.1", "209.68.44.3", "2.2.2.2" ] -} - -exports.invalid = { - fullName : null, - age : -1, - state : 47, - city : false, - zip : [null], - married : "yes", - dozen : 50, - dozenOrBakersDozen : "over 9000", - favoriteEvenNumber : 15, - topThreeFavoriteColors : [ "red", 5 ], - favoriteSingleDigitWholeNumbers : [ 78, 2, 999 ], - favoriteFiveLetterWord : "codernaut", - emailAddresses : [], - ipAddresses : [ "999.0.099.1", "294.48.64.2346", false, "2221409.64214128.42414.235233", "124124.12412412" ] -} - -exports.schema = { // from cosmic thingy - name : "test", - type : "object", - additionalProperties : false, - required : ["fullName", "age", "zip", "married", "dozen", "dozenOrBakersDozen", "favoriteEvenNumber", "topThreeFavoriteColors", "favoriteSingleDigitWholeNumbers", "favoriteFiveLetterWord", "emailAddresses", "ipAddresses"], - properties : - { - fullName : { type : "string" }, - age : { type : "integer", minimum : 0 }, - optionalItem : { type : "string" }, - state : { type : "string" }, - city : { type : "string" }, - zip : { type : "integer", minimum : 0, maximum : 99999 }, - married : { type : "boolean" }, - dozen : { type : "integer", minimum : 12, maximum : 12 }, - dozenOrBakersDozen : { type : "integer", minimum : 12, maximum : 13 }, - favoriteEvenNumber : { type : "integer", multipleOf : 2 }, - topThreeFavoriteColors : { type : "array", minItems : 3, maxItems : 3, uniqueItems : true, items : { type : "string" }}, - favoriteSingleDigitWholeNumbers : { type : "array", minItems : 1, maxItems : 10, uniqueItems : true, items : { type : "integer", minimum : 0, maximum : 9 }}, - favoriteFiveLetterWord : { type : "string", minLength : 5, maxLength : 5 }, - emailAddresses : { type : "array", minItems : 1, uniqueItems : true, items : { type : "string", format : "email" }}, - ipAddresses : { type : "array", uniqueItems : true, items : { type : "string", format : "ipv4" }}, - } - } \ No newline at end of file diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalItems.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalItems.json deleted file mode 100644 index 521745c..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalItems.json +++ /dev/null @@ -1,82 +0,0 @@ -[ - { - "description": "additionalItems as schema", - "schema": { - "items": [{}], - "additionalItems": {"type": "integer"} - }, - "tests": [ - { - "description": "additional items match schema", - "data": [ null, 2, 3, 4 ], - "valid": true - }, - { - "description": "additional items do not match schema", - "data": [ null, 2, 3, "foo" ], - "valid": false - } - ] - }, - { - "description": "items is schema, no additionalItems", - "schema": { - "items": {}, - "additionalItems": false - }, - "tests": [ - { - "description": "all items match schema", - "data": [ 1, 2, 3, 4, 5 ], - "valid": true - } - ] - }, - { - "description": "array of items with no additionalItems", - "schema": { - "items": [{}, {}, {}], - "additionalItems": false - }, - "tests": [ - { - "description": "no additional items present", - "data": [ 1, 2, 3 ], - "valid": true - }, - { - "description": "additional items are not permitted", - "data": [ 1, 2, 3, 4 ], - "valid": false - } - ] - }, - { - "description": "additionalItems as false without items", - "schema": {"additionalItems": false}, - "tests": [ - { - "description": - "items defaults to empty schema so everything is valid", - "data": [ 1, 2, 3, 4, 5 ], - "valid": true - }, - { - "description": "ignores non-arrays", - "data": {"foo" : "bar"}, - "valid": true - } - ] - }, - { - "description": "additionalItems are allowed by default", - "schema": {"items": [{"type": "integer"}]}, - "tests": [ - { - "description": "only the first item is validated", - "data": [1, "foo", false], - "valid": true - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalProperties.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalProperties.json deleted file mode 100644 index 40831f9..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalProperties.json +++ /dev/null @@ -1,88 +0,0 @@ -[ - { - "description": - "additionalProperties being false does not allow other properties", - "schema": { - "properties": {"foo": {}, "bar": {}}, - "patternProperties": { "^v": {} }, - "additionalProperties": false - }, - "tests": [ - { - "description": "no additional properties is valid", - "data": {"foo": 1}, - "valid": true - }, - { - "description": "an additional property is invalid", - "data": {"foo" : 1, "bar" : 2, "quux" : "boom"}, - "valid": false - }, - { - "description": "ignores non-objects", - "data": [1, 2, 3], - "valid": true - }, - { - "description": "patternProperties are not additional properties", - "data": {"foo":1, "vroom": 2}, - "valid": true - } - ] - }, - { - "description": - "additionalProperties allows a schema which should validate", - "schema": { - "properties": {"foo": {}, "bar": {}}, - "additionalProperties": {"type": "boolean"} - }, - "tests": [ - { - "description": "no additional properties is valid", - "data": {"foo": 1}, - "valid": true - }, - { - "description": "an additional valid property is valid", - "data": {"foo" : 1, "bar" : 2, "quux" : true}, - "valid": true - }, - { - "description": "an additional invalid property is invalid", - "data": {"foo" : 1, "bar" : 2, "quux" : 12}, - "valid": false - } - ] - }, - { - "description": - "additionalProperties can exist by itself", - "schema": { - "additionalProperties": {"type": "boolean"} - }, - "tests": [ - { - "description": "an additional valid property is valid", - "data": {"foo" : true}, - "valid": true - }, - { - "description": "an additional invalid property is invalid", - "data": {"foo" : 1}, - "valid": false - } - ] - }, - { - "description": "additionalProperties are allowed by default", - "schema": {"properties": {"foo": {}, "bar": {}}}, - "tests": [ - { - "description": "additional properties are allowed", - "data": {"foo": 1, "bar": 2, "quux": true}, - "valid": true - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/allOf.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/allOf.json deleted file mode 100644 index bbb5f89..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/allOf.json +++ /dev/null @@ -1,112 +0,0 @@ -[ - { - "description": "allOf", - "schema": { - "allOf": [ - { - "properties": { - "bar": {"type": "integer"} - }, - "required": ["bar"] - }, - { - "properties": { - "foo": {"type": "string"} - }, - "required": ["foo"] - } - ] - }, - "tests": [ - { - "description": "allOf", - "data": {"foo": "baz", "bar": 2}, - "valid": true - }, - { - "description": "mismatch second", - "data": {"foo": "baz"}, - "valid": false - }, - { - "description": "mismatch first", - "data": {"bar": 2}, - "valid": false - }, - { - "description": "wrong type", - "data": {"foo": "baz", "bar": "quux"}, - "valid": false - } - ] - }, - { - "description": "allOf with base schema", - "schema": { - "properties": {"bar": {"type": "integer"}}, - "required": ["bar"], - "allOf" : [ - { - "properties": { - "foo": {"type": "string"} - }, - "required": ["foo"] - }, - { - "properties": { - "baz": {"type": "null"} - }, - "required": ["baz"] - } - ] - }, - "tests": [ - { - "description": "valid", - "data": {"foo": "quux", "bar": 2, "baz": null}, - "valid": true - }, - { - "description": "mismatch base schema", - "data": {"foo": "quux", "baz": null}, - "valid": false - }, - { - "description": "mismatch first allOf", - "data": {"bar": 2, "baz": null}, - "valid": false - }, - { - "description": "mismatch second allOf", - "data": {"foo": "quux", "bar": 2}, - "valid": false - }, - { - "description": "mismatch both", - "data": {"bar": 2}, - "valid": false - } - ] - }, - { - "description": "allOf simple types", - "schema": { - "allOf": [ - {"maximum": 30}, - {"minimum": 20} - ] - }, - "tests": [ - { - "description": "valid", - "data": 25, - "valid": true - }, - { - "description": "mismatch one", - "data": 35, - "valid": false - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/anyOf.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/anyOf.json deleted file mode 100644 index a58714a..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/anyOf.json +++ /dev/null @@ -1,68 +0,0 @@ -[ - { - "description": "anyOf", - "schema": { - "anyOf": [ - { - "type": "integer" - }, - { - "minimum": 2 - } - ] - }, - "tests": [ - { - "description": "first anyOf valid", - "data": 1, - "valid": true - }, - { - "description": "second anyOf valid", - "data": 2.5, - "valid": true - }, - { - "description": "both anyOf valid", - "data": 3, - "valid": true - }, - { - "description": "neither anyOf valid", - "data": 1.5, - "valid": false - } - ] - }, - { - "description": "anyOf with base schema", - "schema": { - "type": "string", - "anyOf" : [ - { - "maxLength": 2 - }, - { - "minLength": 4 - } - ] - }, - "tests": [ - { - "description": "mismatch base schema", - "data": 3, - "valid": false - }, - { - "description": "one anyOf valid", - "data": "foobar", - "valid": true - }, - { - "description": "both anyOf invalid", - "data": "foo", - "valid": false - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/bignum.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/bignum.json deleted file mode 100644 index ccc7c17..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/bignum.json +++ /dev/null @@ -1,107 +0,0 @@ -[ - { - "description": "integer", - "schema": {"type": "integer"}, - "tests": [ - { - "description": "a bignum is an integer", - "data": 12345678910111213141516171819202122232425262728293031, - "valid": true - } - ] - }, - { - "description": "number", - "schema": {"type": "number"}, - "tests": [ - { - "description": "a bignum is a number", - "data": 98249283749234923498293171823948729348710298301928331, - "valid": true - } - ] - }, - { - "description": "integer", - "schema": {"type": "integer"}, - "tests": [ - { - "description": "a negative bignum is an integer", - "data": -12345678910111213141516171819202122232425262728293031, - "valid": true - } - ] - }, - { - "description": "number", - "schema": {"type": "number"}, - "tests": [ - { - "description": "a negative bignum is a number", - "data": -98249283749234923498293171823948729348710298301928331, - "valid": true - } - ] - }, - { - "description": "string", - "schema": {"type": "string"}, - "tests": [ - { - "description": "a bignum is not a string", - "data": 98249283749234923498293171823948729348710298301928331, - "valid": false - } - ] - }, - { - "description": "integer comparison", - "schema": {"maximum": 18446744073709551615}, - "tests": [ - { - "description": "comparison works for high numbers", - "data": 18446744073709551600, - "valid": true - } - ] - }, - { - "description": "float comparison with high precision", - "schema": { - "maximum": 972783798187987123879878123.18878137, - "exclusiveMaximum": true - }, - "tests": [ - { - "description": "comparison works for high numbers", - "data": 972783798187987123879878123.188781371, - "valid": false - } - ] - }, - { - "description": "integer comparison", - "schema": {"minimum": -18446744073709551615}, - "tests": [ - { - "description": "comparison works for very negative numbers", - "data": -18446744073709551600, - "valid": true - } - ] - }, - { - "description": "float comparison with high precision on negative numbers", - "schema": { - "minimum": -972783798187987123879878123.18878137, - "exclusiveMinimum": true - }, - "tests": [ - { - "description": "comparison works for very negative numbers", - "data": -972783798187987123879878123.188781371, - "valid": false - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/default.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/default.json deleted file mode 100644 index 1762977..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/default.json +++ /dev/null @@ -1,49 +0,0 @@ -[ - { - "description": "invalid type for default", - "schema": { - "properties": { - "foo": { - "type": "integer", - "default": [] - } - } - }, - "tests": [ - { - "description": "valid when property is specified", - "data": {"foo": 13}, - "valid": true - }, - { - "description": "still valid when the invalid default is used", - "data": {}, - "valid": true - } - ] - }, - { - "description": "invalid string value for default", - "schema": { - "properties": { - "bar": { - "type": "string", - "minLength": 4, - "default": "bad" - } - } - }, - "tests": [ - { - "description": "valid when property is specified", - "data": {"bar": "good"}, - "valid": true - }, - { - "description": "still valid when the invalid default is used", - "data": {}, - "valid": true - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/definitions.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/definitions.json deleted file mode 100644 index cf935a3..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/definitions.json +++ /dev/null @@ -1,32 +0,0 @@ -[ - { - "description": "valid definition", - "schema": {"$ref": "http://json-schema.org/draft-04/schema#"}, - "tests": [ - { - "description": "valid definition schema", - "data": { - "definitions": { - "foo": {"type": "integer"} - } - }, - "valid": true - } - ] - }, - { - "description": "invalid definition", - "schema": {"$ref": "http://json-schema.org/draft-04/schema#"}, - "tests": [ - { - "description": "invalid definition schema", - "data": { - "definitions": { - "foo": {"type": 1} - } - }, - "valid": false - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/dependencies.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/dependencies.json deleted file mode 100644 index 7b9b16a..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/dependencies.json +++ /dev/null @@ -1,113 +0,0 @@ -[ - { - "description": "dependencies", - "schema": { - "dependencies": {"bar": ["foo"]} - }, - "tests": [ - { - "description": "neither", - "data": {}, - "valid": true - }, - { - "description": "nondependant", - "data": {"foo": 1}, - "valid": true - }, - { - "description": "with dependency", - "data": {"foo": 1, "bar": 2}, - "valid": true - }, - { - "description": "missing dependency", - "data": {"bar": 2}, - "valid": false - }, - { - "description": "ignores non-objects", - "data": "foo", - "valid": true - } - ] - }, - { - "description": "multiple dependencies", - "schema": { - "dependencies": {"quux": ["foo", "bar"]} - }, - "tests": [ - { - "description": "neither", - "data": {}, - "valid": true - }, - { - "description": "nondependants", - "data": {"foo": 1, "bar": 2}, - "valid": true - }, - { - "description": "with dependencies", - "data": {"foo": 1, "bar": 2, "quux": 3}, - "valid": true - }, - { - "description": "missing dependency", - "data": {"foo": 1, "quux": 2}, - "valid": false - }, - { - "description": "missing other dependency", - "data": {"bar": 1, "quux": 2}, - "valid": false - }, - { - "description": "missing both dependencies", - "data": {"quux": 1}, - "valid": false - } - ] - }, - { - "description": "multiple dependencies subschema", - "schema": { - "dependencies": { - "bar": { - "properties": { - "foo": {"type": "integer"}, - "bar": {"type": "integer"} - } - } - } - }, - "tests": [ - { - "description": "valid", - "data": {"foo": 1, "bar": 2}, - "valid": true - }, - { - "description": "no dependency", - "data": {"foo": "quux"}, - "valid": true - }, - { - "description": "wrong type", - "data": {"foo": "quux", "bar": 2}, - "valid": false - }, - { - "description": "wrong type other", - "data": {"foo": 2, "bar": "quux"}, - "valid": false - }, - { - "description": "wrong type both", - "data": {"foo": "quux", "bar": "quux"}, - "valid": false - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/enum.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/enum.json deleted file mode 100644 index f124436..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/enum.json +++ /dev/null @@ -1,72 +0,0 @@ -[ - { - "description": "simple enum validation", - "schema": {"enum": [1, 2, 3]}, - "tests": [ - { - "description": "one of the enum is valid", - "data": 1, - "valid": true - }, - { - "description": "something else is invalid", - "data": 4, - "valid": false - } - ] - }, - { - "description": "heterogeneous enum validation", - "schema": {"enum": [6, "foo", [], true, {"foo": 12}]}, - "tests": [ - { - "description": "one of the enum is valid", - "data": [], - "valid": true - }, - { - "description": "something else is invalid", - "data": null, - "valid": false - }, - { - "description": "objects are deep compared", - "data": {"foo": false}, - "valid": false - } - ] - }, - { - "description": "enums in properties", - "schema": { - "type":"object", - "properties": { - "foo": {"enum":["foo"]}, - "bar": {"enum":["bar"]} - }, - "required": ["bar"] - }, - "tests": [ - { - "description": "both properties are valid", - "data": {"foo":"foo", "bar":"bar"}, - "valid": true - }, - { - "description": "missing optional property is valid", - "data": {"bar":"bar"}, - "valid": true - }, - { - "description": "missing required property is invalid", - "data": {"foo":"foo"}, - "valid": false - }, - { - "description": "missing all properties is invalid", - "data": {}, - "valid": false - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/format.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/format.json deleted file mode 100644 index 53c5d25..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/format.json +++ /dev/null @@ -1,143 +0,0 @@ -[ - { - "description": "validation of date-time strings", - "schema": {"format": "date-time"}, - "tests": [ - { - "description": "a valid date-time string", - "data": "1963-06-19T08:30:06.283185Z", - "valid": true - }, - { - "description": "an invalid date-time string", - "data": "06/19/1963 08:30:06 PST", - "valid": false - }, - { - "description": "only RFC3339 not all of ISO 8601 are valid", - "data": "2013-350T01:01:01", - "valid": false - } - ] - }, - { - "description": "validation of URIs", - "schema": {"format": "uri"}, - "tests": [ - { - "description": "a valid URI", - "data": "http://foo.bar/?baz=qux#quux", - "valid": true - }, - { - "description": "an invalid URI", - "data": "\\\\WINDOWS\\fileshare", - "valid": false - }, - { - "description": "an invalid URI though valid URI reference", - "data": "abc", - "valid": false - } - ] - }, - { - "description": "validation of e-mail addresses", - "schema": {"format": "email"}, - "tests": [ - { - "description": "a valid e-mail address", - "data": "joe.bloggs@example.com", - "valid": true - }, - { - "description": "an invalid e-mail address", - "data": "2962", - "valid": false - } - ] - }, - { - "description": "validation of IP addresses", - "schema": {"format": "ipv4"}, - "tests": [ - { - "description": "a valid IP address", - "data": "192.168.0.1", - "valid": true - }, - { - "description": "an IP address with too many components", - "data": "127.0.0.0.1", - "valid": false - }, - { - "description": "an IP address with out-of-range values", - "data": "256.256.256.256", - "valid": false - }, - { - "description": "an IP address without 4 components", - "data": "127.0", - "valid": false - }, - { - "description": "an IP address as an integer", - "data": "0x7f000001", - "valid": false - } - ] - }, - { - "description": "validation of IPv6 addresses", - "schema": {"format": "ipv6"}, - "tests": [ - { - "description": "a valid IPv6 address", - "data": "::1", - "valid": true - }, - { - "description": "an IPv6 address with out-of-range values", - "data": "12345::", - "valid": false - }, - { - "description": "an IPv6 address with too many components", - "data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1", - "valid": false - }, - { - "description": "an IPv6 address containing illegal characters", - "data": "::laptop", - "valid": false - } - ] - }, - { - "description": "validation of host names", - "schema": {"format": "hostname"}, - "tests": [ - { - "description": "a valid host name", - "data": "www.example.com", - "valid": true - }, - { - "description": "a host name starting with an illegal character", - "data": "-a-host-name-that-starts-with--", - "valid": false - }, - { - "description": "a host name containing illegal characters", - "data": "not_a_valid_host_name", - "valid": false - }, - { - "description": "a host name with a component too long", - "data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component", - "valid": false - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/items.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/items.json deleted file mode 100644 index f5e18a1..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/items.json +++ /dev/null @@ -1,46 +0,0 @@ -[ - { - "description": "a schema given for items", - "schema": { - "items": {"type": "integer"} - }, - "tests": [ - { - "description": "valid items", - "data": [ 1, 2, 3 ], - "valid": true - }, - { - "description": "wrong type of items", - "data": [1, "x"], - "valid": false - }, - { - "description": "ignores non-arrays", - "data": {"foo" : "bar"}, - "valid": true - } - ] - }, - { - "description": "an array of schemas for items", - "schema": { - "items": [ - {"type": "integer"}, - {"type": "string"} - ] - }, - "tests": [ - { - "description": "correct types", - "data": [ 1, "foo" ], - "valid": true - }, - { - "description": "wrong types", - "data": [ "foo", 1 ], - "valid": false - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxItems.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxItems.json deleted file mode 100644 index 3b53a6b..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxItems.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "description": "maxItems validation", - "schema": {"maxItems": 2}, - "tests": [ - { - "description": "shorter is valid", - "data": [1], - "valid": true - }, - { - "description": "exact length is valid", - "data": [1, 2], - "valid": true - }, - { - "description": "too long is invalid", - "data": [1, 2, 3], - "valid": false - }, - { - "description": "ignores non-arrays", - "data": "foobar", - "valid": true - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxLength.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxLength.json deleted file mode 100644 index 48eb129..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxLength.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "description": "maxLength validation", - "schema": {"maxLength": 2}, - "tests": [ - { - "description": "shorter is valid", - "data": "f", - "valid": true - }, - { - "description": "exact length is valid", - "data": "fo", - "valid": true - }, - { - "description": "too long is invalid", - "data": "foo", - "valid": false - }, - { - "description": "ignores non-strings", - "data": 100, - "valid": true - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxProperties.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxProperties.json deleted file mode 100644 index d282446..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxProperties.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "description": "maxProperties validation", - "schema": {"maxProperties": 2}, - "tests": [ - { - "description": "shorter is valid", - "data": {"foo": 1}, - "valid": true - }, - { - "description": "exact length is valid", - "data": {"foo": 1, "bar": 2}, - "valid": true - }, - { - "description": "too long is invalid", - "data": {"foo": 1, "bar": 2, "baz": 3}, - "valid": false - }, - { - "description": "ignores non-objects", - "data": "foobar", - "valid": true - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maximum.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maximum.json deleted file mode 100644 index 86c7b89..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maximum.json +++ /dev/null @@ -1,42 +0,0 @@ -[ - { - "description": "maximum validation", - "schema": {"maximum": 3.0}, - "tests": [ - { - "description": "below the maximum is valid", - "data": 2.6, - "valid": true - }, - { - "description": "above the maximum is invalid", - "data": 3.5, - "valid": false - }, - { - "description": "ignores non-numbers", - "data": "x", - "valid": true - } - ] - }, - { - "description": "exclusiveMaximum validation", - "schema": { - "maximum": 3.0, - "exclusiveMaximum": true - }, - "tests": [ - { - "description": "below the maximum is still valid", - "data": 2.2, - "valid": true - }, - { - "description": "boundary point is invalid", - "data": 3.0, - "valid": false - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minItems.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minItems.json deleted file mode 100644 index ed51188..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minItems.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "description": "minItems validation", - "schema": {"minItems": 1}, - "tests": [ - { - "description": "longer is valid", - "data": [1, 2], - "valid": true - }, - { - "description": "exact length is valid", - "data": [1], - "valid": true - }, - { - "description": "too short is invalid", - "data": [], - "valid": false - }, - { - "description": "ignores non-arrays", - "data": "", - "valid": true - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minLength.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minLength.json deleted file mode 100644 index e9c14b1..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minLength.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "description": "minLength validation", - "schema": {"minLength": 2}, - "tests": [ - { - "description": "longer is valid", - "data": "foo", - "valid": true - }, - { - "description": "exact length is valid", - "data": "fo", - "valid": true - }, - { - "description": "too short is invalid", - "data": "f", - "valid": false - }, - { - "description": "ignores non-strings", - "data": 1, - "valid": true - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minProperties.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minProperties.json deleted file mode 100644 index a72c7d2..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minProperties.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "description": "minProperties validation", - "schema": {"minProperties": 1}, - "tests": [ - { - "description": "longer is valid", - "data": {"foo": 1, "bar": 2}, - "valid": true - }, - { - "description": "exact length is valid", - "data": {"foo": 1}, - "valid": true - }, - { - "description": "too short is invalid", - "data": {}, - "valid": false - }, - { - "description": "ignores non-objects", - "data": "", - "valid": true - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minimum.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minimum.json deleted file mode 100644 index d5bf000..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minimum.json +++ /dev/null @@ -1,42 +0,0 @@ -[ - { - "description": "minimum validation", - "schema": {"minimum": 1.1}, - "tests": [ - { - "description": "above the minimum is valid", - "data": 2.6, - "valid": true - }, - { - "description": "below the minimum is invalid", - "data": 0.6, - "valid": false - }, - { - "description": "ignores non-numbers", - "data": "x", - "valid": true - } - ] - }, - { - "description": "exclusiveMinimum validation", - "schema": { - "minimum": 1.1, - "exclusiveMinimum": true - }, - "tests": [ - { - "description": "above the minimum is still valid", - "data": 1.2, - "valid": true - }, - { - "description": "boundary point is invalid", - "data": 1.1, - "valid": false - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json deleted file mode 100644 index ca3b761..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json +++ /dev/null @@ -1,60 +0,0 @@ -[ - { - "description": "by int", - "schema": {"multipleOf": 2}, - "tests": [ - { - "description": "int by int", - "data": 10, - "valid": true - }, - { - "description": "int by int fail", - "data": 7, - "valid": false - }, - { - "description": "ignores non-numbers", - "data": "foo", - "valid": true - } - ] - }, - { - "description": "by number", - "schema": {"multipleOf": 1.5}, - "tests": [ - { - "description": "zero is multiple of anything", - "data": 0, - "valid": true - }, - { - "description": "4.5 is multiple of 1.5", - "data": 4.5, - "valid": true - }, - { - "description": "35 is not multiple of 1.5", - "data": 35, - "valid": false - } - ] - }, - { - "description": "by small number", - "schema": {"multipleOf": 0.0001}, - "tests": [ - { - "description": "0.0075 is multiple of 0.0001", - "data": 0.0075, - "valid": true - }, - { - "description": "0.00751 is not multiple of 0.0001", - "data": 0.00751, - "valid": false - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/not.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/not.json deleted file mode 100644 index cbb7f46..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/not.json +++ /dev/null @@ -1,96 +0,0 @@ -[ - { - "description": "not", - "schema": { - "not": {"type": "integer"} - }, - "tests": [ - { - "description": "allowed", - "data": "foo", - "valid": true - }, - { - "description": "disallowed", - "data": 1, - "valid": false - } - ] - }, - { - "description": "not multiple types", - "schema": { - "not": {"type": ["integer", "boolean"]} - }, - "tests": [ - { - "description": "valid", - "data": "foo", - "valid": true - }, - { - "description": "mismatch", - "data": 1, - "valid": false - }, - { - "description": "other mismatch", - "data": true, - "valid": false - } - ] - }, - { - "description": "not more complex schema", - "schema": { - "not": { - "type": "object", - "properties": { - "foo": { - "type": "string" - } - } - } - }, - "tests": [ - { - "description": "match", - "data": 1, - "valid": true - }, - { - "description": "other match", - "data": {"foo": 1}, - "valid": true - }, - { - "description": "mismatch", - "data": {"foo": "bar"}, - "valid": false - } - ] - }, - { - "description": "forbidden property", - "schema": { - "properties": { - "foo": { - "not": {} - } - } - }, - "tests": [ - { - "description": "property present", - "data": {"foo": 1, "bar": 2}, - "valid": false - }, - { - "description": "property absent", - "data": {"bar": 1, "baz": 2}, - "valid": true - } - ] - } - -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndFormat.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndFormat.json deleted file mode 100644 index d7fce9f..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndFormat.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "description": "validation of null and format", - "schema": {"type": ["null", "string"], "format": "date-time"}, - "tests": [ - { - "description": "a valid date-time string", - "data": "1963-06-19T08:30:06.283185Z", - "valid": true - }, - { - "description": "allow null", - "data": null, - "valid": true - } - ] - } -] \ No newline at end of file diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndObject.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndObject.json deleted file mode 100644 index c65c02c..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndObject.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "description": "multiple types of null and object containing properties", - "schema": { - "type": ["null", "object"], - "properties": { - "foo": {} - } - }, - "tests": [ - { - "description": "null is valid", - "data": null, - "valid": true - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/oneOf.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/oneOf.json deleted file mode 100644 index 1eaa4e4..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/oneOf.json +++ /dev/null @@ -1,68 +0,0 @@ -[ - { - "description": "oneOf", - "schema": { - "oneOf": [ - { - "type": "integer" - }, - { - "minimum": 2 - } - ] - }, - "tests": [ - { - "description": "first oneOf valid", - "data": 1, - "valid": true - }, - { - "description": "second oneOf valid", - "data": 2.5, - "valid": true - }, - { - "description": "both oneOf valid", - "data": 3, - "valid": false - }, - { - "description": "neither oneOf valid", - "data": 1.5, - "valid": false - } - ] - }, - { - "description": "oneOf with base schema", - "schema": { - "type": "string", - "oneOf" : [ - { - "minLength": 2 - }, - { - "maxLength": 4 - } - ] - }, - "tests": [ - { - "description": "mismatch base schema", - "data": 3, - "valid": false - }, - { - "description": "one oneOf valid", - "data": "foobar", - "valid": true - }, - { - "description": "both oneOf valid", - "data": "foo", - "valid": false - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/pattern.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/pattern.json deleted file mode 100644 index befc4b5..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/pattern.json +++ /dev/null @@ -1,23 +0,0 @@ -[ - { - "description": "pattern validation", - "schema": {"pattern": "^a*$"}, - "tests": [ - { - "description": "a matching pattern is valid", - "data": "aaa", - "valid": true - }, - { - "description": "a non-matching pattern is invalid", - "data": "abc", - "valid": false - }, - { - "description": "ignores non-strings", - "data": true, - "valid": true - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/patternProperties.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/patternProperties.json deleted file mode 100644 index 18586e5..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/patternProperties.json +++ /dev/null @@ -1,110 +0,0 @@ -[ - { - "description": - "patternProperties validates properties matching a regex", - "schema": { - "patternProperties": { - "f.*o": {"type": "integer"} - } - }, - "tests": [ - { - "description": "a single valid match is valid", - "data": {"foo": 1}, - "valid": true - }, - { - "description": "multiple valid matches is valid", - "data": {"foo": 1, "foooooo" : 2}, - "valid": true - }, - { - "description": "a single invalid match is invalid", - "data": {"foo": "bar", "fooooo": 2}, - "valid": false - }, - { - "description": "multiple invalid matches is invalid", - "data": {"foo": "bar", "foooooo" : "baz"}, - "valid": false - }, - { - "description": "ignores non-objects", - "data": 12, - "valid": true - } - ] - }, - { - "description": "multiple simultaneous patternProperties are validated", - "schema": { - "patternProperties": { - "a*": {"type": "integer"}, - "aaa*": {"maximum": 20} - } - }, - "tests": [ - { - "description": "a single valid match is valid", - "data": {"a": 21}, - "valid": true - }, - { - "description": "a simultaneous match is valid", - "data": {"aaaa": 18}, - "valid": true - }, - { - "description": "multiple matches is valid", - "data": {"a": 21, "aaaa": 18}, - "valid": true - }, - { - "description": "an invalid due to one is invalid", - "data": {"a": "bar"}, - "valid": false - }, - { - "description": "an invalid due to the other is invalid", - "data": {"aaaa": 31}, - "valid": false - }, - { - "description": "an invalid due to both is invalid", - "data": {"aaa": "foo", "aaaa": 31}, - "valid": false - } - ] - }, - { - "description": "regexes are not anchored by default and are case sensitive", - "schema": { - "patternProperties": { - "[0-9]{2,}": { "type": "boolean" }, - "X_": { "type": "string" } - } - }, - "tests": [ - { - "description": "non recognized members are ignored", - "data": { "answer 1": "42" }, - "valid": true - }, - { - "description": "recognized members are accounted for", - "data": { "a31b": null }, - "valid": false - }, - { - "description": "regexes are case sensitive", - "data": { "a_x_3": 3 }, - "valid": true - }, - { - "description": "regexes are case sensitive, 2", - "data": { "a_X_3": 3 }, - "valid": false - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/properties.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/properties.json deleted file mode 100644 index cd1644d..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/properties.json +++ /dev/null @@ -1,92 +0,0 @@ -[ - { - "description": "object properties validation", - "schema": { - "properties": { - "foo": {"type": "integer"}, - "bar": {"type": "string"} - } - }, - "tests": [ - { - "description": "both properties present and valid is valid", - "data": {"foo": 1, "bar": "baz"}, - "valid": true - }, - { - "description": "one property invalid is invalid", - "data": {"foo": 1, "bar": {}}, - "valid": false - }, - { - "description": "both properties invalid is invalid", - "data": {"foo": [], "bar": {}}, - "valid": false - }, - { - "description": "doesn't invalidate other properties", - "data": {"quux": []}, - "valid": true - }, - { - "description": "ignores non-objects", - "data": [], - "valid": true - } - ] - }, - { - "description": - "properties, patternProperties, additionalProperties interaction", - "schema": { - "properties": { - "foo": {"type": "array", "maxItems": 3}, - "bar": {"type": "array"} - }, - "patternProperties": {"f.o": {"minItems": 2}}, - "additionalProperties": {"type": "integer"} - }, - "tests": [ - { - "description": "property validates property", - "data": {"foo": [1, 2]}, - "valid": true - }, - { - "description": "property invalidates property", - "data": {"foo": [1, 2, 3, 4]}, - "valid": false - }, - { - "description": "patternProperty invalidates property", - "data": {"foo": []}, - "valid": false - }, - { - "description": "patternProperty validates nonproperty", - "data": {"fxo": [1, 2]}, - "valid": true - }, - { - "description": "patternProperty invalidates nonproperty", - "data": {"fxo": []}, - "valid": false - }, - { - "description": "additionalProperty ignores property", - "data": {"bar": []}, - "valid": true - }, - { - "description": "additionalProperty validates others", - "data": {"quux": 3}, - "valid": true - }, - { - "description": "additionalProperty invalidates others", - "data": {"quux": "foo"}, - "valid": false - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/ref.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/ref.json deleted file mode 100644 index d8214bc..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/ref.json +++ /dev/null @@ -1,128 +0,0 @@ -[ - { - "description": "root pointer ref", - "schema": { - "properties": { - "foo": {"$ref": "#"} - }, - "additionalProperties": false - }, - "tests": [ - { - "description": "match", - "data": {"foo": false}, - "valid": true - }, - { - "description": "recursive match", - "data": {"foo": {"foo": false}}, - "valid": true - }, - { - "description": "mismatch", - "data": {"bar": false}, - "valid": false - }, - { - "description": "recursive mismatch", - "data": {"foo": {"bar": false}}, - "valid": false - } - ] - }, - { - "description": "relative pointer ref to object", - "schema": { - "properties": { - "foo": {"type": "integer"}, - "bar": {"$ref": "#/properties/foo"} - } - }, - "tests": [ - { - "description": "match", - "data": {"bar": 3}, - "valid": true - }, - { - "description": "mismatch", - "data": {"bar": true}, - "valid": false - } - ] - }, - { - "description": "relative pointer ref to array", - "schema": { - "items": [ - {"type": "integer"}, - {"$ref": "#/items/0"} - ] - }, - "tests": [ - { - "description": "match array", - "data": [1, 2], - "valid": true - }, - { - "description": "mismatch array", - "data": [1, "foo"], - "valid": false - } - ] - }, - { - "description": "escaped pointer ref", - "schema": { - "tilda~field": {"type": "integer"}, - "slash/field": {"type": "integer"}, - "percent%field": {"type": "integer"}, - "properties": { - "tilda": {"$ref": "#/tilda~0field"}, - "slash": {"$ref": "#/slash~1field"}, - "percent": {"$ref": "#/percent%25field"} - } - }, - "tests": [ - { - "description": "slash", - "data": {"slash": "aoeu"}, - "valid": false - }, - { - "description": "tilda", - "data": {"tilda": "aoeu"}, - "valid": false - }, - { - "description": "percent", - "data": {"percent": "aoeu"}, - "valid": false - } - ] - }, - { - "description": "nested refs", - "schema": { - "definitions": { - "a": {"type": "integer"}, - "b": {"$ref": "#/definitions/a"}, - "c": {"$ref": "#/definitions/b"} - }, - "$ref": "#/definitions/c" - }, - "tests": [ - { - "description": "nested ref valid", - "data": 5, - "valid": true - }, - { - "description": "nested ref invalid", - "data": "a", - "valid": false - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/refRemote.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/refRemote.json deleted file mode 100644 index 4ca8047..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/refRemote.json +++ /dev/null @@ -1,74 +0,0 @@ -[ - { - "description": "remote ref", - "schema": {"$ref": "http://localhost:1234/integer.json"}, - "tests": [ - { - "description": "remote ref valid", - "data": 1, - "valid": true - }, - { - "description": "remote ref invalid", - "data": "a", - "valid": false - } - ] - }, - { - "description": "fragment within remote ref", - "schema": {"$ref": "http://localhost:1234/subSchemas.json#/integer"}, - "tests": [ - { - "description": "remote fragment valid", - "data": 1, - "valid": true - }, - { - "description": "remote fragment invalid", - "data": "a", - "valid": false - } - ] - }, - { - "description": "ref within remote ref", - "schema": { - "$ref": "http://localhost:1234/subSchemas.json#/refToInteger" - }, - "tests": [ - { - "description": "ref within ref valid", - "data": 1, - "valid": true - }, - { - "description": "ref within ref invalid", - "data": "a", - "valid": false - } - ] - }, - { - "description": "change resolution scope", - "schema": { - "id": "http://localhost:1234/", - "items": { - "id": "folder/", - "items": {"$ref": "folderInteger.json"} - } - }, - "tests": [ - { - "description": "changed scope ref valid", - "data": [[1]], - "valid": true - }, - { - "description": "changed scope ref invalid", - "data": [["a"]], - "valid": false - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/required.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/required.json deleted file mode 100644 index 612f73f..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/required.json +++ /dev/null @@ -1,39 +0,0 @@ -[ - { - "description": "required validation", - "schema": { - "properties": { - "foo": {}, - "bar": {} - }, - "required": ["foo"] - }, - "tests": [ - { - "description": "present required property is valid", - "data": {"foo": 1}, - "valid": true - }, - { - "description": "non-present required property is invalid", - "data": {"bar": 1}, - "valid": false - } - ] - }, - { - "description": "required default validation", - "schema": { - "properties": { - "foo": {} - } - }, - "tests": [ - { - "description": "not required by default", - "data": {}, - "valid": true - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/type.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/type.json deleted file mode 100644 index 257f051..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/type.json +++ /dev/null @@ -1,330 +0,0 @@ -[ - { - "description": "integer type matches integers", - "schema": {"type": "integer"}, - "tests": [ - { - "description": "an integer is an integer", - "data": 1, - "valid": true - }, - { - "description": "a float is not an integer", - "data": 1.1, - "valid": false - }, - { - "description": "a string is not an integer", - "data": "foo", - "valid": false - }, - { - "description": "an object is not an integer", - "data": {}, - "valid": false - }, - { - "description": "an array is not an integer", - "data": [], - "valid": false - }, - { - "description": "a boolean is not an integer", - "data": true, - "valid": false - }, - { - "description": "null is not an integer", - "data": null, - "valid": false - } - ] - }, - { - "description": "number type matches numbers", - "schema": {"type": "number"}, - "tests": [ - { - "description": "an integer is a number", - "data": 1, - "valid": true - }, - { - "description": "a float is a number", - "data": 1.1, - "valid": true - }, - { - "description": "a string is not a number", - "data": "foo", - "valid": false - }, - { - "description": "an object is not a number", - "data": {}, - "valid": false - }, - { - "description": "an array is not a number", - "data": [], - "valid": false - }, - { - "description": "a boolean is not a number", - "data": true, - "valid": false - }, - { - "description": "null is not a number", - "data": null, - "valid": false - } - ] - }, - { - "description": "string type matches strings", - "schema": {"type": "string"}, - "tests": [ - { - "description": "1 is not a string", - "data": 1, - "valid": false - }, - { - "description": "a float is not a string", - "data": 1.1, - "valid": false - }, - { - "description": "a string is a string", - "data": "foo", - "valid": true - }, - { - "description": "an object is not a string", - "data": {}, - "valid": false - }, - { - "description": "an array is not a string", - "data": [], - "valid": false - }, - { - "description": "a boolean is not a string", - "data": true, - "valid": false - }, - { - "description": "null is not a string", - "data": null, - "valid": false - } - ] - }, - { - "description": "object type matches objects", - "schema": {"type": "object"}, - "tests": [ - { - "description": "an integer is not an object", - "data": 1, - "valid": false - }, - { - "description": "a float is not an object", - "data": 1.1, - "valid": false - }, - { - "description": "a string is not an object", - "data": "foo", - "valid": false - }, - { - "description": "an object is an object", - "data": {}, - "valid": true - }, - { - "description": "an array is not an object", - "data": [], - "valid": false - }, - { - "description": "a boolean is not an object", - "data": true, - "valid": false - }, - { - "description": "null is not an object", - "data": null, - "valid": false - } - ] - }, - { - "description": "array type matches arrays", - "schema": {"type": "array"}, - "tests": [ - { - "description": "an integer is not an array", - "data": 1, - "valid": false - }, - { - "description": "a float is not an array", - "data": 1.1, - "valid": false - }, - { - "description": "a string is not an array", - "data": "foo", - "valid": false - }, - { - "description": "an object is not an array", - "data": {}, - "valid": false - }, - { - "description": "an array is not an array", - "data": [], - "valid": true - }, - { - "description": "a boolean is not an array", - "data": true, - "valid": false - }, - { - "description": "null is not an array", - "data": null, - "valid": false - } - ] - }, - { - "description": "boolean type matches booleans", - "schema": {"type": "boolean"}, - "tests": [ - { - "description": "an integer is not a boolean", - "data": 1, - "valid": false - }, - { - "description": "a float is not a boolean", - "data": 1.1, - "valid": false - }, - { - "description": "a string is not a boolean", - "data": "foo", - "valid": false - }, - { - "description": "an object is not a boolean", - "data": {}, - "valid": false - }, - { - "description": "an array is not a boolean", - "data": [], - "valid": false - }, - { - "description": "a boolean is not a boolean", - "data": true, - "valid": true - }, - { - "description": "null is not a boolean", - "data": null, - "valid": false - } - ] - }, - { - "description": "null type matches only the null object", - "schema": {"type": "null"}, - "tests": [ - { - "description": "an integer is not null", - "data": 1, - "valid": false - }, - { - "description": "a float is not null", - "data": 1.1, - "valid": false - }, - { - "description": "a string is not null", - "data": "foo", - "valid": false - }, - { - "description": "an object is not null", - "data": {}, - "valid": false - }, - { - "description": "an array is not null", - "data": [], - "valid": false - }, - { - "description": "a boolean is not null", - "data": true, - "valid": false - }, - { - "description": "null is null", - "data": null, - "valid": true - } - ] - }, - { - "description": "multiple types can be specified in an array", - "schema": {"type": ["integer", "string"]}, - "tests": [ - { - "description": "an integer is valid", - "data": 1, - "valid": true - }, - { - "description": "a string is valid", - "data": "foo", - "valid": true - }, - { - "description": "a float is invalid", - "data": 1.1, - "valid": false - }, - { - "description": "an object is invalid", - "data": {}, - "valid": false - }, - { - "description": "an array is invalid", - "data": [], - "valid": false - }, - { - "description": "a boolean is invalid", - "data": true, - "valid": false - }, - { - "description": "null is invalid", - "data": null, - "valid": false - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/uniqueItems.json b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/uniqueItems.json deleted file mode 100644 index c1f4ab9..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/uniqueItems.json +++ /dev/null @@ -1,79 +0,0 @@ -[ - { - "description": "uniqueItems validation", - "schema": {"uniqueItems": true}, - "tests": [ - { - "description": "unique array of integers is valid", - "data": [1, 2], - "valid": true - }, - { - "description": "non-unique array of integers is invalid", - "data": [1, 1], - "valid": false - }, - { - "description": "numbers are unique if mathematically unequal", - "data": [1.0, 1.00, 1], - "valid": false - }, - { - "description": "unique array of objects is valid", - "data": [{"foo": "bar"}, {"foo": "baz"}], - "valid": true - }, - { - "description": "non-unique array of objects is invalid", - "data": [{"foo": "bar"}, {"foo": "bar"}], - "valid": false - }, - { - "description": "unique array of nested objects is valid", - "data": [ - {"foo": {"bar" : {"baz" : true}}}, - {"foo": {"bar" : {"baz" : false}}} - ], - "valid": true - }, - { - "description": "non-unique array of nested objects is invalid", - "data": [ - {"foo": {"bar" : {"baz" : true}}}, - {"foo": {"bar" : {"baz" : true}}} - ], - "valid": false - }, - { - "description": "unique array of arrays is valid", - "data": [["foo"], ["bar"]], - "valid": true - }, - { - "description": "non-unique array of arrays is invalid", - "data": [["foo"], ["foo"]], - "valid": false - }, - { - "description": "1 and true are unique", - "data": [1, true], - "valid": true - }, - { - "description": "0 and false are unique", - "data": [0, false], - "valid": true - }, - { - "description": "unique heterogeneous types are valid", - "data": [{}, [1], true, null, 1], - "valid": true - }, - { - "description": "non-unique heterogeneous types are invalid", - "data": [{}, [1], true, null, {}, 1], - "valid": false - } - ] - } -] diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema.js b/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema.js deleted file mode 100644 index e68a263..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/json-schema.js +++ /dev/null @@ -1,23 +0,0 @@ -var tape = require('tape') -var fs = require('fs') -var validator = require('../') - -var files = fs.readdirSync(__dirname+'/json-schema-draft4') - .map(function(file) { - if (file === 'definitions.json') return null - if (file === 'refRemote.json') return null - return require('./json-schema-draft4/'+file) - }) - .filter(Boolean) - -files.forEach(function(file) { - file.forEach(function(f) { - tape('json-schema-test-suite '+f.description, function(t) { - var validate = validator(f.schema) - f.tests.forEach(function(test) { - t.same(validate(test.data), test.valid, test.description) - }) - t.end() - }) - }) -}) diff --git a/node_modules/eslint/node_modules/is-my-json-valid/test/misc.js b/node_modules/eslint/node_modules/is-my-json-valid/test/misc.js deleted file mode 100644 index b5109e5..0000000 --- a/node_modules/eslint/node_modules/is-my-json-valid/test/misc.js +++ /dev/null @@ -1,429 +0,0 @@ -var tape = require('tape') -var cosmic = require('./fixtures/cosmic') -var validator = require('../') -var validatorRequire = require('../require') - -tape('simple', function(t) { - var schema = { - required: true, - type: 'object', - properties: { - hello: {type:'string', required:true} - } - } - - var validate = validator(schema) - - t.ok(validate({hello: 'world'}), 'should be valid') - t.notOk(validate(), 'should be invalid') - t.notOk(validate({}), 'should be invalid') - t.end() -}) - -tape('advanced', function(t) { - var validate = validator(cosmic.schema) - - t.ok(validate(cosmic.valid), 'should be valid') - t.notOk(validate(cosmic.invalid), 'should be invalid') - t.end() -}) - -tape('greedy/false', function(t) { - var validate = validator({ - type: 'object', - properties: { - x: { - type: 'number' - } - }, - required: ['x', 'y'] - }); - t.notOk(validate({}), 'should be invalid') - t.strictEqual(validate.errors.length, 2); - t.strictEqual(validate.errors[0].field, 'data.x') - t.strictEqual(validate.errors[0].message, 'is required') - t.strictEqual(validate.errors[1].field, 'data.y') - t.strictEqual(validate.errors[1].message, 'is required') - t.notOk(validate({x: 'string'}), 'should be invalid') - t.strictEqual(validate.errors.length, 1); - t.strictEqual(validate.errors[0].field, 'data.y') - t.strictEqual(validate.errors[0].message, 'is required') - t.notOk(validate({x: 'string', y: 'value'}), 'should be invalid') - t.strictEqual(validate.errors.length, 1); - t.strictEqual(validate.errors[0].field, 'data.x') - t.strictEqual(validate.errors[0].message, 'is the wrong type') - t.end(); -}); - -tape('greedy/true', function(t) { - var validate = validator({ - type: 'object', - properties: { - x: { - type: 'number' - } - }, - required: ['x', 'y'] - }, { - greedy: true - }); - t.notOk(validate({}), 'should be invalid') - t.strictEqual(validate.errors.length, 2); - t.strictEqual(validate.errors[0].field, 'data.x') - t.strictEqual(validate.errors[0].message, 'is required') - t.strictEqual(validate.errors[1].field, 'data.y') - t.strictEqual(validate.errors[1].message, 'is required') - t.notOk(validate({x: 'string'}), 'should be invalid') - t.strictEqual(validate.errors.length, 2); - t.strictEqual(validate.errors[0].field, 'data.y') - t.strictEqual(validate.errors[0].message, 'is required') - t.strictEqual(validate.errors[1].field, 'data.x') - t.strictEqual(validate.errors[1].message, 'is the wrong type') - t.notOk(validate({x: 'string', y: 'value'}), 'should be invalid') - t.strictEqual(validate.errors.length, 1); - t.strictEqual(validate.errors[0].field, 'data.x') - t.strictEqual(validate.errors[0].message, 'is the wrong type') - t.ok(validate({x: 1, y: 'value'}), 'should be invalid') - t.end(); -}); - -tape('additional props', function(t) { - var validate = validator({ - type: 'object', - additionalProperties: false - }, { - verbose: true - }) - - t.ok(validate({})) - t.notOk(validate({foo:'bar'})) - t.ok(validate.errors[0].value === 'data.foo', 'should output the property not allowed in verbose mode') - t.end() -}) - -tape('array', function(t) { - var validate = validator({ - type: 'array', - required: true, - items: { - type: 'string' - } - }) - - t.notOk(validate({}), 'wrong type') - t.notOk(validate(), 'is required') - t.ok(validate(['test'])) - t.end() -}) - -tape('nested array', function(t) { - var validate = validator({ - type: 'object', - properties: { - list: { - type: 'array', - required: true, - items: { - type: 'string' - } - } - } - }) - - t.notOk(validate({}), 'is required') - t.ok(validate({list:['test']})) - t.notOk(validate({list:[1]})) - t.end() -}) - -tape('enum', function(t) { - var validate = validator({ - type: 'object', - properties: { - foo: { - type: 'number', - required: true, - enum: [42] - } - } - }) - - t.notOk(validate({}), 'is required') - t.ok(validate({foo:42})) - t.notOk(validate({foo:43})) - t.end() -}) - -tape('minimum/maximum', function(t) { - var validate = validator({ - type: 'object', - properties: { - foo: { - type: 'number', - minimum: 0, - maximum: 0 - } - } - }) - - t.notOk(validate({foo:-42})) - t.ok(validate({foo:0})) - t.notOk(validate({foo:42})) - t.end() -}) - -tape('exclusiveMinimum/exclusiveMaximum', function(t) { - var validate = validator({ - type: 'object', - properties: { - foo: { - type: 'number', - minimum: 10, - maximum: 20, - exclusiveMinimum: true, - exclusiveMaximum: true - } - } - }) - - t.notOk(validate({foo:10})) - t.ok(validate({foo:11})) - t.notOk(validate({foo:20})) - t.ok(validate({foo:19})) - t.end() -}) - -tape('custom format', function(t) { - var validate = validator({ - type: 'object', - properties: { - foo: { - type: 'string', - format: 'as' - } - } - }, {formats: {as:/^a+$/}}) - - t.notOk(validate({foo:''}), 'not as') - t.notOk(validate({foo:'b'}), 'not as') - t.notOk(validate({foo:'aaab'}), 'not as') - t.ok(validate({foo:'a'}), 'as') - t.ok(validate({foo:'aaaaaa'}), 'as') - t.end() -}) - -tape('custom format function', function(t) { - var validate = validator({ - type: 'object', - properties: { - foo: { - type: 'string', - format: 'as' - } - } - }, {formats: {as:function(s) { return /^a+$/.test(s) } }}) - - t.notOk(validate({foo:''}), 'not as') - t.notOk(validate({foo:'b'}), 'not as') - t.notOk(validate({foo:'aaab'}), 'not as') - t.ok(validate({foo:'a'}), 'as') - t.ok(validate({foo:'aaaaaa'}), 'as') - t.end() -}) - -tape('do not mutate schema', function(t) { - var sch = { - items: [ - {} - ], - additionalItems: { - type: 'integer' - } - } - - var copy = JSON.parse(JSON.stringify(sch)) - - validator(sch) - - t.same(sch, copy, 'did not mutate') - t.end() -}) - -tape('#toJSON()', function(t) { - var schema = { - required: true, - type: 'object', - properties: { - hello: {type:'string', required:true} - } - } - - var validate = validator(schema) - - t.deepEqual(validate.toJSON(), schema, 'should return original schema') - t.end() -}) - -tape('external schemas', function(t) { - var ext = {type: 'string'} - var schema = { - required: true, - $ref: '#ext' - } - - var validate = validator(schema, {schemas: {ext:ext}}) - - t.ok(validate('hello string'), 'is a string') - t.notOk(validate(42), 'not a string') - t.end() -}) - -tape('top-level external schema', function(t) { - var defs = { - "string": { - type: "string" - }, - "sex": { - type: "string", - enum: ["male", "female", "other"] - } - } - var schema = { - type: "object", - properties: { - "name": { $ref: "definitions.json#/string" }, - "sex": { $ref: "definitions.json#/sex" } - }, - required: ["name", "sex"] - } - - var validate = validator(schema, { - schemas: { - "definitions.json": defs - } - }) - t.ok(validate({name:"alice", sex:"female"}), 'is an object') - t.notOk(validate({name:"alice", sex: "bob"}), 'recognizes external schema') - t.notOk(validate({name:2, sex: "female"}), 'recognizes external schema') - t.end() -}) - -tape('nested required array decl', function(t) { - var schema = { - properties: { - x: { - type: 'object', - properties: { - y: { - type: 'object', - properties: { - z: { - type: 'string' - } - }, - required: ['z'] - } - } - } - }, - required: ['x'] - } - - var validate = validator(schema) - - t.ok(validate({x: {}}), 'should be valid') - t.notOk(validate({}), 'should not be valid') - t.strictEqual(validate.errors[0].field, 'data.x', 'should output the missing field') - t.end() -}) - -tape('verbose mode', function(t) { - var schema = { - required: true, - type: 'object', - properties: { - hello: { - required: true, - type: 'string' - } - } - }; - - var validate = validator(schema, {verbose: true}) - - t.ok(validate({hello: 'string'}), 'should be valid') - t.notOk(validate({hello: 100}), 'should not be valid') - t.strictEqual(validate.errors[0].value, 100, 'error object should contain the invalid value') - t.end() -}) - -tape('additional props in verbose mode', function(t) { - var schema = { - type: 'object', - required: true, - additionalProperties: false, - properties: { - foo: { - type: 'string' - }, - 'hello world': { - type: 'object', - required: true, - additionalProperties: false, - properties: { - foo: { - type: 'string' - } - } - } - } - }; - - var validate = validator(schema, {verbose: true}) - - validate({'hello world': {bar: 'string'}}); - - t.strictEqual(validate.errors[0].value, 'data["hello world"].bar', 'should output the path to the additional prop in the error') - t.end() -}) - -tape('Date.now() is an integer', function(t) { - var schema = {type: 'integer'} - var validate = validator(schema) - - t.ok(validate(Date.now()), 'is integer') - t.end() -}) - -tape('field shows item index in arrays', function(t) { - var schema = { - type: 'array', - items: { - type: 'array', - items: { - properties: { - foo: { - type: 'string', - required: true - } - } - } - } - } - - var validate = validator(schema) - - validate([ - [ - { foo: 'test' }, - { foo: 'test' } - ], - [ - { foo: 'test' }, - { baz: 'test' } - ] - ]) - - t.strictEqual(validate.errors[0].field, 'data.1.1.foo', 'should output the field with specific index of failing item in the error') - t.end() -}) diff --git a/node_modules/eslint/node_modules/is-resolvable/LICENSE b/node_modules/eslint/node_modules/is-resolvable/LICENSE deleted file mode 100644 index d9ef73f..0000000 --- a/node_modules/eslint/node_modules/is-resolvable/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 - 2015 Shinnosuke Watanabe - -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. diff --git a/node_modules/eslint/node_modules/is-resolvable/README.md b/node_modules/eslint/node_modules/is-resolvable/README.md deleted file mode 100755 index ac9da31..0000000 --- a/node_modules/eslint/node_modules/is-resolvable/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# is-resolvable - -[![NPM version](https://img.shields.io/npm/v/is-resolvable.svg)](https://www.npmjs.com/package/is-resolvable) -[![Build Status](https://travis-ci.org/shinnn/is-resolvable.svg?branch=master)](https://travis-ci.org/shinnn/is-resolvable) -[![Build status](https://ci.appveyor.com/api/projects/status/ww1cdpignehlasbs?svg=true)](https://ci.appveyor.com/project/ShinnosukeWatanabe/is-resolvable) -[![Coverage Status](https://img.shields.io/coveralls/shinnn/is-resolvable.svg)](https://coveralls.io/r/shinnn/is-resolvable) -[![Dependency Status](https://img.shields.io/david/shinnn/is-resolvable.svg?label=deps)](https://david-dm.org/shinnn/is-resolvable) -[![devDependency Status](https://img.shields.io/david/dev/shinnn/is-resolvable.svg?label=devDeps)](https://david-dm.org/shinnn/is-resolvable#info=devDependencies) - -A [Node](https://nodejs.org/) module to check if a module ID is resolvable with [`require()`](https://nodejs.org/api/globals.html#globals_require) - -```javascript -const isResolvable = require('is-resolvable'); - -isResolvable('fs'); //=> true -isResolvable('path'); //=> true - -// When `./index.js` exists -isResolvable('./index.js') //=> true -isResolvable('./index') //=> true -isResolvable('.') //=> true -``` - -## Installation - -[Use npm.](https://docs.npmjs.com/cli/install) - -``` -npm install is-resolvable -``` - -## API - -```javascript -const isResolvable = require('is-resolvable'); -``` - -### isResolvable(*moduleId*) - -*moduleId*: `String` (module ID) -Return: `Boolean` - -It returns `true` if `require()` can load a file form a given module ID, otherwise `false`. - -```javascript -const isResolvable = require('is-resolvable'); - -// When `./foo.json` exists -isResolvable('./foo.json'); //=> true -isResolvable('./foo'); //=> true - -isResolvable('./foo.js'); //=> false - - -// When `lodash` module is installed but `underscore` isn't -isResolvable('lodash'); //=> true -isResolvable('underscore'); //=> false - -// When `readable-stream` module is installed -isResolvable('readable-stream/readable'); //=> true -isResolvable('readable-stream/writable'); //=> true -``` - -## License - -Copyright (c) 2014 - 2015 [Shinnosuke Watanabe](https://github.com/shinnn) - -Licensed under [the MIT License](./LICENSE). diff --git a/node_modules/eslint/node_modules/is-resolvable/index.js b/node_modules/eslint/node_modules/is-resolvable/index.js deleted file mode 100755 index 807817b..0000000 --- a/node_modules/eslint/node_modules/is-resolvable/index.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -var tryit = require('tryit'); - -module.exports = function isResolvable(moduleId) { - if (typeof moduleId !== 'string') { - throw new TypeError( - moduleId + - ' is not a string. A module identifier to be checked if resolvable is required.' - ); - } - - var result; - tryit(function() { - require.resolve(moduleId); - }, function(err) { - if (err) { - result = false; - return; - } - - result = true; - }); - - return result; -}; diff --git a/node_modules/eslint/node_modules/is-resolvable/node_modules/tryit/.npmignore b/node_modules/eslint/node_modules/is-resolvable/node_modules/tryit/.npmignore deleted file mode 100644 index 9daa824..0000000 --- a/node_modules/eslint/node_modules/is-resolvable/node_modules/tryit/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -.DS_Store -node_modules diff --git a/node_modules/eslint/node_modules/is-resolvable/node_modules/tryit/README.md b/node_modules/eslint/node_modules/is-resolvable/node_modules/tryit/README.md deleted file mode 100644 index 8041884..0000000 --- a/node_modules/eslint/node_modules/is-resolvable/node_modules/tryit/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# tryit - -Tiny module wrapping try/catch in JavaScript. - -It's *literally 11 lines of code*, [just read it](tryit.js) that's all the documentation you'll need. - - -## install - -``` -npm install tryit -``` - -## usage - -What you'd normally do: -```js -try { - dangerousThing(); -} catch (e) { - console.log('something'); -} -``` - -With try-it (all it does is wrap try-catch) -```js -var tryit = require('tryit'); - -tryit(dangerousThing); -``` - -You can also handle the error by passing a second function -```js -tryit(dangerousThing, function (e) { - if (e) { - console.log('do something'); - } -}) -``` - -The second function follows error-first pattern common in node. So if you pass a callback it gets called in both cases. But will have an error as the first argument if it fails. - -## WHAT? WHY DO THIS!? - -Primary motivation is having a clean way to wrap things that might fail, where I don't care if it fails. I just want to try it. - -This includes stuff like blindly reading/parsing stuff from localStorage in the browser. If it's not there or if parsing it fails, that's fine. But I don't want to leave a bunch of empty `catch (e) {}` blocks in the code. - -Obviously, this is useful any time you're going to attempt to read some unknown data structure. - -In addition, my understanding is that it's hard for JS engines to optimize code in try blocks. By actually passing the code to be executed into a re-used try block, we can avoid having to have more than a single try block in our app. Again, this is not a primary motivation, just a potential side benefit. - - -## license - -[MIT](http://mit.joreteg.com/) diff --git a/node_modules/eslint/node_modules/is-resolvable/node_modules/tryit/package.json b/node_modules/eslint/node_modules/is-resolvable/node_modules/tryit/package.json deleted file mode 100644 index 105a63e..0000000 --- a/node_modules/eslint/node_modules/is-resolvable/node_modules/tryit/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "tryit", - "description": "Module to wrap try-catch for better performance and cleaner API.", - "version": "1.0.2", - "author": { - "name": "Henrik Joreteg", - "email": "henrik@andyet.net" - }, - "devDependencies": { - "tap-spec": "^2.1.2", - "tape": "^3.0.3" - }, - "keywords": [ - "errors", - "try", - "errorhandling" - ], - "license": "MIT", - "main": "tryit.js", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/HenrikJoreteg/tryit.git" - }, - "scripts": { - "test": "node test/test.js | tap-spec" - }, - "gitHead": "b567b4feb491e2ee89addd3d06f66d6ec2217cf5", - "bugs": { - "url": "https://github.com/HenrikJoreteg/tryit/issues" - }, - "homepage": "https://github.com/HenrikJoreteg/tryit#readme", - "_id": "tryit@1.0.2", - "_shasum": "c196b0073e6b1c595d93c9c830855b7acc32a453", - "_from": "tryit@>=1.0.1 <2.0.0", - "_npmVersion": "3.3.8", - "_nodeVersion": "4.1.0", - "_npmUser": { - "name": "henrikjoreteg", - "email": "henrik@joreteg.com" - }, - "dist": { - "shasum": "c196b0073e6b1c595d93c9c830855b7acc32a453", - "tarball": "http://registry.npmjs.org/tryit/-/tryit-1.0.2.tgz" - }, - "maintainers": [ - { - "name": "henrikjoreteg", - "email": "henrik@andyet.net" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/tryit/-/tryit-1.0.2.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/is-resolvable/node_modules/tryit/test/test.js b/node_modules/eslint/node_modules/is-resolvable/node_modules/tryit/test/test.js deleted file mode 100644 index 68f6f2b..0000000 --- a/node_modules/eslint/node_modules/is-resolvable/node_modules/tryit/test/test.js +++ /dev/null @@ -1,37 +0,0 @@ -var test = require('tape'); -var tryit = require('../tryit'); - - -test('basic functionality', function (t) { - var count = 0; - - var noOp = function () {}; - var throwsError = function () { - throw new Error('whammo'); - } - - tryit(noOp, function (e) { - t.ok(e == null, 'should be called without an error'); - }); - - tryit(throwsError, function (e) { - t.ok('should be called'); - t.ok(e instanceof Error); - }); - - t.end(); -}); - -test('handle case where callback throws', function (t) { - var count = 0; - - t.throws(function () { - tryit(function () {}, function(e) { - count++; - t.equal(count, 1, 'should be called once'); - throw new Error('kablowie'); - }); - }, 'should throw once'); - - t.end(); -}); diff --git a/node_modules/eslint/node_modules/is-resolvable/node_modules/tryit/tryit.js b/node_modules/eslint/node_modules/is-resolvable/node_modules/tryit/tryit.js deleted file mode 100644 index 98a5700..0000000 --- a/node_modules/eslint/node_modules/is-resolvable/node_modules/tryit/tryit.js +++ /dev/null @@ -1,14 +0,0 @@ -// tryit -// Simple, re-usuable try-catch, this is a performance optimization -// and provides a cleaner API. -module.exports = function (fn, cb) { - var err; - - try { - fn(); - } catch (e) { - err = e; - } - - if (cb) cb(err || null); -}; diff --git a/node_modules/eslint/node_modules/is-resolvable/package.json b/node_modules/eslint/node_modules/is-resolvable/package.json deleted file mode 100644 index e23268e..0000000 --- a/node_modules/eslint/node_modules/is-resolvable/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "is-resolvable", - "version": "1.0.0", - "description": "Check if a module ID is resolvable with require()", - "repository": { - "type": "git", - "url": "git+https://github.com/shinnn/is-resolvable.git" - }, - "author": { - "name": "Shinnosuke Watanabe", - "url": "https://github.com/shinnn" - }, - "scripts": { - "pretest": "eslint --config node_modules/@shinnn/eslintrc-node/rc.json index.js test.js", - "test": "node test.js", - "coverage": "istanbul cover test.js" - }, - "license": "MIT", - "files": [ - "index.js" - ], - "keywords": [ - "read", - "file", - "font", - "glyph", - "code-point", - "unicode", - "parse", - "cmap", - "table", - "data", - "metadata" - ], - "dependencies": { - "tryit": "^1.0.1" - }, - "devDependencies": { - "@shinnn/eslintrc-node": "^1.0.2", - "eslint": "^0.24.0", - "istanbul": "^0.3.17", - "tape": "^4.0.0" - }, - "gitHead": "e68ea1b3affa382cbd31b4bae1e1421040249a73", - "bugs": { - "url": "https://github.com/shinnn/is-resolvable/issues" - }, - "homepage": "https://github.com/shinnn/is-resolvable#readme", - "_id": "is-resolvable@1.0.0", - "_shasum": "8df57c61ea2e3c501408d100fb013cf8d6e0cc62", - "_from": "is-resolvable@>=1.0.0 <2.0.0", - "_npmVersion": "2.13.1", - "_nodeVersion": "2.4.0", - "_npmUser": { - "name": "shinnn", - "email": "snnskwtnb@gmail.com" - }, - "dist": { - "shasum": "8df57c61ea2e3c501408d100fb013cf8d6e0cc62", - "tarball": "http://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.0.tgz" - }, - "maintainers": [ - { - "name": "shinnn", - "email": "snnskwtnb@gmail.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/js-yaml/CHANGELOG.md b/node_modules/eslint/node_modules/js-yaml/CHANGELOG.md deleted file mode 100644 index f11a6cd..0000000 --- a/node_modules/eslint/node_modules/js-yaml/CHANGELOG.md +++ /dev/null @@ -1,341 +0,0 @@ -3.4.5 / 2015-11-23 ------------------- - -- Added `lineWidth` option to dumper. - - -3.4.4 / 2015-11-21 ------------------- - -- Fixed floats dump (missed dot for scientific format), #220. -- Allow non-printable characters inside quoted scalars, #192. - - -3.4.3 / 2015-10-10 ------------------- - -- Maintenance release - deps bump (esprima, argparse). - - -3.4.2 / 2015-09-09 ------------------- - -- Fixed serialization of duplicated entries in sequences, #205. - Thanks to @vogelsgesang. - - -3.4.1 / 2015-09-05 ------------------- - -- Fixed stacktrace handling in generated errors, for browsers (FF/IE). - - -3.4.0 / 2015-08-23 ------------------- - -- Fixed multiline keys dump, #197. Thanks to @tcr. -- Don't throw on warnongs anymore. Use `onWarning` option to catch. -- Throw error on unknown tags (was warning before). -- Fixed heading line breaks in some scalars (regression). -- Reworked internals of error class. - - -3.3.1 / 2015-05-13 ------------------- - -- Added `.sortKeys` dumper option, thanks to @rjmunro. -- Fixed astral characters support, #191. - - -3.3.0 / 2015-04-26 ------------------- - -- Significantly improved long strings formatting in dumper, thanks to @isaacs. -- Strip BOM if exists. - - -3.2.7 / 2015-02-19 ------------------- - -- Maintenance release. -- Updated dependencies. -- HISTORY.md -> CHANGELOG.md - - -3.2.6 / 2015-02-07 ------------------- - -- Fixed encoding of UTF-16 surrogate pairs. (e.g. "\U0001F431" CAT FACE). -- Fixed demo dates dump (#113, thanks to @Hypercubed). - - -3.2.5 / 2014-12-28 ------------------- - -- Fixed resolving of all built-in types on empty nodes. -- Fixed invalid warning on empty lines within quoted scalars and flow collections. -- Fixed bug: Tag on an empty node didn't resolve in some cases. - - -3.2.4 / 2014-12-19 ------------------- - -- Fixed resolving of !!null tag on an empty node. - - -3.2.3 / 2014-11-08 ------------------- - -- Implemented dumping of objects with circular and cross references. -- Partially fixed aliasing of constructed objects. (see issue #141 for details) - - -3.2.2 / 2014-09-07 ------------------- - -- Fixed infinite loop on unindented block scalars. -- Rewritten base64 encode/decode in binary type, to keep code licence clear. - - -3.2.1 / 2014-08-24 ------------------- - -- Nothig new. Just fix npm publish error. - - -3.2.0 / 2014-08-24 ------------------- - -- Added input piping support to CLI. -- Fixed typo, that could cause hand on initial indent (#139). - - -3.1.0 / 2014-07-07 ------------------- - -- 1.5x-2x speed boost. -- Removed deprecated `require('xxx.yml')` support. -- Significant code cleanup and refactoring. -- Internal API changed. If you used custom types - see updated examples. - Others are not affected. -- Even if the input string has no trailing line break character, - it will be parsed as if it has one. -- Added benchmark scripts. -- Moved bower files to /dist folder -- Bugfixes. - - -3.0.2 / 2014-02-27 ------------------- - -- Fixed bug: "constructor" string parsed as `null`. - - -3.0.1 / 2013-12-22 ------------------- - -- Fixed parsing of literal scalars. (issue #108) -- Prevented adding unnecessary spaces in object dumps. (issue #68) -- Fixed dumping of objects with very long (> 1024 in length) keys. - - -3.0.0 / 2013-12-16 ------------------- - -- Refactored code. Changed API for custom types. -- Removed output colors in CLI, dump json by default. -- Removed big dependencies from browser version (esprima, buffer) - - load `esprima` manually, if !!js/function needed - - !!bin now returns Array in browser -- AMD support. -- Don't quote dumped strings because of `-` & `?` (if not first char). -- __Deprecated__ loading yaml files via `require()`, as not recommended - behaviour for node. - - -2.1.3 / 2013-10-16 ------------------- - -- Fix wrong loading of empty block scalars. - - -2.1.2 / 2013-10-07 ------------------- - -- Fix unwanted line breaks in folded scalars. - - -2.1.1 / 2013-10-02 ------------------- - -- Dumper now respects deprecated booleans syntax from YAML 1.0/1.1 -- Fixed reader bug in JSON-like sequences/mappings. - - -2.1.0 / 2013-06-05 ------------------- - -- Add standard YAML schemas: Failsafe (`FAILSAFE_SCHEMA`), - JSON (`JSON_SCHEMA`) and Core (`CORE_SCHEMA`). -- Rename `DEFAULT_SCHEMA` to `DEFAULT_FULL_SCHEMA` - and `SAFE_SCHEMA` to `DEFAULT_SAFE_SCHEMA`. -- Bug fix: export `NIL` constant from the public interface. -- Add `skipInvalid` dumper option. -- Use `safeLoad` for `require` extension. - - -2.0.5 / 2013-04-26 ------------------- - -- Close security issue in !!js/function constructor. - Big thanks to @nealpoole for security audit. - - -2.0.4 / 2013-04-08 ------------------- - -- Updated .npmignore to reduce package size - - -2.0.3 / 2013-02-26 ------------------- - -- Fixed dumping of empty arrays ans objects. ([] and {} instead of null) - - -2.0.2 / 2013-02-15 ------------------- - -- Fixed input validation: tabs are printable characters. - - -2.0.1 / 2013-02-09 ------------------- - -- Fixed error, when options not passed to function cass - - -2.0.0 / 2013-02-09 ------------------- - -- Full rewrite. New architecture. Fast one-stage parsing. -- Changed custom types API. -- Added YAML dumper. - - -1.0.3 / 2012-11-05 ------------------- - -- Fixed utf-8 files loading. - - -1.0.2 / 2012-08-02 ------------------- - -- Pull out hand-written shims. Use ES5-Shims for old browsers support. See #44. -- Fix timstamps incorectly parsed in local time when no time part specified. - - -1.0.1 / 2012-07-07 ------------------- - -- Fixes `TypeError: 'undefined' is not an object` under Safari. Thanks Phuong. -- Fix timestamps incorrectly parsed in local time. Thanks @caolan. Closes #46. - - -1.0.0 / 2012-07-01 ------------------- - -- `y`, `yes`, `n`, `no`, `on`, `off` are not converted to Booleans anymore. - Fixes #42. -- `require(filename)` now returns a single document and throws an Error if - file contains more than one document. -- CLI was merged back from js-yaml.bin - - -0.3.7 / 2012-02-28 ------------------- - -- Fix export of `addConstructor()`. Closes #39. - - -0.3.6 / 2012-02-22 ------------------- - -- Removed AMD parts - too buggy to use. Need help to rewrite from scratch -- Removed YUI compressor warning (renamed `double` variable). Closes #40. - - -0.3.5 / 2012-01-10 ------------------- - -- Workagound for .npmignore fuckup under windows. Thanks to airportyh. - - -0.3.4 / 2011-12-24 ------------------- - -- Fixes str[] for oldIEs support. -- Adds better has change support for browserified demo. -- improves compact output of Error. Closes #33. - - -0.3.3 / 2011-12-20 ------------------- - -- jsyaml executable moved to separate module. -- adds `compact` stringification of Errors. - - -0.3.2 / 2011-12-16 ------------------- - -- Fixes ug with block style scalars. Closes #26. -- All sources are passing JSLint now. -- Fixes bug in Safari. Closes #28. -- Fixes bug in Opers. Closes #29. -- Improves browser support. Closes #20. -- Added jsyaml executable. -- Added !!js/function support. Closes #12. - - -0.3.1 / 2011-11-18 ------------------- - -- Added AMD support for browserified version. -- Wrapped browserified js-yaml into closure. -- Fixed the resolvement of non-specific tags. Closes #17. -- Added permalinks for online demo YAML snippets. Now we have YPaste service, lol. -- Added !!js/regexp and !!js/undefined types. Partially solves #12. -- Fixed !!set mapping. -- Fixed month parse in dates. Closes #19. - - -0.3.0 / 2011-11-09 ------------------- - -- Removed JS.Class dependency. Closes #3. -- Added browserified version. Closes #13. -- Added live demo of browserified version. -- Ported some of the PyYAML tests. See #14. -- Fixed timestamp bug when fraction was given. - - -0.2.2 / 2011-11-06 ------------------- - -- Fixed crash on docs without ---. Closes #8. -- Fixed miltiline string parse -- Fixed tests/comments for using array as key - - -0.2.1 / 2011-11-02 ------------------- - -- Fixed short file read (<4k). Closes #9. - - -0.2.0 / 2011-11-02 ------------------- - -- First public release diff --git a/node_modules/eslint/node_modules/js-yaml/LICENSE b/node_modules/eslint/node_modules/js-yaml/LICENSE deleted file mode 100644 index 09d3a29..0000000 --- a/node_modules/eslint/node_modules/js-yaml/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -(The MIT License) - -Copyright (C) 2011-2015 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. diff --git a/node_modules/eslint/node_modules/js-yaml/README.md b/node_modules/eslint/node_modules/js-yaml/README.md deleted file mode 100644 index e0c8fb8..0000000 --- a/node_modules/eslint/node_modules/js-yaml/README.md +++ /dev/null @@ -1,291 +0,0 @@ -JS-YAML - YAML 1.2 parser and serializer for JavaScript -======================================================= - -[![Build Status](https://travis-ci.org/nodeca/js-yaml.svg?branch=master)](https://travis-ci.org/nodeca/js-yaml) -[![NPM version](https://img.shields.io/npm/v/js-yaml.svg)](https://www.npmjs.org/package/js-yaml) - -[Online Demo](http://nodeca.github.com/js-yaml/) - - -This is an implementation of [YAML](http://yaml.org/), a human friendly data -serialization language. Started as [PyYAML](http://pyyaml.org/) port, it was -completely rewritten from scratch. Now it's very fast, and supports 1.2 spec. - - -Installation ------------- - -### YAML module for node.js - -``` -npm install js-yaml -``` - - -### CLI executable - -If you want to inspect your YAML files from CLI, install js-yaml globally: - -``` -npm install -g js-yaml -``` - -#### Usage - -``` -usage: js-yaml [-h] [-v] [-c] [-t] file - -Positional arguments: - file File with YAML document(s) - -Optional arguments: - -h, --help Show this help message and exit. - -v, --version Show program's version number and exit. - -c, --compact Display errors in compact mode - -t, --trace Show stack trace on error -``` - - -### Bundled YAML library for browsers - -``` html - - - - -``` - -Browser support was done mostly for online demo. If you find any errors - feel -free to send pull requests with fixes. Also note, that IE and other old browsers -needs [es5-shims](https://github.com/kriskowal/es5-shim) to operate. - -Notes: - -1. We have no resources to support browserified version. Don't expect it to be - well tested. Don't expect fast fixes if something goes wrong there. -2. `!!js/function` in browser bundle will not work by default. If you really need - it - load `esprima` parser first (via amd or directly). -3. `!!bin` in browser will return `Array`, because browsers do not support - node.js `Buffer` and adding Buffer shims is completely useless on practice. - - -API ---- - -Here we cover the most 'useful' methods. If you need advanced details (creating -your own tags), see [wiki](https://github.com/nodeca/js-yaml/wiki) and -[examples](https://github.com/nodeca/js-yaml/tree/master/examples) for more -info. - -``` javascript -yaml = require('js-yaml'); -fs = require('fs'); - -// Get document, or throw exception on error -try { - var doc = yaml.safeLoad(fs.readFileSync('/home/ixti/example.yml', 'utf8')); - console.log(doc); -} catch (e) { - console.log(e); -} -``` - - -### safeLoad (string [ , options ]) - -**Recommended loading way.** Parses `string` as single YAML document. Returns a JavaScript -object or throws `YAMLException` on error. By default, does not support regexps, -functions and undefined. This method is safe for untrusted data. - -options: - -- `filename` _(default: null)_ - string to be used as a file path in - error/warning messages. -- `onWarning` _(default: null)_ - function to call on warning messages. - Loader will throw on warnings if this function is not provided. -- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ - specifies a schema to use. - - `FAILSAFE_SCHEMA` - only strings, arrays and plain objects: - http://www.yaml.org/spec/1.2/spec.html#id2802346 - - `JSON_SCHEMA` - all JSON-supported types: - http://www.yaml.org/spec/1.2/spec.html#id2803231 - - `CORE_SCHEMA` - same as `JSON_SCHEMA`: - http://www.yaml.org/spec/1.2/spec.html#id2804923 - - `DEFAULT_SAFE_SCHEMA` - all supported YAML types, without unsafe ones - (`!!js/undefined`, `!!js/regexp` and `!!js/function`): - http://yaml.org/type/ - - `DEFAULT_FULL_SCHEMA` - all supported YAML types. - -NOTE: This function **does not** understand multi-document sources, it throws -exception on those. - -NOTE: JS-YAML **does not** support schema-specific tag resolution restrictions. -So, JSON schema is not as strict as defined in the YAML specification. -It allows numbers in any notation, use `Null` and `NULL` as `null`, etc. -Core schema also has no such restrictions. It allows binary notation for integers. - - -### load (string [ , options ]) - -**Use with care with untrusted sources**. The same as `safeLoad()` but uses -`DEFAULT_FULL_SCHEMA` by default - adds some JavaScript-specific types: -`!!js/function`, `!!js/regexp` and `!!js/undefined`. For untrusted sources you -must additionally validate object structure, to avoid injections: - -``` javascript -var untrusted_code = '"toString": ! "function (){very_evil_thing();}"'; - -// I'm just converting that string, what could possibly go wrong? -require('js-yaml').load(untrusted_code) + '' -``` - - -### safeLoadAll (string, iterator [ , options ]) - -Same as `safeLoad()`, but understands multi-document sources and apply -`iterator` to each document. - -``` javascript -var yaml = require('js-yaml'); - -yaml.safeLoadAll(data, function (doc) { - console.log(doc); -}); -``` - - -### loadAll (string, iterator [ , options ]) - -Same as `safeLoadAll()` but uses `DEFAULT_FULL_SCHEMA` by default. - - -### safeDump (object [ , options ]) - -Serializes `object` as YAML document. Uses `DEFAULT_SAFE_SCHEMA`, so it will -throw exception if you try to dump regexps or functions. However, you can -disable exceptions by `skipInvalid` option. - -options: - -- `indent` _(default: 2)_ - indentation width to use (in spaces). -- `skipInvalid` _(default: false)_ - do not throw on invalid types (like function - in the safe schema) and skip pairs and single values with such types. -- `flowLevel` (default: -1) - specifies level of nesting, when to switch from - block to flow style for collections. -1 means block style everwhere -- `styles` - "tag" => "style" map. Each tag may have own set of styles. -- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ specifies a schema to use. -- `sortKeys` _(default: `false`)_ - if `true`, sort keys when dumping YAML. If a - function, use the function to sort the keys. -- `lineWidth` _(default: `80`)_ - set max line width. - -styles: - -``` none -!!null - "canonical" => "~" - -!!int - "binary" => "0b1", "0b101010", "0b1110001111010" - "octal" => "01", "052", "016172" - "decimal" => "1", "42", "7290" - "hexadecimal" => "0x1", "0x2A", "0x1C7A" - -!!null, !!bool, !!float - "lowercase" => "null", "true", "false", ".nan", '.inf' - "uppercase" => "NULL", "TRUE", "FALSE", ".NAN", '.INF' - "camelcase" => "Null", "True", "False", ".NaN", '.Inf' -``` - -By default, !!int uses `decimal`, and !!null, !!bool, !!float use `lowercase`. - - - -### dump (object [ , options ]) - -Same as `safeDump()` but without limits (uses `DEFAULT_FULL_SCHEMA` by default). - - -Supported YAML types --------------------- - -The list of standard YAML tags and corresponding JavaScipt types. See also -[YAML tag discussion](http://pyyaml.org/wiki/YAMLTagDiscussion) and -[YAML types repository](http://yaml.org/type/). - -``` -!!null '' # null -!!bool 'yes' # bool -!!int '3...' # number -!!float '3.14...' # number -!!binary '...base64...' # buffer -!!timestamp 'YYYY-...' # date -!!omap [ ... ] # array of key-value pairs -!!pairs [ ... ] # array or array pairs -!!set { ... } # array of objects with given keys and null values -!!str '...' # string -!!seq [ ... ] # array -!!map { ... } # object -``` - -**JavaScript-specific tags** - -``` -!!js/regexp /pattern/gim # RegExp -!!js/undefined '' # Undefined -!!js/function 'function () {...}' # Function -``` - -Caveats -------- - -Note, that you use arrays or objects as key in JS-YAML. JS does not allow objects -or array as keys, and stringifies (by calling .toString method) them at the -moment of adding them. - -``` yaml ---- -? [ foo, bar ] -: - baz -? { foo: bar } -: - baz - - baz -``` - -``` javascript -{ "foo,bar": ["baz"], "[object Object]": ["baz", "baz"] } -``` - -Also, reading of properties on implicit block mapping keys is not supported yet. -So, the following YAML document cannot be loaded. - -``` yaml -&anchor foo: - foo: bar - *anchor: duplicate key - baz: bat - *anchor: duplicate key -``` - - -Breaking changes in 2.x.x -> 3.x.x ----------------------------------- - -If you have not used __custom__ tags or loader classes and not loaded yaml -files via `require()` - no changes needed. Just upgrade library. - -Otherwise, you should: - -1. Replace all occurences of `require('xxxx.yml')` by `fs.readFileSync()` + - `yaml.safeLoad()`. -2. rewrite your custom tags constructors and custom loader - classes, to conform new API. See - [examples](https://github.com/nodeca/js-yaml/tree/master/examples) and - [wiki](https://github.com/nodeca/js-yaml/wiki) for details. - - -License -------- - -View the [LICENSE](https://github.com/nodeca/js-yaml/blob/master/LICENSE) file -(MIT). diff --git a/node_modules/eslint/node_modules/js-yaml/bin/js-yaml.js b/node_modules/eslint/node_modules/js-yaml/bin/js-yaml.js deleted file mode 100755 index e6029d6..0000000 --- a/node_modules/eslint/node_modules/js-yaml/bin/js-yaml.js +++ /dev/null @@ -1,142 +0,0 @@ -#!/usr/bin/env node - - -'use strict'; - -/*eslint-disable no-console*/ - - -// stdlib -var fs = require('fs'); - - -// 3rd-party -var argparse = require('argparse'); - - -// internal -var yaml = require('..'); - - -//////////////////////////////////////////////////////////////////////////////// - - -var cli = new argparse.ArgumentParser({ - prog: 'js-yaml', - version: require('../package.json').version, - addHelp: true -}); - - -cli.addArgument([ '-c', '--compact' ], { - help: 'Display errors in compact mode', - action: 'storeTrue' -}); - - -// deprecated (not needed after we removed output colors) -// option suppressed, but not completely removed for compatibility -cli.addArgument([ '-j', '--to-json' ], { - help: argparse.Const.SUPPRESS, - dest: 'json', - action: 'storeTrue' -}); - - -cli.addArgument([ '-t', '--trace' ], { - help: 'Show stack trace on error', - action: 'storeTrue' -}); - -cli.addArgument([ 'file' ], { - help: 'File to read, utf-8 encoded without BOM', - nargs: '?', - defaultValue: '-' -}); - - -//////////////////////////////////////////////////////////////////////////////// - - -var options = cli.parseArgs(); - - -//////////////////////////////////////////////////////////////////////////////// - -function readFile(filename, encoding, callback) { - if (options.file === '-') { - // read from stdin - - var chunks = []; - - process.stdin.on('data', function (chunk) { - chunks.push(chunk); - }); - - process.stdin.on('end', function () { - return callback(null, Buffer.concat(chunks).toString(encoding)); - }); - } else { - fs.readFile(filename, encoding, callback); - } -} - -readFile(options.file, 'utf8', function (error, input) { - var output, isYaml; - - if (error) { - if (error.code === 'ENOENT') { - console.error('File not found: ' + options.file); - process.exit(2); - } - - console.error( - options.trace && error.stack || - error.message || - String(error)); - - process.exit(1); - } - - try { - output = JSON.parse(input); - isYaml = false; - } catch (error) { - if (error instanceof SyntaxError) { - try { - output = []; - yaml.loadAll(input, function (doc) { output.push(doc); }, {}); - isYaml = true; - - if (0 === output.length) { - output = null; - } else if (1 === output.length) { - output = output[0]; - } - } catch (error) { - if (options.trace && error.stack) { - console.error(error.stack); - } else { - console.error(error.toString(options.compact)); - } - - process.exit(1); - } - } else { - console.error( - options.trace && error.stack || - error.message || - String(error)); - - process.exit(1); - } - } - - if (isYaml) { - console.log(JSON.stringify(output, null, ' ')); - } else { - console.log(yaml.dump(output)); - } - - process.exit(0); -}); diff --git a/node_modules/eslint/node_modules/js-yaml/dist/js-yaml.js b/node_modules/eslint/node_modules/js-yaml/dist/js-yaml.js deleted file mode 100644 index 366e6df..0000000 --- a/node_modules/eslint/node_modules/js-yaml/dist/js-yaml.js +++ /dev/null @@ -1,4694 +0,0 @@ -/* js-yaml 3.4.5 https://github.com/nodeca/js-yaml */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.jsyaml = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o */ -var CHAR_QUESTION = 0x3F; /* ? */ -var CHAR_COMMERCIAL_AT = 0x40; /* @ */ -var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ -var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ -var CHAR_GRAVE_ACCENT = 0x60; /* ` */ -var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ -var CHAR_VERTICAL_LINE = 0x7C; /* | */ -var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ - -var ESCAPE_SEQUENCES = {}; - -ESCAPE_SEQUENCES[0x00] = '\\0'; -ESCAPE_SEQUENCES[0x07] = '\\a'; -ESCAPE_SEQUENCES[0x08] = '\\b'; -ESCAPE_SEQUENCES[0x09] = '\\t'; -ESCAPE_SEQUENCES[0x0A] = '\\n'; -ESCAPE_SEQUENCES[0x0B] = '\\v'; -ESCAPE_SEQUENCES[0x0C] = '\\f'; -ESCAPE_SEQUENCES[0x0D] = '\\r'; -ESCAPE_SEQUENCES[0x1B] = '\\e'; -ESCAPE_SEQUENCES[0x22] = '\\"'; -ESCAPE_SEQUENCES[0x5C] = '\\\\'; -ESCAPE_SEQUENCES[0x85] = '\\N'; -ESCAPE_SEQUENCES[0xA0] = '\\_'; -ESCAPE_SEQUENCES[0x2028] = '\\L'; -ESCAPE_SEQUENCES[0x2029] = '\\P'; - -var DEPRECATED_BOOLEANS_SYNTAX = [ - 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', - 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' -]; - -function compileStyleMap(schema, map) { - var result, keys, index, length, tag, style, type; - - if (null === map) { - return {}; - } - - result = {}; - keys = Object.keys(map); - - for (index = 0, length = keys.length; index < length; index += 1) { - tag = keys[index]; - style = String(map[tag]); - - if ('!!' === tag.slice(0, 2)) { - tag = 'tag:yaml.org,2002:' + tag.slice(2); - } - - type = schema.compiledTypeMap[tag]; - - if (type && _hasOwnProperty.call(type.styleAliases, style)) { - style = type.styleAliases[style]; - } - - result[tag] = style; - } - - return result; -} - -function encodeHex(character) { - var string, handle, length; - - string = character.toString(16).toUpperCase(); - - if (character <= 0xFF) { - handle = 'x'; - length = 2; - } else if (character <= 0xFFFF) { - handle = 'u'; - length = 4; - } else if (character <= 0xFFFFFFFF) { - handle = 'U'; - length = 8; - } else { - throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); - } - - return '\\' + handle + common.repeat('0', length - string.length) + string; -} - -function State(options) { - this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; - this.indent = Math.max(1, (options['indent'] || 2)); - this.skipInvalid = options['skipInvalid'] || false; - this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); - this.styleMap = compileStyleMap(this.schema, options['styles'] || null); - this.sortKeys = options['sortKeys'] || false; - this.lineWidth = options['lineWidth'] || 80; - - this.implicitTypes = this.schema.compiledImplicit; - this.explicitTypes = this.schema.compiledExplicit; - - this.tag = null; - this.result = ''; - - this.duplicates = []; - this.usedDuplicates = null; -} - -function indentString(string, spaces) { - var ind = common.repeat(' ', spaces), - position = 0, - next = -1, - result = '', - line, - length = string.length; - - while (position < length) { - next = string.indexOf('\n', position); - if (next === -1) { - line = string.slice(position); - position = length; - } else { - line = string.slice(position, next + 1); - position = next + 1; - } - if (line.length && line !== '\n') { - result += ind; - } - result += line; - } - - return result; -} - -function generateNextLine(state, level) { - return '\n' + common.repeat(' ', state.indent * level); -} - -function testImplicitResolving(state, str) { - var index, length, type; - - for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { - type = state.implicitTypes[index]; - - if (type.resolve(str)) { - return true; - } - } - - return false; -} - -function StringBuilder(source) { - this.source = source; - this.result = ''; - this.checkpoint = 0; -} - -StringBuilder.prototype.takeUpTo = function (position) { - var er; - - if (position < this.checkpoint) { - er = new Error('position should be > checkpoint'); - er.position = position; - er.checkpoint = this.checkpoint; - throw er; - } - - this.result += this.source.slice(this.checkpoint, position); - this.checkpoint = position; - return this; -}; - -StringBuilder.prototype.escapeChar = function () { - var character, esc; - - character = this.source.charCodeAt(this.checkpoint); - esc = ESCAPE_SEQUENCES[character] || encodeHex(character); - this.result += esc; - this.checkpoint += 1; - - return this; -}; - -StringBuilder.prototype.finish = function () { - if (this.source.length > this.checkpoint) { - this.takeUpTo(this.source.length); - } -}; - -function writeScalar(state, object, level, iskey) { - var simple, first, spaceWrap, folded, literal, single, double, - sawLineFeed, linePosition, longestLine, indent, max, character, - position, escapeSeq, hexEsc, previous, lineLength, modifier, - trailingLineBreaks, result; - - if (0 === object.length) { - state.dump = "''"; - return; - } - - if (-1 !== DEPRECATED_BOOLEANS_SYNTAX.indexOf(object)) { - state.dump = "'" + object + "'"; - return; - } - - simple = true; - first = object.length ? object.charCodeAt(0) : 0; - spaceWrap = (CHAR_SPACE === first || - CHAR_SPACE === object.charCodeAt(object.length - 1)); - - // Simplified check for restricted first characters - // http://www.yaml.org/spec/1.2/spec.html#ns-plain-first%28c%29 - if (CHAR_MINUS === first || - CHAR_QUESTION === first || - CHAR_COMMERCIAL_AT === first || - CHAR_GRAVE_ACCENT === first) { - simple = false; - } - - // can only use > and | if not wrapped in spaces or is not a key. - if (spaceWrap) { - simple = false; - folded = false; - literal = false; - } else { - folded = !iskey; - literal = !iskey; - } - - single = true; - double = new StringBuilder(object); - - sawLineFeed = false; - linePosition = 0; - longestLine = 0; - - indent = state.indent * level; - max = state.lineWidth; - if (max === -1) { - // Replace -1 with biggest ingeger number according to - // http://ecma262-5.com/ELS5_HTML.htm#Section_8.5 - max = 9007199254740991; - } - - if (indent < 40) { - max -= indent; - } else { - max = 40; - } - - for (position = 0; position < object.length; position++) { - character = object.charCodeAt(position); - if (simple) { - // Characters that can never appear in the simple scalar - if (!simpleChar(character)) { - simple = false; - } else { - // Still simple. If we make it all the way through like - // this, then we can just dump the string as-is. - continue; - } - } - - if (single && character === CHAR_SINGLE_QUOTE) { - single = false; - } - - escapeSeq = ESCAPE_SEQUENCES[character]; - hexEsc = needsHexEscape(character); - - if (!escapeSeq && !hexEsc) { - continue; - } - - if (character !== CHAR_LINE_FEED && - character !== CHAR_DOUBLE_QUOTE && - character !== CHAR_SINGLE_QUOTE) { - folded = false; - literal = false; - } else if (character === CHAR_LINE_FEED) { - sawLineFeed = true; - single = false; - if (position > 0) { - previous = object.charCodeAt(position - 1); - if (previous === CHAR_SPACE) { - literal = false; - folded = false; - } - } - if (folded) { - lineLength = position - linePosition; - linePosition = position; - if (lineLength > longestLine) { - longestLine = lineLength; - } - } - } - - if (character !== CHAR_DOUBLE_QUOTE) { - single = false; - } - - double.takeUpTo(position); - double.escapeChar(); - } - - if (simple && testImplicitResolving(state, object)) { - simple = false; - } - - modifier = ''; - if (folded || literal) { - trailingLineBreaks = 0; - if (object.charCodeAt(object.length - 1) === CHAR_LINE_FEED) { - trailingLineBreaks += 1; - if (object.charCodeAt(object.length - 2) === CHAR_LINE_FEED) { - trailingLineBreaks += 1; - } - } - - if (trailingLineBreaks === 0) { - modifier = '-'; - } else if (trailingLineBreaks === 2) { - modifier = '+'; - } - } - - if (literal && longestLine < max) { - folded = false; - } - - // If it's literally one line, then don't bother with the literal. - // We may still want to do a fold, though, if it's a super long line. - if (!sawLineFeed) { - literal = false; - } - - if (simple) { - state.dump = object; - } else if (single) { - state.dump = '\'' + object + '\''; - } else if (folded) { - result = fold(object, max); - state.dump = '>' + modifier + '\n' + indentString(result, indent); - } else if (literal) { - if (!modifier) { - object = object.replace(/\n$/, ''); - } - state.dump = '|' + modifier + '\n' + indentString(object, indent); - } else if (double) { - double.finish(); - state.dump = '"' + double.result + '"'; - } else { - throw new Error('Failed to dump scalar value'); - } - - return; -} - -// The `trailing` var is a regexp match of any trailing `\n` characters. -// -// There are three cases we care about: -// -// 1. One trailing `\n` on the string. Just use `|` or `>`. -// This is the assumed default. (trailing = null) -// 2. No trailing `\n` on the string. Use `|-` or `>-` to "chomp" the end. -// 3. More than one trailing `\n` on the string. Use `|+` or `>+`. -// -// In the case of `>+`, these line breaks are *not* doubled (like the line -// breaks within the string), so it's important to only end with the exact -// same number as we started. -function fold(object, max) { - var result = '', - position = 0, - length = object.length, - trailing = /\n+$/.exec(object), - newLine; - - if (trailing) { - length = trailing.index + 1; - } - - while (position < length) { - newLine = object.indexOf('\n', position); - if (newLine > length || newLine === -1) { - if (result) { - result += '\n\n'; - } - result += foldLine(object.slice(position, length), max); - position = length; - } else { - if (result) { - result += '\n\n'; - } - result += foldLine(object.slice(position, newLine), max); - position = newLine + 1; - } - } - if (trailing && trailing[0] !== '\n') { - result += trailing[0]; - } - - return result; -} - -function foldLine(line, max) { - if (line === '') { - return line; - } - - var foldRe = /[^\s] [^\s]/g, - result = '', - prevMatch = 0, - foldStart = 0, - match = foldRe.exec(line), - index, - foldEnd, - folded; - - while (match) { - index = match.index; - - // when we cross the max len, if the previous match would've - // been ok, use that one, and carry on. If there was no previous - // match on this fold section, then just have a long line. - if (index - foldStart > max) { - if (prevMatch !== foldStart) { - foldEnd = prevMatch; - } else { - foldEnd = index; - } - - if (result) { - result += '\n'; - } - folded = line.slice(foldStart, foldEnd); - result += folded; - foldStart = foldEnd + 1; - } - prevMatch = index + 1; - match = foldRe.exec(line); - } - - if (result) { - result += '\n'; - } - - // if we end up with one last word at the end, then the last bit might - // be slightly bigger than we wanted, because we exited out of the loop. - if (foldStart !== prevMatch && line.length - foldStart > max) { - result += line.slice(foldStart, prevMatch) + '\n' + - line.slice(prevMatch + 1); - } else { - result += line.slice(foldStart); - } - - return result; -} - -// Returns true if character can be found in a simple scalar -function simpleChar(character) { - return CHAR_TAB !== character && - CHAR_LINE_FEED !== character && - CHAR_CARRIAGE_RETURN !== character && - CHAR_COMMA !== character && - CHAR_LEFT_SQUARE_BRACKET !== character && - CHAR_RIGHT_SQUARE_BRACKET !== character && - CHAR_LEFT_CURLY_BRACKET !== character && - CHAR_RIGHT_CURLY_BRACKET !== character && - CHAR_SHARP !== character && - CHAR_AMPERSAND !== character && - CHAR_ASTERISK !== character && - CHAR_EXCLAMATION !== character && - CHAR_VERTICAL_LINE !== character && - CHAR_GREATER_THAN !== character && - CHAR_SINGLE_QUOTE !== character && - CHAR_DOUBLE_QUOTE !== character && - CHAR_PERCENT !== character && - CHAR_COLON !== character && - !ESCAPE_SEQUENCES[character] && - !needsHexEscape(character); -} - -// Returns true if the character code needs to be escaped. -function needsHexEscape(character) { - return !((0x00020 <= character && character <= 0x00007E) || - (0x00085 === character) || - (0x000A0 <= character && character <= 0x00D7FF) || - (0x0E000 <= character && character <= 0x00FFFD) || - (0x10000 <= character && character <= 0x10FFFF)); -} - -function writeFlowSequence(state, level, object) { - var _result = '', - _tag = state.tag, - index, - length; - - for (index = 0, length = object.length; index < length; index += 1) { - // Write only valid elements. - if (writeNode(state, level, object[index], false, false)) { - if (0 !== index) { - _result += ', '; - } - _result += state.dump; - } - } - - state.tag = _tag; - state.dump = '[' + _result + ']'; -} - -function writeBlockSequence(state, level, object, compact) { - var _result = '', - _tag = state.tag, - index, - length; - - for (index = 0, length = object.length; index < length; index += 1) { - // Write only valid elements. - if (writeNode(state, level + 1, object[index], true, true)) { - if (!compact || 0 !== index) { - _result += generateNextLine(state, level); - } - _result += '- ' + state.dump; - } - } - - state.tag = _tag; - state.dump = _result || '[]'; // Empty sequence if no valid values. -} - -function writeFlowMapping(state, level, object) { - var _result = '', - _tag = state.tag, - objectKeyList = Object.keys(object), - index, - length, - objectKey, - objectValue, - pairBuffer; - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - pairBuffer = ''; - - if (0 !== index) { - pairBuffer += ', '; - } - - objectKey = objectKeyList[index]; - objectValue = object[objectKey]; - - if (!writeNode(state, level, objectKey, false, false)) { - continue; // Skip this pair because of invalid key; - } - - if (state.dump.length > 1024) { - pairBuffer += '? '; - } - - pairBuffer += state.dump + ': '; - - if (!writeNode(state, level, objectValue, false, false)) { - continue; // Skip this pair because of invalid value. - } - - pairBuffer += state.dump; - - // Both key and value are valid. - _result += pairBuffer; - } - - state.tag = _tag; - state.dump = '{' + _result + '}'; -} - -function writeBlockMapping(state, level, object, compact) { - var _result = '', - _tag = state.tag, - objectKeyList = Object.keys(object), - index, - length, - objectKey, - objectValue, - explicitPair, - pairBuffer; - - // Allow sorting keys so that the output file is deterministic - if (state.sortKeys === true) { - // Default sorting - objectKeyList.sort(); - } else if (typeof state.sortKeys === 'function') { - // Custom sort function - objectKeyList.sort(state.sortKeys); - } else if (state.sortKeys) { - // Something is wrong - throw new YAMLException('sortKeys must be a boolean or a function'); - } - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - pairBuffer = ''; - - if (!compact || 0 !== index) { - pairBuffer += generateNextLine(state, level); - } - - objectKey = objectKeyList[index]; - objectValue = object[objectKey]; - - if (!writeNode(state, level + 1, objectKey, true, true, true)) { - continue; // Skip this pair because of invalid key. - } - - explicitPair = (null !== state.tag && '?' !== state.tag) || - (state.dump && state.dump.length > 1024); - - if (explicitPair) { - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { - pairBuffer += '?'; - } else { - pairBuffer += '? '; - } - } - - pairBuffer += state.dump; - - if (explicitPair) { - pairBuffer += generateNextLine(state, level); - } - - if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { - continue; // Skip this pair because of invalid value. - } - - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { - pairBuffer += ':'; - } else { - pairBuffer += ': '; - } - - pairBuffer += state.dump; - - // Both key and value are valid. - _result += pairBuffer; - } - - state.tag = _tag; - state.dump = _result || '{}'; // Empty mapping if no valid pairs. -} - -function detectType(state, object, explicit) { - var _result, typeList, index, length, type, style; - - typeList = explicit ? state.explicitTypes : state.implicitTypes; - - for (index = 0, length = typeList.length; index < length; index += 1) { - type = typeList[index]; - - if ((type.instanceOf || type.predicate) && - (!type.instanceOf || (('object' === typeof object) && (object instanceof type.instanceOf))) && - (!type.predicate || type.predicate(object))) { - - state.tag = explicit ? type.tag : '?'; - - if (type.represent) { - style = state.styleMap[type.tag] || type.defaultStyle; - - if ('[object Function]' === _toString.call(type.represent)) { - _result = type.represent(object, style); - } else if (_hasOwnProperty.call(type.represent, style)) { - _result = type.represent[style](object, style); - } else { - throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); - } - - state.dump = _result; - } - - return true; - } - } - - return false; -} - -// Serializes `object` and writes it to global `result`. -// Returns true on success, or false on invalid object. -// -function writeNode(state, level, object, block, compact, iskey) { - state.tag = null; - state.dump = object; - - if (!detectType(state, object, false)) { - detectType(state, object, true); - } - - var type = _toString.call(state.dump); - - if (block) { - block = (0 > state.flowLevel || state.flowLevel > level); - } - - var objectOrArray = '[object Object]' === type || '[object Array]' === type, - duplicateIndex, - duplicate; - - if (objectOrArray) { - duplicateIndex = state.duplicates.indexOf(object); - duplicate = duplicateIndex !== -1; - } - - if ((null !== state.tag && '?' !== state.tag) || duplicate || (2 !== state.indent && level > 0)) { - compact = false; - } - - if (duplicate && state.usedDuplicates[duplicateIndex]) { - state.dump = '*ref_' + duplicateIndex; - } else { - if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { - state.usedDuplicates[duplicateIndex] = true; - } - if ('[object Object]' === type) { - if (block && (0 !== Object.keys(state.dump).length)) { - writeBlockMapping(state, level, state.dump, compact); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + state.dump; - } - } else { - writeFlowMapping(state, level, state.dump); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; - } - } - } else if ('[object Array]' === type) { - if (block && (0 !== state.dump.length)) { - writeBlockSequence(state, level, state.dump, compact); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + state.dump; - } - } else { - writeFlowSequence(state, level, state.dump); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; - } - } - } else if ('[object String]' === type) { - if ('?' !== state.tag) { - writeScalar(state, state.dump, level, iskey); - } - } else { - if (state.skipInvalid) { - return false; - } - throw new YAMLException('unacceptable kind of an object to dump ' + type); - } - - if (null !== state.tag && '?' !== state.tag) { - state.dump = '!<' + state.tag + '> ' + state.dump; - } - } - - return true; -} - -function getDuplicateReferences(object, state) { - var objects = [], - duplicatesIndexes = [], - index, - length; - - inspectNode(object, objects, duplicatesIndexes); - - for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { - state.duplicates.push(objects[duplicatesIndexes[index]]); - } - state.usedDuplicates = new Array(length); -} - -function inspectNode(object, objects, duplicatesIndexes) { - var objectKeyList, - index, - length; - - if (null !== object && 'object' === typeof object) { - index = objects.indexOf(object); - if (-1 !== index) { - if (-1 === duplicatesIndexes.indexOf(index)) { - duplicatesIndexes.push(index); - } - } else { - objects.push(object); - - if (Array.isArray(object)) { - for (index = 0, length = object.length; index < length; index += 1) { - inspectNode(object[index], objects, duplicatesIndexes); - } - } else { - objectKeyList = Object.keys(object); - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); - } - } - } - } -} - -function dump(input, options) { - options = options || {}; - - var state = new State(options); - - getDuplicateReferences(input, state); - - if (writeNode(state, 0, input, true, true)) { - return state.dump + '\n'; - } - return ''; -} - -function safeDump(input, options) { - return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); -} - -module.exports.dump = dump; -module.exports.safeDump = safeDump; - -},{"./common":2,"./exception":4,"./schema/default_full":9,"./schema/default_safe":10}],4:[function(require,module,exports){ -// YAML error class. http://stackoverflow.com/questions/8458984 -// -'use strict'; - - -var inherits = require('util').inherits; - - -function YAMLException(reason, mark) { - // Super constructor - Error.call(this); - - // Include stack trace in error object - if (Error.captureStackTrace) { - // Chrome and NodeJS - Error.captureStackTrace(this, this.constructor); - } else { - // FF, IE 10+ and Safari 6+. Fallback for others - this.stack = (new Error()).stack || ''; - } - - this.name = 'YAMLException'; - this.reason = reason; - this.mark = mark; - this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); -} - - -// Inherit from Error -inherits(YAMLException, Error); - - -YAMLException.prototype.toString = function toString(compact) { - var result = this.name + ': '; - - result += this.reason || '(unknown reason)'; - - if (!compact && this.mark) { - result += ' ' + this.mark.toString(); - } - - return result; -}; - - -module.exports = YAMLException; - -},{"util":34}],5:[function(require,module,exports){ -'use strict'; - -/*eslint-disable max-len,no-use-before-define*/ - -var common = require('./common'); -var YAMLException = require('./exception'); -var Mark = require('./mark'); -var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe'); -var DEFAULT_FULL_SCHEMA = require('./schema/default_full'); - - -var _hasOwnProperty = Object.prototype.hasOwnProperty; - - -var CONTEXT_FLOW_IN = 1; -var CONTEXT_FLOW_OUT = 2; -var CONTEXT_BLOCK_IN = 3; -var CONTEXT_BLOCK_OUT = 4; - - -var CHOMPING_CLIP = 1; -var CHOMPING_STRIP = 2; -var CHOMPING_KEEP = 3; - - -var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; -var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; -var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; -var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; -var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; - - -function is_EOL(c) { - return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); -} - -function is_WHITE_SPACE(c) { - return (c === 0x09/* Tab */) || (c === 0x20/* Space */); -} - -function is_WS_OR_EOL(c) { - return (c === 0x09/* Tab */) || - (c === 0x20/* Space */) || - (c === 0x0A/* LF */) || - (c === 0x0D/* CR */); -} - -function is_FLOW_INDICATOR(c) { - return 0x2C/* , */ === c || - 0x5B/* [ */ === c || - 0x5D/* ] */ === c || - 0x7B/* { */ === c || - 0x7D/* } */ === c; -} - -function fromHexCode(c) { - var lc; - - if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { - return c - 0x30; - } - - /*eslint-disable no-bitwise*/ - lc = c | 0x20; - - if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { - return lc - 0x61 + 10; - } - - return -1; -} - -function escapedHexLen(c) { - if (c === 0x78/* x */) { return 2; } - if (c === 0x75/* u */) { return 4; } - if (c === 0x55/* U */) { return 8; } - return 0; -} - -function fromDecimalCode(c) { - if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { - return c - 0x30; - } - - return -1; -} - -function simpleEscapeSequence(c) { - return (c === 0x30/* 0 */) ? '\x00' : - (c === 0x61/* a */) ? '\x07' : - (c === 0x62/* b */) ? '\x08' : - (c === 0x74/* t */) ? '\x09' : - (c === 0x09/* Tab */) ? '\x09' : - (c === 0x6E/* n */) ? '\x0A' : - (c === 0x76/* v */) ? '\x0B' : - (c === 0x66/* f */) ? '\x0C' : - (c === 0x72/* r */) ? '\x0D' : - (c === 0x65/* e */) ? '\x1B' : - (c === 0x20/* Space */) ? ' ' : - (c === 0x22/* " */) ? '\x22' : - (c === 0x2F/* / */) ? '/' : - (c === 0x5C/* \ */) ? '\x5C' : - (c === 0x4E/* N */) ? '\x85' : - (c === 0x5F/* _ */) ? '\xA0' : - (c === 0x4C/* L */) ? '\u2028' : - (c === 0x50/* P */) ? '\u2029' : ''; -} - -function charFromCodepoint(c) { - if (c <= 0xFFFF) { - return String.fromCharCode(c); - } - // Encode UTF-16 surrogate pair - // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF - return String.fromCharCode(((c - 0x010000) >> 10) + 0xD800, - ((c - 0x010000) & 0x03FF) + 0xDC00); -} - -var simpleEscapeCheck = new Array(256); // integer, for fast access -var simpleEscapeMap = new Array(256); -for (var i = 0; i < 256; i++) { - simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; - simpleEscapeMap[i] = simpleEscapeSequence(i); -} - - -function State(input, options) { - this.input = input; - - this.filename = options['filename'] || null; - this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; - this.onWarning = options['onWarning'] || null; - this.legacy = options['legacy'] || false; - - this.implicitTypes = this.schema.compiledImplicit; - this.typeMap = this.schema.compiledTypeMap; - - this.length = input.length; - this.position = 0; - this.line = 0; - this.lineStart = 0; - this.lineIndent = 0; - - this.documents = []; - - /* - this.version; - this.checkLineBreaks; - this.tagMap; - this.anchorMap; - this.tag; - this.anchor; - this.kind; - this.result;*/ - -} - - -function generateError(state, message) { - return new YAMLException( - message, - new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart))); -} - -function throwError(state, message) { - throw generateError(state, message); -} - -function throwWarning(state, message) { - if (state.onWarning) { - state.onWarning.call(null, generateError(state, message)); - } -} - - -var directiveHandlers = { - - YAML: function handleYamlDirective(state, name, args) { - - var match, major, minor; - - if (null !== state.version) { - throwError(state, 'duplication of %YAML directive'); - } - - if (1 !== args.length) { - throwError(state, 'YAML directive accepts exactly one argument'); - } - - match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); - - if (null === match) { - throwError(state, 'ill-formed argument of the YAML directive'); - } - - major = parseInt(match[1], 10); - minor = parseInt(match[2], 10); - - if (1 !== major) { - throwError(state, 'unacceptable YAML version of the document'); - } - - state.version = args[0]; - state.checkLineBreaks = (minor < 2); - - if (1 !== minor && 2 !== minor) { - throwWarning(state, 'unsupported YAML version of the document'); - } - }, - - TAG: function handleTagDirective(state, name, args) { - - var handle, prefix; - - if (2 !== args.length) { - throwError(state, 'TAG directive accepts exactly two arguments'); - } - - handle = args[0]; - prefix = args[1]; - - if (!PATTERN_TAG_HANDLE.test(handle)) { - throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); - } - - if (_hasOwnProperty.call(state.tagMap, handle)) { - throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); - } - - if (!PATTERN_TAG_URI.test(prefix)) { - throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); - } - - state.tagMap[handle] = prefix; - } -}; - - -function captureSegment(state, start, end, checkJson) { - var _position, _length, _character, _result; - - if (start < end) { - _result = state.input.slice(start, end); - - if (checkJson) { - for (_position = 0, _length = _result.length; - _position < _length; - _position += 1) { - _character = _result.charCodeAt(_position); - if (!(0x09 === _character || - 0x20 <= _character && _character <= 0x10FFFF)) { - throwError(state, 'expected valid JSON character'); - } - } - } else if (PATTERN_NON_PRINTABLE.test(_result)) { - throwError(state, 'the stream contains non-printable characters'); - } - - state.result += _result; - } -} - -function mergeMappings(state, destination, source) { - var sourceKeys, key, index, quantity; - - if (!common.isObject(source)) { - throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); - } - - sourceKeys = Object.keys(source); - - for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { - key = sourceKeys[index]; - - if (!_hasOwnProperty.call(destination, key)) { - destination[key] = source[key]; - } - } -} - -function storeMappingPair(state, _result, keyTag, keyNode, valueNode) { - var index, quantity; - - keyNode = String(keyNode); - - if (null === _result) { - _result = {}; - } - - if ('tag:yaml.org,2002:merge' === keyTag) { - if (Array.isArray(valueNode)) { - for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { - mergeMappings(state, _result, valueNode[index]); - } - } else { - mergeMappings(state, _result, valueNode); - } - } else { - _result[keyNode] = valueNode; - } - - return _result; -} - -function readLineBreak(state) { - var ch; - - ch = state.input.charCodeAt(state.position); - - if (0x0A/* LF */ === ch) { - state.position++; - } else if (0x0D/* CR */ === ch) { - state.position++; - if (0x0A/* LF */ === state.input.charCodeAt(state.position)) { - state.position++; - } - } else { - throwError(state, 'a line break is expected'); - } - - state.line += 1; - state.lineStart = state.position; -} - -function skipSeparationSpace(state, allowComments, checkIndent) { - var lineBreaks = 0, - ch = state.input.charCodeAt(state.position); - - while (0 !== ch) { - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (allowComments && 0x23/* # */ === ch) { - do { - ch = state.input.charCodeAt(++state.position); - } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && 0 !== ch); - } - - if (is_EOL(ch)) { - readLineBreak(state); - - ch = state.input.charCodeAt(state.position); - lineBreaks++; - state.lineIndent = 0; - - while (0x20/* Space */ === ch) { - state.lineIndent++; - ch = state.input.charCodeAt(++state.position); - } - } else { - break; - } - } - - if (-1 !== checkIndent && 0 !== lineBreaks && state.lineIndent < checkIndent) { - throwWarning(state, 'deficient indentation'); - } - - return lineBreaks; -} - -function testDocumentSeparator(state) { - var _position = state.position, - ch; - - ch = state.input.charCodeAt(_position); - - // Condition state.position === state.lineStart is tested - // in parent on each call, for efficiency. No needs to test here again. - if ((0x2D/* - */ === ch || 0x2E/* . */ === ch) && - state.input.charCodeAt(_position + 1) === ch && - state.input.charCodeAt(_position + 2) === ch) { - - _position += 3; - - ch = state.input.charCodeAt(_position); - - if (ch === 0 || is_WS_OR_EOL(ch)) { - return true; - } - } - - return false; -} - -function writeFoldedLines(state, count) { - if (1 === count) { - state.result += ' '; - } else if (count > 1) { - state.result += common.repeat('\n', count - 1); - } -} - - -function readPlainScalar(state, nodeIndent, withinFlowCollection) { - var preceding, - following, - captureStart, - captureEnd, - hasPendingContent, - _line, - _lineStart, - _lineIndent, - _kind = state.kind, - _result = state.result, - ch; - - ch = state.input.charCodeAt(state.position); - - if (is_WS_OR_EOL(ch) || - is_FLOW_INDICATOR(ch) || - 0x23/* # */ === ch || - 0x26/* & */ === ch || - 0x2A/* * */ === ch || - 0x21/* ! */ === ch || - 0x7C/* | */ === ch || - 0x3E/* > */ === ch || - 0x27/* ' */ === ch || - 0x22/* " */ === ch || - 0x25/* % */ === ch || - 0x40/* @ */ === ch || - 0x60/* ` */ === ch) { - return false; - } - - if (0x3F/* ? */ === ch || 0x2D/* - */ === ch) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following) || - withinFlowCollection && is_FLOW_INDICATOR(following)) { - return false; - } - } - - state.kind = 'scalar'; - state.result = ''; - captureStart = captureEnd = state.position; - hasPendingContent = false; - - while (0 !== ch) { - if (0x3A/* : */ === ch) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following) || - withinFlowCollection && is_FLOW_INDICATOR(following)) { - break; - } - - } else if (0x23/* # */ === ch) { - preceding = state.input.charCodeAt(state.position - 1); - - if (is_WS_OR_EOL(preceding)) { - break; - } - - } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || - withinFlowCollection && is_FLOW_INDICATOR(ch)) { - break; - - } else if (is_EOL(ch)) { - _line = state.line; - _lineStart = state.lineStart; - _lineIndent = state.lineIndent; - skipSeparationSpace(state, false, -1); - - if (state.lineIndent >= nodeIndent) { - hasPendingContent = true; - ch = state.input.charCodeAt(state.position); - continue; - } else { - state.position = captureEnd; - state.line = _line; - state.lineStart = _lineStart; - state.lineIndent = _lineIndent; - break; - } - } - - if (hasPendingContent) { - captureSegment(state, captureStart, captureEnd, false); - writeFoldedLines(state, state.line - _line); - captureStart = captureEnd = state.position; - hasPendingContent = false; - } - - if (!is_WHITE_SPACE(ch)) { - captureEnd = state.position + 1; - } - - ch = state.input.charCodeAt(++state.position); - } - - captureSegment(state, captureStart, captureEnd, false); - - if (state.result) { - return true; - } - - state.kind = _kind; - state.result = _result; - return false; -} - -function readSingleQuotedScalar(state, nodeIndent) { - var ch, - captureStart, captureEnd; - - ch = state.input.charCodeAt(state.position); - - if (0x27/* ' */ !== ch) { - return false; - } - - state.kind = 'scalar'; - state.result = ''; - state.position++; - captureStart = captureEnd = state.position; - - while (0 !== (ch = state.input.charCodeAt(state.position))) { - if (0x27/* ' */ === ch) { - captureSegment(state, captureStart, state.position, true); - ch = state.input.charCodeAt(++state.position); - - if (0x27/* ' */ === ch) { - captureStart = captureEnd = state.position; - state.position++; - } else { - return true; - } - - } else if (is_EOL(ch)) { - captureSegment(state, captureStart, captureEnd, true); - writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); - captureStart = captureEnd = state.position; - - } else if (state.position === state.lineStart && testDocumentSeparator(state)) { - throwError(state, 'unexpected end of the document within a single quoted scalar'); - - } else { - state.position++; - captureEnd = state.position; - } - } - - throwError(state, 'unexpected end of the stream within a single quoted scalar'); -} - -function readDoubleQuotedScalar(state, nodeIndent) { - var captureStart, - captureEnd, - hexLength, - hexResult, - tmp, - ch; - - ch = state.input.charCodeAt(state.position); - - if (0x22/* " */ !== ch) { - return false; - } - - state.kind = 'scalar'; - state.result = ''; - state.position++; - captureStart = captureEnd = state.position; - - while (0 !== (ch = state.input.charCodeAt(state.position))) { - if (0x22/* " */ === ch) { - captureSegment(state, captureStart, state.position, true); - state.position++; - return true; - - } else if (0x5C/* \ */ === ch) { - captureSegment(state, captureStart, state.position, true); - ch = state.input.charCodeAt(++state.position); - - if (is_EOL(ch)) { - skipSeparationSpace(state, false, nodeIndent); - - // TODO: rework to inline fn with no type cast? - } else if (ch < 256 && simpleEscapeCheck[ch]) { - state.result += simpleEscapeMap[ch]; - state.position++; - - } else if ((tmp = escapedHexLen(ch)) > 0) { - hexLength = tmp; - hexResult = 0; - - for (; hexLength > 0; hexLength--) { - ch = state.input.charCodeAt(++state.position); - - if ((tmp = fromHexCode(ch)) >= 0) { - hexResult = (hexResult << 4) + tmp; - - } else { - throwError(state, 'expected hexadecimal character'); - } - } - - state.result += charFromCodepoint(hexResult); - - state.position++; - - } else { - throwError(state, 'unknown escape sequence'); - } - - captureStart = captureEnd = state.position; - - } else if (is_EOL(ch)) { - captureSegment(state, captureStart, captureEnd, true); - writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); - captureStart = captureEnd = state.position; - - } else if (state.position === state.lineStart && testDocumentSeparator(state)) { - throwError(state, 'unexpected end of the document within a double quoted scalar'); - - } else { - state.position++; - captureEnd = state.position; - } - } - - throwError(state, 'unexpected end of the stream within a double quoted scalar'); -} - -function readFlowCollection(state, nodeIndent) { - var readNext = true, - _line, - _tag = state.tag, - _result, - _anchor = state.anchor, - following, - terminator, - isPair, - isExplicitPair, - isMapping, - keyNode, - keyTag, - valueNode, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x5B/* [ */) { - terminator = 0x5D;/* ] */ - isMapping = false; - _result = []; - } else if (ch === 0x7B/* { */) { - terminator = 0x7D;/* } */ - isMapping = true; - _result = {}; - } else { - return false; - } - - if (null !== state.anchor) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(++state.position); - - while (0 !== ch) { - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if (ch === terminator) { - state.position++; - state.tag = _tag; - state.anchor = _anchor; - state.kind = isMapping ? 'mapping' : 'sequence'; - state.result = _result; - return true; - } else if (!readNext) { - throwError(state, 'missed comma between flow collection entries'); - } - - keyTag = keyNode = valueNode = null; - isPair = isExplicitPair = false; - - if (0x3F/* ? */ === ch) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following)) { - isPair = isExplicitPair = true; - state.position++; - skipSeparationSpace(state, true, nodeIndent); - } - } - - _line = state.line; - composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - keyTag = state.tag; - keyNode = state.result; - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if ((isExplicitPair || state.line === _line) && 0x3A/* : */ === ch) { - isPair = true; - ch = state.input.charCodeAt(++state.position); - skipSeparationSpace(state, true, nodeIndent); - composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - valueNode = state.result; - } - - if (isMapping) { - storeMappingPair(state, _result, keyTag, keyNode, valueNode); - } else if (isPair) { - _result.push(storeMappingPair(state, null, keyTag, keyNode, valueNode)); - } else { - _result.push(keyNode); - } - - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if (0x2C/* , */ === ch) { - readNext = true; - ch = state.input.charCodeAt(++state.position); - } else { - readNext = false; - } - } - - throwError(state, 'unexpected end of the stream within a flow collection'); -} - -function readBlockScalar(state, nodeIndent) { - var captureStart, - folding, - chomping = CHOMPING_CLIP, - detectedIndent = false, - textIndent = nodeIndent, - emptyLines = 0, - atMoreIndented = false, - tmp, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x7C/* | */) { - folding = false; - } else if (ch === 0x3E/* > */) { - folding = true; - } else { - return false; - } - - state.kind = 'scalar'; - state.result = ''; - - while (0 !== ch) { - ch = state.input.charCodeAt(++state.position); - - if (0x2B/* + */ === ch || 0x2D/* - */ === ch) { - if (CHOMPING_CLIP === chomping) { - chomping = (0x2B/* + */ === ch) ? CHOMPING_KEEP : CHOMPING_STRIP; - } else { - throwError(state, 'repeat of a chomping mode identifier'); - } - - } else if ((tmp = fromDecimalCode(ch)) >= 0) { - if (tmp === 0) { - throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); - } else if (!detectedIndent) { - textIndent = nodeIndent + tmp - 1; - detectedIndent = true; - } else { - throwError(state, 'repeat of an indentation width identifier'); - } - - } else { - break; - } - } - - if (is_WHITE_SPACE(ch)) { - do { ch = state.input.charCodeAt(++state.position); } - while (is_WHITE_SPACE(ch)); - - if (0x23/* # */ === ch) { - do { ch = state.input.charCodeAt(++state.position); } - while (!is_EOL(ch) && (0 !== ch)); - } - } - - while (0 !== ch) { - readLineBreak(state); - state.lineIndent = 0; - - ch = state.input.charCodeAt(state.position); - - while ((!detectedIndent || state.lineIndent < textIndent) && - (0x20/* Space */ === ch)) { - state.lineIndent++; - ch = state.input.charCodeAt(++state.position); - } - - if (!detectedIndent && state.lineIndent > textIndent) { - textIndent = state.lineIndent; - } - - if (is_EOL(ch)) { - emptyLines++; - continue; - } - - // End of the scalar. - if (state.lineIndent < textIndent) { - - // Perform the chomping. - if (chomping === CHOMPING_KEEP) { - state.result += common.repeat('\n', emptyLines); - } else if (chomping === CHOMPING_CLIP) { - if (detectedIndent) { // i.e. only if the scalar is not empty. - state.result += '\n'; - } - } - - // Break this `while` cycle and go to the funciton's epilogue. - break; - } - - // Folded style: use fancy rules to handle line breaks. - if (folding) { - - // Lines starting with white space characters (more-indented lines) are not folded. - if (is_WHITE_SPACE(ch)) { - atMoreIndented = true; - state.result += common.repeat('\n', emptyLines + 1); - - // End of more-indented block. - } else if (atMoreIndented) { - atMoreIndented = false; - state.result += common.repeat('\n', emptyLines + 1); - - // Just one line break - perceive as the same line. - } else if (0 === emptyLines) { - if (detectedIndent) { // i.e. only if we have already read some scalar content. - state.result += ' '; - } - - // Several line breaks - perceive as different lines. - } else { - state.result += common.repeat('\n', emptyLines); - } - - // Literal style: just add exact number of line breaks between content lines. - } else if (detectedIndent) { - // If current line isn't the first one - count line break from the last content line. - state.result += common.repeat('\n', emptyLines + 1); - } else { - // In case of the first content line - count only empty lines. - state.result += common.repeat('\n', emptyLines); - } - - detectedIndent = true; - emptyLines = 0; - captureStart = state.position; - - while (!is_EOL(ch) && (0 !== ch)) { - ch = state.input.charCodeAt(++state.position); - } - - captureSegment(state, captureStart, state.position, false); - } - - return true; -} - -function readBlockSequence(state, nodeIndent) { - var _line, - _tag = state.tag, - _anchor = state.anchor, - _result = [], - following, - detected = false, - ch; - - if (null !== state.anchor) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(state.position); - - while (0 !== ch) { - - if (0x2D/* - */ !== ch) { - break; - } - - following = state.input.charCodeAt(state.position + 1); - - if (!is_WS_OR_EOL(following)) { - break; - } - - detected = true; - state.position++; - - if (skipSeparationSpace(state, true, -1)) { - if (state.lineIndent <= nodeIndent) { - _result.push(null); - ch = state.input.charCodeAt(state.position); - continue; - } - } - - _line = state.line; - composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); - _result.push(state.result); - skipSeparationSpace(state, true, -1); - - ch = state.input.charCodeAt(state.position); - - if ((state.line === _line || state.lineIndent > nodeIndent) && (0 !== ch)) { - throwError(state, 'bad indentation of a sequence entry'); - } else if (state.lineIndent < nodeIndent) { - break; - } - } - - if (detected) { - state.tag = _tag; - state.anchor = _anchor; - state.kind = 'sequence'; - state.result = _result; - return true; - } - return false; -} - -function readBlockMapping(state, nodeIndent, flowIndent) { - var following, - allowCompact, - _line, - _tag = state.tag, - _anchor = state.anchor, - _result = {}, - keyTag = null, - keyNode = null, - valueNode = null, - atExplicitKey = false, - detected = false, - ch; - - if (null !== state.anchor) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(state.position); - - while (0 !== ch) { - following = state.input.charCodeAt(state.position + 1); - _line = state.line; // Save the current line. - - // - // Explicit notation case. There are two separate blocks: - // first for the key (denoted by "?") and second for the value (denoted by ":") - // - if ((0x3F/* ? */ === ch || 0x3A/* : */ === ch) && is_WS_OR_EOL(following)) { - - if (0x3F/* ? */ === ch) { - if (atExplicitKey) { - storeMappingPair(state, _result, keyTag, keyNode, null); - keyTag = keyNode = valueNode = null; - } - - detected = true; - atExplicitKey = true; - allowCompact = true; - - } else if (atExplicitKey) { - // i.e. 0x3A/* : */ === character after the explicit key. - atExplicitKey = false; - allowCompact = true; - - } else { - throwError(state, 'incomplete explicit mapping pair; a key node is missed'); - } - - state.position += 1; - ch = following; - - // - // Implicit notation case. Flow-style node as the key first, then ":", and the value. - // - } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { - - if (state.line === _line) { - ch = state.input.charCodeAt(state.position); - - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (0x3A/* : */ === ch) { - ch = state.input.charCodeAt(++state.position); - - if (!is_WS_OR_EOL(ch)) { - throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); - } - - if (atExplicitKey) { - storeMappingPair(state, _result, keyTag, keyNode, null); - keyTag = keyNode = valueNode = null; - } - - detected = true; - atExplicitKey = false; - allowCompact = false; - keyTag = state.tag; - keyNode = state.result; - - } else if (detected) { - throwError(state, 'can not read an implicit mapping pair; a colon is missed'); - - } else { - state.tag = _tag; - state.anchor = _anchor; - return true; // Keep the result of `composeNode`. - } - - } else if (detected) { - throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); - - } else { - state.tag = _tag; - state.anchor = _anchor; - return true; // Keep the result of `composeNode`. - } - - } else { - break; // Reading is done. Go to the epilogue. - } - - // - // Common reading code for both explicit and implicit notations. - // - if (state.line === _line || state.lineIndent > nodeIndent) { - if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { - if (atExplicitKey) { - keyNode = state.result; - } else { - valueNode = state.result; - } - } - - if (!atExplicitKey) { - storeMappingPair(state, _result, keyTag, keyNode, valueNode); - keyTag = keyNode = valueNode = null; - } - - skipSeparationSpace(state, true, -1); - ch = state.input.charCodeAt(state.position); - } - - if (state.lineIndent > nodeIndent && (0 !== ch)) { - throwError(state, 'bad indentation of a mapping entry'); - } else if (state.lineIndent < nodeIndent) { - break; - } - } - - // - // Epilogue. - // - - // Special case: last mapping's node contains only the key in explicit notation. - if (atExplicitKey) { - storeMappingPair(state, _result, keyTag, keyNode, null); - } - - // Expose the resulting mapping. - if (detected) { - state.tag = _tag; - state.anchor = _anchor; - state.kind = 'mapping'; - state.result = _result; - } - - return detected; -} - -function readTagProperty(state) { - var _position, - isVerbatim = false, - isNamed = false, - tagHandle, - tagName, - ch; - - ch = state.input.charCodeAt(state.position); - - if (0x21/* ! */ !== ch) { - return false; - } - - if (null !== state.tag) { - throwError(state, 'duplication of a tag property'); - } - - ch = state.input.charCodeAt(++state.position); - - if (0x3C/* < */ === ch) { - isVerbatim = true; - ch = state.input.charCodeAt(++state.position); - - } else if (0x21/* ! */ === ch) { - isNamed = true; - tagHandle = '!!'; - ch = state.input.charCodeAt(++state.position); - - } else { - tagHandle = '!'; - } - - _position = state.position; - - if (isVerbatim) { - do { ch = state.input.charCodeAt(++state.position); } - while (0 !== ch && 0x3E/* > */ !== ch); - - if (state.position < state.length) { - tagName = state.input.slice(_position, state.position); - ch = state.input.charCodeAt(++state.position); - } else { - throwError(state, 'unexpected end of the stream within a verbatim tag'); - } - } else { - while (0 !== ch && !is_WS_OR_EOL(ch)) { - - if (0x21/* ! */ === ch) { - if (!isNamed) { - tagHandle = state.input.slice(_position - 1, state.position + 1); - - if (!PATTERN_TAG_HANDLE.test(tagHandle)) { - throwError(state, 'named tag handle cannot contain such characters'); - } - - isNamed = true; - _position = state.position + 1; - } else { - throwError(state, 'tag suffix cannot contain exclamation marks'); - } - } - - ch = state.input.charCodeAt(++state.position); - } - - tagName = state.input.slice(_position, state.position); - - if (PATTERN_FLOW_INDICATORS.test(tagName)) { - throwError(state, 'tag suffix cannot contain flow indicator characters'); - } - } - - if (tagName && !PATTERN_TAG_URI.test(tagName)) { - throwError(state, 'tag name cannot contain such characters: ' + tagName); - } - - if (isVerbatim) { - state.tag = tagName; - - } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { - state.tag = state.tagMap[tagHandle] + tagName; - - } else if ('!' === tagHandle) { - state.tag = '!' + tagName; - - } else if ('!!' === tagHandle) { - state.tag = 'tag:yaml.org,2002:' + tagName; - - } else { - throwError(state, 'undeclared tag handle "' + tagHandle + '"'); - } - - return true; -} - -function readAnchorProperty(state) { - var _position, - ch; - - ch = state.input.charCodeAt(state.position); - - if (0x26/* & */ !== ch) { - return false; - } - - if (null !== state.anchor) { - throwError(state, 'duplication of an anchor property'); - } - - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (state.position === _position) { - throwError(state, 'name of an anchor node must contain at least one character'); - } - - state.anchor = state.input.slice(_position, state.position); - return true; -} - -function readAlias(state) { - var _position, alias, - ch; - - ch = state.input.charCodeAt(state.position); - - if (0x2A/* * */ !== ch) { - return false; - } - - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (state.position === _position) { - throwError(state, 'name of an alias node must contain at least one character'); - } - - alias = state.input.slice(_position, state.position); - - if (!state.anchorMap.hasOwnProperty(alias)) { - throwError(state, 'unidentified alias "' + alias + '"'); - } - - state.result = state.anchorMap[alias]; - skipSeparationSpace(state, true, -1); - return true; -} - -function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { - var allowBlockStyles, - allowBlockScalars, - allowBlockCollections, - indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { - indentStatus = 1; - } else if (state.lineIndent === parentIndent) { - indentStatus = 0; - } else if (state.lineIndent < parentIndent) { - indentStatus = -1; - } - } - } - - if (1 === indentStatus) { - while (readTagProperty(state) || readAnchorProperty(state)) { - if (skipSeparationSpace(state, true, -1)) { - atNewLine = true; - allowBlockCollections = allowBlockStyles; - - if (state.lineIndent > parentIndent) { - indentStatus = 1; - } else if (state.lineIndent === parentIndent) { - indentStatus = 0; - } else if (state.lineIndent < parentIndent) { - indentStatus = -1; - } - } else { - allowBlockCollections = false; - } - } - } - - if (allowBlockCollections) { - allowBlockCollections = atNewLine || allowCompact; - } - - if (1 === indentStatus || CONTEXT_BLOCK_OUT === nodeContext) { - if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { - flowIndent = parentIndent; - } else { - flowIndent = parentIndent + 1; - } - - blockIndent = state.position - state.lineStart; - - if (1 === indentStatus) { - if (allowBlockCollections && - (readBlockSequence(state, blockIndent) || - readBlockMapping(state, blockIndent, flowIndent)) || - readFlowCollection(state, flowIndent)) { - hasContent = true; - } else { - if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || - readSingleQuotedScalar(state, flowIndent) || - readDoubleQuotedScalar(state, flowIndent)) { - hasContent = true; - - } else if (readAlias(state)) { - hasContent = true; - - if (null !== state.tag || null !== state.anchor) { - throwError(state, 'alias node should not have any properties'); - } - - } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { - hasContent = true; - - if (null === state.tag) { - state.tag = '?'; - } - } - - if (null !== state.anchor) { - state.anchorMap[state.anchor] = state.result; - } - } - } else if (0 === indentStatus) { - // Special case: block sequences are allowed to have same indentation level as the parent. - // http://www.yaml.org/spec/1.2/spec.html#id2799784 - hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); - } - } - - if (null !== state.tag && '!' !== state.tag) { - if ('?' === state.tag) { - for (typeIndex = 0, typeQuantity = state.implicitTypes.length; - typeIndex < typeQuantity; - typeIndex += 1) { - type = state.implicitTypes[typeIndex]; - - // Implicit resolving is not allowed for non-scalar types, and '?' - // non-specific tag is only assigned to plain scalars. So, it isn't - // needed to check for 'kind' conformity. - - if (type.resolve(state.result)) { // `state.result` updated in resolver if matched - state.result = type.construct(state.result); - state.tag = type.tag; - if (null !== state.anchor) { - state.anchorMap[state.anchor] = state.result; - } - break; - } - } - } else if (_hasOwnProperty.call(state.typeMap, state.tag)) { - type = state.typeMap[state.tag]; - - if (null !== state.result && type.kind !== state.kind) { - throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); - } - - if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched - throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); - } else { - state.result = type.construct(state.result); - if (null !== state.anchor) { - state.anchorMap[state.anchor] = state.result; - } - } - } else { - throwError(state, 'unknown tag !<' + state.tag + '>'); - } - } - - return null !== state.tag || null !== state.anchor || hasContent; -} - -function readDocument(state) { - var documentStart = state.position, - _position, - directiveName, - directiveArgs, - hasDirectives = false, - ch; - - state.version = null; - state.checkLineBreaks = state.legacy; - state.tagMap = {}; - state.anchorMap = {}; - - while (0 !== (ch = state.input.charCodeAt(state.position))) { - skipSeparationSpace(state, true, -1); - - ch = state.input.charCodeAt(state.position); - - if (state.lineIndent > 0 || 0x25/* % */ !== ch) { - break; - } - - hasDirectives = true; - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (0 !== ch && !is_WS_OR_EOL(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - directiveName = state.input.slice(_position, state.position); - directiveArgs = []; - - if (directiveName.length < 1) { - throwError(state, 'directive name must not be less than one character in length'); - } - - while (0 !== ch) { - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (0x23/* # */ === ch) { - do { ch = state.input.charCodeAt(++state.position); } - while (0 !== ch && !is_EOL(ch)); - break; - } - - if (is_EOL(ch)) { - break; - } - - _position = state.position; - - while (0 !== ch && !is_WS_OR_EOL(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - directiveArgs.push(state.input.slice(_position, state.position)); - } - - if (0 !== ch) { - readLineBreak(state); - } - - if (_hasOwnProperty.call(directiveHandlers, directiveName)) { - directiveHandlers[directiveName](state, directiveName, directiveArgs); - } else { - throwWarning(state, 'unknown document directive "' + directiveName + '"'); - } - } - - skipSeparationSpace(state, true, -1); - - if (0 === state.lineIndent && - 0x2D/* - */ === state.input.charCodeAt(state.position) && - 0x2D/* - */ === state.input.charCodeAt(state.position + 1) && - 0x2D/* - */ === state.input.charCodeAt(state.position + 2)) { - state.position += 3; - skipSeparationSpace(state, true, -1); - - } else if (hasDirectives) { - throwError(state, 'directives end mark is expected'); - } - - composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); - skipSeparationSpace(state, true, -1); - - if (state.checkLineBreaks && - PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { - throwWarning(state, 'non-ASCII line breaks are interpreted as content'); - } - - state.documents.push(state.result); - - if (state.position === state.lineStart && testDocumentSeparator(state)) { - - if (0x2E/* . */ === state.input.charCodeAt(state.position)) { - state.position += 3; - skipSeparationSpace(state, true, -1); - } - return; - } - - if (state.position < (state.length - 1)) { - throwError(state, 'end of the stream or a document separator is expected'); - } else { - return; - } -} - - -function loadDocuments(input, options) { - input = String(input); - options = options || {}; - - if (input.length !== 0) { - - // Add tailing `\n` if not exists - if (0x0A/* LF */ !== input.charCodeAt(input.length - 1) && - 0x0D/* CR */ !== input.charCodeAt(input.length - 1)) { - input += '\n'; - } - - // Strip BOM - if (input.charCodeAt(0) === 0xFEFF) { - input = input.slice(1); - } - } - - var state = new State(input, options); - - // Use 0 as string terminator. That significantly simplifies bounds check. - state.input += '\0'; - - while (0x20/* Space */ === state.input.charCodeAt(state.position)) { - state.lineIndent += 1; - state.position += 1; - } - - while (state.position < (state.length - 1)) { - readDocument(state); - } - - return state.documents; -} - - -function loadAll(input, iterator, options) { - var documents = loadDocuments(input, options), index, length; - - for (index = 0, length = documents.length; index < length; index += 1) { - iterator(documents[index]); - } -} - - -function load(input, options) { - var documents = loadDocuments(input, options); - - if (0 === documents.length) { - /*eslint-disable no-undefined*/ - return undefined; - } else if (1 === documents.length) { - return documents[0]; - } - throw new YAMLException('expected a single document in the stream, but found more'); -} - - -function safeLoadAll(input, output, options) { - loadAll(input, output, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); -} - - -function safeLoad(input, options) { - return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); -} - - -module.exports.loadAll = loadAll; -module.exports.load = load; -module.exports.safeLoadAll = safeLoadAll; -module.exports.safeLoad = safeLoad; - -},{"./common":2,"./exception":4,"./mark":6,"./schema/default_full":9,"./schema/default_safe":10}],6:[function(require,module,exports){ -'use strict'; - - -var common = require('./common'); - - -function Mark(name, buffer, position, line, column) { - this.name = name; - this.buffer = buffer; - this.position = position; - this.line = line; - this.column = column; -} - - -Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { - var head, start, tail, end, snippet; - - if (!this.buffer) { - return null; - } - - indent = indent || 4; - maxLength = maxLength || 75; - - head = ''; - start = this.position; - - while (start > 0 && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1))) { - start -= 1; - if (this.position - start > (maxLength / 2 - 1)) { - head = ' ... '; - start += 5; - break; - } - } - - tail = ''; - end = this.position; - - while (end < this.buffer.length && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end))) { - end += 1; - if (end - this.position > (maxLength / 2 - 1)) { - tail = ' ... '; - end -= 5; - break; - } - } - - snippet = this.buffer.slice(start, end); - - return common.repeat(' ', indent) + head + snippet + tail + '\n' + - common.repeat(' ', indent + this.position - start + head.length) + '^'; -}; - - -Mark.prototype.toString = function toString(compact) { - var snippet, where = ''; - - if (this.name) { - where += 'in "' + this.name + '" '; - } - - where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); - - if (!compact) { - snippet = this.getSnippet(); - - if (snippet) { - where += ':\n' + snippet; - } - } - - return where; -}; - - -module.exports = Mark; - -},{"./common":2}],7:[function(require,module,exports){ -'use strict'; - -/*eslint-disable max-len*/ - -var common = require('./common'); -var YAMLException = require('./exception'); -var Type = require('./type'); - - -function compileList(schema, name, result) { - var exclude = []; - - schema.include.forEach(function (includedSchema) { - result = compileList(includedSchema, name, result); - }); - - schema[name].forEach(function (currentType) { - result.forEach(function (previousType, previousIndex) { - if (previousType.tag === currentType.tag) { - exclude.push(previousIndex); - } - }); - - result.push(currentType); - }); - - return result.filter(function (type, index) { - return -1 === exclude.indexOf(index); - }); -} - - -function compileMap(/* lists... */) { - var result = {}, index, length; - - function collectType(type) { - result[type.tag] = type; - } - - for (index = 0, length = arguments.length; index < length; index += 1) { - arguments[index].forEach(collectType); - } - - return result; -} - - -function Schema(definition) { - this.include = definition.include || []; - this.implicit = definition.implicit || []; - this.explicit = definition.explicit || []; - - this.implicit.forEach(function (type) { - if (type.loadKind && 'scalar' !== type.loadKind) { - throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); - } - }); - - this.compiledImplicit = compileList(this, 'implicit', []); - this.compiledExplicit = compileList(this, 'explicit', []); - this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); -} - - -Schema.DEFAULT = null; - - -Schema.create = function createSchema() { - var schemas, types; - - switch (arguments.length) { - case 1: - schemas = Schema.DEFAULT; - types = arguments[0]; - break; - - case 2: - schemas = arguments[0]; - types = arguments[1]; - break; - - default: - throw new YAMLException('Wrong number of arguments for Schema.create function'); - } - - schemas = common.toArray(schemas); - types = common.toArray(types); - - if (!schemas.every(function (schema) { return schema instanceof Schema; })) { - throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); - } - - if (!types.every(function (type) { return type instanceof Type; })) { - throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); - } - - return new Schema({ - include: schemas, - explicit: types - }); -}; - - -module.exports = Schema; - -},{"./common":2,"./exception":4,"./type":13}],8:[function(require,module,exports){ -// Standard YAML's Core schema. -// http://www.yaml.org/spec/1.2/spec.html#id2804923 -// -// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. -// So, Core schema has no distinctions from JSON schema is JS-YAML. - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./json') - ] -}); - -},{"../schema":7,"./json":12}],9:[function(require,module,exports){ -// JS-YAML's default schema for `load` function. -// It is not described in the YAML specification. -// -// This schema is based on JS-YAML's default safe schema and includes -// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. -// -// Also this schema is used as default base schema at `Schema.create` function. - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = Schema.DEFAULT = new Schema({ - include: [ - require('./default_safe') - ], - explicit: [ - require('../type/js/undefined'), - require('../type/js/regexp'), - require('../type/js/function') - ] -}); - -},{"../schema":7,"../type/js/function":18,"../type/js/regexp":19,"../type/js/undefined":20,"./default_safe":10}],10:[function(require,module,exports){ -// JS-YAML's default schema for `safeLoad` function. -// It is not described in the YAML specification. -// -// This schema is based on standard YAML's Core schema and includes most of -// extra types described at YAML tag repository. (http://yaml.org/type/) - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./core') - ], - implicit: [ - require('../type/timestamp'), - require('../type/merge') - ], - explicit: [ - require('../type/binary'), - require('../type/omap'), - require('../type/pairs'), - require('../type/set') - ] -}); - -},{"../schema":7,"../type/binary":14,"../type/merge":22,"../type/omap":24,"../type/pairs":25,"../type/set":27,"../type/timestamp":29,"./core":8}],11:[function(require,module,exports){ -// Standard YAML's Failsafe schema. -// http://www.yaml.org/spec/1.2/spec.html#id2802346 - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - explicit: [ - require('../type/str'), - require('../type/seq'), - require('../type/map') - ] -}); - -},{"../schema":7,"../type/map":21,"../type/seq":26,"../type/str":28}],12:[function(require,module,exports){ -// Standard YAML's JSON schema. -// http://www.yaml.org/spec/1.2/spec.html#id2803231 -// -// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. -// So, this schema is not such strict as defined in the YAML specification. -// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./failsafe') - ], - implicit: [ - require('../type/null'), - require('../type/bool'), - require('../type/int'), - require('../type/float') - ] -}); - -},{"../schema":7,"../type/bool":15,"../type/float":16,"../type/int":17,"../type/null":23,"./failsafe":11}],13:[function(require,module,exports){ -'use strict'; - -var YAMLException = require('./exception'); - -var TYPE_CONSTRUCTOR_OPTIONS = [ - 'kind', - 'resolve', - 'construct', - 'instanceOf', - 'predicate', - 'represent', - 'defaultStyle', - 'styleAliases' -]; - -var YAML_NODE_KINDS = [ - 'scalar', - 'sequence', - 'mapping' -]; - -function compileStyleAliases(map) { - var result = {}; - - if (null !== map) { - Object.keys(map).forEach(function (style) { - map[style].forEach(function (alias) { - result[String(alias)] = style; - }); - }); - } - - return result; -} - -function Type(tag, options) { - options = options || {}; - - Object.keys(options).forEach(function (name) { - if (-1 === TYPE_CONSTRUCTOR_OPTIONS.indexOf(name)) { - throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); - } - }); - - // TODO: Add tag format check. - this.tag = tag; - this.kind = options['kind'] || null; - this.resolve = options['resolve'] || function () { return true; }; - this.construct = options['construct'] || function (data) { return data; }; - this.instanceOf = options['instanceOf'] || null; - this.predicate = options['predicate'] || null; - this.represent = options['represent'] || null; - this.defaultStyle = options['defaultStyle'] || null; - this.styleAliases = compileStyleAliases(options['styleAliases'] || null); - - if (-1 === YAML_NODE_KINDS.indexOf(this.kind)) { - throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); - } -} - -module.exports = Type; - -},{"./exception":4}],14:[function(require,module,exports){ -'use strict'; - -/*eslint-disable no-bitwise*/ - -// A trick for browserified version. -// Since we make browserifier to ignore `buffer` module, NodeBuffer will be undefined -var NodeBuffer = require('buffer').Buffer; -var Type = require('../type'); - - -// [ 64, 65, 66 ] -> [ padding, CR, LF ] -var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; - - -function resolveYamlBinary(data) { - if (null === data) { - return false; - } - - var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; - - // Convert one by one. - for (idx = 0; idx < max; idx++) { - code = map.indexOf(data.charAt(idx)); - - // Skip CR/LF - if (code > 64) { continue; } - - // Fail on illegal characters - if (code < 0) { return false; } - - bitlen += 6; - } - - // If there are any bits left, source was corrupted - return (bitlen % 8) === 0; -} - -function constructYamlBinary(data) { - var idx, tailbits, - input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan - max = input.length, - map = BASE64_MAP, - bits = 0, - result = []; - - // Collect by 6*4 bits (3 bytes) - - for (idx = 0; idx < max; idx++) { - if ((idx % 4 === 0) && idx) { - result.push((bits >> 16) & 0xFF); - result.push((bits >> 8) & 0xFF); - result.push(bits & 0xFF); - } - - bits = (bits << 6) | map.indexOf(input.charAt(idx)); - } - - // Dump tail - - tailbits = (max % 4) * 6; - - if (tailbits === 0) { - result.push((bits >> 16) & 0xFF); - result.push((bits >> 8) & 0xFF); - result.push(bits & 0xFF); - } else if (tailbits === 18) { - result.push((bits >> 10) & 0xFF); - result.push((bits >> 2) & 0xFF); - } else if (tailbits === 12) { - result.push((bits >> 4) & 0xFF); - } - - // Wrap into Buffer for NodeJS and leave Array for browser - if (NodeBuffer) { - return new NodeBuffer(result); - } - - return result; -} - -function representYamlBinary(object /*, style*/) { - var result = '', bits = 0, idx, tail, - max = object.length, - map = BASE64_MAP; - - // Convert every three bytes to 4 ASCII characters. - - for (idx = 0; idx < max; idx++) { - if ((idx % 3 === 0) && idx) { - result += map[(bits >> 18) & 0x3F]; - result += map[(bits >> 12) & 0x3F]; - result += map[(bits >> 6) & 0x3F]; - result += map[bits & 0x3F]; - } - - bits = (bits << 8) + object[idx]; - } - - // Dump tail - - tail = max % 3; - - if (tail === 0) { - result += map[(bits >> 18) & 0x3F]; - result += map[(bits >> 12) & 0x3F]; - result += map[(bits >> 6) & 0x3F]; - result += map[bits & 0x3F]; - } else if (tail === 2) { - result += map[(bits >> 10) & 0x3F]; - result += map[(bits >> 4) & 0x3F]; - result += map[(bits << 2) & 0x3F]; - result += map[64]; - } else if (tail === 1) { - result += map[(bits >> 2) & 0x3F]; - result += map[(bits << 4) & 0x3F]; - result += map[64]; - result += map[64]; - } - - return result; -} - -function isBinary(object) { - return NodeBuffer && NodeBuffer.isBuffer(object); -} - -module.exports = new Type('tag:yaml.org,2002:binary', { - kind: 'scalar', - resolve: resolveYamlBinary, - construct: constructYamlBinary, - predicate: isBinary, - represent: representYamlBinary -}); - -},{"../type":13,"buffer":30}],15:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -function resolveYamlBoolean(data) { - if (null === data) { - return false; - } - - var max = data.length; - - return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || - (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); -} - -function constructYamlBoolean(data) { - return data === 'true' || - data === 'True' || - data === 'TRUE'; -} - -function isBoolean(object) { - return '[object Boolean]' === Object.prototype.toString.call(object); -} - -module.exports = new Type('tag:yaml.org,2002:bool', { - kind: 'scalar', - resolve: resolveYamlBoolean, - construct: constructYamlBoolean, - predicate: isBoolean, - represent: { - lowercase: function (object) { return object ? 'true' : 'false'; }, - uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, - camelcase: function (object) { return object ? 'True' : 'False'; } - }, - defaultStyle: 'lowercase' -}); - -},{"../type":13}],16:[function(require,module,exports){ -'use strict'; - -var common = require('../common'); -var Type = require('../type'); - -var YAML_FLOAT_PATTERN = new RegExp( - '^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?' + - '|\\.[0-9_]+(?:[eE][-+][0-9]+)?' + - '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + - '|[-+]?\\.(?:inf|Inf|INF)' + - '|\\.(?:nan|NaN|NAN))$'); - -function resolveYamlFloat(data) { - if (null === data) { - return false; - } - - if (!YAML_FLOAT_PATTERN.test(data)) { - return false; - } - return true; -} - -function constructYamlFloat(data) { - var value, sign, base, digits; - - value = data.replace(/_/g, '').toLowerCase(); - sign = '-' === value[0] ? -1 : 1; - digits = []; - - if (0 <= '+-'.indexOf(value[0])) { - value = value.slice(1); - } - - if ('.inf' === value) { - return (1 === sign) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; - - } else if ('.nan' === value) { - return NaN; - - } else if (0 <= value.indexOf(':')) { - value.split(':').forEach(function (v) { - digits.unshift(parseFloat(v, 10)); - }); - - value = 0.0; - base = 1; - - digits.forEach(function (d) { - value += d * base; - base *= 60; - }); - - return sign * value; - - } - return sign * parseFloat(value, 10); -} - - -var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; - -function representYamlFloat(object, style) { - var res; - - if (isNaN(object)) { - switch (style) { - case 'lowercase': - return '.nan'; - case 'uppercase': - return '.NAN'; - case 'camelcase': - return '.NaN'; - } - } else if (Number.POSITIVE_INFINITY === object) { - switch (style) { - case 'lowercase': - return '.inf'; - case 'uppercase': - return '.INF'; - case 'camelcase': - return '.Inf'; - } - } else if (Number.NEGATIVE_INFINITY === object) { - switch (style) { - case 'lowercase': - return '-.inf'; - case 'uppercase': - return '-.INF'; - case 'camelcase': - return '-.Inf'; - } - } else if (common.isNegativeZero(object)) { - return '-0.0'; - } - - res = object.toString(10); - - // JS stringifier can build scientific format without dots: 5e-100, - // while YAML requres dot: 5.e-100. Fix it with simple hack - - return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; -} - -function isFloat(object) { - return ('[object Number]' === Object.prototype.toString.call(object)) && - (0 !== object % 1 || common.isNegativeZero(object)); -} - -module.exports = new Type('tag:yaml.org,2002:float', { - kind: 'scalar', - resolve: resolveYamlFloat, - construct: constructYamlFloat, - predicate: isFloat, - represent: representYamlFloat, - defaultStyle: 'lowercase' -}); - -},{"../common":2,"../type":13}],17:[function(require,module,exports){ -'use strict'; - -var common = require('../common'); -var Type = require('../type'); - -function isHexCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || - ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || - ((0x61/* a */ <= c) && (c <= 0x66/* f */)); -} - -function isOctCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); -} - -function isDecCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); -} - -function resolveYamlInteger(data) { - if (null === data) { - return false; - } - - var max = data.length, - index = 0, - hasDigits = false, - ch; - - if (!max) { return false; } - - ch = data[index]; - - // sign - if (ch === '-' || ch === '+') { - ch = data[++index]; - } - - if (ch === '0') { - // 0 - if (index + 1 === max) { return true; } - ch = data[++index]; - - // base 2, base 8, base 16 - - if (ch === 'b') { - // base 2 - index++; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') { continue; } - if (ch !== '0' && ch !== '1') { - return false; - } - hasDigits = true; - } - return hasDigits; - } - - - if (ch === 'x') { - // base 16 - index++; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') { continue; } - if (!isHexCode(data.charCodeAt(index))) { - return false; - } - hasDigits = true; - } - return hasDigits; - } - - // base 8 - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') { continue; } - if (!isOctCode(data.charCodeAt(index))) { - return false; - } - hasDigits = true; - } - return hasDigits; - } - - // base 10 (except 0) or base 60 - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') { continue; } - if (ch === ':') { break; } - if (!isDecCode(data.charCodeAt(index))) { - return false; - } - hasDigits = true; - } - - if (!hasDigits) { return false; } - - // if !base60 - done; - if (ch !== ':') { return true; } - - // base60 almost not used, no needs to optimize - return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); -} - -function constructYamlInteger(data) { - var value = data, sign = 1, ch, base, digits = []; - - if (value.indexOf('_') !== -1) { - value = value.replace(/_/g, ''); - } - - ch = value[0]; - - if (ch === '-' || ch === '+') { - if (ch === '-') { sign = -1; } - value = value.slice(1); - ch = value[0]; - } - - if ('0' === value) { - return 0; - } - - if (ch === '0') { - if (value[1] === 'b') { - return sign * parseInt(value.slice(2), 2); - } - if (value[1] === 'x') { - return sign * parseInt(value, 16); - } - return sign * parseInt(value, 8); - - } - - if (value.indexOf(':') !== -1) { - value.split(':').forEach(function (v) { - digits.unshift(parseInt(v, 10)); - }); - - value = 0; - base = 1; - - digits.forEach(function (d) { - value += (d * base); - base *= 60; - }); - - return sign * value; - - } - - return sign * parseInt(value, 10); -} - -function isInteger(object) { - return ('[object Number]' === Object.prototype.toString.call(object)) && - (0 === object % 1 && !common.isNegativeZero(object)); -} - -module.exports = new Type('tag:yaml.org,2002:int', { - kind: 'scalar', - resolve: resolveYamlInteger, - construct: constructYamlInteger, - predicate: isInteger, - represent: { - binary: function (object) { return '0b' + object.toString(2); }, - octal: function (object) { return '0' + object.toString(8); }, - decimal: function (object) { return object.toString(10); }, - hexadecimal: function (object) { return '0x' + object.toString(16).toUpperCase(); } - }, - defaultStyle: 'decimal', - styleAliases: { - binary: [ 2, 'bin' ], - octal: [ 8, 'oct' ], - decimal: [ 10, 'dec' ], - hexadecimal: [ 16, 'hex' ] - } -}); - -},{"../common":2,"../type":13}],18:[function(require,module,exports){ -'use strict'; - -var esprima; - -// Browserified version does not have esprima -// -// 1. For node.js just require module as deps -// 2. For browser try to require mudule via external AMD system. -// If not found - try to fallback to window.esprima. If not -// found too - then fail to parse. -// -try { - esprima = require('esprima'); -} catch (_) { - /*global window */ - if (typeof window !== 'undefined') { esprima = window.esprima; } -} - -var Type = require('../../type'); - -function resolveJavascriptFunction(data) { - if (null === data) { - return false; - } - - try { - var source = '(' + data + ')', - ast = esprima.parse(source, { range: true }); - - if ('Program' !== ast.type || - 1 !== ast.body.length || - 'ExpressionStatement' !== ast.body[0].type || - 'FunctionExpression' !== ast.body[0].expression.type) { - return false; - } - - return true; - } catch (err) { - return false; - } -} - -function constructJavascriptFunction(data) { - /*jslint evil:true*/ - - var source = '(' + data + ')', - ast = esprima.parse(source, { range: true }), - params = [], - body; - - if ('Program' !== ast.type || - 1 !== ast.body.length || - 'ExpressionStatement' !== ast.body[0].type || - 'FunctionExpression' !== ast.body[0].expression.type) { - throw new Error('Failed to resolve function'); - } - - ast.body[0].expression.params.forEach(function (param) { - params.push(param.name); - }); - - body = ast.body[0].expression.body.range; - - // Esprima's ranges include the first '{' and the last '}' characters on - // function expressions. So cut them out. - /*eslint-disable no-new-func*/ - return new Function(params, source.slice(body[0] + 1, body[1] - 1)); -} - -function representJavascriptFunction(object /*, style*/) { - return object.toString(); -} - -function isFunction(object) { - return '[object Function]' === Object.prototype.toString.call(object); -} - -module.exports = new Type('tag:yaml.org,2002:js/function', { - kind: 'scalar', - resolve: resolveJavascriptFunction, - construct: constructJavascriptFunction, - predicate: isFunction, - represent: representJavascriptFunction -}); - -},{"../../type":13,"esprima":"esprima"}],19:[function(require,module,exports){ -'use strict'; - -var Type = require('../../type'); - -function resolveJavascriptRegExp(data) { - if (null === data) { - return false; - } - - if (0 === data.length) { - return false; - } - - var regexp = data, - tail = /\/([gim]*)$/.exec(data), - modifiers = ''; - - // if regexp starts with '/' it can have modifiers and must be properly closed - // `/foo/gim` - modifiers tail can be maximum 3 chars - if ('/' === regexp[0]) { - if (tail) { - modifiers = tail[1]; - } - - if (modifiers.length > 3) { return false; } - // if expression starts with /, is should be properly terminated - if (regexp[regexp.length - modifiers.length - 1] !== '/') { return false; } - - regexp = regexp.slice(1, regexp.length - modifiers.length - 1); - } - - try { - return true; - } catch (error) { - return false; - } -} - -function constructJavascriptRegExp(data) { - var regexp = data, - tail = /\/([gim]*)$/.exec(data), - modifiers = ''; - - // `/foo/gim` - tail can be maximum 4 chars - if ('/' === regexp[0]) { - if (tail) { - modifiers = tail[1]; - } - regexp = regexp.slice(1, regexp.length - modifiers.length - 1); - } - - return new RegExp(regexp, modifiers); -} - -function representJavascriptRegExp(object /*, style*/) { - var result = '/' + object.source + '/'; - - if (object.global) { - result += 'g'; - } - - if (object.multiline) { - result += 'm'; - } - - if (object.ignoreCase) { - result += 'i'; - } - - return result; -} - -function isRegExp(object) { - return '[object RegExp]' === Object.prototype.toString.call(object); -} - -module.exports = new Type('tag:yaml.org,2002:js/regexp', { - kind: 'scalar', - resolve: resolveJavascriptRegExp, - construct: constructJavascriptRegExp, - predicate: isRegExp, - represent: representJavascriptRegExp -}); - -},{"../../type":13}],20:[function(require,module,exports){ -'use strict'; - -var Type = require('../../type'); - -function resolveJavascriptUndefined() { - return true; -} - -function constructJavascriptUndefined() { - /*eslint-disable no-undefined*/ - return undefined; -} - -function representJavascriptUndefined() { - return ''; -} - -function isUndefined(object) { - return 'undefined' === typeof object; -} - -module.exports = new Type('tag:yaml.org,2002:js/undefined', { - kind: 'scalar', - resolve: resolveJavascriptUndefined, - construct: constructJavascriptUndefined, - predicate: isUndefined, - represent: representJavascriptUndefined -}); - -},{"../../type":13}],21:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -module.exports = new Type('tag:yaml.org,2002:map', { - kind: 'mapping', - construct: function (data) { return null !== data ? data : {}; } -}); - -},{"../type":13}],22:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -function resolveYamlMerge(data) { - return '<<' === data || null === data; -} - -module.exports = new Type('tag:yaml.org,2002:merge', { - kind: 'scalar', - resolve: resolveYamlMerge -}); - -},{"../type":13}],23:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -function resolveYamlNull(data) { - if (null === data) { - return true; - } - - var max = data.length; - - return (max === 1 && data === '~') || - (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); -} - -function constructYamlNull() { - return null; -} - -function isNull(object) { - return null === object; -} - -module.exports = new Type('tag:yaml.org,2002:null', { - kind: 'scalar', - resolve: resolveYamlNull, - construct: constructYamlNull, - predicate: isNull, - represent: { - canonical: function () { return '~'; }, - lowercase: function () { return 'null'; }, - uppercase: function () { return 'NULL'; }, - camelcase: function () { return 'Null'; } - }, - defaultStyle: 'lowercase' -}); - -},{"../type":13}],24:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -var _hasOwnProperty = Object.prototype.hasOwnProperty; -var _toString = Object.prototype.toString; - -function resolveYamlOmap(data) { - if (null === data) { - return true; - } - - var objectKeys = [], index, length, pair, pairKey, pairHasKey, - object = data; - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - pairHasKey = false; - - if ('[object Object]' !== _toString.call(pair)) { - return false; - } - - for (pairKey in pair) { - if (_hasOwnProperty.call(pair, pairKey)) { - if (!pairHasKey) { - pairHasKey = true; - } else { - return false; - } - } - } - - if (!pairHasKey) { - return false; - } - - if (-1 === objectKeys.indexOf(pairKey)) { - objectKeys.push(pairKey); - } else { - return false; - } - } - - return true; -} - -function constructYamlOmap(data) { - return null !== data ? data : []; -} - -module.exports = new Type('tag:yaml.org,2002:omap', { - kind: 'sequence', - resolve: resolveYamlOmap, - construct: constructYamlOmap -}); - -},{"../type":13}],25:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -var _toString = Object.prototype.toString; - -function resolveYamlPairs(data) { - if (null === data) { - return true; - } - - var index, length, pair, keys, result, - object = data; - - result = new Array(object.length); - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - - if ('[object Object]' !== _toString.call(pair)) { - return false; - } - - keys = Object.keys(pair); - - if (1 !== keys.length) { - return false; - } - - result[index] = [ keys[0], pair[keys[0]] ]; - } - - return true; -} - -function constructYamlPairs(data) { - if (null === data) { - return []; - } - - var index, length, pair, keys, result, - object = data; - - result = new Array(object.length); - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - - keys = Object.keys(pair); - - result[index] = [ keys[0], pair[keys[0]] ]; - } - - return result; -} - -module.exports = new Type('tag:yaml.org,2002:pairs', { - kind: 'sequence', - resolve: resolveYamlPairs, - construct: constructYamlPairs -}); - -},{"../type":13}],26:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -module.exports = new Type('tag:yaml.org,2002:seq', { - kind: 'sequence', - construct: function (data) { return null !== data ? data : []; } -}); - -},{"../type":13}],27:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -var _hasOwnProperty = Object.prototype.hasOwnProperty; - -function resolveYamlSet(data) { - if (null === data) { - return true; - } - - var key, object = data; - - for (key in object) { - if (_hasOwnProperty.call(object, key)) { - if (null !== object[key]) { - return false; - } - } - } - - return true; -} - -function constructYamlSet(data) { - return null !== data ? data : {}; -} - -module.exports = new Type('tag:yaml.org,2002:set', { - kind: 'mapping', - resolve: resolveYamlSet, - construct: constructYamlSet -}); - -},{"../type":13}],28:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -module.exports = new Type('tag:yaml.org,2002:str', { - kind: 'scalar', - construct: function (data) { return null !== data ? data : ''; } -}); - -},{"../type":13}],29:[function(require,module,exports){ -'use strict'; - -var Type = require('../type'); - -var YAML_TIMESTAMP_REGEXP = new RegExp( - '^([0-9][0-9][0-9][0-9])' + // [1] year - '-([0-9][0-9]?)' + // [2] month - '-([0-9][0-9]?)' + // [3] day - '(?:(?:[Tt]|[ \\t]+)' + // ... - '([0-9][0-9]?)' + // [4] hour - ':([0-9][0-9])' + // [5] minute - ':([0-9][0-9])' + // [6] second - '(?:\\.([0-9]*))?' + // [7] fraction - '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour - '(?::([0-9][0-9]))?))?)?$'); // [11] tz_minute - -function resolveYamlTimestamp(data) { - if (null === data) { - return false; - } - - if (YAML_TIMESTAMP_REGEXP.exec(data) === null) { - return false; - } - - return true; -} - -function constructYamlTimestamp(data) { - var match, year, month, day, hour, minute, second, fraction = 0, - delta = null, tz_hour, tz_minute, date; - - match = YAML_TIMESTAMP_REGEXP.exec(data); - - if (null === match) { - throw new Error('Date resolve error'); - } - - // match: [1] year [2] month [3] day - - year = +(match[1]); - month = +(match[2]) - 1; // JS month starts with 0 - day = +(match[3]); - - if (!match[4]) { // no hour - return new Date(Date.UTC(year, month, day)); - } - - // match: [4] hour [5] minute [6] second [7] fraction - - hour = +(match[4]); - minute = +(match[5]); - second = +(match[6]); - - if (match[7]) { - fraction = match[7].slice(0, 3); - while (fraction.length < 3) { // milli-seconds - fraction += '0'; - } - fraction = +fraction; - } - - // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute - - if (match[9]) { - tz_hour = +(match[10]); - tz_minute = +(match[11] || 0); - delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds - if ('-' === match[9]) { - delta = -delta; - } - } - - date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); - - if (delta) { - date.setTime(date.getTime() - delta); - } - - return date; -} - -function representYamlTimestamp(object /*, style*/) { - return object.toISOString(); -} - -module.exports = new Type('tag:yaml.org,2002:timestamp', { - kind: 'scalar', - resolve: resolveYamlTimestamp, - construct: constructYamlTimestamp, - instanceOf: Date, - represent: representYamlTimestamp -}); - -},{"../type":13}],30:[function(require,module,exports){ - -},{}],31:[function(require,module,exports){ -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); - }; -} else { - // old school shim for old browsers - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor - } -} - -},{}],32:[function(require,module,exports){ -// shim for using process in browser - -var process = module.exports = {}; -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = setTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - currentQueue[queueIndex].run(); - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - clearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (!draining) { - setTimeout(drainQueue, 0); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -// TODO(shtylman) -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - -},{}],33:[function(require,module,exports){ -module.exports = function isBuffer(arg) { - return arg && typeof arg === 'object' - && typeof arg.copy === 'function' - && typeof arg.fill === 'function' - && typeof arg.readUInt8 === 'function'; -} -},{}],34:[function(require,module,exports){ -(function (process,global){ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var formatRegExp = /%[sdj%]/g; -exports.format = function(f) { - if (!isString(f)) { - var objects = []; - for (var i = 0; i < arguments.length; i++) { - objects.push(inspect(arguments[i])); - } - return objects.join(' '); - } - - var i = 1; - var args = arguments; - var len = args.length; - var str = String(f).replace(formatRegExp, function(x) { - if (x === '%%') return '%'; - if (i >= len) return x; - switch (x) { - case '%s': return String(args[i++]); - case '%d': return Number(args[i++]); - case '%j': - try { - return JSON.stringify(args[i++]); - } catch (_) { - return '[Circular]'; - } - default: - return x; - } - }); - for (var x = args[i]; i < len; x = args[++i]) { - if (isNull(x) || !isObject(x)) { - str += ' ' + x; - } else { - str += ' ' + inspect(x); - } - } - return str; -}; - - -// Mark that a method should not be used. -// Returns a modified function which warns once by default. -// If --no-deprecation is set, then it is a no-op. -exports.deprecate = function(fn, msg) { - // Allow for deprecating things in the process of starting up. - if (isUndefined(global.process)) { - return function() { - return exports.deprecate(fn, msg).apply(this, arguments); - }; - } - - if (process.noDeprecation === true) { - return fn; - } - - var warned = false; - function deprecated() { - if (!warned) { - if (process.throwDeprecation) { - throw new Error(msg); - } else if (process.traceDeprecation) { - console.trace(msg); - } else { - console.error(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - - return deprecated; -}; - - -var debugs = {}; -var debugEnviron; -exports.debuglog = function(set) { - if (isUndefined(debugEnviron)) - debugEnviron = process.env.NODE_DEBUG || ''; - set = set.toUpperCase(); - if (!debugs[set]) { - if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { - var pid = process.pid; - debugs[set] = function() { - var msg = exports.format.apply(exports, arguments); - console.error('%s %d: %s', set, pid, msg); - }; - } else { - debugs[set] = function() {}; - } - } - return debugs[set]; -}; - - -/** - * Echos the value of a value. Trys to print the value out - * in the best way possible given the different types. - * - * @param {Object} obj The object to print out. - * @param {Object} opts Optional options object that alters the output. - */ -/* legacy: obj, showHidden, depth, colors*/ -function inspect(obj, opts) { - // default options - var ctx = { - seen: [], - stylize: stylizeNoColor - }; - // legacy... - if (arguments.length >= 3) ctx.depth = arguments[2]; - if (arguments.length >= 4) ctx.colors = arguments[3]; - if (isBoolean(opts)) { - // legacy... - ctx.showHidden = opts; - } else if (opts) { - // got an "options" object - exports._extend(ctx, opts); - } - // set default options - if (isUndefined(ctx.showHidden)) ctx.showHidden = false; - if (isUndefined(ctx.depth)) ctx.depth = 2; - if (isUndefined(ctx.colors)) ctx.colors = false; - if (isUndefined(ctx.customInspect)) ctx.customInspect = true; - if (ctx.colors) ctx.stylize = stylizeWithColor; - return formatValue(ctx, obj, ctx.depth); -} -exports.inspect = inspect; - - -// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics -inspect.colors = { - 'bold' : [1, 22], - 'italic' : [3, 23], - 'underline' : [4, 24], - 'inverse' : [7, 27], - 'white' : [37, 39], - 'grey' : [90, 39], - 'black' : [30, 39], - 'blue' : [34, 39], - 'cyan' : [36, 39], - 'green' : [32, 39], - 'magenta' : [35, 39], - 'red' : [31, 39], - 'yellow' : [33, 39] -}; - -// Don't use 'blue' not visible on cmd.exe -inspect.styles = { - 'special': 'cyan', - 'number': 'yellow', - 'boolean': 'yellow', - 'undefined': 'grey', - 'null': 'bold', - 'string': 'green', - 'date': 'magenta', - // "name": intentionally not styling - 'regexp': 'red' -}; - - -function stylizeWithColor(str, styleType) { - var style = inspect.styles[styleType]; - - if (style) { - return '\u001b[' + inspect.colors[style][0] + 'm' + str + - '\u001b[' + inspect.colors[style][1] + 'm'; - } else { - return str; - } -} - - -function stylizeNoColor(str, styleType) { - return str; -} - - -function arrayToHash(array) { - var hash = {}; - - array.forEach(function(val, idx) { - hash[val] = true; - }); - - return hash; -} - - -function formatValue(ctx, value, recurseTimes) { - // Provide a hook for user-specified inspect functions. - // Check that value is an object with an inspect function on it - if (ctx.customInspect && - value && - isFunction(value.inspect) && - // Filter out the util module, it's inspect function is special - value.inspect !== exports.inspect && - // Also filter out any prototype objects using the circular check. - !(value.constructor && value.constructor.prototype === value)) { - var ret = value.inspect(recurseTimes, ctx); - if (!isString(ret)) { - ret = formatValue(ctx, ret, recurseTimes); - } - return ret; - } - - // Primitive types cannot have properties - var primitive = formatPrimitive(ctx, value); - if (primitive) { - return primitive; - } - - // Look up the keys of the object. - var keys = Object.keys(value); - var visibleKeys = arrayToHash(keys); - - if (ctx.showHidden) { - keys = Object.getOwnPropertyNames(value); - } - - // IE doesn't make error fields non-enumerable - // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx - if (isError(value) - && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { - return formatError(value); - } - - // Some type of object without properties can be shortcutted. - if (keys.length === 0) { - if (isFunction(value)) { - var name = value.name ? ': ' + value.name : ''; - return ctx.stylize('[Function' + name + ']', 'special'); - } - if (isRegExp(value)) { - return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); - } - if (isDate(value)) { - return ctx.stylize(Date.prototype.toString.call(value), 'date'); - } - if (isError(value)) { - return formatError(value); - } - } - - var base = '', array = false, braces = ['{', '}']; - - // Make Array say that they are Array - if (isArray(value)) { - array = true; - braces = ['[', ']']; - } - - // Make functions say that they are functions - if (isFunction(value)) { - var n = value.name ? ': ' + value.name : ''; - base = ' [Function' + n + ']'; - } - - // Make RegExps say that they are RegExps - if (isRegExp(value)) { - base = ' ' + RegExp.prototype.toString.call(value); - } - - // Make dates with properties first say the date - if (isDate(value)) { - base = ' ' + Date.prototype.toUTCString.call(value); - } - - // Make error with message first say the error - if (isError(value)) { - base = ' ' + formatError(value); - } - - if (keys.length === 0 && (!array || value.length == 0)) { - return braces[0] + base + braces[1]; - } - - if (recurseTimes < 0) { - if (isRegExp(value)) { - return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); - } else { - return ctx.stylize('[Object]', 'special'); - } - } - - ctx.seen.push(value); - - var output; - if (array) { - output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); - } else { - output = keys.map(function(key) { - return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); - }); - } - - ctx.seen.pop(); - - return reduceToSingleString(output, base, braces); -} - - -function formatPrimitive(ctx, value) { - if (isUndefined(value)) - return ctx.stylize('undefined', 'undefined'); - if (isString(value)) { - var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') - .replace(/'/g, "\\'") - .replace(/\\"/g, '"') + '\''; - return ctx.stylize(simple, 'string'); - } - if (isNumber(value)) - return ctx.stylize('' + value, 'number'); - if (isBoolean(value)) - return ctx.stylize('' + value, 'boolean'); - // For some reason typeof null is "object", so special case here. - if (isNull(value)) - return ctx.stylize('null', 'null'); -} - - -function formatError(value) { - return '[' + Error.prototype.toString.call(value) + ']'; -} - - -function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { - var output = []; - for (var i = 0, l = value.length; i < l; ++i) { - if (hasOwnProperty(value, String(i))) { - output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, - String(i), true)); - } else { - output.push(''); - } - } - keys.forEach(function(key) { - if (!key.match(/^\d+$/)) { - output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, - key, true)); - } - }); - return output; -} - - -function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { - var name, str, desc; - desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; - if (desc.get) { - if (desc.set) { - str = ctx.stylize('[Getter/Setter]', 'special'); - } else { - str = ctx.stylize('[Getter]', 'special'); - } - } else { - if (desc.set) { - str = ctx.stylize('[Setter]', 'special'); - } - } - if (!hasOwnProperty(visibleKeys, key)) { - name = '[' + key + ']'; - } - if (!str) { - if (ctx.seen.indexOf(desc.value) < 0) { - if (isNull(recurseTimes)) { - str = formatValue(ctx, desc.value, null); - } else { - str = formatValue(ctx, desc.value, recurseTimes - 1); - } - if (str.indexOf('\n') > -1) { - if (array) { - str = str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n').substr(2); - } else { - str = '\n' + str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n'); - } - } - } else { - str = ctx.stylize('[Circular]', 'special'); - } - } - if (isUndefined(name)) { - if (array && key.match(/^\d+$/)) { - return str; - } - name = JSON.stringify('' + key); - if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { - name = name.substr(1, name.length - 2); - name = ctx.stylize(name, 'name'); - } else { - name = name.replace(/'/g, "\\'") - .replace(/\\"/g, '"') - .replace(/(^"|"$)/g, "'"); - name = ctx.stylize(name, 'string'); - } - } - - return name + ': ' + str; -} - - -function reduceToSingleString(output, base, braces) { - var numLinesEst = 0; - var length = output.reduce(function(prev, cur) { - numLinesEst++; - if (cur.indexOf('\n') >= 0) numLinesEst++; - return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; - }, 0); - - if (length > 60) { - return braces[0] + - (base === '' ? '' : base + '\n ') + - ' ' + - output.join(',\n ') + - ' ' + - braces[1]; - } - - return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; -} - - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. -function isArray(ar) { - return Array.isArray(ar); -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return isObject(re) && objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return isObject(d) && objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - -function isError(e) { - return isObject(e) && - (objectToString(e) === '[object Error]' || e instanceof Error); -} -exports.isError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -exports.isBuffer = require('./support/isBuffer'); - -function objectToString(o) { - return Object.prototype.toString.call(o); -} - - -function pad(n) { - return n < 10 ? '0' + n.toString(10) : n.toString(10); -} - - -var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', - 'Oct', 'Nov', 'Dec']; - -// 26 Feb 16:19:34 -function timestamp() { - var d = new Date(); - var time = [pad(d.getHours()), - pad(d.getMinutes()), - pad(d.getSeconds())].join(':'); - return [d.getDate(), months[d.getMonth()], time].join(' '); -} - - -// log is just a thin wrapper to console.log that prepends a timestamp -exports.log = function() { - console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); -}; - - -/** - * Inherit the prototype methods from one constructor into another. - * - * The Function.prototype.inherits from lang.js rewritten as a standalone - * function (not on Function.prototype). NOTE: If this file is to be loaded - * during bootstrapping this function needs to be rewritten using some native - * functions as prototype setup using normal JavaScript does not work as - * expected during bootstrapping (see mirror.js in r114903). - * - * @param {function} ctor Constructor function which needs to inherit the - * prototype. - * @param {function} superCtor Constructor function to inherit prototype from. - */ -exports.inherits = require('inherits'); - -exports._extend = function(origin, add) { - // Don't do anything if add isn't an object - if (!add || !isObject(add)) return origin; - - var keys = Object.keys(add); - var i = keys.length; - while (i--) { - origin[keys[i]] = add[keys[i]]; - } - return origin; -}; - -function hasOwnProperty(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -} - -}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./support/isBuffer":33,"_process":32,"inherits":31}],"/":[function(require,module,exports){ -'use strict'; - - -var yaml = require('./lib/js-yaml.js'); - - -module.exports = yaml; - -},{"./lib/js-yaml.js":1}]},{},[])("/") -}); \ No newline at end of file diff --git a/node_modules/eslint/node_modules/js-yaml/dist/js-yaml.min.js b/node_modules/eslint/node_modules/js-yaml/dist/js-yaml.min.js deleted file mode 100644 index ad39031..0000000 --- a/node_modules/eslint/node_modules/js-yaml/dist/js-yaml.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/* js-yaml 3.4.5 https://github.com/nodeca/js-yaml */ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.jsyaml=e()}}(function(){return function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[s]={exports:{}};t[s][0].call(l.exports,function(e){var n=t[s][1][e];return i(n?n:e)},l,l.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;sn;n+=1)i=o[n],e[i]=t[i];return e}function a(e,t){var n,r="";for(n=0;t>n;n+=1)r+=e;return r}function u(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e}t.exports.isNothing=r,t.exports.isObject=i,t.exports.toArray=o,t.exports.repeat=a,t.exports.isNegativeZero=u,t.exports.extend=s},{}],3:[function(e,t,n){"use strict";function r(e,t){var n,r,i,o,s,a,u;if(null===t)return{};for(n={},r=Object.keys(t),i=0,o=r.length;o>i;i+=1)s=r[i],a=String(t[s]),"!!"===s.slice(0,2)&&(s="tag:yaml.org,2002:"+s.slice(2)),u=e.compiledTypeMap[s],u&&F.call(u.styleAliases,a)&&(a=u.styleAliases[a]),n[s]=a;return n}function i(e){var t,n,r;if(t=e.toString(16).toUpperCase(),255>=e)n="x",r=2;else if(65535>=e)n="u",r=4;else{if(!(4294967295>=e))throw new S("code point within a string may not be greater than 0xFFFFFFFF");n="U",r=8}return"\\"+n+j.repeat("0",r-t.length)+t}function o(e){this.schema=e.schema||O,this.indent=Math.max(1,e.indent||2),this.skipInvalid=e.skipInvalid||!1,this.flowLevel=j.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=r(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function s(e,t){for(var n,r=j.repeat(" ",t),i=0,o=-1,s="",a=e.length;a>i;)o=e.indexOf("\n",i),-1===o?(n=e.slice(i),i=a):(n=e.slice(i,o+1),i=o+1),n.length&&"\n"!==n&&(s+=r),s+=n;return s}function a(e,t){return"\n"+j.repeat(" ",e.indent*t)}function u(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;r>n;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function c(e){this.source=e,this.result="",this.checkpoint=0}function l(e,t,n,r){var i,o,a,l,f,m,g,y,v,x,b,A,w,k,C,j,S,O,E,I,F;if(0===t.length)return void(e.dump="''");if(-1!==te.indexOf(t))return void(e.dump="'"+t+"'");for(i=!0,o=t.length?t.charCodeAt(0):0,a=M===o||M===t.charCodeAt(t.length-1),(P===o||G===o||K===o||Z===o)&&(i=!1),a?(i=!1,l=!1,f=!1):(l=!r,f=!r),m=!0,g=new c(t),y=!1,v=0,x=0,b=e.indent*n,A=e.lineWidth,-1===A&&(A=9007199254740991),40>b?A-=b:A=40,k=0;k0&&(S=t.charCodeAt(k-1),S===M&&(f=!1,l=!1)),l&&(O=k-v,v=k,O>x&&(x=O))),w!==D&&(m=!1),g.takeUpTo(k),g.escapeChar())}if(i&&u(e,t)&&(i=!1),E="",(l||f)&&(I=0,t.charCodeAt(t.length-1)===_&&(I+=1,t.charCodeAt(t.length-2)===_&&(I+=1)),0===I?E="-":2===I&&(E="+")),f&&A>x&&(l=!1),y||(f=!1),i)e.dump=t;else if(m)e.dump="'"+t+"'";else if(l)F=p(t,A),e.dump=">"+E+"\n"+s(F,b);else if(f)E||(t=t.replace(/\n$/,"")),e.dump="|"+E+"\n"+s(t,b);else{if(!g)throw new Error("Failed to dump scalar value");g.finish(),e.dump='"'+g.result+'"'}}function p(e,t){var n,r="",i=0,o=e.length,s=/\n+$/.exec(e);for(s&&(o=s.index+1);o>i;)n=e.indexOf("\n",i),n>o||-1===n?(r&&(r+="\n\n"),r+=f(e.slice(i,o),t),i=o):(r&&(r+="\n\n"),r+=f(e.slice(i,n),t),i=n+1);return s&&"\n"!==s[0]&&(r+=s[0]),r}function f(e,t){if(""===e)return e;for(var n,r,i,o=/[^\s] [^\s]/g,s="",a=0,u=0,c=o.exec(e);c;)n=c.index,n-u>t&&(r=a!==u?a:n,s&&(s+="\n"),i=e.slice(u,r),s+=i,u=r+1),a=n+1,c=o.exec(e);return s&&(s+="\n"),s+=u!==a&&e.length-u>t?e.slice(u,a)+"\n"+e.slice(a+1):e.slice(u)}function d(e){return N!==e&&_!==e&&T!==e&&B!==e&&J!==e&&W!==e&&V!==e&&X!==e&&U!==e&&q!==e&&$!==e&&L!==e&&Q!==e&&H!==e&&Y!==e&&D!==e&&z!==e&&R!==e&&!ee[e]&&!h(e)}function h(e){return!(e>=32&&126>=e||133===e||e>=160&&55295>=e||e>=57344&&65533>=e||e>=65536&&1114111>=e)}function m(e,t,n){var r,i,o="",s=e.tag;for(r=0,i=n.length;i>r;r+=1)b(e,t,n[r],!1,!1)&&(0!==r&&(o+=", "),o+=e.dump);e.tag=s,e.dump="["+o+"]"}function g(e,t,n,r){var i,o,s="",u=e.tag;for(i=0,o=n.length;o>i;i+=1)b(e,t+1,n[i],!0,!0)&&(r&&0===i||(s+=a(e,t)),s+="- "+e.dump);e.tag=u,e.dump=s||"[]"}function y(e,t,n){var r,i,o,s,a,u="",c=e.tag,l=Object.keys(n);for(r=0,i=l.length;i>r;r+=1)a="",0!==r&&(a+=", "),o=l[r],s=n[o],b(e,t,o,!1,!1)&&(e.dump.length>1024&&(a+="? "),a+=e.dump+": ",b(e,t,s,!1,!1)&&(a+=e.dump,u+=a));e.tag=c,e.dump="{"+u+"}"}function v(e,t,n,r){var i,o,s,u,c,l,p="",f=e.tag,d=Object.keys(n);if(e.sortKeys===!0)d.sort();else if("function"==typeof e.sortKeys)d.sort(e.sortKeys);else if(e.sortKeys)throw new S("sortKeys must be a boolean or a function");for(i=0,o=d.length;o>i;i+=1)l="",r&&0===i||(l+=a(e,t)),s=d[i],u=n[s],b(e,t+1,s,!0,!0,!0)&&(c=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024,c&&(l+=e.dump&&_===e.dump.charCodeAt(0)?"?":"? "),l+=e.dump,c&&(l+=a(e,t)),b(e,t+1,u,!0,c)&&(l+=e.dump&&_===e.dump.charCodeAt(0)?":":": ",l+=e.dump,p+=l));e.tag=f,e.dump=p||"{}"}function x(e,t,n){var r,i,o,s,a,u;for(i=n?e.explicitTypes:e.implicitTypes,o=0,s=i.length;s>o;o+=1)if(a=i[o],(a.instanceOf||a.predicate)&&(!a.instanceOf||"object"==typeof t&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(e.tag=n?a.tag:"?",a.represent){if(u=e.styleMap[a.tag]||a.defaultStyle,"[object Function]"===I.call(a.represent))r=a.represent(t,u);else{if(!F.call(a.represent,u))throw new S("!<"+a.tag+'> tag resolver accepts not "'+u+'" style');r=a.represent[u](t,u)}e.dump=r}return!0}return!1}function b(e,t,n,r,i,o){e.tag=null,e.dump=n,x(e,n,!1)||x(e,n,!0);var s=I.call(e.dump);r&&(r=0>e.flowLevel||e.flowLevel>t);var a,u,c="[object Object]"===s||"[object Array]"===s;if(c&&(a=e.duplicates.indexOf(n),u=-1!==a),(null!==e.tag&&"?"!==e.tag||u||2!==e.indent&&t>0)&&(i=!1),u&&e.usedDuplicates[a])e.dump="*ref_"+a;else{if(c&&u&&!e.usedDuplicates[a]&&(e.usedDuplicates[a]=!0),"[object Object]"===s)r&&0!==Object.keys(e.dump).length?(v(e,t,e.dump,i),u&&(e.dump="&ref_"+a+e.dump)):(y(e,t,e.dump),u&&(e.dump="&ref_"+a+" "+e.dump));else if("[object Array]"===s)r&&0!==e.dump.length?(g(e,t,e.dump,i),u&&(e.dump="&ref_"+a+e.dump)):(m(e,t,e.dump),u&&(e.dump="&ref_"+a+" "+e.dump));else{if("[object String]"!==s){if(e.skipInvalid)return!1;throw new S("unacceptable kind of an object to dump "+s)}"?"!==e.tag&&l(e,e.dump,t,o)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function A(e,t){var n,r,i=[],o=[];for(w(e,i,o),n=0,r=o.length;r>n;n+=1)t.duplicates.push(i[o[n]]);t.usedDuplicates=new Array(r)}function w(e,t,n){var r,i,o;if(null!==e&&"object"==typeof e)if(i=t.indexOf(e),-1!==i)-1===n.indexOf(i)&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,o=e.length;o>i;i+=1)w(e[i],t,n);else for(r=Object.keys(e),i=0,o=r.length;o>i;i+=1)w(e[r[i]],t,n)}function k(e,t){t=t||{};var n=new o(t);return A(e,n),b(n,0,e,!0,!0)?n.dump+"\n":""}function C(e,t){return k(e,j.extend({schema:E},t))}var j=e("./common"),S=e("./exception"),O=e("./schema/default_full"),E=e("./schema/default_safe"),I=Object.prototype.toString,F=Object.prototype.hasOwnProperty,N=9,_=10,T=13,M=32,L=33,D=34,U=35,z=37,q=38,Y=39,$=42,B=44,P=45,R=58,H=62,G=63,K=64,J=91,W=93,Z=96,V=123,Q=124,X=125,ee={};ee[0]="\\0",ee[7]="\\a",ee[8]="\\b",ee[9]="\\t",ee[10]="\\n",ee[11]="\\v",ee[12]="\\f",ee[13]="\\r",ee[27]="\\e",ee[34]='\\"',ee[92]="\\\\",ee[133]="\\N",ee[160]="\\_",ee[8232]="\\L",ee[8233]="\\P";var te=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];c.prototype.takeUpTo=function(e){var t;if(e checkpoint"),t.position=e,t.checkpoint=this.checkpoint,t;return this.result+=this.source.slice(this.checkpoint,e),this.checkpoint=e,this},c.prototype.escapeChar=function(){var e,t;return e=this.source.charCodeAt(this.checkpoint),t=ee[e]||i(e),this.result+=t,this.checkpoint+=1,this},c.prototype.finish=function(){this.source.length>this.checkpoint&&this.takeUpTo(this.source.length)},t.exports.dump=k,t.exports.safeDump=C},{"./common":2,"./exception":4,"./schema/default_full":9,"./schema/default_safe":10}],4:[function(e,t,n){"use strict";function r(e,t){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||"",this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():"")}var i=e("util").inherits;i(r,Error),r.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t},t.exports=r},{util:34}],5:[function(e,t,n){"use strict";function r(e){return 10===e||13===e}function i(e){return 9===e||32===e}function o(e){return 9===e||32===e||10===e||13===e}function s(e){return 44===e||91===e||93===e||123===e||125===e}function a(e){var t;return e>=48&&57>=e?e-48:(t=32|e,t>=97&&102>=t?t-97+10:-1)}function u(e){return 120===e?2:117===e?4:85===e?8:0}function c(e){return e>=48&&57>=e?e-48:-1}function l(e){return 48===e?"\x00":97===e?"":98===e?"\b":116===e?" ":9===e?" ":110===e?"\n":118===e?" ":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function p(e){return 65535>=e?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function f(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||R,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function d(e,t){return new $(t,new B(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function h(e,t){throw d(e,t)}function m(e,t){e.onWarning&&e.onWarning.call(null,d(e,t))}function g(e,t,n,r){var i,o,s,a;if(n>t){if(a=e.input.slice(t,n),r)for(i=0,o=a.length;o>i;i+=1)s=a.charCodeAt(i),9===s||s>=32&&1114111>=s||h(e,"expected valid JSON character");else X.test(a)&&h(e,"the stream contains non-printable characters");e.result+=a}}function y(e,t,n){var r,i,o,s;for(Y.isObject(n)||h(e,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(n),o=0,s=r.length;s>o;o+=1)i=r[o],H.call(t,i)||(t[i]=n[i])}function v(e,t,n,r,i){var o,s;if(r=String(r),null===t&&(t={}),"tag:yaml.org,2002:merge"===n)if(Array.isArray(i))for(o=0,s=i.length;s>o;o+=1)y(e,t,i[o]);else y(e,t,i);else t[r]=i;return t}function x(e){var t;t=e.input.charCodeAt(e.position),10===t?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):h(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function b(e,t,n){for(var o=0,s=e.input.charCodeAt(e.position);0!==s;){for(;i(s);)s=e.input.charCodeAt(++e.position);if(t&&35===s)do s=e.input.charCodeAt(++e.position);while(10!==s&&13!==s&&0!==s);if(!r(s))break;for(x(e),s=e.input.charCodeAt(e.position),o++,e.lineIndent=0;32===s;)e.lineIndent++,s=e.input.charCodeAt(++e.position)}return-1!==n&&0!==o&&e.lineIndent1&&(e.result+=Y.repeat("\n",t-1))}function k(e,t,n){var a,u,c,l,p,f,d,h,m,y=e.kind,v=e.result;if(m=e.input.charCodeAt(e.position),o(m)||s(m)||35===m||38===m||42===m||33===m||124===m||62===m||39===m||34===m||37===m||64===m||96===m)return!1;if((63===m||45===m)&&(u=e.input.charCodeAt(e.position+1),o(u)||n&&s(u)))return!1;for(e.kind="scalar",e.result="",c=l=e.position,p=!1;0!==m;){if(58===m){if(u=e.input.charCodeAt(e.position+1),o(u)||n&&s(u))break}else if(35===m){if(a=e.input.charCodeAt(e.position-1),o(a))break}else{if(e.position===e.lineStart&&A(e)||n&&s(m))break;if(r(m)){if(f=e.line,d=e.lineStart,h=e.lineIndent,b(e,!1,-1),e.lineIndent>=t){p=!0,m=e.input.charCodeAt(e.position);continue}e.position=l,e.line=f,e.lineStart=d,e.lineIndent=h;break}}p&&(g(e,c,l,!1),w(e,e.line-f),c=l=e.position,p=!1),i(m)||(l=e.position+1),m=e.input.charCodeAt(++e.position)}return g(e,c,l,!1),e.result?!0:(e.kind=y,e.result=v,!1)}function C(e,t){var n,i,o;if(n=e.input.charCodeAt(e.position),39!==n)return!1;for(e.kind="scalar",e.result="",e.position++,i=o=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(g(e,i,e.position,!0),n=e.input.charCodeAt(++e.position),39!==n)return!0;i=o=e.position,e.position++}else r(n)?(g(e,i,o,!0),w(e,b(e,!1,t)),i=o=e.position):e.position===e.lineStart&&A(e)?h(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);h(e,"unexpected end of the stream within a single quoted scalar")}function j(e,t){var n,i,o,s,c,l;if(l=e.input.charCodeAt(e.position),34!==l)return!1;for(e.kind="scalar",e.result="",e.position++,n=i=e.position;0!==(l=e.input.charCodeAt(e.position));){if(34===l)return g(e,n,e.position,!0),e.position++,!0;if(92===l){if(g(e,n,e.position,!0),l=e.input.charCodeAt(++e.position),r(l))b(e,!1,t);else if(256>l&&ie[l])e.result+=oe[l],e.position++;else if((c=u(l))>0){for(o=c,s=0;o>0;o--)l=e.input.charCodeAt(++e.position),(c=a(l))>=0?s=(s<<4)+c:h(e,"expected hexadecimal character");e.result+=p(s),e.position++}else h(e,"unknown escape sequence");n=i=e.position}else r(l)?(g(e,n,i,!0),w(e,b(e,!1,t)),n=i=e.position):e.position===e.lineStart&&A(e)?h(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}h(e,"unexpected end of the stream within a double quoted scalar")}function S(e,t){var n,r,i,s,a,u,c,l,p,f,d,m=!0,g=e.tag,y=e.anchor;if(d=e.input.charCodeAt(e.position),91===d)s=93,c=!1,r=[];else{if(123!==d)return!1;s=125,c=!0,r={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=r),d=e.input.charCodeAt(++e.position);0!==d;){if(b(e,!0,t),d=e.input.charCodeAt(e.position),d===s)return e.position++,e.tag=g,e.anchor=y,e.kind=c?"mapping":"sequence",e.result=r,!0;m||h(e,"missed comma between flow collection entries"),p=l=f=null,a=u=!1,63===d&&(i=e.input.charCodeAt(e.position+1),o(i)&&(a=u=!0,e.position++,b(e,!0,t))),n=e.line,T(e,t,G,!1,!0),p=e.tag,l=e.result,b(e,!0,t),d=e.input.charCodeAt(e.position),!u&&e.line!==n||58!==d||(a=!0,d=e.input.charCodeAt(++e.position),b(e,!0,t),T(e,t,G,!1,!0),f=e.result),c?v(e,r,p,l,f):r.push(a?v(e,null,p,l,f):l),b(e,!0,t),d=e.input.charCodeAt(e.position),44===d?(m=!0,d=e.input.charCodeAt(++e.position)):m=!1}h(e,"unexpected end of the stream within a flow collection")}function O(e,t){var n,o,s,a,u=Z,l=!1,p=t,f=0,d=!1;if(a=e.input.charCodeAt(e.position),124===a)o=!1;else{if(62!==a)return!1;o=!0}for(e.kind="scalar",e.result="";0!==a;)if(a=e.input.charCodeAt(++e.position),43===a||45===a)Z===u?u=43===a?Q:V:h(e,"repeat of a chomping mode identifier");else{if(!((s=c(a))>=0))break;0===s?h(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?h(e,"repeat of an indentation width identifier"):(p=t+s-1,l=!0)}if(i(a)){do a=e.input.charCodeAt(++e.position);while(i(a));if(35===a)do a=e.input.charCodeAt(++e.position);while(!r(a)&&0!==a)}for(;0!==a;){for(x(e),e.lineIndent=0,a=e.input.charCodeAt(e.position);(!l||e.lineIndentp&&(p=e.lineIndent),r(a))f++;else{if(e.lineIndentt)&&0!==i)h(e,"bad indentation of a sequence entry");else if(e.lineIndentt)&&(T(e,t,W,!0,s)&&(g?d=e.result:m=e.result),g||(v(e,p,f,d,m),f=d=m=null),b(e,!0,-1),u=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==u)h(e,"bad indentation of a mapping entry");else if(e.lineIndentt?d=1:e.lineIndent===t?d=0:e.lineIndentt?d=1:e.lineIndent===t?d=0:e.lineIndentu;u+=1)if(l=e.implicitTypes[u],l.resolve(e.result)){e.result=l.construct(e.result),e.tag=l.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else H.call(e.typeMap,e.tag)?(l=e.typeMap[e.tag],null!==e.result&&l.kind!==e.kind&&h(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+l.kind+'", not "'+e.kind+'"'),l.resolve(e.result)?(e.result=l.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):h(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):h(e,"unknown tag !<"+e.tag+">");return null!==e.tag||null!==e.anchor||g}function M(e){var t,n,s,a,u=e.position,c=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(a=e.input.charCodeAt(e.position))&&(b(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==a));){for(c=!0,a=e.input.charCodeAt(++e.position),t=e.position;0!==a&&!o(a);)a=e.input.charCodeAt(++e.position);for(n=e.input.slice(t,e.position),s=[],n.length<1&&h(e,"directive name must not be less than one character in length");0!==a;){for(;i(a);)a=e.input.charCodeAt(++e.position);if(35===a){do a=e.input.charCodeAt(++e.position);while(0!==a&&!r(a));break}if(r(a))break;for(t=e.position;0!==a&&!o(a);)a=e.input.charCodeAt(++e.position);s.push(e.input.slice(t,e.position))}0!==a&&x(e),H.call(ae,n)?ae[n](e,n,s):m(e,'unknown document directive "'+n+'"')}return b(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,b(e,!0,-1)):c&&h(e,"directives end mark is expected"),T(e,e.lineIndent-1,W,!1,!0),b(e,!0,-1),e.checkLineBreaks&&ee.test(e.input.slice(u,e.position))&&m(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&A(e)?void(46===e.input.charCodeAt(e.position)&&(e.position+=3,b(e,!0,-1))):void(e.positionr;r+=1)t(o[r])}function U(e,t){var n=L(e,t);if(0===n.length)return void 0;if(1===n.length)return n[0];throw new $("expected a single document in the stream, but found more")}function z(e,t,n){D(e,t,Y.extend({schema:P},n))}function q(e,t){return U(e,Y.extend({schema:P},t))}for(var Y=e("./common"),$=e("./exception"),B=e("./mark"),P=e("./schema/default_safe"),R=e("./schema/default_full"),H=Object.prototype.hasOwnProperty,G=1,K=2,J=3,W=4,Z=1,V=2,Q=3,X=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ee=/[\x85\u2028\u2029]/,te=/[,\[\]\{\}]/,ne=/^(?:!|!!|![a-z\-]+!)$/i,re=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i,ie=new Array(256),oe=new Array(256),se=0;256>se;se++)ie[se]=l(se)?1:0,oe[se]=l(se);var ae={YAML:function(e,t,n){var r,i,o;null!==e.version&&h(e,"duplication of %YAML directive"),1!==n.length&&h(e,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),null===r&&h(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),o=parseInt(r[2],10),1!==i&&h(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=2>o,1!==o&&2!==o&&m(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,i;2!==n.length&&h(e,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],ne.test(r)||h(e,"ill-formed tag handle (first argument) of the TAG directive"),H.call(e.tagMap,r)&&h(e,'there is a previously declared suffix for "'+r+'" tag handle'),re.test(i)||h(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[r]=i}};t.exports.loadAll=D,t.exports.load=U,t.exports.safeLoadAll=z,t.exports.safeLoad=q},{"./common":2,"./exception":4,"./mark":6,"./schema/default_full":9,"./schema/default_safe":10}],6:[function(e,t,n){"use strict";function r(e,t,n,r,i){this.name=e,this.buffer=t,this.position=n,this.line=r,this.column=i}var i=e("./common");r.prototype.getSnippet=function(e,t){var n,r,o,s,a;if(!this.buffer)return null;for(e=e||4,t=t||75,n="",r=this.position;r>0&&-1==="\x00\r\n…\u2028\u2029".indexOf(this.buffer.charAt(r-1));)if(r-=1,this.position-r>t/2-1){n=" ... ",r+=5;break}for(o="",s=this.position;st/2-1){o=" ... ",s-=5;break}return a=this.buffer.slice(r,s),i.repeat(" ",e)+n+a+o+"\n"+i.repeat(" ",e+this.position-r+n.length)+"^"},r.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet(),t&&(n+=":\n"+t)),n},t.exports=r},{"./common":2}],7:[function(e,t,n){"use strict";function r(e,t,n){var i=[];return e.include.forEach(function(e){n=r(e,t,n)}),e[t].forEach(function(e){n.forEach(function(t,n){t.tag===e.tag&&i.push(n)}),n.push(e)}),n.filter(function(e,t){return-1===i.indexOf(t)})}function i(){function e(e){r[e.tag]=e}var t,n,r={};for(t=0,n=arguments.length;n>t;t+=1)arguments[t].forEach(e);return r}function o(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new a("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=r(this,"implicit",[]),this.compiledExplicit=r(this,"explicit",[]),this.compiledTypeMap=i(this.compiledImplicit,this.compiledExplicit)}var s=e("./common"),a=e("./exception"),u=e("./type");o.DEFAULT=null,o.create=function(){var e,t;switch(arguments.length){case 1:e=o.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new a("Wrong number of arguments for Schema.create function")}if(e=s.toArray(e),t=s.toArray(t),!e.every(function(e){return e instanceof o}))throw new a("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every(function(e){return e instanceof u}))throw new a("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new o({include:e,explicit:t})},t.exports=o},{"./common":2,"./exception":4,"./type":13}],8:[function(e,t,n){"use strict";var r=e("../schema");t.exports=new r({include:[e("./json")]})},{"../schema":7,"./json":12}],9:[function(e,t,n){"use strict";var r=e("../schema");t.exports=r.DEFAULT=new r({include:[e("./default_safe")],explicit:[e("../type/js/undefined"),e("../type/js/regexp"),e("../type/js/function")]})},{"../schema":7,"../type/js/function":18,"../type/js/regexp":19,"../type/js/undefined":20,"./default_safe":10}],10:[function(e,t,n){"use strict";var r=e("../schema");t.exports=new r({include:[e("./core")],implicit:[e("../type/timestamp"),e("../type/merge")],explicit:[e("../type/binary"),e("../type/omap"),e("../type/pairs"),e("../type/set")]})},{"../schema":7,"../type/binary":14,"../type/merge":22,"../type/omap":24,"../type/pairs":25,"../type/set":27,"../type/timestamp":29,"./core":8}],11:[function(e,t,n){"use strict";var r=e("../schema");t.exports=new r({explicit:[e("../type/str"),e("../type/seq"),e("../type/map")]})},{"../schema":7,"../type/map":21,"../type/seq":26,"../type/str":28}],12:[function(e,t,n){"use strict";var r=e("../schema");t.exports=new r({include:[e("./failsafe")],implicit:[e("../type/null"),e("../type/bool"),e("../type/int"),e("../type/float")]})},{"../schema":7,"../type/bool":15,"../type/float":16,"../type/int":17,"../type/null":23,"./failsafe":11}],13:[function(e,t,n){"use strict";function r(e){var t={};return null!==e&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}function i(e,t){if(t=t||{},Object.keys(t).forEach(function(t){if(-1===s.indexOf(t))throw new o('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=r(t.styleAliases||null),-1===a.indexOf(this.kind))throw new o('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var o=e("./exception"),s=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],a=["scalar","sequence","mapping"];t.exports=i},{"./exception":4}],14:[function(e,t,n){"use strict";function r(e){if(null===e)return!1;var t,n,r=0,i=e.length,o=c;for(n=0;i>n;n++)if(t=o.indexOf(e.charAt(n)),!(t>64)){if(0>t)return!1;r+=6}return r%8===0}function i(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,o=c,s=0,u=[];for(t=0;i>t;t++)t%4===0&&t&&(u.push(s>>16&255),u.push(s>>8&255),u.push(255&s)),s=s<<6|o.indexOf(r.charAt(t));return n=i%4*6,0===n?(u.push(s>>16&255),u.push(s>>8&255),u.push(255&s)):18===n?(u.push(s>>10&255),u.push(s>>2&255)):12===n&&u.push(s>>4&255),a?new a(u):u}function o(e){var t,n,r="",i=0,o=e.length,s=c;for(t=0;o>t;t++)t%3===0&&t&&(r+=s[i>>18&63],r+=s[i>>12&63],r+=s[i>>6&63],r+=s[63&i]),i=(i<<8)+e[t];return n=o%3,0===n?(r+=s[i>>18&63],r+=s[i>>12&63],r+=s[i>>6&63],r+=s[63&i]):2===n?(r+=s[i>>10&63],r+=s[i>>4&63],r+=s[i<<2&63],r+=s[64]):1===n&&(r+=s[i>>2&63],r+=s[i<<4&63],r+=s[64],r+=s[64]),r}function s(e){return a&&a.isBuffer(e)}var a=e("buffer").Buffer,u=e("../type"),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";t.exports=new u("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r, -construct:i,predicate:s,represent:o})},{"../type":13,buffer:30}],15:[function(e,t,n){"use strict";function r(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)}function i(e){return"true"===e||"True"===e||"TRUE"===e}function o(e){return"[object Boolean]"===Object.prototype.toString.call(e)}var s=e("../type");t.exports=new s("tag:yaml.org,2002:bool",{kind:"scalar",resolve:r,construct:i,predicate:o,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},{"../type":13}],16:[function(e,t,n){"use strict";function r(e){return null===e?!1:c.test(e)?!0:!1}function i(e){var t,n,r,i;return t=e.replace(/_/g,"").toLowerCase(),n="-"===t[0]?-1:1,i=[],0<="+-".indexOf(t[0])&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:0<=t.indexOf(":")?(t.split(":").forEach(function(e){i.unshift(parseFloat(e,10))}),t=0,r=1,i.forEach(function(e){t+=e*r,r*=60}),n*t):n*parseFloat(t,10)}function o(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(a.isNegativeZero(e))return"-0.0";return n=e.toString(10),l.test(n)?n.replace("e",".e"):n}function s(e){return"[object Number]"===Object.prototype.toString.call(e)&&(0!==e%1||a.isNegativeZero(e))}var a=e("../common"),u=e("../type"),c=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?|\\.[0-9_]+(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),l=/^[-+]?[0-9]+e/;t.exports=new u("tag:yaml.org,2002:float",{kind:"scalar",resolve:r,construct:i,predicate:s,represent:o,defaultStyle:"lowercase"})},{"../common":2,"../type":13}],17:[function(e,t,n){"use strict";function r(e){return e>=48&&57>=e||e>=65&&70>=e||e>=97&&102>=e}function i(e){return e>=48&&55>=e}function o(e){return e>=48&&57>=e}function s(e){if(null===e)return!1;var t,n=e.length,s=0,a=!1;if(!n)return!1;if(t=e[s],("-"===t||"+"===t)&&(t=e[++s]),"0"===t){if(s+1===n)return!0;if(t=e[++s],"b"===t){for(s++;n>s;s++)if(t=e[s],"_"!==t){if("0"!==t&&"1"!==t)return!1;a=!0}return a}if("x"===t){for(s++;n>s;s++)if(t=e[s],"_"!==t){if(!r(e.charCodeAt(s)))return!1;a=!0}return a}for(;n>s;s++)if(t=e[s],"_"!==t){if(!i(e.charCodeAt(s)))return!1;a=!0}return a}for(;n>s;s++)if(t=e[s],"_"!==t){if(":"===t)break;if(!o(e.charCodeAt(s)))return!1;a=!0}return a?":"!==t?!0:/^(:[0-5]?[0-9])+$/.test(e.slice(s)):!1}function a(e){var t,n,r=e,i=1,o=[];return-1!==r.indexOf("_")&&(r=r.replace(/_/g,"")),t=r[0],("-"===t||"+"===t)&&("-"===t&&(i=-1),r=r.slice(1),t=r[0]),"0"===r?0:"0"===t?"b"===r[1]?i*parseInt(r.slice(2),2):"x"===r[1]?i*parseInt(r,16):i*parseInt(r,8):-1!==r.indexOf(":")?(r.split(":").forEach(function(e){o.unshift(parseInt(e,10))}),r=0,n=1,o.forEach(function(e){r+=e*n,n*=60}),i*r):i*parseInt(r,10)}function u(e){return"[object Number]"===Object.prototype.toString.call(e)&&0===e%1&&!c.isNegativeZero(e)}var c=e("../common"),l=e("../type");t.exports=new l("tag:yaml.org,2002:int",{kind:"scalar",resolve:s,construct:a,predicate:u,represent:{binary:function(e){return"0b"+e.toString(2)},octal:function(e){return"0"+e.toString(8)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return"0x"+e.toString(16).toUpperCase()}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},{"../common":2,"../type":13}],18:[function(e,t,n){"use strict";function r(e){if(null===e)return!1;try{var t="("+e+")",n=a.parse(t,{range:!0});return"Program"!==n.type||1!==n.body.length||"ExpressionStatement"!==n.body[0].type||"FunctionExpression"!==n.body[0].expression.type?!1:!0}catch(r){return!1}}function i(e){var t,n="("+e+")",r=a.parse(n,{range:!0}),i=[];if("Program"!==r.type||1!==r.body.length||"ExpressionStatement"!==r.body[0].type||"FunctionExpression"!==r.body[0].expression.type)throw new Error("Failed to resolve function");return r.body[0].expression.params.forEach(function(e){i.push(e.name)}),t=r.body[0].expression.body.range,new Function(i,n.slice(t[0]+1,t[1]-1))}function o(e){return e.toString()}function s(e){return"[object Function]"===Object.prototype.toString.call(e)}var a;try{a=e("esprima")}catch(u){"undefined"!=typeof window&&(a=window.esprima)}var c=e("../../type");t.exports=new c("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:r,construct:i,predicate:s,represent:o})},{"../../type":13,esprima:"esprima"}],19:[function(e,t,n){"use strict";function r(e){if(null===e)return!1;if(0===e.length)return!1;var t=e,n=/\/([gim]*)$/.exec(e),r="";if("/"===t[0]){if(n&&(r=n[1]),r.length>3)return!1;if("/"!==t[t.length-r.length-1])return!1;t=t.slice(1,t.length-r.length-1)}try{return!0}catch(i){return!1}}function i(e){var t=e,n=/\/([gim]*)$/.exec(e),r="";return"/"===t[0]&&(n&&(r=n[1]),t=t.slice(1,t.length-r.length-1)),new RegExp(t,r)}function o(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function s(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var a=e("../../type");t.exports=new a("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:r,construct:i,predicate:s,represent:o})},{"../../type":13}],20:[function(e,t,n){"use strict";function r(){return!0}function i(){return void 0}function o(){return""}function s(e){return"undefined"==typeof e}var a=e("../../type");t.exports=new a("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:r,construct:i,predicate:s,represent:o})},{"../../type":13}],21:[function(e,t,n){"use strict";var r=e("../type");t.exports=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},{"../type":13}],22:[function(e,t,n){"use strict";function r(e){return"<<"===e||null===e}var i=e("../type");t.exports=new i("tag:yaml.org,2002:merge",{kind:"scalar",resolve:r})},{"../type":13}],23:[function(e,t,n){"use strict";function r(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)}function i(){return null}function o(e){return null===e}var s=e("../type");t.exports=new s("tag:yaml.org,2002:null",{kind:"scalar",resolve:r,construct:i,predicate:o,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},{"../type":13}],24:[function(e,t,n){"use strict";function r(e){if(null===e)return!0;var t,n,r,i,o,u=[],c=e;for(t=0,n=c.length;n>t;t+=1){if(r=c[t],o=!1,"[object Object]"!==a.call(r))return!1;for(i in r)if(s.call(r,i)){if(o)return!1;o=!0}if(!o)return!1;if(-1!==u.indexOf(i))return!1;u.push(i)}return!0}function i(e){return null!==e?e:[]}var o=e("../type"),s=Object.prototype.hasOwnProperty,a=Object.prototype.toString;t.exports=new o("tag:yaml.org,2002:omap",{kind:"sequence",resolve:r,construct:i})},{"../type":13}],25:[function(e,t,n){"use strict";function r(e){if(null===e)return!0;var t,n,r,i,o,a=e;for(o=new Array(a.length),t=0,n=a.length;n>t;t+=1){if(r=a[t],"[object Object]"!==s.call(r))return!1;if(i=Object.keys(r),1!==i.length)return!1;o[t]=[i[0],r[i[0]]]}return!0}function i(e){if(null===e)return[];var t,n,r,i,o,s=e;for(o=new Array(s.length),t=0,n=s.length;n>t;t+=1)r=s[t],i=Object.keys(r),o[t]=[i[0],r[i[0]]];return o}var o=e("../type"),s=Object.prototype.toString;t.exports=new o("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:r,construct:i})},{"../type":13}],26:[function(e,t,n){"use strict";var r=e("../type");t.exports=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},{"../type":13}],27:[function(e,t,n){"use strict";function r(e){if(null===e)return!0;var t,n=e;for(t in n)if(s.call(n,t)&&null!==n[t])return!1;return!0}function i(e){return null!==e?e:{}}var o=e("../type"),s=Object.prototype.hasOwnProperty;t.exports=new o("tag:yaml.org,2002:set",{kind:"mapping",resolve:r,construct:i})},{"../type":13}],28:[function(e,t,n){"use strict";var r=e("../type");t.exports=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},{"../type":13}],29:[function(e,t,n){"use strict";function r(e){return null===e?!1:null===a.exec(e)?!1:!0}function i(e){var t,n,r,i,o,s,u,c,l,p,f=0,d=null;if(t=a.exec(e),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(o=+t[4],s=+t[5],u=+t[6],t[7]){for(f=t[7].slice(0,3);f.length<3;)f+="0";f=+f}return t[9]&&(c=+t[10],l=+(t[11]||0),d=6e4*(60*c+l),"-"===t[9]&&(d=-d)),p=new Date(Date.UTC(n,r,i,o,s,u,f)),d&&p.setTime(p.getTime()-d),p}function o(e){return e.toISOString()}var s=e("../type"),a=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?)?$");t.exports=new s("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:r,construct:i,instanceOf:Date,represent:o})},{"../type":13}],30:[function(e,t,n){},{}],31:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],32:[function(e,t,n){function r(){l=!1,a.length?c=a.concat(c):p=-1,c.length&&i()}function i(){if(!l){var e=setTimeout(r);l=!0;for(var t=c.length;t;){for(a=c,c=[];++p1)for(var n=1;n=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),m(t)?r.showHidden=t:t&&n._extend(r,t),A(r.showHidden)&&(r.showHidden=!1),A(r.depth)&&(r.depth=2),A(r.colors)&&(r.colors=!1),A(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),u(r,e,r.depth)}function o(e,t){var n=i.styles[t];return n?"["+i.colors[n][0]+"m"+e+"["+i.colors[n][1]+"m":e}function s(e,t){return e}function a(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function u(e,t,r){if(e.customInspect&&t&&S(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(r,e);return x(i)||(i=u(e,i,r)),i}var o=c(e,t);if(o)return o;var s=Object.keys(t),m=a(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),j(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(t);if(0===s.length){if(S(t)){var g=t.name?": "+t.name:"";return e.stylize("[Function"+g+"]","special")}if(w(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(C(t))return e.stylize(Date.prototype.toString.call(t),"date");if(j(t))return l(t)}var y="",v=!1,b=["{","}"];if(h(t)&&(v=!0,b=["[","]"]),S(t)){var A=t.name?": "+t.name:"";y=" [Function"+A+"]"}if(w(t)&&(y=" "+RegExp.prototype.toString.call(t)),C(t)&&(y=" "+Date.prototype.toUTCString.call(t)),j(t)&&(y=" "+l(t)),0===s.length&&(!v||0==t.length))return b[0]+y+b[1];if(0>r)return w(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var k;return k=v?p(e,t,r,m,s):s.map(function(n){return f(e,t,r,m,n,v)}),e.seen.pop(),d(k,y,b)}function c(e,t){if(A(t))return e.stylize("undefined","undefined");if(x(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return v(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,n,r,i){for(var o=[],s=0,a=t.length;a>s;++s)o.push(N(t,String(s))?f(e,t,n,r,String(s),!0):"");return i.forEach(function(i){i.match(/^\d+$/)||o.push(f(e,t,n,r,i,!0))}),o}function f(e,t,n,r,i,o){var s,a,c;if(c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},c.get?a=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(a=e.stylize("[Setter]","special")),N(r,i)||(s="["+i+"]"),a||(e.seen.indexOf(c.value)<0?(a=g(n)?u(e,c.value,null):u(e,c.value,n-1),a.indexOf("\n")>-1&&(a=o?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n"))):a=e.stylize("[Circular]","special")),A(s)){if(o&&i.match(/^\d+$/))return a;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function d(e,t,n){var r=0,i=e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function h(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function g(e){return null===e}function y(e){return null==e}function v(e){return"number"==typeof e}function x(e){return"string"==typeof e}function b(e){return"symbol"==typeof e}function A(e){return void 0===e}function w(e){return k(e)&&"[object RegExp]"===E(e)}function k(e){return"object"==typeof e&&null!==e}function C(e){return k(e)&&"[object Date]"===E(e)}function j(e){return k(e)&&("[object Error]"===E(e)||e instanceof Error)}function S(e){return"function"==typeof e}function O(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function E(e){return Object.prototype.toString.call(e)}function I(e){return 10>e?"0"+e.toString(10):e.toString(10)}function F(){var e=new Date,t=[I(e.getHours()),I(e.getMinutes()),I(e.getSeconds())].join(":");return[e.getDate(),L[e.getMonth()],t].join(" ")}function N(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var _=/%[sdj%]/g;n.format=function(e){if(!x(e)){for(var t=[],n=0;n=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return e}}),a=r[n];o>n;a=r[++n])s+=g(a)||!k(a)?" "+a:" "+i(a);return s},n.deprecate=function(e,i){function o(){if(!s){if(t.throwDeprecation)throw new Error(i);t.traceDeprecation?console.trace(i):console.error(i),s=!0}return e.apply(this,arguments)}if(A(r.process))return function(){return n.deprecate(e,i).apply(this,arguments)};if(t.noDeprecation===!0)return e;var s=!1;return o};var T,M={};n.debuglog=function(e){if(A(T)&&(T=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!M[e])if(new RegExp("\\b"+e+"\\b","i").test(T)){var r=t.pid;M[e]=function(){var t=n.format.apply(n,arguments);console.error("%s %d: %s",e,r,t)}}else M[e]=function(){};return M[e]},n.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=h,n.isBoolean=m,n.isNull=g,n.isNullOrUndefined=y,n.isNumber=v,n.isString=x,n.isSymbol=b,n.isUndefined=A,n.isRegExp=w,n.isObject=k,n.isDate=C,n.isError=j,n.isFunction=S,n.isPrimitive=O,n.isBuffer=e("./support/isBuffer");var L=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",F(),n.format.apply(n,arguments))},n.inherits=e("inherits"),n._extend=function(e,t){if(!t||!k(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":33,_process:32,inherits:31}],"/":[function(e,t,n){"use strict";var r=e("./lib/js-yaml.js");t.exports=r},{"./lib/js-yaml.js":1}]},{},[])("/")}); diff --git a/node_modules/eslint/node_modules/js-yaml/index.js b/node_modules/eslint/node_modules/js-yaml/index.js deleted file mode 100644 index 1374435..0000000 --- a/node_modules/eslint/node_modules/js-yaml/index.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - - -var yaml = require('./lib/js-yaml.js'); - - -module.exports = yaml; diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml.js deleted file mode 100644 index f0e9281..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - - -var loader = require('./js-yaml/loader'); -var dumper = require('./js-yaml/dumper'); - - -function deprecated(name) { - return function () { - throw new Error('Function ' + name + ' is deprecated and cannot be used.'); - }; -} - - -module.exports.Type = require('./js-yaml/type'); -module.exports.Schema = require('./js-yaml/schema'); -module.exports.FAILSAFE_SCHEMA = require('./js-yaml/schema/failsafe'); -module.exports.JSON_SCHEMA = require('./js-yaml/schema/json'); -module.exports.CORE_SCHEMA = require('./js-yaml/schema/core'); -module.exports.DEFAULT_SAFE_SCHEMA = require('./js-yaml/schema/default_safe'); -module.exports.DEFAULT_FULL_SCHEMA = require('./js-yaml/schema/default_full'); -module.exports.load = loader.load; -module.exports.loadAll = loader.loadAll; -module.exports.safeLoad = loader.safeLoad; -module.exports.safeLoadAll = loader.safeLoadAll; -module.exports.dump = dumper.dump; -module.exports.safeDump = dumper.safeDump; -module.exports.YAMLException = require('./js-yaml/exception'); - -// Deprecated schema names from JS-YAML 2.0.x -module.exports.MINIMAL_SCHEMA = require('./js-yaml/schema/failsafe'); -module.exports.SAFE_SCHEMA = require('./js-yaml/schema/default_safe'); -module.exports.DEFAULT_SCHEMA = require('./js-yaml/schema/default_full'); - -// Deprecated functions from JS-YAML 1.x.x -module.exports.scan = deprecated('scan'); -module.exports.parse = deprecated('parse'); -module.exports.compose = deprecated('compose'); -module.exports.addConstructor = deprecated('addConstructor'); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/common.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/common.js deleted file mode 100644 index 197eb24..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/common.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict'; - - -function isNothing(subject) { - return (typeof subject === 'undefined') || (null === subject); -} - - -function isObject(subject) { - return (typeof subject === 'object') && (null !== subject); -} - - -function toArray(sequence) { - if (Array.isArray(sequence)) { - return sequence; - } else if (isNothing(sequence)) { - return []; - } - return [ sequence ]; -} - - -function extend(target, source) { - var index, length, key, sourceKeys; - - if (source) { - sourceKeys = Object.keys(source); - - for (index = 0, length = sourceKeys.length; index < length; index += 1) { - key = sourceKeys[index]; - target[key] = source[key]; - } - } - - return target; -} - - -function repeat(string, count) { - var result = '', cycle; - - for (cycle = 0; cycle < count; cycle += 1) { - result += string; - } - - return result; -} - - -function isNegativeZero(number) { - return (0 === number) && (Number.NEGATIVE_INFINITY === 1 / number); -} - - -module.exports.isNothing = isNothing; -module.exports.isObject = isObject; -module.exports.toArray = toArray; -module.exports.repeat = repeat; -module.exports.isNegativeZero = isNegativeZero; -module.exports.extend = extend; diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/dumper.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/dumper.js deleted file mode 100644 index 26112f6..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/dumper.js +++ /dev/null @@ -1,848 +0,0 @@ -'use strict'; - -/*eslint-disable no-use-before-define*/ - -var common = require('./common'); -var YAMLException = require('./exception'); -var DEFAULT_FULL_SCHEMA = require('./schema/default_full'); -var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe'); - -var _toString = Object.prototype.toString; -var _hasOwnProperty = Object.prototype.hasOwnProperty; - -var CHAR_TAB = 0x09; /* Tab */ -var CHAR_LINE_FEED = 0x0A; /* LF */ -var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */ -var CHAR_SPACE = 0x20; /* Space */ -var CHAR_EXCLAMATION = 0x21; /* ! */ -var CHAR_DOUBLE_QUOTE = 0x22; /* " */ -var CHAR_SHARP = 0x23; /* # */ -var CHAR_PERCENT = 0x25; /* % */ -var CHAR_AMPERSAND = 0x26; /* & */ -var CHAR_SINGLE_QUOTE = 0x27; /* ' */ -var CHAR_ASTERISK = 0x2A; /* * */ -var CHAR_COMMA = 0x2C; /* , */ -var CHAR_MINUS = 0x2D; /* - */ -var CHAR_COLON = 0x3A; /* : */ -var CHAR_GREATER_THAN = 0x3E; /* > */ -var CHAR_QUESTION = 0x3F; /* ? */ -var CHAR_COMMERCIAL_AT = 0x40; /* @ */ -var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ -var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ -var CHAR_GRAVE_ACCENT = 0x60; /* ` */ -var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ -var CHAR_VERTICAL_LINE = 0x7C; /* | */ -var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ - -var ESCAPE_SEQUENCES = {}; - -ESCAPE_SEQUENCES[0x00] = '\\0'; -ESCAPE_SEQUENCES[0x07] = '\\a'; -ESCAPE_SEQUENCES[0x08] = '\\b'; -ESCAPE_SEQUENCES[0x09] = '\\t'; -ESCAPE_SEQUENCES[0x0A] = '\\n'; -ESCAPE_SEQUENCES[0x0B] = '\\v'; -ESCAPE_SEQUENCES[0x0C] = '\\f'; -ESCAPE_SEQUENCES[0x0D] = '\\r'; -ESCAPE_SEQUENCES[0x1B] = '\\e'; -ESCAPE_SEQUENCES[0x22] = '\\"'; -ESCAPE_SEQUENCES[0x5C] = '\\\\'; -ESCAPE_SEQUENCES[0x85] = '\\N'; -ESCAPE_SEQUENCES[0xA0] = '\\_'; -ESCAPE_SEQUENCES[0x2028] = '\\L'; -ESCAPE_SEQUENCES[0x2029] = '\\P'; - -var DEPRECATED_BOOLEANS_SYNTAX = [ - 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', - 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' -]; - -function compileStyleMap(schema, map) { - var result, keys, index, length, tag, style, type; - - if (null === map) { - return {}; - } - - result = {}; - keys = Object.keys(map); - - for (index = 0, length = keys.length; index < length; index += 1) { - tag = keys[index]; - style = String(map[tag]); - - if ('!!' === tag.slice(0, 2)) { - tag = 'tag:yaml.org,2002:' + tag.slice(2); - } - - type = schema.compiledTypeMap[tag]; - - if (type && _hasOwnProperty.call(type.styleAliases, style)) { - style = type.styleAliases[style]; - } - - result[tag] = style; - } - - return result; -} - -function encodeHex(character) { - var string, handle, length; - - string = character.toString(16).toUpperCase(); - - if (character <= 0xFF) { - handle = 'x'; - length = 2; - } else if (character <= 0xFFFF) { - handle = 'u'; - length = 4; - } else if (character <= 0xFFFFFFFF) { - handle = 'U'; - length = 8; - } else { - throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); - } - - return '\\' + handle + common.repeat('0', length - string.length) + string; -} - -function State(options) { - this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; - this.indent = Math.max(1, (options['indent'] || 2)); - this.skipInvalid = options['skipInvalid'] || false; - this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); - this.styleMap = compileStyleMap(this.schema, options['styles'] || null); - this.sortKeys = options['sortKeys'] || false; - this.lineWidth = options['lineWidth'] || 80; - - this.implicitTypes = this.schema.compiledImplicit; - this.explicitTypes = this.schema.compiledExplicit; - - this.tag = null; - this.result = ''; - - this.duplicates = []; - this.usedDuplicates = null; -} - -function indentString(string, spaces) { - var ind = common.repeat(' ', spaces), - position = 0, - next = -1, - result = '', - line, - length = string.length; - - while (position < length) { - next = string.indexOf('\n', position); - if (next === -1) { - line = string.slice(position); - position = length; - } else { - line = string.slice(position, next + 1); - position = next + 1; - } - if (line.length && line !== '\n') { - result += ind; - } - result += line; - } - - return result; -} - -function generateNextLine(state, level) { - return '\n' + common.repeat(' ', state.indent * level); -} - -function testImplicitResolving(state, str) { - var index, length, type; - - for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { - type = state.implicitTypes[index]; - - if (type.resolve(str)) { - return true; - } - } - - return false; -} - -function StringBuilder(source) { - this.source = source; - this.result = ''; - this.checkpoint = 0; -} - -StringBuilder.prototype.takeUpTo = function (position) { - var er; - - if (position < this.checkpoint) { - er = new Error('position should be > checkpoint'); - er.position = position; - er.checkpoint = this.checkpoint; - throw er; - } - - this.result += this.source.slice(this.checkpoint, position); - this.checkpoint = position; - return this; -}; - -StringBuilder.prototype.escapeChar = function () { - var character, esc; - - character = this.source.charCodeAt(this.checkpoint); - esc = ESCAPE_SEQUENCES[character] || encodeHex(character); - this.result += esc; - this.checkpoint += 1; - - return this; -}; - -StringBuilder.prototype.finish = function () { - if (this.source.length > this.checkpoint) { - this.takeUpTo(this.source.length); - } -}; - -function writeScalar(state, object, level, iskey) { - var simple, first, spaceWrap, folded, literal, single, double, - sawLineFeed, linePosition, longestLine, indent, max, character, - position, escapeSeq, hexEsc, previous, lineLength, modifier, - trailingLineBreaks, result; - - if (0 === object.length) { - state.dump = "''"; - return; - } - - if (-1 !== DEPRECATED_BOOLEANS_SYNTAX.indexOf(object)) { - state.dump = "'" + object + "'"; - return; - } - - simple = true; - first = object.length ? object.charCodeAt(0) : 0; - spaceWrap = (CHAR_SPACE === first || - CHAR_SPACE === object.charCodeAt(object.length - 1)); - - // Simplified check for restricted first characters - // http://www.yaml.org/spec/1.2/spec.html#ns-plain-first%28c%29 - if (CHAR_MINUS === first || - CHAR_QUESTION === first || - CHAR_COMMERCIAL_AT === first || - CHAR_GRAVE_ACCENT === first) { - simple = false; - } - - // can only use > and | if not wrapped in spaces or is not a key. - if (spaceWrap) { - simple = false; - folded = false; - literal = false; - } else { - folded = !iskey; - literal = !iskey; - } - - single = true; - double = new StringBuilder(object); - - sawLineFeed = false; - linePosition = 0; - longestLine = 0; - - indent = state.indent * level; - max = state.lineWidth; - if (max === -1) { - // Replace -1 with biggest ingeger number according to - // http://ecma262-5.com/ELS5_HTML.htm#Section_8.5 - max = 9007199254740991; - } - - if (indent < 40) { - max -= indent; - } else { - max = 40; - } - - for (position = 0; position < object.length; position++) { - character = object.charCodeAt(position); - if (simple) { - // Characters that can never appear in the simple scalar - if (!simpleChar(character)) { - simple = false; - } else { - // Still simple. If we make it all the way through like - // this, then we can just dump the string as-is. - continue; - } - } - - if (single && character === CHAR_SINGLE_QUOTE) { - single = false; - } - - escapeSeq = ESCAPE_SEQUENCES[character]; - hexEsc = needsHexEscape(character); - - if (!escapeSeq && !hexEsc) { - continue; - } - - if (character !== CHAR_LINE_FEED && - character !== CHAR_DOUBLE_QUOTE && - character !== CHAR_SINGLE_QUOTE) { - folded = false; - literal = false; - } else if (character === CHAR_LINE_FEED) { - sawLineFeed = true; - single = false; - if (position > 0) { - previous = object.charCodeAt(position - 1); - if (previous === CHAR_SPACE) { - literal = false; - folded = false; - } - } - if (folded) { - lineLength = position - linePosition; - linePosition = position; - if (lineLength > longestLine) { - longestLine = lineLength; - } - } - } - - if (character !== CHAR_DOUBLE_QUOTE) { - single = false; - } - - double.takeUpTo(position); - double.escapeChar(); - } - - if (simple && testImplicitResolving(state, object)) { - simple = false; - } - - modifier = ''; - if (folded || literal) { - trailingLineBreaks = 0; - if (object.charCodeAt(object.length - 1) === CHAR_LINE_FEED) { - trailingLineBreaks += 1; - if (object.charCodeAt(object.length - 2) === CHAR_LINE_FEED) { - trailingLineBreaks += 1; - } - } - - if (trailingLineBreaks === 0) { - modifier = '-'; - } else if (trailingLineBreaks === 2) { - modifier = '+'; - } - } - - if (literal && longestLine < max) { - folded = false; - } - - // If it's literally one line, then don't bother with the literal. - // We may still want to do a fold, though, if it's a super long line. - if (!sawLineFeed) { - literal = false; - } - - if (simple) { - state.dump = object; - } else if (single) { - state.dump = '\'' + object + '\''; - } else if (folded) { - result = fold(object, max); - state.dump = '>' + modifier + '\n' + indentString(result, indent); - } else if (literal) { - if (!modifier) { - object = object.replace(/\n$/, ''); - } - state.dump = '|' + modifier + '\n' + indentString(object, indent); - } else if (double) { - double.finish(); - state.dump = '"' + double.result + '"'; - } else { - throw new Error('Failed to dump scalar value'); - } - - return; -} - -// The `trailing` var is a regexp match of any trailing `\n` characters. -// -// There are three cases we care about: -// -// 1. One trailing `\n` on the string. Just use `|` or `>`. -// This is the assumed default. (trailing = null) -// 2. No trailing `\n` on the string. Use `|-` or `>-` to "chomp" the end. -// 3. More than one trailing `\n` on the string. Use `|+` or `>+`. -// -// In the case of `>+`, these line breaks are *not* doubled (like the line -// breaks within the string), so it's important to only end with the exact -// same number as we started. -function fold(object, max) { - var result = '', - position = 0, - length = object.length, - trailing = /\n+$/.exec(object), - newLine; - - if (trailing) { - length = trailing.index + 1; - } - - while (position < length) { - newLine = object.indexOf('\n', position); - if (newLine > length || newLine === -1) { - if (result) { - result += '\n\n'; - } - result += foldLine(object.slice(position, length), max); - position = length; - } else { - if (result) { - result += '\n\n'; - } - result += foldLine(object.slice(position, newLine), max); - position = newLine + 1; - } - } - if (trailing && trailing[0] !== '\n') { - result += trailing[0]; - } - - return result; -} - -function foldLine(line, max) { - if (line === '') { - return line; - } - - var foldRe = /[^\s] [^\s]/g, - result = '', - prevMatch = 0, - foldStart = 0, - match = foldRe.exec(line), - index, - foldEnd, - folded; - - while (match) { - index = match.index; - - // when we cross the max len, if the previous match would've - // been ok, use that one, and carry on. If there was no previous - // match on this fold section, then just have a long line. - if (index - foldStart > max) { - if (prevMatch !== foldStart) { - foldEnd = prevMatch; - } else { - foldEnd = index; - } - - if (result) { - result += '\n'; - } - folded = line.slice(foldStart, foldEnd); - result += folded; - foldStart = foldEnd + 1; - } - prevMatch = index + 1; - match = foldRe.exec(line); - } - - if (result) { - result += '\n'; - } - - // if we end up with one last word at the end, then the last bit might - // be slightly bigger than we wanted, because we exited out of the loop. - if (foldStart !== prevMatch && line.length - foldStart > max) { - result += line.slice(foldStart, prevMatch) + '\n' + - line.slice(prevMatch + 1); - } else { - result += line.slice(foldStart); - } - - return result; -} - -// Returns true if character can be found in a simple scalar -function simpleChar(character) { - return CHAR_TAB !== character && - CHAR_LINE_FEED !== character && - CHAR_CARRIAGE_RETURN !== character && - CHAR_COMMA !== character && - CHAR_LEFT_SQUARE_BRACKET !== character && - CHAR_RIGHT_SQUARE_BRACKET !== character && - CHAR_LEFT_CURLY_BRACKET !== character && - CHAR_RIGHT_CURLY_BRACKET !== character && - CHAR_SHARP !== character && - CHAR_AMPERSAND !== character && - CHAR_ASTERISK !== character && - CHAR_EXCLAMATION !== character && - CHAR_VERTICAL_LINE !== character && - CHAR_GREATER_THAN !== character && - CHAR_SINGLE_QUOTE !== character && - CHAR_DOUBLE_QUOTE !== character && - CHAR_PERCENT !== character && - CHAR_COLON !== character && - !ESCAPE_SEQUENCES[character] && - !needsHexEscape(character); -} - -// Returns true if the character code needs to be escaped. -function needsHexEscape(character) { - return !((0x00020 <= character && character <= 0x00007E) || - (0x00085 === character) || - (0x000A0 <= character && character <= 0x00D7FF) || - (0x0E000 <= character && character <= 0x00FFFD) || - (0x10000 <= character && character <= 0x10FFFF)); -} - -function writeFlowSequence(state, level, object) { - var _result = '', - _tag = state.tag, - index, - length; - - for (index = 0, length = object.length; index < length; index += 1) { - // Write only valid elements. - if (writeNode(state, level, object[index], false, false)) { - if (0 !== index) { - _result += ', '; - } - _result += state.dump; - } - } - - state.tag = _tag; - state.dump = '[' + _result + ']'; -} - -function writeBlockSequence(state, level, object, compact) { - var _result = '', - _tag = state.tag, - index, - length; - - for (index = 0, length = object.length; index < length; index += 1) { - // Write only valid elements. - if (writeNode(state, level + 1, object[index], true, true)) { - if (!compact || 0 !== index) { - _result += generateNextLine(state, level); - } - _result += '- ' + state.dump; - } - } - - state.tag = _tag; - state.dump = _result || '[]'; // Empty sequence if no valid values. -} - -function writeFlowMapping(state, level, object) { - var _result = '', - _tag = state.tag, - objectKeyList = Object.keys(object), - index, - length, - objectKey, - objectValue, - pairBuffer; - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - pairBuffer = ''; - - if (0 !== index) { - pairBuffer += ', '; - } - - objectKey = objectKeyList[index]; - objectValue = object[objectKey]; - - if (!writeNode(state, level, objectKey, false, false)) { - continue; // Skip this pair because of invalid key; - } - - if (state.dump.length > 1024) { - pairBuffer += '? '; - } - - pairBuffer += state.dump + ': '; - - if (!writeNode(state, level, objectValue, false, false)) { - continue; // Skip this pair because of invalid value. - } - - pairBuffer += state.dump; - - // Both key and value are valid. - _result += pairBuffer; - } - - state.tag = _tag; - state.dump = '{' + _result + '}'; -} - -function writeBlockMapping(state, level, object, compact) { - var _result = '', - _tag = state.tag, - objectKeyList = Object.keys(object), - index, - length, - objectKey, - objectValue, - explicitPair, - pairBuffer; - - // Allow sorting keys so that the output file is deterministic - if (state.sortKeys === true) { - // Default sorting - objectKeyList.sort(); - } else if (typeof state.sortKeys === 'function') { - // Custom sort function - objectKeyList.sort(state.sortKeys); - } else if (state.sortKeys) { - // Something is wrong - throw new YAMLException('sortKeys must be a boolean or a function'); - } - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - pairBuffer = ''; - - if (!compact || 0 !== index) { - pairBuffer += generateNextLine(state, level); - } - - objectKey = objectKeyList[index]; - objectValue = object[objectKey]; - - if (!writeNode(state, level + 1, objectKey, true, true, true)) { - continue; // Skip this pair because of invalid key. - } - - explicitPair = (null !== state.tag && '?' !== state.tag) || - (state.dump && state.dump.length > 1024); - - if (explicitPair) { - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { - pairBuffer += '?'; - } else { - pairBuffer += '? '; - } - } - - pairBuffer += state.dump; - - if (explicitPair) { - pairBuffer += generateNextLine(state, level); - } - - if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { - continue; // Skip this pair because of invalid value. - } - - if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { - pairBuffer += ':'; - } else { - pairBuffer += ': '; - } - - pairBuffer += state.dump; - - // Both key and value are valid. - _result += pairBuffer; - } - - state.tag = _tag; - state.dump = _result || '{}'; // Empty mapping if no valid pairs. -} - -function detectType(state, object, explicit) { - var _result, typeList, index, length, type, style; - - typeList = explicit ? state.explicitTypes : state.implicitTypes; - - for (index = 0, length = typeList.length; index < length; index += 1) { - type = typeList[index]; - - if ((type.instanceOf || type.predicate) && - (!type.instanceOf || (('object' === typeof object) && (object instanceof type.instanceOf))) && - (!type.predicate || type.predicate(object))) { - - state.tag = explicit ? type.tag : '?'; - - if (type.represent) { - style = state.styleMap[type.tag] || type.defaultStyle; - - if ('[object Function]' === _toString.call(type.represent)) { - _result = type.represent(object, style); - } else if (_hasOwnProperty.call(type.represent, style)) { - _result = type.represent[style](object, style); - } else { - throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); - } - - state.dump = _result; - } - - return true; - } - } - - return false; -} - -// Serializes `object` and writes it to global `result`. -// Returns true on success, or false on invalid object. -// -function writeNode(state, level, object, block, compact, iskey) { - state.tag = null; - state.dump = object; - - if (!detectType(state, object, false)) { - detectType(state, object, true); - } - - var type = _toString.call(state.dump); - - if (block) { - block = (0 > state.flowLevel || state.flowLevel > level); - } - - var objectOrArray = '[object Object]' === type || '[object Array]' === type, - duplicateIndex, - duplicate; - - if (objectOrArray) { - duplicateIndex = state.duplicates.indexOf(object); - duplicate = duplicateIndex !== -1; - } - - if ((null !== state.tag && '?' !== state.tag) || duplicate || (2 !== state.indent && level > 0)) { - compact = false; - } - - if (duplicate && state.usedDuplicates[duplicateIndex]) { - state.dump = '*ref_' + duplicateIndex; - } else { - if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { - state.usedDuplicates[duplicateIndex] = true; - } - if ('[object Object]' === type) { - if (block && (0 !== Object.keys(state.dump).length)) { - writeBlockMapping(state, level, state.dump, compact); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + state.dump; - } - } else { - writeFlowMapping(state, level, state.dump); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; - } - } - } else if ('[object Array]' === type) { - if (block && (0 !== state.dump.length)) { - writeBlockSequence(state, level, state.dump, compact); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + state.dump; - } - } else { - writeFlowSequence(state, level, state.dump); - if (duplicate) { - state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; - } - } - } else if ('[object String]' === type) { - if ('?' !== state.tag) { - writeScalar(state, state.dump, level, iskey); - } - } else { - if (state.skipInvalid) { - return false; - } - throw new YAMLException('unacceptable kind of an object to dump ' + type); - } - - if (null !== state.tag && '?' !== state.tag) { - state.dump = '!<' + state.tag + '> ' + state.dump; - } - } - - return true; -} - -function getDuplicateReferences(object, state) { - var objects = [], - duplicatesIndexes = [], - index, - length; - - inspectNode(object, objects, duplicatesIndexes); - - for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { - state.duplicates.push(objects[duplicatesIndexes[index]]); - } - state.usedDuplicates = new Array(length); -} - -function inspectNode(object, objects, duplicatesIndexes) { - var objectKeyList, - index, - length; - - if (null !== object && 'object' === typeof object) { - index = objects.indexOf(object); - if (-1 !== index) { - if (-1 === duplicatesIndexes.indexOf(index)) { - duplicatesIndexes.push(index); - } - } else { - objects.push(object); - - if (Array.isArray(object)) { - for (index = 0, length = object.length; index < length; index += 1) { - inspectNode(object[index], objects, duplicatesIndexes); - } - } else { - objectKeyList = Object.keys(object); - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); - } - } - } - } -} - -function dump(input, options) { - options = options || {}; - - var state = new State(options); - - getDuplicateReferences(input, state); - - if (writeNode(state, 0, input, true, true)) { - return state.dump + '\n'; - } - return ''; -} - -function safeDump(input, options) { - return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); -} - -module.exports.dump = dump; -module.exports.safeDump = safeDump; diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/exception.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/exception.js deleted file mode 100644 index d63f309..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/exception.js +++ /dev/null @@ -1,46 +0,0 @@ -// YAML error class. http://stackoverflow.com/questions/8458984 -// -'use strict'; - - -var inherits = require('util').inherits; - - -function YAMLException(reason, mark) { - // Super constructor - Error.call(this); - - // Include stack trace in error object - if (Error.captureStackTrace) { - // Chrome and NodeJS - Error.captureStackTrace(this, this.constructor); - } else { - // FF, IE 10+ and Safari 6+. Fallback for others - this.stack = (new Error()).stack || ''; - } - - this.name = 'YAMLException'; - this.reason = reason; - this.mark = mark; - this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); -} - - -// Inherit from Error -inherits(YAMLException, Error); - - -YAMLException.prototype.toString = function toString(compact) { - var result = this.name + ': '; - - result += this.reason || '(unknown reason)'; - - if (!compact && this.mark) { - result += ' ' + this.mark.toString(); - } - - return result; -}; - - -module.exports = YAMLException; diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/loader.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/loader.js deleted file mode 100644 index 960bf45..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/loader.js +++ /dev/null @@ -1,1578 +0,0 @@ -'use strict'; - -/*eslint-disable max-len,no-use-before-define*/ - -var common = require('./common'); -var YAMLException = require('./exception'); -var Mark = require('./mark'); -var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe'); -var DEFAULT_FULL_SCHEMA = require('./schema/default_full'); - - -var _hasOwnProperty = Object.prototype.hasOwnProperty; - - -var CONTEXT_FLOW_IN = 1; -var CONTEXT_FLOW_OUT = 2; -var CONTEXT_BLOCK_IN = 3; -var CONTEXT_BLOCK_OUT = 4; - - -var CHOMPING_CLIP = 1; -var CHOMPING_STRIP = 2; -var CHOMPING_KEEP = 3; - - -var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; -var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; -var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; -var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; -var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; - - -function is_EOL(c) { - return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); -} - -function is_WHITE_SPACE(c) { - return (c === 0x09/* Tab */) || (c === 0x20/* Space */); -} - -function is_WS_OR_EOL(c) { - return (c === 0x09/* Tab */) || - (c === 0x20/* Space */) || - (c === 0x0A/* LF */) || - (c === 0x0D/* CR */); -} - -function is_FLOW_INDICATOR(c) { - return 0x2C/* , */ === c || - 0x5B/* [ */ === c || - 0x5D/* ] */ === c || - 0x7B/* { */ === c || - 0x7D/* } */ === c; -} - -function fromHexCode(c) { - var lc; - - if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { - return c - 0x30; - } - - /*eslint-disable no-bitwise*/ - lc = c | 0x20; - - if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { - return lc - 0x61 + 10; - } - - return -1; -} - -function escapedHexLen(c) { - if (c === 0x78/* x */) { return 2; } - if (c === 0x75/* u */) { return 4; } - if (c === 0x55/* U */) { return 8; } - return 0; -} - -function fromDecimalCode(c) { - if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { - return c - 0x30; - } - - return -1; -} - -function simpleEscapeSequence(c) { - return (c === 0x30/* 0 */) ? '\x00' : - (c === 0x61/* a */) ? '\x07' : - (c === 0x62/* b */) ? '\x08' : - (c === 0x74/* t */) ? '\x09' : - (c === 0x09/* Tab */) ? '\x09' : - (c === 0x6E/* n */) ? '\x0A' : - (c === 0x76/* v */) ? '\x0B' : - (c === 0x66/* f */) ? '\x0C' : - (c === 0x72/* r */) ? '\x0D' : - (c === 0x65/* e */) ? '\x1B' : - (c === 0x20/* Space */) ? ' ' : - (c === 0x22/* " */) ? '\x22' : - (c === 0x2F/* / */) ? '/' : - (c === 0x5C/* \ */) ? '\x5C' : - (c === 0x4E/* N */) ? '\x85' : - (c === 0x5F/* _ */) ? '\xA0' : - (c === 0x4C/* L */) ? '\u2028' : - (c === 0x50/* P */) ? '\u2029' : ''; -} - -function charFromCodepoint(c) { - if (c <= 0xFFFF) { - return String.fromCharCode(c); - } - // Encode UTF-16 surrogate pair - // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF - return String.fromCharCode(((c - 0x010000) >> 10) + 0xD800, - ((c - 0x010000) & 0x03FF) + 0xDC00); -} - -var simpleEscapeCheck = new Array(256); // integer, for fast access -var simpleEscapeMap = new Array(256); -for (var i = 0; i < 256; i++) { - simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; - simpleEscapeMap[i] = simpleEscapeSequence(i); -} - - -function State(input, options) { - this.input = input; - - this.filename = options['filename'] || null; - this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; - this.onWarning = options['onWarning'] || null; - this.legacy = options['legacy'] || false; - - this.implicitTypes = this.schema.compiledImplicit; - this.typeMap = this.schema.compiledTypeMap; - - this.length = input.length; - this.position = 0; - this.line = 0; - this.lineStart = 0; - this.lineIndent = 0; - - this.documents = []; - - /* - this.version; - this.checkLineBreaks; - this.tagMap; - this.anchorMap; - this.tag; - this.anchor; - this.kind; - this.result;*/ - -} - - -function generateError(state, message) { - return new YAMLException( - message, - new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart))); -} - -function throwError(state, message) { - throw generateError(state, message); -} - -function throwWarning(state, message) { - if (state.onWarning) { - state.onWarning.call(null, generateError(state, message)); - } -} - - -var directiveHandlers = { - - YAML: function handleYamlDirective(state, name, args) { - - var match, major, minor; - - if (null !== state.version) { - throwError(state, 'duplication of %YAML directive'); - } - - if (1 !== args.length) { - throwError(state, 'YAML directive accepts exactly one argument'); - } - - match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); - - if (null === match) { - throwError(state, 'ill-formed argument of the YAML directive'); - } - - major = parseInt(match[1], 10); - minor = parseInt(match[2], 10); - - if (1 !== major) { - throwError(state, 'unacceptable YAML version of the document'); - } - - state.version = args[0]; - state.checkLineBreaks = (minor < 2); - - if (1 !== minor && 2 !== minor) { - throwWarning(state, 'unsupported YAML version of the document'); - } - }, - - TAG: function handleTagDirective(state, name, args) { - - var handle, prefix; - - if (2 !== args.length) { - throwError(state, 'TAG directive accepts exactly two arguments'); - } - - handle = args[0]; - prefix = args[1]; - - if (!PATTERN_TAG_HANDLE.test(handle)) { - throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); - } - - if (_hasOwnProperty.call(state.tagMap, handle)) { - throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); - } - - if (!PATTERN_TAG_URI.test(prefix)) { - throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); - } - - state.tagMap[handle] = prefix; - } -}; - - -function captureSegment(state, start, end, checkJson) { - var _position, _length, _character, _result; - - if (start < end) { - _result = state.input.slice(start, end); - - if (checkJson) { - for (_position = 0, _length = _result.length; - _position < _length; - _position += 1) { - _character = _result.charCodeAt(_position); - if (!(0x09 === _character || - 0x20 <= _character && _character <= 0x10FFFF)) { - throwError(state, 'expected valid JSON character'); - } - } - } else if (PATTERN_NON_PRINTABLE.test(_result)) { - throwError(state, 'the stream contains non-printable characters'); - } - - state.result += _result; - } -} - -function mergeMappings(state, destination, source) { - var sourceKeys, key, index, quantity; - - if (!common.isObject(source)) { - throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); - } - - sourceKeys = Object.keys(source); - - for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { - key = sourceKeys[index]; - - if (!_hasOwnProperty.call(destination, key)) { - destination[key] = source[key]; - } - } -} - -function storeMappingPair(state, _result, keyTag, keyNode, valueNode) { - var index, quantity; - - keyNode = String(keyNode); - - if (null === _result) { - _result = {}; - } - - if ('tag:yaml.org,2002:merge' === keyTag) { - if (Array.isArray(valueNode)) { - for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { - mergeMappings(state, _result, valueNode[index]); - } - } else { - mergeMappings(state, _result, valueNode); - } - } else { - _result[keyNode] = valueNode; - } - - return _result; -} - -function readLineBreak(state) { - var ch; - - ch = state.input.charCodeAt(state.position); - - if (0x0A/* LF */ === ch) { - state.position++; - } else if (0x0D/* CR */ === ch) { - state.position++; - if (0x0A/* LF */ === state.input.charCodeAt(state.position)) { - state.position++; - } - } else { - throwError(state, 'a line break is expected'); - } - - state.line += 1; - state.lineStart = state.position; -} - -function skipSeparationSpace(state, allowComments, checkIndent) { - var lineBreaks = 0, - ch = state.input.charCodeAt(state.position); - - while (0 !== ch) { - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (allowComments && 0x23/* # */ === ch) { - do { - ch = state.input.charCodeAt(++state.position); - } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && 0 !== ch); - } - - if (is_EOL(ch)) { - readLineBreak(state); - - ch = state.input.charCodeAt(state.position); - lineBreaks++; - state.lineIndent = 0; - - while (0x20/* Space */ === ch) { - state.lineIndent++; - ch = state.input.charCodeAt(++state.position); - } - } else { - break; - } - } - - if (-1 !== checkIndent && 0 !== lineBreaks && state.lineIndent < checkIndent) { - throwWarning(state, 'deficient indentation'); - } - - return lineBreaks; -} - -function testDocumentSeparator(state) { - var _position = state.position, - ch; - - ch = state.input.charCodeAt(_position); - - // Condition state.position === state.lineStart is tested - // in parent on each call, for efficiency. No needs to test here again. - if ((0x2D/* - */ === ch || 0x2E/* . */ === ch) && - state.input.charCodeAt(_position + 1) === ch && - state.input.charCodeAt(_position + 2) === ch) { - - _position += 3; - - ch = state.input.charCodeAt(_position); - - if (ch === 0 || is_WS_OR_EOL(ch)) { - return true; - } - } - - return false; -} - -function writeFoldedLines(state, count) { - if (1 === count) { - state.result += ' '; - } else if (count > 1) { - state.result += common.repeat('\n', count - 1); - } -} - - -function readPlainScalar(state, nodeIndent, withinFlowCollection) { - var preceding, - following, - captureStart, - captureEnd, - hasPendingContent, - _line, - _lineStart, - _lineIndent, - _kind = state.kind, - _result = state.result, - ch; - - ch = state.input.charCodeAt(state.position); - - if (is_WS_OR_EOL(ch) || - is_FLOW_INDICATOR(ch) || - 0x23/* # */ === ch || - 0x26/* & */ === ch || - 0x2A/* * */ === ch || - 0x21/* ! */ === ch || - 0x7C/* | */ === ch || - 0x3E/* > */ === ch || - 0x27/* ' */ === ch || - 0x22/* " */ === ch || - 0x25/* % */ === ch || - 0x40/* @ */ === ch || - 0x60/* ` */ === ch) { - return false; - } - - if (0x3F/* ? */ === ch || 0x2D/* - */ === ch) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following) || - withinFlowCollection && is_FLOW_INDICATOR(following)) { - return false; - } - } - - state.kind = 'scalar'; - state.result = ''; - captureStart = captureEnd = state.position; - hasPendingContent = false; - - while (0 !== ch) { - if (0x3A/* : */ === ch) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following) || - withinFlowCollection && is_FLOW_INDICATOR(following)) { - break; - } - - } else if (0x23/* # */ === ch) { - preceding = state.input.charCodeAt(state.position - 1); - - if (is_WS_OR_EOL(preceding)) { - break; - } - - } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || - withinFlowCollection && is_FLOW_INDICATOR(ch)) { - break; - - } else if (is_EOL(ch)) { - _line = state.line; - _lineStart = state.lineStart; - _lineIndent = state.lineIndent; - skipSeparationSpace(state, false, -1); - - if (state.lineIndent >= nodeIndent) { - hasPendingContent = true; - ch = state.input.charCodeAt(state.position); - continue; - } else { - state.position = captureEnd; - state.line = _line; - state.lineStart = _lineStart; - state.lineIndent = _lineIndent; - break; - } - } - - if (hasPendingContent) { - captureSegment(state, captureStart, captureEnd, false); - writeFoldedLines(state, state.line - _line); - captureStart = captureEnd = state.position; - hasPendingContent = false; - } - - if (!is_WHITE_SPACE(ch)) { - captureEnd = state.position + 1; - } - - ch = state.input.charCodeAt(++state.position); - } - - captureSegment(state, captureStart, captureEnd, false); - - if (state.result) { - return true; - } - - state.kind = _kind; - state.result = _result; - return false; -} - -function readSingleQuotedScalar(state, nodeIndent) { - var ch, - captureStart, captureEnd; - - ch = state.input.charCodeAt(state.position); - - if (0x27/* ' */ !== ch) { - return false; - } - - state.kind = 'scalar'; - state.result = ''; - state.position++; - captureStart = captureEnd = state.position; - - while (0 !== (ch = state.input.charCodeAt(state.position))) { - if (0x27/* ' */ === ch) { - captureSegment(state, captureStart, state.position, true); - ch = state.input.charCodeAt(++state.position); - - if (0x27/* ' */ === ch) { - captureStart = captureEnd = state.position; - state.position++; - } else { - return true; - } - - } else if (is_EOL(ch)) { - captureSegment(state, captureStart, captureEnd, true); - writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); - captureStart = captureEnd = state.position; - - } else if (state.position === state.lineStart && testDocumentSeparator(state)) { - throwError(state, 'unexpected end of the document within a single quoted scalar'); - - } else { - state.position++; - captureEnd = state.position; - } - } - - throwError(state, 'unexpected end of the stream within a single quoted scalar'); -} - -function readDoubleQuotedScalar(state, nodeIndent) { - var captureStart, - captureEnd, - hexLength, - hexResult, - tmp, - ch; - - ch = state.input.charCodeAt(state.position); - - if (0x22/* " */ !== ch) { - return false; - } - - state.kind = 'scalar'; - state.result = ''; - state.position++; - captureStart = captureEnd = state.position; - - while (0 !== (ch = state.input.charCodeAt(state.position))) { - if (0x22/* " */ === ch) { - captureSegment(state, captureStart, state.position, true); - state.position++; - return true; - - } else if (0x5C/* \ */ === ch) { - captureSegment(state, captureStart, state.position, true); - ch = state.input.charCodeAt(++state.position); - - if (is_EOL(ch)) { - skipSeparationSpace(state, false, nodeIndent); - - // TODO: rework to inline fn with no type cast? - } else if (ch < 256 && simpleEscapeCheck[ch]) { - state.result += simpleEscapeMap[ch]; - state.position++; - - } else if ((tmp = escapedHexLen(ch)) > 0) { - hexLength = tmp; - hexResult = 0; - - for (; hexLength > 0; hexLength--) { - ch = state.input.charCodeAt(++state.position); - - if ((tmp = fromHexCode(ch)) >= 0) { - hexResult = (hexResult << 4) + tmp; - - } else { - throwError(state, 'expected hexadecimal character'); - } - } - - state.result += charFromCodepoint(hexResult); - - state.position++; - - } else { - throwError(state, 'unknown escape sequence'); - } - - captureStart = captureEnd = state.position; - - } else if (is_EOL(ch)) { - captureSegment(state, captureStart, captureEnd, true); - writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); - captureStart = captureEnd = state.position; - - } else if (state.position === state.lineStart && testDocumentSeparator(state)) { - throwError(state, 'unexpected end of the document within a double quoted scalar'); - - } else { - state.position++; - captureEnd = state.position; - } - } - - throwError(state, 'unexpected end of the stream within a double quoted scalar'); -} - -function readFlowCollection(state, nodeIndent) { - var readNext = true, - _line, - _tag = state.tag, - _result, - _anchor = state.anchor, - following, - terminator, - isPair, - isExplicitPair, - isMapping, - keyNode, - keyTag, - valueNode, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x5B/* [ */) { - terminator = 0x5D;/* ] */ - isMapping = false; - _result = []; - } else if (ch === 0x7B/* { */) { - terminator = 0x7D;/* } */ - isMapping = true; - _result = {}; - } else { - return false; - } - - if (null !== state.anchor) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(++state.position); - - while (0 !== ch) { - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if (ch === terminator) { - state.position++; - state.tag = _tag; - state.anchor = _anchor; - state.kind = isMapping ? 'mapping' : 'sequence'; - state.result = _result; - return true; - } else if (!readNext) { - throwError(state, 'missed comma between flow collection entries'); - } - - keyTag = keyNode = valueNode = null; - isPair = isExplicitPair = false; - - if (0x3F/* ? */ === ch) { - following = state.input.charCodeAt(state.position + 1); - - if (is_WS_OR_EOL(following)) { - isPair = isExplicitPair = true; - state.position++; - skipSeparationSpace(state, true, nodeIndent); - } - } - - _line = state.line; - composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - keyTag = state.tag; - keyNode = state.result; - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if ((isExplicitPair || state.line === _line) && 0x3A/* : */ === ch) { - isPair = true; - ch = state.input.charCodeAt(++state.position); - skipSeparationSpace(state, true, nodeIndent); - composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); - valueNode = state.result; - } - - if (isMapping) { - storeMappingPair(state, _result, keyTag, keyNode, valueNode); - } else if (isPair) { - _result.push(storeMappingPair(state, null, keyTag, keyNode, valueNode)); - } else { - _result.push(keyNode); - } - - skipSeparationSpace(state, true, nodeIndent); - - ch = state.input.charCodeAt(state.position); - - if (0x2C/* , */ === ch) { - readNext = true; - ch = state.input.charCodeAt(++state.position); - } else { - readNext = false; - } - } - - throwError(state, 'unexpected end of the stream within a flow collection'); -} - -function readBlockScalar(state, nodeIndent) { - var captureStart, - folding, - chomping = CHOMPING_CLIP, - detectedIndent = false, - textIndent = nodeIndent, - emptyLines = 0, - atMoreIndented = false, - tmp, - ch; - - ch = state.input.charCodeAt(state.position); - - if (ch === 0x7C/* | */) { - folding = false; - } else if (ch === 0x3E/* > */) { - folding = true; - } else { - return false; - } - - state.kind = 'scalar'; - state.result = ''; - - while (0 !== ch) { - ch = state.input.charCodeAt(++state.position); - - if (0x2B/* + */ === ch || 0x2D/* - */ === ch) { - if (CHOMPING_CLIP === chomping) { - chomping = (0x2B/* + */ === ch) ? CHOMPING_KEEP : CHOMPING_STRIP; - } else { - throwError(state, 'repeat of a chomping mode identifier'); - } - - } else if ((tmp = fromDecimalCode(ch)) >= 0) { - if (tmp === 0) { - throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); - } else if (!detectedIndent) { - textIndent = nodeIndent + tmp - 1; - detectedIndent = true; - } else { - throwError(state, 'repeat of an indentation width identifier'); - } - - } else { - break; - } - } - - if (is_WHITE_SPACE(ch)) { - do { ch = state.input.charCodeAt(++state.position); } - while (is_WHITE_SPACE(ch)); - - if (0x23/* # */ === ch) { - do { ch = state.input.charCodeAt(++state.position); } - while (!is_EOL(ch) && (0 !== ch)); - } - } - - while (0 !== ch) { - readLineBreak(state); - state.lineIndent = 0; - - ch = state.input.charCodeAt(state.position); - - while ((!detectedIndent || state.lineIndent < textIndent) && - (0x20/* Space */ === ch)) { - state.lineIndent++; - ch = state.input.charCodeAt(++state.position); - } - - if (!detectedIndent && state.lineIndent > textIndent) { - textIndent = state.lineIndent; - } - - if (is_EOL(ch)) { - emptyLines++; - continue; - } - - // End of the scalar. - if (state.lineIndent < textIndent) { - - // Perform the chomping. - if (chomping === CHOMPING_KEEP) { - state.result += common.repeat('\n', emptyLines); - } else if (chomping === CHOMPING_CLIP) { - if (detectedIndent) { // i.e. only if the scalar is not empty. - state.result += '\n'; - } - } - - // Break this `while` cycle and go to the funciton's epilogue. - break; - } - - // Folded style: use fancy rules to handle line breaks. - if (folding) { - - // Lines starting with white space characters (more-indented lines) are not folded. - if (is_WHITE_SPACE(ch)) { - atMoreIndented = true; - state.result += common.repeat('\n', emptyLines + 1); - - // End of more-indented block. - } else if (atMoreIndented) { - atMoreIndented = false; - state.result += common.repeat('\n', emptyLines + 1); - - // Just one line break - perceive as the same line. - } else if (0 === emptyLines) { - if (detectedIndent) { // i.e. only if we have already read some scalar content. - state.result += ' '; - } - - // Several line breaks - perceive as different lines. - } else { - state.result += common.repeat('\n', emptyLines); - } - - // Literal style: just add exact number of line breaks between content lines. - } else if (detectedIndent) { - // If current line isn't the first one - count line break from the last content line. - state.result += common.repeat('\n', emptyLines + 1); - } else { - // In case of the first content line - count only empty lines. - state.result += common.repeat('\n', emptyLines); - } - - detectedIndent = true; - emptyLines = 0; - captureStart = state.position; - - while (!is_EOL(ch) && (0 !== ch)) { - ch = state.input.charCodeAt(++state.position); - } - - captureSegment(state, captureStart, state.position, false); - } - - return true; -} - -function readBlockSequence(state, nodeIndent) { - var _line, - _tag = state.tag, - _anchor = state.anchor, - _result = [], - following, - detected = false, - ch; - - if (null !== state.anchor) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(state.position); - - while (0 !== ch) { - - if (0x2D/* - */ !== ch) { - break; - } - - following = state.input.charCodeAt(state.position + 1); - - if (!is_WS_OR_EOL(following)) { - break; - } - - detected = true; - state.position++; - - if (skipSeparationSpace(state, true, -1)) { - if (state.lineIndent <= nodeIndent) { - _result.push(null); - ch = state.input.charCodeAt(state.position); - continue; - } - } - - _line = state.line; - composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); - _result.push(state.result); - skipSeparationSpace(state, true, -1); - - ch = state.input.charCodeAt(state.position); - - if ((state.line === _line || state.lineIndent > nodeIndent) && (0 !== ch)) { - throwError(state, 'bad indentation of a sequence entry'); - } else if (state.lineIndent < nodeIndent) { - break; - } - } - - if (detected) { - state.tag = _tag; - state.anchor = _anchor; - state.kind = 'sequence'; - state.result = _result; - return true; - } - return false; -} - -function readBlockMapping(state, nodeIndent, flowIndent) { - var following, - allowCompact, - _line, - _tag = state.tag, - _anchor = state.anchor, - _result = {}, - keyTag = null, - keyNode = null, - valueNode = null, - atExplicitKey = false, - detected = false, - ch; - - if (null !== state.anchor) { - state.anchorMap[state.anchor] = _result; - } - - ch = state.input.charCodeAt(state.position); - - while (0 !== ch) { - following = state.input.charCodeAt(state.position + 1); - _line = state.line; // Save the current line. - - // - // Explicit notation case. There are two separate blocks: - // first for the key (denoted by "?") and second for the value (denoted by ":") - // - if ((0x3F/* ? */ === ch || 0x3A/* : */ === ch) && is_WS_OR_EOL(following)) { - - if (0x3F/* ? */ === ch) { - if (atExplicitKey) { - storeMappingPair(state, _result, keyTag, keyNode, null); - keyTag = keyNode = valueNode = null; - } - - detected = true; - atExplicitKey = true; - allowCompact = true; - - } else if (atExplicitKey) { - // i.e. 0x3A/* : */ === character after the explicit key. - atExplicitKey = false; - allowCompact = true; - - } else { - throwError(state, 'incomplete explicit mapping pair; a key node is missed'); - } - - state.position += 1; - ch = following; - - // - // Implicit notation case. Flow-style node as the key first, then ":", and the value. - // - } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { - - if (state.line === _line) { - ch = state.input.charCodeAt(state.position); - - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (0x3A/* : */ === ch) { - ch = state.input.charCodeAt(++state.position); - - if (!is_WS_OR_EOL(ch)) { - throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); - } - - if (atExplicitKey) { - storeMappingPair(state, _result, keyTag, keyNode, null); - keyTag = keyNode = valueNode = null; - } - - detected = true; - atExplicitKey = false; - allowCompact = false; - keyTag = state.tag; - keyNode = state.result; - - } else if (detected) { - throwError(state, 'can not read an implicit mapping pair; a colon is missed'); - - } else { - state.tag = _tag; - state.anchor = _anchor; - return true; // Keep the result of `composeNode`. - } - - } else if (detected) { - throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); - - } else { - state.tag = _tag; - state.anchor = _anchor; - return true; // Keep the result of `composeNode`. - } - - } else { - break; // Reading is done. Go to the epilogue. - } - - // - // Common reading code for both explicit and implicit notations. - // - if (state.line === _line || state.lineIndent > nodeIndent) { - if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { - if (atExplicitKey) { - keyNode = state.result; - } else { - valueNode = state.result; - } - } - - if (!atExplicitKey) { - storeMappingPair(state, _result, keyTag, keyNode, valueNode); - keyTag = keyNode = valueNode = null; - } - - skipSeparationSpace(state, true, -1); - ch = state.input.charCodeAt(state.position); - } - - if (state.lineIndent > nodeIndent && (0 !== ch)) { - throwError(state, 'bad indentation of a mapping entry'); - } else if (state.lineIndent < nodeIndent) { - break; - } - } - - // - // Epilogue. - // - - // Special case: last mapping's node contains only the key in explicit notation. - if (atExplicitKey) { - storeMappingPair(state, _result, keyTag, keyNode, null); - } - - // Expose the resulting mapping. - if (detected) { - state.tag = _tag; - state.anchor = _anchor; - state.kind = 'mapping'; - state.result = _result; - } - - return detected; -} - -function readTagProperty(state) { - var _position, - isVerbatim = false, - isNamed = false, - tagHandle, - tagName, - ch; - - ch = state.input.charCodeAt(state.position); - - if (0x21/* ! */ !== ch) { - return false; - } - - if (null !== state.tag) { - throwError(state, 'duplication of a tag property'); - } - - ch = state.input.charCodeAt(++state.position); - - if (0x3C/* < */ === ch) { - isVerbatim = true; - ch = state.input.charCodeAt(++state.position); - - } else if (0x21/* ! */ === ch) { - isNamed = true; - tagHandle = '!!'; - ch = state.input.charCodeAt(++state.position); - - } else { - tagHandle = '!'; - } - - _position = state.position; - - if (isVerbatim) { - do { ch = state.input.charCodeAt(++state.position); } - while (0 !== ch && 0x3E/* > */ !== ch); - - if (state.position < state.length) { - tagName = state.input.slice(_position, state.position); - ch = state.input.charCodeAt(++state.position); - } else { - throwError(state, 'unexpected end of the stream within a verbatim tag'); - } - } else { - while (0 !== ch && !is_WS_OR_EOL(ch)) { - - if (0x21/* ! */ === ch) { - if (!isNamed) { - tagHandle = state.input.slice(_position - 1, state.position + 1); - - if (!PATTERN_TAG_HANDLE.test(tagHandle)) { - throwError(state, 'named tag handle cannot contain such characters'); - } - - isNamed = true; - _position = state.position + 1; - } else { - throwError(state, 'tag suffix cannot contain exclamation marks'); - } - } - - ch = state.input.charCodeAt(++state.position); - } - - tagName = state.input.slice(_position, state.position); - - if (PATTERN_FLOW_INDICATORS.test(tagName)) { - throwError(state, 'tag suffix cannot contain flow indicator characters'); - } - } - - if (tagName && !PATTERN_TAG_URI.test(tagName)) { - throwError(state, 'tag name cannot contain such characters: ' + tagName); - } - - if (isVerbatim) { - state.tag = tagName; - - } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { - state.tag = state.tagMap[tagHandle] + tagName; - - } else if ('!' === tagHandle) { - state.tag = '!' + tagName; - - } else if ('!!' === tagHandle) { - state.tag = 'tag:yaml.org,2002:' + tagName; - - } else { - throwError(state, 'undeclared tag handle "' + tagHandle + '"'); - } - - return true; -} - -function readAnchorProperty(state) { - var _position, - ch; - - ch = state.input.charCodeAt(state.position); - - if (0x26/* & */ !== ch) { - return false; - } - - if (null !== state.anchor) { - throwError(state, 'duplication of an anchor property'); - } - - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (state.position === _position) { - throwError(state, 'name of an anchor node must contain at least one character'); - } - - state.anchor = state.input.slice(_position, state.position); - return true; -} - -function readAlias(state) { - var _position, alias, - ch; - - ch = state.input.charCodeAt(state.position); - - if (0x2A/* * */ !== ch) { - return false; - } - - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (state.position === _position) { - throwError(state, 'name of an alias node must contain at least one character'); - } - - alias = state.input.slice(_position, state.position); - - if (!state.anchorMap.hasOwnProperty(alias)) { - throwError(state, 'unidentified alias "' + alias + '"'); - } - - state.result = state.anchorMap[alias]; - skipSeparationSpace(state, true, -1); - return true; -} - -function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { - var allowBlockStyles, - allowBlockScalars, - allowBlockCollections, - indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { - indentStatus = 1; - } else if (state.lineIndent === parentIndent) { - indentStatus = 0; - } else if (state.lineIndent < parentIndent) { - indentStatus = -1; - } - } - } - - if (1 === indentStatus) { - while (readTagProperty(state) || readAnchorProperty(state)) { - if (skipSeparationSpace(state, true, -1)) { - atNewLine = true; - allowBlockCollections = allowBlockStyles; - - if (state.lineIndent > parentIndent) { - indentStatus = 1; - } else if (state.lineIndent === parentIndent) { - indentStatus = 0; - } else if (state.lineIndent < parentIndent) { - indentStatus = -1; - } - } else { - allowBlockCollections = false; - } - } - } - - if (allowBlockCollections) { - allowBlockCollections = atNewLine || allowCompact; - } - - if (1 === indentStatus || CONTEXT_BLOCK_OUT === nodeContext) { - if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { - flowIndent = parentIndent; - } else { - flowIndent = parentIndent + 1; - } - - blockIndent = state.position - state.lineStart; - - if (1 === indentStatus) { - if (allowBlockCollections && - (readBlockSequence(state, blockIndent) || - readBlockMapping(state, blockIndent, flowIndent)) || - readFlowCollection(state, flowIndent)) { - hasContent = true; - } else { - if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || - readSingleQuotedScalar(state, flowIndent) || - readDoubleQuotedScalar(state, flowIndent)) { - hasContent = true; - - } else if (readAlias(state)) { - hasContent = true; - - if (null !== state.tag || null !== state.anchor) { - throwError(state, 'alias node should not have any properties'); - } - - } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { - hasContent = true; - - if (null === state.tag) { - state.tag = '?'; - } - } - - if (null !== state.anchor) { - state.anchorMap[state.anchor] = state.result; - } - } - } else if (0 === indentStatus) { - // Special case: block sequences are allowed to have same indentation level as the parent. - // http://www.yaml.org/spec/1.2/spec.html#id2799784 - hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); - } - } - - if (null !== state.tag && '!' !== state.tag) { - if ('?' === state.tag) { - for (typeIndex = 0, typeQuantity = state.implicitTypes.length; - typeIndex < typeQuantity; - typeIndex += 1) { - type = state.implicitTypes[typeIndex]; - - // Implicit resolving is not allowed for non-scalar types, and '?' - // non-specific tag is only assigned to plain scalars. So, it isn't - // needed to check for 'kind' conformity. - - if (type.resolve(state.result)) { // `state.result` updated in resolver if matched - state.result = type.construct(state.result); - state.tag = type.tag; - if (null !== state.anchor) { - state.anchorMap[state.anchor] = state.result; - } - break; - } - } - } else if (_hasOwnProperty.call(state.typeMap, state.tag)) { - type = state.typeMap[state.tag]; - - if (null !== state.result && type.kind !== state.kind) { - throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); - } - - if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched - throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); - } else { - state.result = type.construct(state.result); - if (null !== state.anchor) { - state.anchorMap[state.anchor] = state.result; - } - } - } else { - throwError(state, 'unknown tag !<' + state.tag + '>'); - } - } - - return null !== state.tag || null !== state.anchor || hasContent; -} - -function readDocument(state) { - var documentStart = state.position, - _position, - directiveName, - directiveArgs, - hasDirectives = false, - ch; - - state.version = null; - state.checkLineBreaks = state.legacy; - state.tagMap = {}; - state.anchorMap = {}; - - while (0 !== (ch = state.input.charCodeAt(state.position))) { - skipSeparationSpace(state, true, -1); - - ch = state.input.charCodeAt(state.position); - - if (state.lineIndent > 0 || 0x25/* % */ !== ch) { - break; - } - - hasDirectives = true; - ch = state.input.charCodeAt(++state.position); - _position = state.position; - - while (0 !== ch && !is_WS_OR_EOL(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - directiveName = state.input.slice(_position, state.position); - directiveArgs = []; - - if (directiveName.length < 1) { - throwError(state, 'directive name must not be less than one character in length'); - } - - while (0 !== ch) { - while (is_WHITE_SPACE(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - if (0x23/* # */ === ch) { - do { ch = state.input.charCodeAt(++state.position); } - while (0 !== ch && !is_EOL(ch)); - break; - } - - if (is_EOL(ch)) { - break; - } - - _position = state.position; - - while (0 !== ch && !is_WS_OR_EOL(ch)) { - ch = state.input.charCodeAt(++state.position); - } - - directiveArgs.push(state.input.slice(_position, state.position)); - } - - if (0 !== ch) { - readLineBreak(state); - } - - if (_hasOwnProperty.call(directiveHandlers, directiveName)) { - directiveHandlers[directiveName](state, directiveName, directiveArgs); - } else { - throwWarning(state, 'unknown document directive "' + directiveName + '"'); - } - } - - skipSeparationSpace(state, true, -1); - - if (0 === state.lineIndent && - 0x2D/* - */ === state.input.charCodeAt(state.position) && - 0x2D/* - */ === state.input.charCodeAt(state.position + 1) && - 0x2D/* - */ === state.input.charCodeAt(state.position + 2)) { - state.position += 3; - skipSeparationSpace(state, true, -1); - - } else if (hasDirectives) { - throwError(state, 'directives end mark is expected'); - } - - composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); - skipSeparationSpace(state, true, -1); - - if (state.checkLineBreaks && - PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { - throwWarning(state, 'non-ASCII line breaks are interpreted as content'); - } - - state.documents.push(state.result); - - if (state.position === state.lineStart && testDocumentSeparator(state)) { - - if (0x2E/* . */ === state.input.charCodeAt(state.position)) { - state.position += 3; - skipSeparationSpace(state, true, -1); - } - return; - } - - if (state.position < (state.length - 1)) { - throwError(state, 'end of the stream or a document separator is expected'); - } else { - return; - } -} - - -function loadDocuments(input, options) { - input = String(input); - options = options || {}; - - if (input.length !== 0) { - - // Add tailing `\n` if not exists - if (0x0A/* LF */ !== input.charCodeAt(input.length - 1) && - 0x0D/* CR */ !== input.charCodeAt(input.length - 1)) { - input += '\n'; - } - - // Strip BOM - if (input.charCodeAt(0) === 0xFEFF) { - input = input.slice(1); - } - } - - var state = new State(input, options); - - // Use 0 as string terminator. That significantly simplifies bounds check. - state.input += '\0'; - - while (0x20/* Space */ === state.input.charCodeAt(state.position)) { - state.lineIndent += 1; - state.position += 1; - } - - while (state.position < (state.length - 1)) { - readDocument(state); - } - - return state.documents; -} - - -function loadAll(input, iterator, options) { - var documents = loadDocuments(input, options), index, length; - - for (index = 0, length = documents.length; index < length; index += 1) { - iterator(documents[index]); - } -} - - -function load(input, options) { - var documents = loadDocuments(input, options); - - if (0 === documents.length) { - /*eslint-disable no-undefined*/ - return undefined; - } else if (1 === documents.length) { - return documents[0]; - } - throw new YAMLException('expected a single document in the stream, but found more'); -} - - -function safeLoadAll(input, output, options) { - loadAll(input, output, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); -} - - -function safeLoad(input, options) { - return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); -} - - -module.exports.loadAll = loadAll; -module.exports.load = load; -module.exports.safeLoadAll = safeLoadAll; -module.exports.safeLoad = safeLoad; diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/mark.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/mark.js deleted file mode 100644 index bfe279b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/mark.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - - -var common = require('./common'); - - -function Mark(name, buffer, position, line, column) { - this.name = name; - this.buffer = buffer; - this.position = position; - this.line = line; - this.column = column; -} - - -Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { - var head, start, tail, end, snippet; - - if (!this.buffer) { - return null; - } - - indent = indent || 4; - maxLength = maxLength || 75; - - head = ''; - start = this.position; - - while (start > 0 && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1))) { - start -= 1; - if (this.position - start > (maxLength / 2 - 1)) { - head = ' ... '; - start += 5; - break; - } - } - - tail = ''; - end = this.position; - - while (end < this.buffer.length && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end))) { - end += 1; - if (end - this.position > (maxLength / 2 - 1)) { - tail = ' ... '; - end -= 5; - break; - } - } - - snippet = this.buffer.slice(start, end); - - return common.repeat(' ', indent) + head + snippet + tail + '\n' + - common.repeat(' ', indent + this.position - start + head.length) + '^'; -}; - - -Mark.prototype.toString = function toString(compact) { - var snippet, where = ''; - - if (this.name) { - where += 'in "' + this.name + '" '; - } - - where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); - - if (!compact) { - snippet = this.getSnippet(); - - if (snippet) { - where += ':\n' + snippet; - } - } - - return where; -}; - - -module.exports = Mark; diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema.js deleted file mode 100644 index 984e290..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema.js +++ /dev/null @@ -1,104 +0,0 @@ -'use strict'; - -/*eslint-disable max-len*/ - -var common = require('./common'); -var YAMLException = require('./exception'); -var Type = require('./type'); - - -function compileList(schema, name, result) { - var exclude = []; - - schema.include.forEach(function (includedSchema) { - result = compileList(includedSchema, name, result); - }); - - schema[name].forEach(function (currentType) { - result.forEach(function (previousType, previousIndex) { - if (previousType.tag === currentType.tag) { - exclude.push(previousIndex); - } - }); - - result.push(currentType); - }); - - return result.filter(function (type, index) { - return -1 === exclude.indexOf(index); - }); -} - - -function compileMap(/* lists... */) { - var result = {}, index, length; - - function collectType(type) { - result[type.tag] = type; - } - - for (index = 0, length = arguments.length; index < length; index += 1) { - arguments[index].forEach(collectType); - } - - return result; -} - - -function Schema(definition) { - this.include = definition.include || []; - this.implicit = definition.implicit || []; - this.explicit = definition.explicit || []; - - this.implicit.forEach(function (type) { - if (type.loadKind && 'scalar' !== type.loadKind) { - throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); - } - }); - - this.compiledImplicit = compileList(this, 'implicit', []); - this.compiledExplicit = compileList(this, 'explicit', []); - this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); -} - - -Schema.DEFAULT = null; - - -Schema.create = function createSchema() { - var schemas, types; - - switch (arguments.length) { - case 1: - schemas = Schema.DEFAULT; - types = arguments[0]; - break; - - case 2: - schemas = arguments[0]; - types = arguments[1]; - break; - - default: - throw new YAMLException('Wrong number of arguments for Schema.create function'); - } - - schemas = common.toArray(schemas); - types = common.toArray(types); - - if (!schemas.every(function (schema) { return schema instanceof Schema; })) { - throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); - } - - if (!types.every(function (type) { return type instanceof Type; })) { - throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); - } - - return new Schema({ - include: schemas, - explicit: types - }); -}; - - -module.exports = Schema; diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/core.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/core.js deleted file mode 100644 index 206daab..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/core.js +++ /dev/null @@ -1,18 +0,0 @@ -// Standard YAML's Core schema. -// http://www.yaml.org/spec/1.2/spec.html#id2804923 -// -// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. -// So, Core schema has no distinctions from JSON schema is JS-YAML. - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./json') - ] -}); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/default_full.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/default_full.js deleted file mode 100644 index a55ef42..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/default_full.js +++ /dev/null @@ -1,25 +0,0 @@ -// JS-YAML's default schema for `load` function. -// It is not described in the YAML specification. -// -// This schema is based on JS-YAML's default safe schema and includes -// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. -// -// Also this schema is used as default base schema at `Schema.create` function. - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = Schema.DEFAULT = new Schema({ - include: [ - require('./default_safe') - ], - explicit: [ - require('../type/js/undefined'), - require('../type/js/regexp'), - require('../type/js/function') - ] -}); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js deleted file mode 100644 index 11d89bb..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js +++ /dev/null @@ -1,28 +0,0 @@ -// JS-YAML's default schema for `safeLoad` function. -// It is not described in the YAML specification. -// -// This schema is based on standard YAML's Core schema and includes most of -// extra types described at YAML tag repository. (http://yaml.org/type/) - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./core') - ], - implicit: [ - require('../type/timestamp'), - require('../type/merge') - ], - explicit: [ - require('../type/binary'), - require('../type/omap'), - require('../type/pairs'), - require('../type/set') - ] -}); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js deleted file mode 100644 index b7a33eb..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js +++ /dev/null @@ -1,17 +0,0 @@ -// Standard YAML's Failsafe schema. -// http://www.yaml.org/spec/1.2/spec.html#id2802346 - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - explicit: [ - require('../type/str'), - require('../type/seq'), - require('../type/map') - ] -}); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/json.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/json.js deleted file mode 100644 index 5be3dbf..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/schema/json.js +++ /dev/null @@ -1,25 +0,0 @@ -// Standard YAML's JSON schema. -// http://www.yaml.org/spec/1.2/spec.html#id2803231 -// -// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. -// So, this schema is not such strict as defined in the YAML specification. -// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. - - -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./failsafe') - ], - implicit: [ - require('../type/null'), - require('../type/bool'), - require('../type/int'), - require('../type/float') - ] -}); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type.js deleted file mode 100644 index 5e3176c..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict'; - -var YAMLException = require('./exception'); - -var TYPE_CONSTRUCTOR_OPTIONS = [ - 'kind', - 'resolve', - 'construct', - 'instanceOf', - 'predicate', - 'represent', - 'defaultStyle', - 'styleAliases' -]; - -var YAML_NODE_KINDS = [ - 'scalar', - 'sequence', - 'mapping' -]; - -function compileStyleAliases(map) { - var result = {}; - - if (null !== map) { - Object.keys(map).forEach(function (style) { - map[style].forEach(function (alias) { - result[String(alias)] = style; - }); - }); - } - - return result; -} - -function Type(tag, options) { - options = options || {}; - - Object.keys(options).forEach(function (name) { - if (-1 === TYPE_CONSTRUCTOR_OPTIONS.indexOf(name)) { - throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); - } - }); - - // TODO: Add tag format check. - this.tag = tag; - this.kind = options['kind'] || null; - this.resolve = options['resolve'] || function () { return true; }; - this.construct = options['construct'] || function (data) { return data; }; - this.instanceOf = options['instanceOf'] || null; - this.predicate = options['predicate'] || null; - this.represent = options['represent'] || null; - this.defaultStyle = options['defaultStyle'] || null; - this.styleAliases = compileStyleAliases(options['styleAliases'] || null); - - if (-1 === YAML_NODE_KINDS.indexOf(this.kind)) { - throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); - } -} - -module.exports = Type; diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/binary.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/binary.js deleted file mode 100644 index b4cdba1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/binary.js +++ /dev/null @@ -1,134 +0,0 @@ -'use strict'; - -/*eslint-disable no-bitwise*/ - -// A trick for browserified version. -// Since we make browserifier to ignore `buffer` module, NodeBuffer will be undefined -var NodeBuffer = require('buffer').Buffer; -var Type = require('../type'); - - -// [ 64, 65, 66 ] -> [ padding, CR, LF ] -var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; - - -function resolveYamlBinary(data) { - if (null === data) { - return false; - } - - var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; - - // Convert one by one. - for (idx = 0; idx < max; idx++) { - code = map.indexOf(data.charAt(idx)); - - // Skip CR/LF - if (code > 64) { continue; } - - // Fail on illegal characters - if (code < 0) { return false; } - - bitlen += 6; - } - - // If there are any bits left, source was corrupted - return (bitlen % 8) === 0; -} - -function constructYamlBinary(data) { - var idx, tailbits, - input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan - max = input.length, - map = BASE64_MAP, - bits = 0, - result = []; - - // Collect by 6*4 bits (3 bytes) - - for (idx = 0; idx < max; idx++) { - if ((idx % 4 === 0) && idx) { - result.push((bits >> 16) & 0xFF); - result.push((bits >> 8) & 0xFF); - result.push(bits & 0xFF); - } - - bits = (bits << 6) | map.indexOf(input.charAt(idx)); - } - - // Dump tail - - tailbits = (max % 4) * 6; - - if (tailbits === 0) { - result.push((bits >> 16) & 0xFF); - result.push((bits >> 8) & 0xFF); - result.push(bits & 0xFF); - } else if (tailbits === 18) { - result.push((bits >> 10) & 0xFF); - result.push((bits >> 2) & 0xFF); - } else if (tailbits === 12) { - result.push((bits >> 4) & 0xFF); - } - - // Wrap into Buffer for NodeJS and leave Array for browser - if (NodeBuffer) { - return new NodeBuffer(result); - } - - return result; -} - -function representYamlBinary(object /*, style*/) { - var result = '', bits = 0, idx, tail, - max = object.length, - map = BASE64_MAP; - - // Convert every three bytes to 4 ASCII characters. - - for (idx = 0; idx < max; idx++) { - if ((idx % 3 === 0) && idx) { - result += map[(bits >> 18) & 0x3F]; - result += map[(bits >> 12) & 0x3F]; - result += map[(bits >> 6) & 0x3F]; - result += map[bits & 0x3F]; - } - - bits = (bits << 8) + object[idx]; - } - - // Dump tail - - tail = max % 3; - - if (tail === 0) { - result += map[(bits >> 18) & 0x3F]; - result += map[(bits >> 12) & 0x3F]; - result += map[(bits >> 6) & 0x3F]; - result += map[bits & 0x3F]; - } else if (tail === 2) { - result += map[(bits >> 10) & 0x3F]; - result += map[(bits >> 4) & 0x3F]; - result += map[(bits << 2) & 0x3F]; - result += map[64]; - } else if (tail === 1) { - result += map[(bits >> 2) & 0x3F]; - result += map[(bits << 4) & 0x3F]; - result += map[64]; - result += map[64]; - } - - return result; -} - -function isBinary(object) { - return NodeBuffer && NodeBuffer.isBuffer(object); -} - -module.exports = new Type('tag:yaml.org,2002:binary', { - kind: 'scalar', - resolve: resolveYamlBinary, - construct: constructYamlBinary, - predicate: isBinary, - represent: representYamlBinary -}); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/bool.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/bool.js deleted file mode 100644 index 5c2a304..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/bool.js +++ /dev/null @@ -1,37 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -function resolveYamlBoolean(data) { - if (null === data) { - return false; - } - - var max = data.length; - - return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || - (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); -} - -function constructYamlBoolean(data) { - return data === 'true' || - data === 'True' || - data === 'TRUE'; -} - -function isBoolean(object) { - return '[object Boolean]' === Object.prototype.toString.call(object); -} - -module.exports = new Type('tag:yaml.org,2002:bool', { - kind: 'scalar', - resolve: resolveYamlBoolean, - construct: constructYamlBoolean, - predicate: isBoolean, - represent: { - lowercase: function (object) { return object ? 'true' : 'false'; }, - uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, - camelcase: function (object) { return object ? 'True' : 'False'; } - }, - defaultStyle: 'lowercase' -}); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/float.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/float.js deleted file mode 100644 index 8151a6e..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/float.js +++ /dev/null @@ -1,117 +0,0 @@ -'use strict'; - -var common = require('../common'); -var Type = require('../type'); - -var YAML_FLOAT_PATTERN = new RegExp( - '^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?' + - '|\\.[0-9_]+(?:[eE][-+][0-9]+)?' + - '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + - '|[-+]?\\.(?:inf|Inf|INF)' + - '|\\.(?:nan|NaN|NAN))$'); - -function resolveYamlFloat(data) { - if (null === data) { - return false; - } - - if (!YAML_FLOAT_PATTERN.test(data)) { - return false; - } - return true; -} - -function constructYamlFloat(data) { - var value, sign, base, digits; - - value = data.replace(/_/g, '').toLowerCase(); - sign = '-' === value[0] ? -1 : 1; - digits = []; - - if (0 <= '+-'.indexOf(value[0])) { - value = value.slice(1); - } - - if ('.inf' === value) { - return (1 === sign) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; - - } else if ('.nan' === value) { - return NaN; - - } else if (0 <= value.indexOf(':')) { - value.split(':').forEach(function (v) { - digits.unshift(parseFloat(v, 10)); - }); - - value = 0.0; - base = 1; - - digits.forEach(function (d) { - value += d * base; - base *= 60; - }); - - return sign * value; - - } - return sign * parseFloat(value, 10); -} - - -var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; - -function representYamlFloat(object, style) { - var res; - - if (isNaN(object)) { - switch (style) { - case 'lowercase': - return '.nan'; - case 'uppercase': - return '.NAN'; - case 'camelcase': - return '.NaN'; - } - } else if (Number.POSITIVE_INFINITY === object) { - switch (style) { - case 'lowercase': - return '.inf'; - case 'uppercase': - return '.INF'; - case 'camelcase': - return '.Inf'; - } - } else if (Number.NEGATIVE_INFINITY === object) { - switch (style) { - case 'lowercase': - return '-.inf'; - case 'uppercase': - return '-.INF'; - case 'camelcase': - return '-.Inf'; - } - } else if (common.isNegativeZero(object)) { - return '-0.0'; - } - - res = object.toString(10); - - // JS stringifier can build scientific format without dots: 5e-100, - // while YAML requres dot: 5.e-100. Fix it with simple hack - - return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; -} - -function isFloat(object) { - return ('[object Number]' === Object.prototype.toString.call(object)) && - (0 !== object % 1 || common.isNegativeZero(object)); -} - -module.exports = new Type('tag:yaml.org,2002:float', { - kind: 'scalar', - resolve: resolveYamlFloat, - construct: constructYamlFloat, - predicate: isFloat, - represent: representYamlFloat, - defaultStyle: 'lowercase' -}); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/int.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/int.js deleted file mode 100644 index 800f106..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/int.js +++ /dev/null @@ -1,183 +0,0 @@ -'use strict'; - -var common = require('../common'); -var Type = require('../type'); - -function isHexCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || - ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || - ((0x61/* a */ <= c) && (c <= 0x66/* f */)); -} - -function isOctCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); -} - -function isDecCode(c) { - return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); -} - -function resolveYamlInteger(data) { - if (null === data) { - return false; - } - - var max = data.length, - index = 0, - hasDigits = false, - ch; - - if (!max) { return false; } - - ch = data[index]; - - // sign - if (ch === '-' || ch === '+') { - ch = data[++index]; - } - - if (ch === '0') { - // 0 - if (index + 1 === max) { return true; } - ch = data[++index]; - - // base 2, base 8, base 16 - - if (ch === 'b') { - // base 2 - index++; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') { continue; } - if (ch !== '0' && ch !== '1') { - return false; - } - hasDigits = true; - } - return hasDigits; - } - - - if (ch === 'x') { - // base 16 - index++; - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') { continue; } - if (!isHexCode(data.charCodeAt(index))) { - return false; - } - hasDigits = true; - } - return hasDigits; - } - - // base 8 - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') { continue; } - if (!isOctCode(data.charCodeAt(index))) { - return false; - } - hasDigits = true; - } - return hasDigits; - } - - // base 10 (except 0) or base 60 - - for (; index < max; index++) { - ch = data[index]; - if (ch === '_') { continue; } - if (ch === ':') { break; } - if (!isDecCode(data.charCodeAt(index))) { - return false; - } - hasDigits = true; - } - - if (!hasDigits) { return false; } - - // if !base60 - done; - if (ch !== ':') { return true; } - - // base60 almost not used, no needs to optimize - return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); -} - -function constructYamlInteger(data) { - var value = data, sign = 1, ch, base, digits = []; - - if (value.indexOf('_') !== -1) { - value = value.replace(/_/g, ''); - } - - ch = value[0]; - - if (ch === '-' || ch === '+') { - if (ch === '-') { sign = -1; } - value = value.slice(1); - ch = value[0]; - } - - if ('0' === value) { - return 0; - } - - if (ch === '0') { - if (value[1] === 'b') { - return sign * parseInt(value.slice(2), 2); - } - if (value[1] === 'x') { - return sign * parseInt(value, 16); - } - return sign * parseInt(value, 8); - - } - - if (value.indexOf(':') !== -1) { - value.split(':').forEach(function (v) { - digits.unshift(parseInt(v, 10)); - }); - - value = 0; - base = 1; - - digits.forEach(function (d) { - value += (d * base); - base *= 60; - }); - - return sign * value; - - } - - return sign * parseInt(value, 10); -} - -function isInteger(object) { - return ('[object Number]' === Object.prototype.toString.call(object)) && - (0 === object % 1 && !common.isNegativeZero(object)); -} - -module.exports = new Type('tag:yaml.org,2002:int', { - kind: 'scalar', - resolve: resolveYamlInteger, - construct: constructYamlInteger, - predicate: isInteger, - represent: { - binary: function (object) { return '0b' + object.toString(2); }, - octal: function (object) { return '0' + object.toString(8); }, - decimal: function (object) { return object.toString(10); }, - hexadecimal: function (object) { return '0x' + object.toString(16).toUpperCase(); } - }, - defaultStyle: 'decimal', - styleAliases: { - binary: [ 2, 'bin' ], - octal: [ 8, 'oct' ], - decimal: [ 10, 'dec' ], - hexadecimal: [ 16, 'hex' ] - } -}); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/js/function.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/js/function.js deleted file mode 100644 index 0bc07c4..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/js/function.js +++ /dev/null @@ -1,84 +0,0 @@ -'use strict'; - -var esprima; - -// Browserified version does not have esprima -// -// 1. For node.js just require module as deps -// 2. For browser try to require mudule via external AMD system. -// If not found - try to fallback to window.esprima. If not -// found too - then fail to parse. -// -try { - esprima = require('esprima'); -} catch (_) { - /*global window */ - if (typeof window !== 'undefined') { esprima = window.esprima; } -} - -var Type = require('../../type'); - -function resolveJavascriptFunction(data) { - if (null === data) { - return false; - } - - try { - var source = '(' + data + ')', - ast = esprima.parse(source, { range: true }); - - if ('Program' !== ast.type || - 1 !== ast.body.length || - 'ExpressionStatement' !== ast.body[0].type || - 'FunctionExpression' !== ast.body[0].expression.type) { - return false; - } - - return true; - } catch (err) { - return false; - } -} - -function constructJavascriptFunction(data) { - /*jslint evil:true*/ - - var source = '(' + data + ')', - ast = esprima.parse(source, { range: true }), - params = [], - body; - - if ('Program' !== ast.type || - 1 !== ast.body.length || - 'ExpressionStatement' !== ast.body[0].type || - 'FunctionExpression' !== ast.body[0].expression.type) { - throw new Error('Failed to resolve function'); - } - - ast.body[0].expression.params.forEach(function (param) { - params.push(param.name); - }); - - body = ast.body[0].expression.body.range; - - // Esprima's ranges include the first '{' and the last '}' characters on - // function expressions. So cut them out. - /*eslint-disable no-new-func*/ - return new Function(params, source.slice(body[0] + 1, body[1] - 1)); -} - -function representJavascriptFunction(object /*, style*/) { - return object.toString(); -} - -function isFunction(object) { - return '[object Function]' === Object.prototype.toString.call(object); -} - -module.exports = new Type('tag:yaml.org,2002:js/function', { - kind: 'scalar', - resolve: resolveJavascriptFunction, - construct: constructJavascriptFunction, - predicate: isFunction, - represent: representJavascriptFunction -}); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js deleted file mode 100644 index d4f3703..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +++ /dev/null @@ -1,83 +0,0 @@ -'use strict'; - -var Type = require('../../type'); - -function resolveJavascriptRegExp(data) { - if (null === data) { - return false; - } - - if (0 === data.length) { - return false; - } - - var regexp = data, - tail = /\/([gim]*)$/.exec(data), - modifiers = ''; - - // if regexp starts with '/' it can have modifiers and must be properly closed - // `/foo/gim` - modifiers tail can be maximum 3 chars - if ('/' === regexp[0]) { - if (tail) { - modifiers = tail[1]; - } - - if (modifiers.length > 3) { return false; } - // if expression starts with /, is should be properly terminated - if (regexp[regexp.length - modifiers.length - 1] !== '/') { return false; } - - regexp = regexp.slice(1, regexp.length - modifiers.length - 1); - } - - try { - return true; - } catch (error) { - return false; - } -} - -function constructJavascriptRegExp(data) { - var regexp = data, - tail = /\/([gim]*)$/.exec(data), - modifiers = ''; - - // `/foo/gim` - tail can be maximum 4 chars - if ('/' === regexp[0]) { - if (tail) { - modifiers = tail[1]; - } - regexp = regexp.slice(1, regexp.length - modifiers.length - 1); - } - - return new RegExp(regexp, modifiers); -} - -function representJavascriptRegExp(object /*, style*/) { - var result = '/' + object.source + '/'; - - if (object.global) { - result += 'g'; - } - - if (object.multiline) { - result += 'm'; - } - - if (object.ignoreCase) { - result += 'i'; - } - - return result; -} - -function isRegExp(object) { - return '[object RegExp]' === Object.prototype.toString.call(object); -} - -module.exports = new Type('tag:yaml.org,2002:js/regexp', { - kind: 'scalar', - resolve: resolveJavascriptRegExp, - construct: constructJavascriptRegExp, - predicate: isRegExp, - represent: representJavascriptRegExp -}); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js deleted file mode 100644 index 562753c..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -var Type = require('../../type'); - -function resolveJavascriptUndefined() { - return true; -} - -function constructJavascriptUndefined() { - /*eslint-disable no-undefined*/ - return undefined; -} - -function representJavascriptUndefined() { - return ''; -} - -function isUndefined(object) { - return 'undefined' === typeof object; -} - -module.exports = new Type('tag:yaml.org,2002:js/undefined', { - kind: 'scalar', - resolve: resolveJavascriptUndefined, - construct: constructJavascriptUndefined, - predicate: isUndefined, - represent: representJavascriptUndefined -}); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/map.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/map.js deleted file mode 100644 index dab9838..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/map.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -module.exports = new Type('tag:yaml.org,2002:map', { - kind: 'mapping', - construct: function (data) { return null !== data ? data : {}; } -}); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/merge.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/merge.js deleted file mode 100644 index 29fa382..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/merge.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -function resolveYamlMerge(data) { - return '<<' === data || null === data; -} - -module.exports = new Type('tag:yaml.org,2002:merge', { - kind: 'scalar', - resolve: resolveYamlMerge -}); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/null.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/null.js deleted file mode 100644 index 3474055..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/null.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -function resolveYamlNull(data) { - if (null === data) { - return true; - } - - var max = data.length; - - return (max === 1 && data === '~') || - (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); -} - -function constructYamlNull() { - return null; -} - -function isNull(object) { - return null === object; -} - -module.exports = new Type('tag:yaml.org,2002:null', { - kind: 'scalar', - resolve: resolveYamlNull, - construct: constructYamlNull, - predicate: isNull, - represent: { - canonical: function () { return '~'; }, - lowercase: function () { return 'null'; }, - uppercase: function () { return 'NULL'; }, - camelcase: function () { return 'Null'; } - }, - defaultStyle: 'lowercase' -}); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/omap.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/omap.js deleted file mode 100644 index f956459..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/omap.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -var _hasOwnProperty = Object.prototype.hasOwnProperty; -var _toString = Object.prototype.toString; - -function resolveYamlOmap(data) { - if (null === data) { - return true; - } - - var objectKeys = [], index, length, pair, pairKey, pairHasKey, - object = data; - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - pairHasKey = false; - - if ('[object Object]' !== _toString.call(pair)) { - return false; - } - - for (pairKey in pair) { - if (_hasOwnProperty.call(pair, pairKey)) { - if (!pairHasKey) { - pairHasKey = true; - } else { - return false; - } - } - } - - if (!pairHasKey) { - return false; - } - - if (-1 === objectKeys.indexOf(pairKey)) { - objectKeys.push(pairKey); - } else { - return false; - } - } - - return true; -} - -function constructYamlOmap(data) { - return null !== data ? data : []; -} - -module.exports = new Type('tag:yaml.org,2002:omap', { - kind: 'sequence', - resolve: resolveYamlOmap, - construct: constructYamlOmap -}); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/pairs.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/pairs.js deleted file mode 100644 index 02a0af6..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/pairs.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -var _toString = Object.prototype.toString; - -function resolveYamlPairs(data) { - if (null === data) { - return true; - } - - var index, length, pair, keys, result, - object = data; - - result = new Array(object.length); - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - - if ('[object Object]' !== _toString.call(pair)) { - return false; - } - - keys = Object.keys(pair); - - if (1 !== keys.length) { - return false; - } - - result[index] = [ keys[0], pair[keys[0]] ]; - } - - return true; -} - -function constructYamlPairs(data) { - if (null === data) { - return []; - } - - var index, length, pair, keys, result, - object = data; - - result = new Array(object.length); - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - - keys = Object.keys(pair); - - result[index] = [ keys[0], pair[keys[0]] ]; - } - - return result; -} - -module.exports = new Type('tag:yaml.org,2002:pairs', { - kind: 'sequence', - resolve: resolveYamlPairs, - construct: constructYamlPairs -}); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/seq.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/seq.js deleted file mode 100644 index 5b860a2..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/seq.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -module.exports = new Type('tag:yaml.org,2002:seq', { - kind: 'sequence', - construct: function (data) { return null !== data ? data : []; } -}); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/set.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/set.js deleted file mode 100644 index 64d29e9..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/set.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -var _hasOwnProperty = Object.prototype.hasOwnProperty; - -function resolveYamlSet(data) { - if (null === data) { - return true; - } - - var key, object = data; - - for (key in object) { - if (_hasOwnProperty.call(object, key)) { - if (null !== object[key]) { - return false; - } - } - } - - return true; -} - -function constructYamlSet(data) { - return null !== data ? data : {}; -} - -module.exports = new Type('tag:yaml.org,2002:set', { - kind: 'mapping', - resolve: resolveYamlSet, - construct: constructYamlSet -}); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/str.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/str.js deleted file mode 100644 index 8b5284f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/str.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -module.exports = new Type('tag:yaml.org,2002:str', { - kind: 'scalar', - construct: function (data) { return null !== data ? data : ''; } -}); diff --git a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/timestamp.js b/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/timestamp.js deleted file mode 100644 index 8d5e759..0000000 --- a/node_modules/eslint/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +++ /dev/null @@ -1,93 +0,0 @@ -'use strict'; - -var Type = require('../type'); - -var YAML_TIMESTAMP_REGEXP = new RegExp( - '^([0-9][0-9][0-9][0-9])' + // [1] year - '-([0-9][0-9]?)' + // [2] month - '-([0-9][0-9]?)' + // [3] day - '(?:(?:[Tt]|[ \\t]+)' + // ... - '([0-9][0-9]?)' + // [4] hour - ':([0-9][0-9])' + // [5] minute - ':([0-9][0-9])' + // [6] second - '(?:\\.([0-9]*))?' + // [7] fraction - '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour - '(?::([0-9][0-9]))?))?)?$'); // [11] tz_minute - -function resolveYamlTimestamp(data) { - if (null === data) { - return false; - } - - if (YAML_TIMESTAMP_REGEXP.exec(data) === null) { - return false; - } - - return true; -} - -function constructYamlTimestamp(data) { - var match, year, month, day, hour, minute, second, fraction = 0, - delta = null, tz_hour, tz_minute, date; - - match = YAML_TIMESTAMP_REGEXP.exec(data); - - if (null === match) { - throw new Error('Date resolve error'); - } - - // match: [1] year [2] month [3] day - - year = +(match[1]); - month = +(match[2]) - 1; // JS month starts with 0 - day = +(match[3]); - - if (!match[4]) { // no hour - return new Date(Date.UTC(year, month, day)); - } - - // match: [4] hour [5] minute [6] second [7] fraction - - hour = +(match[4]); - minute = +(match[5]); - second = +(match[6]); - - if (match[7]) { - fraction = match[7].slice(0, 3); - while (fraction.length < 3) { // milli-seconds - fraction += '0'; - } - fraction = +fraction; - } - - // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute - - if (match[9]) { - tz_hour = +(match[10]); - tz_minute = +(match[11] || 0); - delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds - if ('-' === match[9]) { - delta = -delta; - } - } - - date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); - - if (delta) { - date.setTime(date.getTime() - delta); - } - - return date; -} - -function representYamlTimestamp(object /*, style*/) { - return object.toISOString(); -} - -module.exports = new Type('tag:yaml.org,2002:timestamp', { - kind: 'scalar', - resolve: resolveYamlTimestamp, - construct: constructYamlTimestamp, - instanceOf: Date, - represent: representYamlTimestamp -}); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/.bin/esparse b/node_modules/eslint/node_modules/js-yaml/node_modules/.bin/esparse deleted file mode 120000 index 7423b18..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/.bin/esparse +++ /dev/null @@ -1 +0,0 @@ -../esprima/bin/esparse.js \ No newline at end of file diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/.bin/esvalidate b/node_modules/eslint/node_modules/js-yaml/node_modules/.bin/esvalidate deleted file mode 120000 index 16069ef..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/.bin/esvalidate +++ /dev/null @@ -1 +0,0 @@ -../esprima/bin/esvalidate.js \ No newline at end of file diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/CHANGELOG.md b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/CHANGELOG.md deleted file mode 100644 index 821324a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/CHANGELOG.md +++ /dev/null @@ -1,148 +0,0 @@ -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. diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/LICENSE b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/LICENSE deleted file mode 100644 index 1afdae5..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -(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. diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/README.md b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/README.md deleted file mode 100644 index 72e4261..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/README.md +++ /dev/null @@ -1,243 +0,0 @@ -argparse -======== - -[![Build Status](https://secure.travis-ci.org/nodeca/argparse.png?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`. - - -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' - } -); -var args = parser.parseArgs(); -console.dir(args); -``` - -Display help: - -``` -$ ./test.js -h -usage: example.js [-h] [-v] [-f FOO] [-b BAR] - -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 -``` - -Parse arguments: - -``` -$ ./test.js -f=3 --bar=4 -{ foo: '3', bar: '4' } -``` - -More [examples](https://github.com/nodeca/argparse/tree/master/examples). - - -ArgumentParser objects -====================== - -``` -new ArgumentParser({paramters 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 supportied 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([names or flags], {options}) -``` - -Defines how a single command-line argument should be parsed. - -- ```name or flags``` - Either a name or a list of option strings, e.g. foo or -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. - - diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/arguments.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/arguments.js deleted file mode 100755 index 5b090fa..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/arguments.js +++ /dev/null @@ -1,36 +0,0 @@ -#!/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: arguments' -}); -parser.addArgument( - [ '-f', '--foo' ], - { - help: 'foo bar' - } -); -parser.addArgument( - [ '-b', '--bar' ], - { - help: 'bar foo' - } -); - - -parser.printHelp(); -console.log('-----------'); - -var args; -args = parser.parseArgs('-f 1 -b2'.split(' ')); -console.dir(args); -console.log('-----------'); -args = parser.parseArgs('-f=3 --bar=4'.split(' ')); -console.dir(args); -console.log('-----------'); -args = parser.parseArgs('--foo 5 --bar 6'.split(' ')); -console.dir(args); -console.log('-----------'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/choice.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/choice.js deleted file mode 100755 index 2616fa4..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/choice.js +++ /dev/null @@ -1,22 +0,0 @@ -#!/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: choice' -}); - -parser.addArgument(['foo'], {choices: 'abc'}); - -parser.printHelp(); -console.log('-----------'); - -var args; -args = parser.parseArgs(['c']); -console.dir(args); -console.log('-----------'); -parser.parseArgs(['X']); -console.dir(args); - diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/constants.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/constants.js deleted file mode 100755 index 172a4f3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/constants.js +++ /dev/null @@ -1,59 +0,0 @@ -#!/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: constant' -}); - -parser.addArgument( - [ '-a'], - { - action: 'storeConst', - dest: 'answer', - help: 'store constant', - constant: 42 - } -); -parser.addArgument( - [ '--str' ], - { - action: 'appendConst', - dest: 'types', - help: 'append constant "str" to types', - constant: 'str' - } -); -parser.addArgument( - [ '--int' ], - { - action: 'appendConst', - dest: 'types', - help: 'append constant "int" to types', - constant: 'int' - } -); - -parser.addArgument( - [ '--true' ], - { - action: 'storeTrue', - help: 'store true constant' - } -); -parser.addArgument( - [ '--false' ], - { - action: 'storeFalse', - help: 'store false constant' - } -); - -parser.printHelp(); -console.log('-----------'); - -var args; -args = parser.parseArgs('-a --str --int --true'.split(' ')); -console.dir(args); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/help.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/help.js deleted file mode 100755 index 7eb9555..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/help.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/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: help', - epilog: 'help epilog', - prog: 'help_example_prog', - usage: 'Usage %(prog)s ' -}); -parser.printHelp(); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/nargs.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/nargs.js deleted file mode 100755 index 74f376b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/nargs.js +++ /dev/null @@ -1,33 +0,0 @@ -#!/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: nargs' -}); -parser.addArgument( - [ '-f', '--foo' ], - { - help: 'foo bar', - nargs: 1 - } -); -parser.addArgument( - [ '-b', '--bar' ], - { - help: 'bar foo', - nargs: '*' - } -); - -parser.printHelp(); -console.log('-----------'); - -var args; -args = parser.parseArgs('--foo a --bar c d'.split(' ')); -console.dir(args); -console.log('-----------'); -args = parser.parseArgs('--bar b c f --foo a'.split(' ')); -console.dir(args); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/parents.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/parents.js deleted file mode 100755 index dfe8968..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/parents.js +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; - -var args; -var parent_parser = new ArgumentParser({ addHelp: false }); -// note addHelp:false to prevent duplication of the -h option -parent_parser.addArgument( - ['--parent'], - { type: 'int', description: 'parent' } -); - -var foo_parser = new ArgumentParser({ - parents: [ parent_parser ], - description: 'child1' -}); -foo_parser.addArgument(['foo']); -args = foo_parser.parseArgs(['--parent', '2', 'XXX']); -console.log(args); - -var bar_parser = new ArgumentParser({ - parents: [ parent_parser ], - description: 'child2' -}); -bar_parser.addArgument(['--bar']); -args = bar_parser.parseArgs(['--bar', 'YYY']); -console.log(args); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/prefix_chars.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/prefix_chars.js deleted file mode 100755 index 430d5e1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/prefix_chars.js +++ /dev/null @@ -1,23 +0,0 @@ -#!/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: prefix_chars', - prefixChars: '-+' -}); -parser.addArgument(['+f', '++foo']); -parser.addArgument(['++bar'], {action: 'storeTrue'}); - -parser.printHelp(); -console.log('-----------'); - -var args; -args = parser.parseArgs(['+f', '1']); -console.dir(args); -args = parser.parseArgs(['++bar']); -console.dir(args); -args = parser.parseArgs(['++foo', '2', '++bar']); -console.dir(args); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/sub_commands.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/sub_commands.js deleted file mode 100755 index df9c494..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/sub_commands.js +++ /dev/null @@ -1,49 +0,0 @@ -#!/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, help: 'c1 help'}); -bar.addArgument( - [ '-f', '--foo' ], - { - action: 'store', - help: 'foo3 bar3' - } -); -var bar = subparsers.addParser( - 'c2', - {aliases: ['co'], addHelp: true, help: 'c2 help'} -); -bar.addArgument( - [ '-b', '--bar' ], - { - action: 'store', - type: 'int', - help: 'foo3 bar3' - } -); -parser.printHelp(); -console.log('-----------'); - -var args; -args = parser.parseArgs('c1 -f 2'.split(' ')); -console.dir(args); -console.log('-----------'); -args = parser.parseArgs('c2 -b 1'.split(' ')); -console.dir(args); -console.log('-----------'); -args = parser.parseArgs('co -b 1'.split(' ')); -console.dir(args); -console.log('-----------'); -parser.parseArgs(['c1', '-h']); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/sum.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/sum.js deleted file mode 100755 index 4532800..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/sum.js +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env node - -'use strict'; - - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ description: 'Process some integers.' }); - - -function sum(arr) { - return arr.reduce(function (a, b) { - return a + b; - }, 0); -} -function max(arr) { - return Math.max.apply(Math, arr); -} - - -parser.addArgument(['integers'], { - metavar: 'N', - type: 'int', - nargs: '+', - help: 'an integer for the accumulator' -}); -parser.addArgument(['--sum'], { - dest: 'accumulate', - action: 'storeConst', - constant: sum, - defaultValue: max, - help: 'sum the integers (default: find the max)' -}); - -var args = parser.parseArgs('--sum 1 2 -1'.split(' ')); -console.log(args.accumulate(args.integers)); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/testformatters.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/testformatters.js deleted file mode 100644 index 1c03cdc..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/examples/testformatters.js +++ /dev/null @@ -1,270 +0,0 @@ -'use strict'; - -var a, group, parser, helptext; - -var assert = require('assert'); - - -var print = function () { - return console.log.apply(console, arguments); - }; -// print = function () {}; - -var argparse = require('argparse'); - -print("TEST argparse.ArgumentDefaultsHelpFormatter"); - -parser = new argparse.ArgumentParser({ - debug: true, - formatterClass: argparse.ArgumentDefaultsHelpFormatter, - description: 'description' -}); - -parser.addArgument(['--foo'], { - help: 'foo help - oh and by the way, %(defaultValue)s' -}); - -parser.addArgument(['--bar'], { - action: 'storeTrue', - help: 'bar help' -}); - -parser.addArgument(['spam'], { - help: 'spam help' -}); - -parser.addArgument(['badger'], { - nargs: '?', - defaultValue: 'wooden', - help: 'badger help' -}); - -group = parser.addArgumentGroup({ - title: 'title', - description: 'group description' -}); - -group.addArgument(['--baz'], { - type: 'int', - defaultValue: 42, - help: 'baz help' -}); - -helptext = parser.formatHelp(); -print(helptext); -// test selected clips -assert(helptext.match(/badger help \(default: wooden\)/)); -assert(helptext.match(/foo help - oh and by the way, null/)); -assert(helptext.match(/bar help \(default: false\)/)); -assert(helptext.match(/title:\n {2}group description/)); // test indent -assert(helptext.match(/baz help \(default: 42\)/im)); - -/* -usage: PROG [-h] [--foo FOO] [--bar] [--baz BAZ] spam [badger] - -description - -positional arguments: - spam spam help - badger badger help (default: wooden) - -optional arguments: - -h, --help show this help message and exit - --foo FOO foo help - oh and by the way, null - --bar bar help (default: false) - -title: - group description - - --baz BAZ baz help (default: 42) -*/ - -print("TEST argparse.RawDescriptionHelpFormatter"); - -parser = new argparse.ArgumentParser({ - debug: true, - prog: 'PROG', - formatterClass: argparse.RawDescriptionHelpFormatter, - description: 'Keep the formatting\n' + - ' exactly as it is written\n' + - '\n' + - 'here\n' -}); - -a = parser.addArgument(['--foo'], { - help: ' foo help should not\n' + - ' retain this odd formatting' -}); - -parser.addArgument(['spam'], { - 'help': 'spam help' -}); - -group = parser.addArgumentGroup({ - title: 'title', - description: ' This text\n' + - ' should be indented\n' + - ' exactly like it is here\n' -}); - -group.addArgument(['--bar'], { - help: 'bar help' -}); - -helptext = parser.formatHelp(); -print(helptext); -// test selected clips -assert(helptext.match(parser.description)); -assert.equal(helptext.match(a.help), null); -assert(helptext.match(/foo help should not retain this odd formatting/)); - -/* -class TestHelpRawDescription(HelpTestCase): - """Test the RawTextHelpFormatter""" -.... - -usage: PROG [-h] [--foo FOO] [--bar BAR] spam - -Keep the formatting - exactly as it is written - -here - -positional arguments: - spam spam help - -optional arguments: - -h, --help show this help message and exit - --foo FOO foo help should not retain this odd formatting - -title: - This text - should be indented - exactly like it is here - - --bar BAR bar help -*/ - - -print("TEST argparse.RawTextHelpFormatter"); - -parser = new argparse.ArgumentParser({ - debug: true, - prog: 'PROG', - formatterClass: argparse.RawTextHelpFormatter, - description: 'Keep the formatting\n' + - ' exactly as it is written\n' + - '\n' + - 'here\n' -}); - -parser.addArgument(['--baz'], { - help: ' baz help should also\n' + - 'appear as given here' -}); - -a = parser.addArgument(['--foo'], { - help: ' foo help should also\n' + - 'appear as given here' -}); - -parser.addArgument(['spam'], { - 'help': 'spam help' -}); - -group = parser.addArgumentGroup({ - title: 'title', - description: ' This text\n' + - ' should be indented\n' + - ' exactly like it is here\n' -}); - -group.addArgument(['--bar'], { - help: 'bar help' -}); - -helptext = parser.formatHelp(); -print(helptext); -// test selected clips -assert(helptext.match(parser.description)); -assert(helptext.match(/( {14})appear as given here/gm)); - -/* -class TestHelpRawText(HelpTestCase): - """Test the RawTextHelpFormatter""" - -usage: PROG [-h] [--foo FOO] [--bar BAR] spam - -Keep the formatting - exactly as it is written - -here - -positional arguments: - spam spam help - -optional arguments: - -h, --help show this help message and exit - --foo FOO foo help should also - appear as given here - -title: - This text - should be indented - exactly like it is here - - --bar BAR bar help -*/ - - -print("TEST metavar as a tuple"); - -parser = new argparse.ArgumentParser({ - prog: 'PROG' -}); - -parser.addArgument(['-w'], { - help: 'w', - nargs: '+', - metavar: ['W1', 'W2'] -}); - -parser.addArgument(['-x'], { - help: 'x', - nargs: '*', - metavar: ['X1', 'X2'] -}); - -parser.addArgument(['-y'], { - help: 'y', - nargs: 3, - metavar: ['Y1', 'Y2', 'Y3'] -}); - -parser.addArgument(['-z'], { - help: 'z', - nargs: '?', - metavar: ['Z1'] -}); - -helptext = parser.formatHelp(); -print(helptext); -var ustring = 'PROG [-h] [-w W1 [W2 ...]] [-x [X1 [X2 ...]]] [-y Y1 Y2 Y3] [-z [Z1]]'; -ustring = ustring.replace(/\[/g, '\\[').replace(/\]/g, '\\]'); -// print(ustring) -assert(helptext.match(new RegExp(ustring))); - -/* -class TestHelpTupleMetavar(HelpTestCase): - """Test specifying metavar as a tuple""" - -usage: PROG [-h] [-w W1 [W2 ...]] [-x [X1 [X2 ...]]] [-y Y1 Y2 Y3] [-z [Z1]] - -optional arguments: - -h, --help show this help message and exit - -w W1 [W2 ...] w - -x [X1 [X2 ...]] x - -y Y1 Y2 Y3 y - -z [Z1] z -*/ - diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/index.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/index.js deleted file mode 100644 index 3bbc143..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/index.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -module.exports = require('./lib/argparse'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action.js deleted file mode 100644 index 6f7e9a5..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action.js +++ /dev/null @@ -1,146 +0,0 @@ -/** - * 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. - * - * #####Alowed 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 $$ = 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 = options.nargs !== undefined ? options.nargs : null; - this.constant = options.constant !== undefined ? options.constant : null; - this.defaultValue = options.defaultValue; - this.type = options.type !== undefined ? options.type : null; - this.choices = options.choices !== undefined ? options.choices : null; - this.required = options.required !== undefined ? options.required: false; - this.help = options.help !== undefined ? options.help : null; - this.metavar = options.metavar !== undefined ? options.metavar : null; - - if (!(this.optionStrings instanceof Array)) { - throw new Error('optionStrings should be an array'); - } - if (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 !== $$.SUPPRESS) { - return this.metavar; - } else if (this.dest !== undefined && this.dest !== $$.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 -}; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/append.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/append.js deleted file mode 100644 index 48c6dbe..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/append.js +++ /dev/null @@ -1,55 +0,0 @@ -/*: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 $$ = 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 !== $$.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 = [].concat(namespace[this.dest] || []); // or _.clone - items.push(values); - namespace.set(this.dest, items); -}; - - diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/append/constant.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/append/constant.js deleted file mode 100644 index 90747ab..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/append/constant.js +++ /dev/null @@ -1,47 +0,0 @@ -/*: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 (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); -}; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/count.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/count.js deleted file mode 100644 index d6a5899..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/count.js +++ /dev/null @@ -1,40 +0,0 @@ -/*: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); -}; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/help.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/help.js deleted file mode 100644 index 7f7b4e2..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/help.js +++ /dev/null @@ -1,48 +0,0 @@ -/*: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 $$ = 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 = $$.SUPPRESS; - } - options.dest = (options.dest !== null ? options.dest: $$.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(); -}; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store.js deleted file mode 100644 index 8ebc974..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store.js +++ /dev/null @@ -1,50 +0,0 @@ -/*: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 $$ = 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 (this.constant !== undefined && this.nargs !== $$.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); -}; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js deleted file mode 100644 index 8410fcf..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js +++ /dev/null @@ -1,43 +0,0 @@ -/*: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 (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); -}; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store/false.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store/false.js deleted file mode 100644 index 66417bf..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store/false.js +++ /dev/null @@ -1,27 +0,0 @@ -/*: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); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store/true.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store/true.js deleted file mode 100644 index 43ec708..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store/true.js +++ /dev/null @@ -1,26 +0,0 @@ -/*: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); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/subparsers.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/subparsers.js deleted file mode 100644 index 257714d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/subparsers.js +++ /dev/null @@ -1,148 +0,0 @@ -/** 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 _ = require('lodash'); - - -var Action = require('../action'); - -// Constants -var $$ = require('../const'); - -// Errors -var argumentErrorHelper = require('../argument/error'); - - -/*:nodoc:* - * new ChoicesPseudoAction(name, help) - * - * Create pseudo action for correct help text - * - **/ -var ChoicesPseudoAction = function (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]] - * - **/ -var ActionSubparsers = module.exports = function ActionSubparsers(options) { - options = options || {}; - options.dest = options.dest || $$.SUPPRESS; - options.nargs = $$.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 || _.isString(options.help)) { - 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 !== $$.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, - _.keys(this._nameParserMap).join(', ') - )); - } - - // parse all the remaining options into the namespace - parser.parseArgs(argStrings, namespace); -}; - - diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/version.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/version.js deleted file mode 100644 index a17877c..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/version.js +++ /dev/null @@ -1,50 +0,0 @@ -/*: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 $$ = 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: $$.SUPPRESS); - options.dest = (options.dest || $$.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()); -}; - - - diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action_container.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action_container.js deleted file mode 100644 index 0077cca..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/action_container.js +++ /dev/null @@ -1,479 +0,0 @@ -/** internal - * class ActionContainer - * - * Action container. Parent for [[ArgumentParser]] and [[ArgumentGroup]] - **/ - -'use strict'; - -var format = require('util').format; -var _ = require('lodash'); - -// Constants -var $$ = require('./const'); - -//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 (3 > arguments.length) { - 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) { - 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 (action.dest in options) { - 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 (Array): 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, ...}) - **/ -ActionContainer.prototype.addArgument = function (args, options) { - args = args; - options = options || {}; - - if (!_.isArray(args)) { - throw new TypeError('addArgument first argument should be an array'); - } - if (!_.isObject(options) || _.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 (_.isUndefined(options.defaultValue)) { - var dest = options.dest; - if (_.has(this._defaults, dest)) { - options.defaultValue = this._defaults[dest]; - } else if (!_.isUndefined(this.argumentDefault)) { - options.defaultValue = this.argumentDefault; - } - } - - // create the action object, and add it to the parser - var ActionClass = this._popActionClass(options); - if (! _.isFunction(ActionClass)) { - 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 (!_.isFunction(typeFunction)) { - 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 (!_.some(self._hasNegativeNumberOptionals)) { - 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 (_.isArray(dest)) { - dest = _.first(dest); - } - // 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 !== $$.OPTIONAL && options.nargs !== $$.ZERO_OR_MORE) { - options.required = true; - } - if (options.nargs === $$.ZERO_OR_MORE && 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 = _.trim(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 = _.map(conflOptionals, 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); - } - }); -}; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/argparse.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/argparse.js deleted file mode 100644 index f2a2c51..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/argparse.js +++ /dev/null @@ -1,14 +0,0 @@ -'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; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/argument/error.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/argument/error.js deleted file mode 100644 index c8a02a0..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/argument/error.js +++ /dev/null @@ -1,50 +0,0 @@ -'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; -}; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/argument/exclusive.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/argument/exclusive.js deleted file mode 100644 index 8287e00..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/argument/exclusive.js +++ /dev/null @@ -1,54 +0,0 @@ -/** 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); -}; - diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/argument/group.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/argument/group.js deleted file mode 100644 index 58b271f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/argument/group.js +++ /dev/null @@ -1,75 +0,0 @@ -/** 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); - } -}; - diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js deleted file mode 100644 index 2f47bed..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js +++ /dev/null @@ -1,1170 +0,0 @@ -/** - * class ArgumentParser - * - * Object for parsing command line strings into js objects. - * - * Inherited from [[ActionContainer]] - **/ -'use strict'; - -var util = require('util'); -var format = require('util').format; -var Path = require('path'); - -var _ = require('lodash'); -var sprintf = require('sprintf-js').sprintf; - -// Constants -var $$ = require('./const'); - -var ActionContainer = require('./action_container'); - -// Errors -var argumentErrorHelper = require('./argument/error'); - -var HelpFormatter = require('./help/formatter'); - -var Namespace = require('./namespace'); - - -/** - * new ArgumentParser(options) - * - * Create a new ArgumentParser object. - * - * ##### Options: - * - `prog` The name of the program (default: Path.basename(process.argv[1])) - * - `usage` A usage message (default: auto-generated from arguments) - * - `description` A description of what the program does - * - `epilog` Text following the argument descriptions - * - `parents` Parsers whose arguments should be copied into this one - * - `formatterClass` HelpFormatter class for printing help messages - * - `prefixChars` Characters that prefix optional arguments - * - `fromfilePrefixChars` Characters that prefix files containing additional arguments - * - `argumentDefault` The default value for all arguments - * - `addHelp` Add a -h/-help option - * - `conflictHandler` Specifies how to handle conflicting argument names - * - `debug` Enable debug mode. Argument errors throw exception in - * debug mode and process.exit in normal. Used for development and - * testing (default: false) - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#argumentparser-objects - **/ -var ArgumentParser = module.exports = function ArgumentParser(options) { - if (!(this instanceof ArgumentParser)) { - return new ArgumentParser(options); - } - var self = this; - options = options || {}; - - options.description = (options.description || null); - options.argumentDefault = (options.argumentDefault || null); - options.prefixChars = (options.prefixChars || '-'); - options.conflictHandler = (options.conflictHandler || 'error'); - ActionContainer.call(this, options); - - options.addHelp = (options.addHelp === undefined || !!options.addHelp); - options.parents = (options.parents || []); - // default program name - options.prog = (options.prog || Path.basename(process.argv[1])); - this.prog = options.prog; - this.usage = options.usage; - this.epilog = options.epilog; - this.version = options.version; - - this.debug = (options.debug === true); - - this.formatterClass = (options.formatterClass || HelpFormatter); - this.fromfilePrefixChars = options.fromfilePrefixChars || null; - this._positionals = this.addArgumentGroup({title: 'Positional arguments'}); - this._optionals = this.addArgumentGroup({title: 'Optional arguments'}); - this._subparsers = null; - - // register types - var FUNCTION_IDENTITY = function (o) { - return o; - }; - this.register('type', 'auto', FUNCTION_IDENTITY); - this.register('type', null, FUNCTION_IDENTITY); - this.register('type', 'int', function (x) { - var result = parseInt(x, 10); - if (isNaN(result)) { - throw new Error(x + ' is not a valid integer.'); - } - return result; - }); - this.register('type', 'float', function (x) { - var result = parseFloat(x); - if (isNaN(result)) { - throw new Error(x + ' is not a valid float.'); - } - return result; - }); - this.register('type', 'string', function (x) { - return '' + x; - }); - - // add help and version arguments if necessary - var defaultPrefix = (this.prefixChars.indexOf('-') > -1) ? '-' : this.prefixChars[0]; - if (options.addHelp) { - this.addArgument( - [defaultPrefix + 'h', defaultPrefix + defaultPrefix + 'help'], - { - action: 'help', - defaultValue: $$.SUPPRESS, - help: 'Show this help message and exit.' - } - ); - } - if (this.version !== undefined) { - this.addArgument( - [defaultPrefix + 'v', defaultPrefix + defaultPrefix + 'version'], - { - action: 'version', - version: this.version, - defaultValue: $$.SUPPRESS, - help: "Show program's version number and exit." - } - ); - } - - // add parent arguments and defaults - options.parents.forEach(function (parent) { - self._addContainerActions(parent); - if (parent._defaults !== undefined) { - for (var defaultKey in parent._defaults) { - if (parent._defaults.hasOwnProperty(defaultKey)) { - self._defaults[defaultKey] = parent._defaults[defaultKey]; - } - } - } - }); - -}; -util.inherits(ArgumentParser, ActionContainer); - -/** - * ArgumentParser#addSubparsers(options) -> [[ActionSubparsers]] - * - options (object): hash of options see [[ActionSubparsers.new]] - * - * See also [subcommands][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#sub-commands - **/ -ArgumentParser.prototype.addSubparsers = function (options) { - if (!!this._subparsers) { - this.error('Cannot have multiple subparser arguments.'); - } - - options = options || {}; - options.debug = (this.debug === true); - options.optionStrings = []; - options.parserClass = (options.parserClass || ArgumentParser); - - - if (!!options.title || !!options.description) { - - this._subparsers = this.addArgumentGroup({ - title: (options.title || 'subcommands'), - description: options.description - }); - delete options.title; - delete options.description; - - } else { - this._subparsers = this._positionals; - } - - // prog defaults to the usage message of this parser, skipping - // optional arguments and with no "usage:" prefix - if (!options.prog) { - var formatter = this._getFormatter(); - var positionals = this._getPositionalActions(); - var groups = this._mutuallyExclusiveGroups; - formatter.addUsage(this.usage, positionals, groups, ''); - options.prog = _.trim(formatter.formatHelp()); - } - - // create the parsers action and add it to the positionals list - var ParsersClass = this._popActionClass(options, 'parsers'); - var action = new ParsersClass(options); - this._subparsers._addAction(action); - - // return the created parsers action - return action; -}; - -ArgumentParser.prototype._addAction = function (action) { - if (action.isOptional()) { - this._optionals._addAction(action); - } else { - this._positionals._addAction(action); - } - return action; -}; - -ArgumentParser.prototype._getOptionalActions = function () { - return this._actions.filter(function (action) { - return action.isOptional(); - }); -}; - -ArgumentParser.prototype._getPositionalActions = function () { - return this._actions.filter(function (action) { - return action.isPositional(); - }); -}; - - -/** - * ArgumentParser#parseArgs(args, namespace) -> Namespace|Object - * - args (array): input elements - * - namespace (Namespace|Object): result object - * - * Parsed args and throws error if some arguments are not recognized - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#the-parse-args-method - **/ -ArgumentParser.prototype.parseArgs = function (args, namespace) { - var argv; - var result = this.parseKnownArgs(args, namespace); - - args = result[0]; - argv = result[1]; - if (argv && argv.length > 0) { - this.error( - format('Unrecognized arguments: %s.', argv.join(' ')) - ); - } - return args; -}; - -/** - * ArgumentParser#parseKnownArgs(args, namespace) -> array - * - args (array): input options - * - namespace (Namespace|Object): result object - * - * Parse known arguments and return tuple of result object - * and unknown args - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#partial-parsing - **/ -ArgumentParser.prototype.parseKnownArgs = function (args, namespace) { - var self = this; - - // args default to the system args - args = args || process.argv.slice(2); - - // default Namespace built from parser defaults - namespace = namespace || new Namespace(); - - self._actions.forEach(function (action) { - if (action.dest !== $$.SUPPRESS) { - if (!_.has(namespace, action.dest)) { - if (action.defaultValue !== $$.SUPPRESS) { - var defaultValue = action.defaultValue; - if (_.isString(action.defaultValue)) { - defaultValue = self._getValue(action, defaultValue); - } - namespace[action.dest] = defaultValue; - } - } - } - }); - - _.keys(self._defaults).forEach(function (dest) { - namespace[dest] = self._defaults[dest]; - }); - - // parse the arguments and exit if there are any errors - try { - var res = this._parseKnownArgs(args, namespace); - - namespace = res[0]; - args = res[1]; - if (_.has(namespace, $$._UNRECOGNIZED_ARGS_ATTR)) { - args = _.union(args, namespace[$$._UNRECOGNIZED_ARGS_ATTR]); - delete namespace[$$._UNRECOGNIZED_ARGS_ATTR]; - } - return [namespace, args]; - } catch (e) { - this.error(e); - } -}; - -ArgumentParser.prototype._parseKnownArgs = function (argStrings, namespace) { - var self = this; - - var extras = []; - - // replace arg strings that are file references - if (this.fromfilePrefixChars !== null) { - argStrings = this._readArgsFromFiles(argStrings); - } - // map all mutually exclusive arguments to the other arguments - // they can't occur with - // Python has 'conflicts = action_conflicts.setdefault(mutex_action, [])' - // though I can't conceive of a way in which an action could be a member - // of two different mutually exclusive groups. - - function actionHash(action) { - // some sort of hashable key for this action - // action itself cannot be a key in actionConflicts - // I think getName() (join of optionStrings) is unique enough - return action.getName(); - } - - var conflicts, key; - var actionConflicts = {}; - - this._mutuallyExclusiveGroups.forEach(function (mutexGroup) { - mutexGroup._groupActions.forEach(function (mutexAction, i, groupActions) { - key = actionHash(mutexAction); - if (!_.has(actionConflicts, key)) { - actionConflicts[key] = []; - } - conflicts = actionConflicts[key]; - conflicts.push.apply(conflicts, groupActions.slice(0, i)); - conflicts.push.apply(conflicts, groupActions.slice(i + 1)); - }); - }); - - // find all option indices, and determine the arg_string_pattern - // which has an 'O' if there is an option at an index, - // an 'A' if there is an argument, or a '-' if there is a '--' - var optionStringIndices = {}; - - var argStringPatternParts = []; - - argStrings.forEach(function (argString, argStringIndex) { - if (argString === '--') { - argStringPatternParts.push('-'); - while (argStringIndex < argStrings.length) { - argStringPatternParts.push('A'); - argStringIndex++; - } - } - // otherwise, add the arg to the arg strings - // and note the index if it was an option - else { - var pattern; - var optionTuple = self._parseOptional(argString); - if (!optionTuple) { - pattern = 'A'; - } - else { - optionStringIndices[argStringIndex] = optionTuple; - pattern = 'O'; - } - argStringPatternParts.push(pattern); - } - }); - var argStringsPattern = argStringPatternParts.join(''); - - var seenActions = []; - var seenNonDefaultActions = []; - - - function takeAction(action, argumentStrings, optionString) { - seenActions.push(action); - var argumentValues = self._getValues(action, argumentStrings); - - // error if this argument is not allowed with other previously - // seen arguments, assuming that actions that use the default - // value don't really count as "present" - if (argumentValues !== action.defaultValue) { - seenNonDefaultActions.push(action); - if (!!actionConflicts[actionHash(action)]) { - actionConflicts[actionHash(action)].forEach(function (actionConflict) { - if (seenNonDefaultActions.indexOf(actionConflict) >= 0) { - throw argumentErrorHelper( - action, - format('Not allowed with argument "%s".', actionConflict.getName()) - ); - } - }); - } - } - - if (argumentValues !== $$.SUPPRESS) { - action.call(self, namespace, argumentValues, optionString); - } - } - - function consumeOptional(startIndex) { - // get the optional identified at this index - var optionTuple = optionStringIndices[startIndex]; - var action = optionTuple[0]; - var optionString = optionTuple[1]; - var explicitArg = optionTuple[2]; - - // identify additional optionals in the same arg string - // (e.g. -xyz is the same as -x -y -z if no args are required) - var actionTuples = []; - - var args, argCount, start, stop; - - while (true) { - if (!action) { - extras.push(argStrings[startIndex]); - return startIndex + 1; - } - if (!!explicitArg) { - argCount = self._matchArgument(action, 'A'); - - // if the action is a single-dash option and takes no - // arguments, try to parse more single-dash options out - // of the tail of the option string - var chars = self.prefixChars; - if (argCount === 0 && chars.indexOf(optionString[1]) < 0) { - actionTuples.push([action, [], optionString]); - optionString = optionString[0] + explicitArg[0]; - var newExplicitArg = explicitArg.slice(1) || null; - var optionalsMap = self._optionStringActions; - - if (_.keys(optionalsMap).indexOf(optionString) >= 0) { - action = optionalsMap[optionString]; - explicitArg = newExplicitArg; - } - else { - var msg = 'ignored explicit argument %r'; - throw argumentErrorHelper(action, msg); - } - } - // if the action expect exactly one argument, we've - // successfully matched the option; exit the loop - else if (argCount === 1) { - stop = startIndex + 1; - args = [explicitArg]; - actionTuples.push([action, args, optionString]); - break; - } - // error if a double-dash option did not use the - // explicit argument - else { - var message = 'ignored explicit argument %r'; - throw argumentErrorHelper(action, sprintf(message, explicitArg)); - } - } - // if there is no explicit argument, try to match the - // optional's string arguments with the following strings - // if successful, exit the loop - else { - - start = startIndex + 1; - var selectedPatterns = argStringsPattern.substr(start); - - argCount = self._matchArgument(action, selectedPatterns); - stop = start + argCount; - - - args = argStrings.slice(start, stop); - - actionTuples.push([action, args, optionString]); - break; - } - - } - - // add the Optional to the list and return the index at which - // the Optional's string args stopped - if (actionTuples.length < 1) { - throw new Error('length should be > 0'); - } - for (var i = 0; i < actionTuples.length; i++) { - takeAction.apply(self, actionTuples[i]); - } - return stop; - } - - // the list of Positionals left to be parsed; this is modified - // by consume_positionals() - var positionals = self._getPositionalActions(); - - function consumePositionals(startIndex) { - // match as many Positionals as possible - var selectedPattern = argStringsPattern.substr(startIndex); - var argCounts = self._matchArgumentsPartial(positionals, selectedPattern); - - // slice off the appropriate arg strings for each Positional - // and add the Positional and its args to the list - _.zip(positionals, argCounts).forEach(function (item) { - var action = item[0]; - var argCount = item[1]; - if (argCount === undefined) { - return; - } - var args = argStrings.slice(startIndex, startIndex + argCount); - - startIndex += argCount; - takeAction(action, args); - }); - - // slice off the Positionals that we just parsed and return the - // index at which the Positionals' string args stopped - positionals = positionals.slice(argCounts.length); - return startIndex; - } - - // consume Positionals and Optionals alternately, until we have - // passed the last option string - var startIndex = 0; - var position; - - var maxOptionStringIndex = -1; - - Object.keys(optionStringIndices).forEach(function (position) { - maxOptionStringIndex = Math.max(maxOptionStringIndex, parseInt(position, 10)); - }); - - var positionalsEndIndex, nextOptionStringIndex; - - while (startIndex <= maxOptionStringIndex) { - // consume any Positionals preceding the next option - nextOptionStringIndex = null; - for (position in optionStringIndices) { - if (!optionStringIndices.hasOwnProperty(position)) { continue; } - - position = parseInt(position, 10); - if (position >= startIndex) { - if (nextOptionStringIndex !== null) { - nextOptionStringIndex = Math.min(nextOptionStringIndex, position); - } - else { - nextOptionStringIndex = position; - } - } - } - - if (startIndex !== nextOptionStringIndex) { - positionalsEndIndex = consumePositionals(startIndex); - // only try to parse the next optional if we didn't consume - // the option string during the positionals parsing - if (positionalsEndIndex > startIndex) { - startIndex = positionalsEndIndex; - continue; - } - else { - startIndex = positionalsEndIndex; - } - } - - // if we consumed all the positionals we could and we're not - // at the index of an option string, there were extra arguments - if (!optionStringIndices[startIndex]) { - var strings = argStrings.slice(startIndex, nextOptionStringIndex); - extras = extras.concat(strings); - startIndex = nextOptionStringIndex; - } - // consume the next optional and any arguments for it - startIndex = consumeOptional(startIndex); - } - - // consume any positionals following the last Optional - var stopIndex = consumePositionals(startIndex); - - // if we didn't consume all the argument strings, there were extras - extras = extras.concat(argStrings.slice(stopIndex)); - - // if we didn't use all the Positional objects, there were too few - // arg strings supplied. - if (positionals.length > 0) { - self.error('too few arguments'); - } - - // make sure all required actions were present - self._actions.forEach(function (action) { - if (action.required) { - if (_.indexOf(seenActions, action) < 0) { - self.error(format('Argument "%s" is required', action.getName())); - } - } - }); - - // make sure all required groups have one option present - var actionUsed = false; - self._mutuallyExclusiveGroups.forEach(function (group) { - if (group.required) { - actionUsed = _.some(group._groupActions, function (action) { - return _.includes(seenNonDefaultActions, action); - }); - - // if no actions were used, report the error - if (!actionUsed) { - var names = []; - group._groupActions.forEach(function (action) { - if (action.help !== $$.SUPPRESS) { - names.push(action.getName()); - } - }); - names = names.join(' '); - var msg = 'one of the arguments ' + names + ' is required'; - self.error(msg); - } - } - }); - - // return the updated namespace and the extra arguments - return [namespace, extras]; -}; - -ArgumentParser.prototype._readArgsFromFiles = function (argStrings) { - // expand arguments referencing files - var _this = this; - var fs = require('fs'); - var newArgStrings = []; - argStrings.forEach(function (argString) { - if (_this.fromfilePrefixChars.indexOf(argString[0]) < 0) { - // for regular arguments, just add them back into the list - newArgStrings.push(argString); - } else { - // replace arguments referencing files with the file content - try { - var argstrs = []; - var filename = argString.slice(1); - var content = fs.readFileSync(filename, 'utf8'); - content = content.trim().split('\n'); - content.forEach(function (argLine) { - _this.convertArgLineToArgs(argLine).forEach(function (arg) { - argstrs.push(arg); - }); - argstrs = _this._readArgsFromFiles(argstrs); - }); - newArgStrings.push.apply(newArgStrings, argstrs); - } catch (error) { - return _this.error(error.message); - } - } - }); - return newArgStrings; -}; - -ArgumentParser.prototype.convertArgLineToArgs = function (argLine) { - return [argLine]; -}; - -ArgumentParser.prototype._matchArgument = function (action, regexpArgStrings) { - - // match the pattern for this action to the arg strings - var regexpNargs = new RegExp('^' + this._getNargsPattern(action)); - var matches = regexpArgStrings.match(regexpNargs); - var message; - - // throw an exception if we weren't able to find a match - if (!matches) { - switch (action.nargs) { - case undefined: - case null: - message = 'Expected one argument.'; - break; - case $$.OPTIONAL: - message = 'Expected at most one argument.'; - break; - case $$.ONE_OR_MORE: - message = 'Expected at least one argument.'; - break; - default: - message = 'Expected %s argument(s)'; - } - - throw argumentErrorHelper( - action, - format(message, action.nargs) - ); - } - // return the number of arguments matched - return matches[1].length; -}; - -ArgumentParser.prototype._matchArgumentsPartial = function (actions, regexpArgStrings) { - // progressively shorten the actions list by slicing off the - // final actions until we find a match - var self = this; - var result = []; - var actionSlice, pattern, matches; - var i, j; - - var getLength = function (string) { - return string.length; - }; - - for (i = actions.length; i > 0; i--) { - pattern = ''; - actionSlice = actions.slice(0, i); - for (j = 0; j < actionSlice.length; j++) { - pattern += self._getNargsPattern(actionSlice[j]); - } - - pattern = new RegExp('^' + pattern); - matches = regexpArgStrings.match(pattern); - - if (matches && matches.length > 0) { - // need only groups - matches = matches.splice(1); - result = result.concat(matches.map(getLength)); - break; - } - } - - // return the list of arg string counts - return result; -}; - -ArgumentParser.prototype._parseOptional = function (argString) { - var action, optionString, argExplicit, optionTuples; - - // if it's an empty string, it was meant to be a positional - if (!argString) { - return null; - } - - // if it doesn't start with a prefix, it was meant to be positional - if (this.prefixChars.indexOf(argString[0]) < 0) { - return null; - } - - // if the option string is present in the parser, return the action - if (!!this._optionStringActions[argString]) { - return [this._optionStringActions[argString], argString, null]; - } - - // if it's just a single character, it was meant to be positional - if (argString.length === 1) { - return null; - } - - // if the option string before the "=" is present, return the action - if (argString.indexOf('=') >= 0) { - optionString = argString.split('=', 1)[0]; - argExplicit = argString.slice(optionString.length + 1); - - if (!!this._optionStringActions[optionString]) { - action = this._optionStringActions[optionString]; - return [action, optionString, argExplicit]; - } - } - - // search through all possible prefixes of the option string - // and all actions in the parser for possible interpretations - optionTuples = this._getOptionTuples(argString); - - // if multiple actions match, the option string was ambiguous - if (optionTuples.length > 1) { - var optionStrings = optionTuples.map(function (optionTuple) { - return optionTuple[1]; - }); - this.error(format( - 'Ambiguous option: "%s" could match %s.', - argString, optionStrings.join(', ') - )); - // if exactly one action matched, this segmentation is good, - // so return the parsed action - } else if (optionTuples.length === 1) { - return optionTuples[0]; - } - - // if it was not found as an option, but it looks like a negative - // number, it was meant to be positional - // unless there are negative-number-like options - if (argString.match(this._regexpNegativeNumber)) { - if (!_.some(this._hasNegativeNumberOptionals)) { - return null; - } - } - // if it contains a space, it was meant to be a positional - if (argString.search(' ') >= 0) { - return null; - } - - // it was meant to be an optional but there is no such option - // in this parser (though it might be a valid option in a subparser) - return [null, argString, null]; -}; - -ArgumentParser.prototype._getOptionTuples = function (optionString) { - var result = []; - var chars = this.prefixChars; - var optionPrefix; - var argExplicit; - var action; - var actionOptionString; - - // option strings starting with two prefix characters are only split at - // the '=' - if (chars.indexOf(optionString[0]) >= 0 && chars.indexOf(optionString[1]) >= 0) { - if (optionString.indexOf('=') >= 0) { - var optionStringSplit = optionString.split('=', 1); - - optionPrefix = optionStringSplit[0]; - argExplicit = optionStringSplit[1]; - } else { - optionPrefix = optionString; - argExplicit = null; - } - - for (actionOptionString in this._optionStringActions) { - if (actionOptionString.substr(0, optionPrefix.length) === optionPrefix) { - action = this._optionStringActions[actionOptionString]; - result.push([action, actionOptionString, argExplicit]); - } - } - - // single character options can be concatenated with their arguments - // but multiple character options always have to have their argument - // separate - } else if (chars.indexOf(optionString[0]) >= 0 && chars.indexOf(optionString[1]) < 0) { - optionPrefix = optionString; - argExplicit = null; - var optionPrefixShort = optionString.substr(0, 2); - var argExplicitShort = optionString.substr(2); - - for (actionOptionString in this._optionStringActions) { - action = this._optionStringActions[actionOptionString]; - if (actionOptionString === optionPrefixShort) { - result.push([action, actionOptionString, argExplicitShort]); - } else if (actionOptionString.substr(0, optionPrefix.length) === optionPrefix) { - result.push([action, actionOptionString, argExplicit]); - } - } - - // shouldn't ever get here - } else { - throw new Error(format('Unexpected option string: %s.', optionString)); - } - // return the collected option tuples - return result; -}; - -ArgumentParser.prototype._getNargsPattern = function (action) { - // in all examples below, we have to allow for '--' args - // which are represented as '-' in the pattern - var regexpNargs; - - switch (action.nargs) { - // the default (null) is assumed to be a single argument - case undefined: - case null: - regexpNargs = '(-*A-*)'; - break; - // allow zero or more arguments - case $$.OPTIONAL: - regexpNargs = '(-*A?-*)'; - break; - // allow zero or more arguments - case $$.ZERO_OR_MORE: - regexpNargs = '(-*[A-]*)'; - break; - // allow one or more arguments - case $$.ONE_OR_MORE: - regexpNargs = '(-*A[A-]*)'; - break; - // allow any number of options or arguments - case $$.REMAINDER: - regexpNargs = '([-AO]*)'; - break; - // allow one argument followed by any number of options or arguments - case $$.PARSER: - regexpNargs = '(-*A[-AO]*)'; - break; - // all others should be integers - default: - regexpNargs = '(-*' + _.repeat('-*A', action.nargs) + '-*)'; - } - - // if this is an optional action, -- is not allowed - if (action.isOptional()) { - regexpNargs = regexpNargs.replace(/-\*/g, ''); - regexpNargs = regexpNargs.replace(/-/g, ''); - } - - // return the pattern - return regexpNargs; -}; - -// -// Value conversion methods -// - -ArgumentParser.prototype._getValues = function (action, argStrings) { - var self = this; - - // for everything but PARSER args, strip out '--' - if (action.nargs !== $$.PARSER && action.nargs !== $$.REMAINDER) { - argStrings = argStrings.filter(function (arrayElement) { - return arrayElement !== '--'; - }); - } - - var value, argString; - - // optional argument produces a default when not present - if (argStrings.length === 0 && action.nargs === $$.OPTIONAL) { - - value = (action.isOptional()) ? action.constant: action.defaultValue; - - if (typeof(value) === 'string') { - value = this._getValue(action, value); - this._checkValue(action, value); - } - - // when nargs='*' on a positional, if there were no command-line - // args, use the default if it is anything other than None - } else if (argStrings.length === 0 && action.nargs === $$.ZERO_OR_MORE && - action.optionStrings.length === 0) { - - value = (action.defaultValue || argStrings); - this._checkValue(action, value); - - // single argument or optional argument produces a single value - } else if (argStrings.length === 1 && - (!action.nargs || action.nargs === $$.OPTIONAL)) { - - argString = argStrings[0]; - value = this._getValue(action, argString); - this._checkValue(action, value); - - // REMAINDER arguments convert all values, checking none - } else if (action.nargs === $$.REMAINDER) { - value = argStrings.map(function (v) { - return self._getValue(action, v); - }); - - // PARSER arguments convert all values, but check only the first - } else if (action.nargs === $$.PARSER) { - value = argStrings.map(function (v) { - return self._getValue(action, v); - }); - this._checkValue(action, value[0]); - - // all other types of nargs produce a list - } else { - value = argStrings.map(function (v) { - return self._getValue(action, v); - }); - value.forEach(function (v) { - self._checkValue(action, v); - }); - } - - // return the converted value - return value; -}; - -ArgumentParser.prototype._getValue = function (action, argString) { - var result; - - var typeFunction = this._registryGet('type', action.type, action.type); - if (!_.isFunction(typeFunction)) { - var message = format('%s is not callable', typeFunction); - throw argumentErrorHelper(action, message); - } - - // convert the value to the appropriate type - try { - result = typeFunction(argString); - - // ArgumentTypeErrors indicate errors - // If action.type is not a registered string, it is a function - // Try to deduce its name for inclusion in the error message - // Failing that, include the error message it raised. - } catch (e) { - var name = null; - if (_.isString(action.type)) { - name = action.type; - } else { - name = action.type.name || action.type.displayName || ''; - } - var msg = format('Invalid %s value: %s', name, argString); - if (name === '') {msg += '\n' + e.message; } - throw argumentErrorHelper(action, msg); - } - // return the converted value - return result; -}; - -ArgumentParser.prototype._checkValue = function (action, value) { - // converted value must be one of the choices (if specified) - var choices = action.choices; - if (!!choices) { - // choise for argument can by array or string - if ((_.isString(choices) || _.isArray(choices)) && - choices.indexOf(value) !== -1) { - return; - } - // choise for subparsers can by only hash - if (_.isObject(choices) && !_.isArray(choices) && choices[value]) { - return; - } - - if (_.isString(choices)) { - choices = choices.split('').join(', '); - } - else if (_.isArray(choices)) { - choices = choices.join(', '); - } - else { - choices = _.keys(choices).join(', '); - } - var message = format('Invalid choice: %s (choose from [%s])', value, choices); - throw argumentErrorHelper(action, message); - } -}; - -// -// Help formatting methods -// - -/** - * ArgumentParser#formatUsage -> string - * - * Return usage string - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#printing-help - **/ -ArgumentParser.prototype.formatUsage = function () { - var formatter = this._getFormatter(); - formatter.addUsage(this.usage, this._actions, this._mutuallyExclusiveGroups); - return formatter.formatHelp(); -}; - -/** - * ArgumentParser#formatHelp -> string - * - * Return help - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#printing-help - **/ -ArgumentParser.prototype.formatHelp = function () { - var formatter = this._getFormatter(); - - // usage - formatter.addUsage(this.usage, this._actions, this._mutuallyExclusiveGroups); - - // description - formatter.addText(this.description); - - // positionals, optionals and user-defined groups - this._actionGroups.forEach(function (actionGroup) { - formatter.startSection(actionGroup.title); - formatter.addText(actionGroup.description); - formatter.addArguments(actionGroup._groupActions); - formatter.endSection(); - }); - - // epilog - formatter.addText(this.epilog); - - // determine help from format above - return formatter.formatHelp(); -}; - -ArgumentParser.prototype._getFormatter = function () { - var FormatterClass = this.formatterClass; - var formatter = new FormatterClass({prog: this.prog}); - return formatter; -}; - -// -// Print functions -// - -/** - * ArgumentParser#printUsage() -> Void - * - * Print usage - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#printing-help - **/ -ArgumentParser.prototype.printUsage = function () { - this._printMessage(this.formatUsage()); -}; - -/** - * ArgumentParser#printHelp() -> Void - * - * Print help - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#printing-help - **/ -ArgumentParser.prototype.printHelp = function () { - this._printMessage(this.formatHelp()); -}; - -ArgumentParser.prototype._printMessage = function (message, stream) { - if (!stream) { - stream = process.stdout; - } - if (message) { - stream.write('' + message); - } -}; - -// -// Exit functions -// - -/** - * ArgumentParser#exit(status=0, message) -> Void - * - status (int): exit status - * - message (string): message - * - * Print message in stderr/stdout and exit program - **/ -ArgumentParser.prototype.exit = function (status, message) { - if (!!message) { - if (status === 0) { - this._printMessage(message); - } - else { - this._printMessage(message, process.stderr); - } - } - - process.exit(status); -}; - -/** - * ArgumentParser#error(message) -> Void - * - err (Error|string): message - * - * Error method Prints a usage message incorporating the message to stderr and - * exits. If you override this in a subclass, - * it should not return -- it should - * either exit or throw an exception. - * - **/ -ArgumentParser.prototype.error = function (err) { - var message; - if (err instanceof Error) { - if (this.debug === true) { - throw err; - } - message = err.message; - } - else { - message = err; - } - var msg = format('%s: error: %s', this.prog, message) + $$.EOL; - - if (this.debug === true) { - throw new Error(msg); - } - - this.printUsage(process.stderr); - - return this.exit(2, msg); -}; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/const.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/const.js deleted file mode 100644 index b1fd4ce..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/const.js +++ /dev/null @@ -1,21 +0,0 @@ -// -// 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'; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/help/added_formatters.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/help/added_formatters.js deleted file mode 100644 index 7f9c555..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/help/added_formatters.js +++ /dev/null @@ -1,88 +0,0 @@ -'use strict'; - -var util = require('util'); -var _ = require('lodash'); - - -// Constants -var $$ = require('../const'); - -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. - **/ - -var ArgumentDefaultsHelpFormatter = 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 !== $$.SUPPRESS) { - var defaulting_nargs = [$$.OPTIONAL, $$.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. - **/ - -var RawDescriptionHelpFormatter = 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. - **/ - -var RawTextHelpFormatter = function RawTextHelpFormatter(options) { - RawDescriptionHelpFormatter.call(this, options); -}; - -util.inherits(RawTextHelpFormatter, RawDescriptionHelpFormatter); - -RawTextHelpFormatter.prototype._splitLines = function (text) { - return text.split('\n'); -}; - -module.exports.RawTextHelpFormatter = RawTextHelpFormatter; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js deleted file mode 100644 index e050728..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js +++ /dev/null @@ -1,798 +0,0 @@ -/** - * 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 _ = require('lodash'); -var sprintf = require('sprintf-js').sprintf; - -// Constants -var $$ = require('../const'); - - -/*: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 !== $$.SUPPRESS) { - var currentIndent = formatter.currentIndent; - heading = _.repeat(' ', currentIndent) + this._heading + ':' + $$.EOL; - } - - // join the section-initialize newline, the heading and the help - return formatter._joinParts([$$.EOL, heading, itemHelp, $$.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($$.EOL + $$.EOL + $$.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 !== $$.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 !== $$.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 !== $$.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, $$.EOL + $$.EOL); - help = _.trim(help, $$.EOL) + $$.EOL; - } - return help; -}; - -HelpFormatter.prototype._joinParts = function (partStrings) { - return partStrings.filter(function (part) { - return (!!part && part !== $$.SUPPRESS); - }).join(''); -}; - -HelpFormatter.prototype._formatUsage = function (usage, actions, groups, prefix) { - if (!prefix && !_.isString(prefix)) { - 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 - 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 + positionalParts; - lines = _getLines(parts, indent); - if (lines.length > 1) { - lines = [].concat( - _getLines(optionalParts, indent), - _getLines(positionalParts, indent) - ); - } - lines = [prog] + lines; - } - // join lines into usage - usage = lines.join($$.EOL); - } - } - - // prefix with 'usage:' - return prefix + usage + $$.EOL + $$.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 (_.isEqual(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 === $$.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 = _.trim(text); - - // 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) + $$.EOL + $$.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 + $$.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 + $$.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] + $$.EOL); - helpLines.slice(1).forEach(function (line) { - parts.push(_.repeat(' ', helpPosition) + line + $$.EOL); - }); - - // or add a newline if the description doesn't end with one - } else if (actionHeader.charAt(actionHeader.length - 1) !== $$.EOL) { - parts.push($$.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]; - } else { - 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 (_.isString(choices)) { - choices = choices.split('').join(', '); - } else if (_.isArray(choices)) { - choices = choices.join(','); - } - else - { - choices = _.keys(choices).join(','); - } - result = '{' + choices + '}'; - } else { - result = metavarDefault; - } - - return function (size) { - if (Array.isArray(result)) { - return result; - } else { - 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) { - case undefined: - case null: - metavars = buildMetavar(1); - result = '' + metavars[0]; - break; - case $$.OPTIONAL: - metavars = buildMetavar(1); - result = '[' + metavars[0] + ']'; - break; - case $$.ZERO_OR_MORE: - metavars = buildMetavar(2); - result = '[' + metavars[0] + ' [' + metavars[1] + ' ...]]'; - break; - case $$.ONE_OR_MORE: - metavars = buildMetavar(2); - result = '' + metavars[0] + ' [' + metavars[1] + ' ...]'; - break; - case $$.REMAINDER: - result = '...'; - break; - case $$.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 !== $$.SUPPRESS) { - params[actionProperty] = actionValue; - } - }); - - if (!!params.choices) { - if (_.isString(params.choices)) { - params.choices = params.choices.split('').join(', '); - } - else if (_.isArray(params.choices)) { - params.choices = params.choices.join(', '); - } - else { - params.choices = _.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 = _.trim(text); - text = text.replace(this._whitespaceMatcher, ' '); - - // Wraps the single paragraph in text (a string) so every line - // is at most width characters long. - text.split($$.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($$.EOL); -}; - -HelpFormatter.prototype._getHelpString = function (action) { - return action.help; -}; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/namespace.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/namespace.js deleted file mode 100644 index 2f1f8f4..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/lib/namespace.js +++ /dev/null @@ -1,77 +0,0 @@ -/** - * 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('lodash'); - -/** - * 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; - } else { - return defaultValue; - } -}; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/LICENSE b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/LICENSE deleted file mode 100644 index b054ca5..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/README.md b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/README.md deleted file mode 100644 index 9a0dfcd..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# lodash v4.2.1 - -The [lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash -``` - -In Node.js: -```js -// load the full build -var _ = require('lodash'); -// load the core build -var _ = require('lodash/core'); -// load the fp build for immutable auto-curried iteratee-first data-last methods -var _ = require('lodash/fp'); - -// or a method category -var array = require('lodash/array'); -var object = require('lodash/fp/object'); - -// or method for smaller builds with browserify/rollup/webpack -var chunk = require('lodash/chunk'); -var extend = require('lodash/fp/extend'); -``` - -See the [package source](https://github.com/lodash/lodash/tree/4.2.1-npm) for more details. - -**Note:**
-Don’t assign values to the [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL.
-Install [n_](https://www.npmjs.com/package/n_) for a REPL that includes lodash by default. - -## Module formats - -Lodash is available in a variety of other builds & module formats. - - * [lodash](https://www.npmjs.com/package/lodash) & [per method packages](https://www.npmjs.com/browse/keyword/lodash-modularized) - * [lodash-amd](https://www.npmjs.com/package/lodash-amd) - * [lodash-es](https://www.npmjs.com/package/lodash-es) & [babel-plugin-lodash](https://www.npmjs.com/package/babel-plugin-lodash) - -## Further Reading - - * [API Documentation](https://lodash.com/docs) - * [Build Differences](https://github.com/lodash/lodash/wiki/Build-Differences) - * [Changelog](https://github.com/lodash/lodash/wiki/Changelog) - * [Roadmap](https://github.com/lodash/lodash/wiki/Roadmap) - * [More Resources](https://github.com/lodash/lodash/wiki/Resources) - -## Support - -Tested in Chrome 47-48, Firefox 43-44, IE 9-11, Edge 13, Safari 8-9, Node.js 0.10, 0.12, 4, & 5, & PhantomJS 1.9.8. -Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available. Special thanks to [Sauce Labs](https://saucelabs.com/) for providing automated browser testing. diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_Hash.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_Hash.js deleted file mode 100644 index 25108ad..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_Hash.js +++ /dev/null @@ -1,17 +0,0 @@ -var nativeCreate = require('./_nativeCreate'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Creates an hash object. - * - * @private - * @returns {Object} Returns the new hash object. - */ -function Hash() {} - -// Avoid inheriting from `Object.prototype` when possible. -Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto; - -module.exports = Hash; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_LazyWrapper.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_LazyWrapper.js deleted file mode 100644 index 3c14d80..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_LazyWrapper.js +++ /dev/null @@ -1,26 +0,0 @@ -var baseCreate = require('./_baseCreate'), - baseLodash = require('./_baseLodash'); - -/** Used as references for the maximum length and index of an array. */ -var MAX_ARRAY_LENGTH = 4294967295; - -/** - * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. - * - * @private - * @param {*} value The value to wrap. - */ -function LazyWrapper(value) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__dir__ = 1; - this.__filtered__ = false; - this.__iteratees__ = []; - this.__takeCount__ = MAX_ARRAY_LENGTH; - this.__views__ = []; -} - -LazyWrapper.prototype = baseCreate(baseLodash.prototype); -LazyWrapper.prototype.constructor = LazyWrapper; - -module.exports = LazyWrapper; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_LodashWrapper.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_LodashWrapper.js deleted file mode 100644 index 7c255b2..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_LodashWrapper.js +++ /dev/null @@ -1,22 +0,0 @@ -var baseCreate = require('./_baseCreate'), - baseLodash = require('./_baseLodash'); - -/** - * The base constructor for creating `lodash` wrapper objects. - * - * @private - * @param {*} value The value to wrap. - * @param {boolean} [chainAll] Enable chaining for all wrapper methods. - */ -function LodashWrapper(value, chainAll) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__chain__ = !!chainAll; - this.__index__ = 0; - this.__values__ = undefined; -} - -LodashWrapper.prototype = baseCreate(baseLodash.prototype); -LodashWrapper.prototype.constructor = LodashWrapper; - -module.exports = LodashWrapper; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_Map.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_Map.js deleted file mode 100644 index b73f29a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_Map.js +++ /dev/null @@ -1,7 +0,0 @@ -var getNative = require('./_getNative'), - root = require('./_root'); - -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'); - -module.exports = Map; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_MapCache.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_MapCache.js deleted file mode 100644 index 734324b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_MapCache.js +++ /dev/null @@ -1,31 +0,0 @@ -var mapClear = require('./_mapClear'), - mapDelete = require('./_mapDelete'), - mapGet = require('./_mapGet'), - mapHas = require('./_mapHas'), - mapSet = require('./_mapSet'); - -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @param {Array} [values] The values to cache. - */ -function MapCache(values) { - var index = -1, - length = values ? values.length : 0; - - this.clear(); - while (++index < length) { - var entry = values[index]; - this.set(entry[0], entry[1]); - } -} - -// Add functions to the `MapCache`. -MapCache.prototype.clear = mapClear; -MapCache.prototype['delete'] = mapDelete; -MapCache.prototype.get = mapGet; -MapCache.prototype.has = mapHas; -MapCache.prototype.set = mapSet; - -module.exports = MapCache; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_Reflect.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_Reflect.js deleted file mode 100644 index 1de7475..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_Reflect.js +++ /dev/null @@ -1,6 +0,0 @@ -var root = require('./_root'); - -/** Built-in value references. */ -var Reflect = root.Reflect; - -module.exports = Reflect; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_Set.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_Set.js deleted file mode 100644 index b3c8dcb..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_Set.js +++ /dev/null @@ -1,7 +0,0 @@ -var getNative = require('./_getNative'), - root = require('./_root'); - -/* Built-in method references that are verified to be native. */ -var Set = getNative(root, 'Set'); - -module.exports = Set; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_SetCache.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_SetCache.js deleted file mode 100644 index 66b8b61..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_SetCache.js +++ /dev/null @@ -1,24 +0,0 @@ -var MapCache = require('./_MapCache'), - cachePush = require('./_cachePush'); - -/** - * - * Creates a set cache object to store unique values. - * - * @private - * @param {Array} [values] The values to cache. - */ -function SetCache(values) { - var index = -1, - length = values ? values.length : 0; - - this.__data__ = new MapCache; - while (++index < length) { - this.push(values[index]); - } -} - -// Add functions to the `SetCache`. -SetCache.prototype.push = cachePush; - -module.exports = SetCache; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_Stack.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_Stack.js deleted file mode 100644 index 7c3c2f3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_Stack.js +++ /dev/null @@ -1,31 +0,0 @@ -var stackClear = require('./_stackClear'), - stackDelete = require('./_stackDelete'), - stackGet = require('./_stackGet'), - stackHas = require('./_stackHas'), - stackSet = require('./_stackSet'); - -/** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @param {Array} [values] The values to cache. - */ -function Stack(values) { - var index = -1, - length = values ? values.length : 0; - - this.clear(); - while (++index < length) { - var entry = values[index]; - this.set(entry[0], entry[1]); - } -} - -// Add functions to the `Stack` cache. -Stack.prototype.clear = stackClear; -Stack.prototype['delete'] = stackDelete; -Stack.prototype.get = stackGet; -Stack.prototype.has = stackHas; -Stack.prototype.set = stackSet; - -module.exports = Stack; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_Symbol.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_Symbol.js deleted file mode 100644 index a013f7c..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_Symbol.js +++ /dev/null @@ -1,6 +0,0 @@ -var root = require('./_root'); - -/** Built-in value references. */ -var Symbol = root.Symbol; - -module.exports = Symbol; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_Uint8Array.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_Uint8Array.js deleted file mode 100644 index 2fb30e1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_Uint8Array.js +++ /dev/null @@ -1,6 +0,0 @@ -var root = require('./_root'); - -/** Built-in value references. */ -var Uint8Array = root.Uint8Array; - -module.exports = Uint8Array; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_WeakMap.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_WeakMap.js deleted file mode 100644 index 567f86c..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_WeakMap.js +++ /dev/null @@ -1,7 +0,0 @@ -var getNative = require('./_getNative'), - root = require('./_root'); - -/* Built-in method references that are verified to be native. */ -var WeakMap = getNative(root, 'WeakMap'); - -module.exports = WeakMap; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_addMapEntry.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_addMapEntry.js deleted file mode 100644 index c76dc3f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_addMapEntry.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Adds the key-value `pair` to `map`. - * - * @private - * @param {Object} map The map to modify. - * @param {Array} pair The key-value pair to add. - * @returns {Object} Returns `map`. - */ -function addMapEntry(map, pair) { - map.set(pair[0], pair[1]); - return map; -} - -module.exports = addMapEntry; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_addSetEntry.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_addSetEntry.js deleted file mode 100644 index 7b75c13..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_addSetEntry.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Adds `value` to `set`. - * - * @private - * @param {Object} set The set to modify. - * @param {*} value The value to add. - * @returns {Object} Returns `set`. - */ -function addSetEntry(set, value) { - set.add(value); - return set; -} - -module.exports = addSetEntry; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_apply.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_apply.js deleted file mode 100644 index 22d4f8a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_apply.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {...*} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ -function apply(func, thisArg, args) { - var length = args.length; - switch (length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); -} - -module.exports = apply; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayAggregator.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayAggregator.js deleted file mode 100644 index 562eeb3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayAggregator.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * A specialized version of `baseAggregator` for arrays. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform keys. - * @param {Object} accumulator The initial aggregated object. - * @returns {Function} Returns `accumulator`. - */ -function arrayAggregator(array, setter, iteratee, accumulator) { - var index = -1, - length = array.length; - - while (++index < length) { - var value = array[index]; - setter(accumulator, value, iteratee(value), array); - } - return accumulator; -} - -module.exports = arrayAggregator; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayConcat.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayConcat.js deleted file mode 100644 index 96e7741..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayConcat.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Creates a new array concatenating `array` with `other`. - * - * @private - * @param {Array} array The first array to concatenate. - * @param {Array} other The second array to concatenate. - * @returns {Array} Returns the new concatenated array. - */ -function arrayConcat(array, other) { - var index = -1, - length = array.length, - othIndex = -1, - othLength = other.length, - result = Array(length + othLength); - - while (++index < length) { - result[index] = array[index]; - } - while (++othIndex < othLength) { - result[index++] = other[othIndex]; - } - return result; -} - -module.exports = arrayConcat; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayEach.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayEach.js deleted file mode 100644 index c302e63..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayEach.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ -function arrayEach(array, iteratee) { - var index = -1, - length = array.length; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; -} - -module.exports = arrayEach; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayEachRight.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayEachRight.js deleted file mode 100644 index 5318585..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayEachRight.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * A specialized version of `_.forEachRight` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ -function arrayEachRight(array, iteratee) { - var length = array.length; - - while (length--) { - if (iteratee(array[length], length, array) === false) { - break; - } - } - return array; -} - -module.exports = arrayEachRight; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayEvery.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayEvery.js deleted file mode 100644 index d3ba018..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayEvery.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * A specialized version of `_.every` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, else `false`. - */ -function arrayEvery(array, predicate) { - var index = -1, - length = array.length; - - while (++index < length) { - if (!predicate(array[index], index, array)) { - return false; - } - } - return true; -} - -module.exports = arrayEvery; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayFilter.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayFilter.js deleted file mode 100644 index 297083b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayFilter.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * A specialized version of `_.filter` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ -function arrayFilter(array, predicate) { - var index = -1, - length = array.length, - resIndex = -1, - result = []; - - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[++resIndex] = value; - } - } - return result; -} - -module.exports = arrayFilter; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayIncludes.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayIncludes.js deleted file mode 100644 index 9574f5d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayIncludes.js +++ /dev/null @@ -1,16 +0,0 @@ -var baseIndexOf = require('./_baseIndexOf'); - -/** - * A specialized version of `_.includes` for arrays without support for - * specifying an index to search from. - * - * @private - * @param {Array} array The array to search. - * @param {*} target The value to search for. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ -function arrayIncludes(array, value) { - return !!array.length && baseIndexOf(array, value, 0) > -1; -} - -module.exports = arrayIncludes; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayIncludesWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayIncludesWith.js deleted file mode 100644 index a360d3a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayIncludesWith.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * A specialized version of `_.includesWith` for arrays without support for - * specifying an index to search from. - * - * @private - * @param {Array} array The array to search. - * @param {*} target The value to search for. - * @param {Function} comparator The comparator invoked per element. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ -function arrayIncludesWith(array, value, comparator) { - var index = -1, - length = array.length; - - while (++index < length) { - if (comparator(value, array[index])) { - return true; - } - } - return false; -} - -module.exports = arrayIncludesWith; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayMap.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayMap.js deleted file mode 100644 index 73b29cf..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayMap.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ -function arrayMap(array, iteratee) { - var index = -1, - length = array.length, - result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; -} - -module.exports = arrayMap; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayPush.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayPush.js deleted file mode 100644 index 7d742b3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayPush.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ -function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; -} - -module.exports = arrayPush; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayReduce.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayReduce.js deleted file mode 100644 index 6a355bc..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayReduce.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as the initial value. - * @returns {*} Returns the accumulated value. - */ -function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array.length; - - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; -} - -module.exports = arrayReduce; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayReduceRight.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayReduceRight.js deleted file mode 100644 index b33a2d0..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arrayReduceRight.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * A specialized version of `_.reduceRight` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the last element of `array` as the initial value. - * @returns {*} Returns the accumulated value. - */ -function arrayReduceRight(array, iteratee, accumulator, initAccum) { - var length = array.length; - if (initAccum && length) { - accumulator = array[--length]; - } - while (length--) { - accumulator = iteratee(accumulator, array[length], length, array); - } - return accumulator; -} - -module.exports = arrayReduceRight; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arraySome.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arraySome.js deleted file mode 100644 index b93d531..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_arraySome.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * A specialized version of `_.some` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`. - */ -function arraySome(array, predicate) { - var index = -1, - length = array.length; - - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; - } - } - return false; -} - -module.exports = arraySome; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_assignInDefaults.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_assignInDefaults.js deleted file mode 100644 index ea6b0e3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_assignInDefaults.js +++ /dev/null @@ -1,27 +0,0 @@ -var eq = require('./eq'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used by `_.defaults` to customize its `_.assignIn` use. - * - * @private - * @param {*} objValue The destination value. - * @param {*} srcValue The source value. - * @param {string} key The key of the property to assign. - * @param {Object} object The parent object of `objValue`. - * @returns {*} Returns the value to assign. - */ -function assignInDefaults(objValue, srcValue, key, object) { - if (objValue === undefined || - (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { - return srcValue; - } - return objValue; -} - -module.exports = assignInDefaults; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_assignMergeValue.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_assignMergeValue.js deleted file mode 100644 index 1c493b0..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_assignMergeValue.js +++ /dev/null @@ -1,18 +0,0 @@ -var eq = require('./eq'); - -/** - * This function is like `assignValue` except that it doesn't assign `undefined` values. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function assignMergeValue(object, key, value) { - if ((value !== undefined && !eq(object[key], value)) || - (typeof key == 'number' && value === undefined && !(key in object))) { - object[key] = value; - } -} - -module.exports = assignMergeValue; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_assignValue.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_assignValue.js deleted file mode 100644 index 7563b60..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_assignValue.js +++ /dev/null @@ -1,28 +0,0 @@ -var eq = require('./eq'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function assignValue(object, key, value) { - var objValue = object[key]; - if ((!eq(objValue, value) || - (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) || - (value === undefined && !(key in object))) { - object[key] = value; - } -} - -module.exports = assignValue; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_assocDelete.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_assocDelete.js deleted file mode 100644 index 709a04a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_assocDelete.js +++ /dev/null @@ -1,31 +0,0 @@ -var assocIndexOf = require('./_assocIndexOf'); - -/** Used for built-in method references. */ -var arrayProto = Array.prototype; - -/** Built-in value references. */ -var splice = arrayProto.splice; - -/** - * Removes `key` and its value from the associative array. - * - * @private - * @param {Array} array The array to query. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function assocDelete(array, key) { - var index = assocIndexOf(array, key); - if (index < 0) { - return false; - } - var lastIndex = array.length - 1; - if (index == lastIndex) { - array.pop(); - } else { - splice.call(array, index, 1); - } - return true; -} - -module.exports = assocDelete; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_assocGet.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_assocGet.js deleted file mode 100644 index e53d332..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_assocGet.js +++ /dev/null @@ -1,16 +0,0 @@ -var assocIndexOf = require('./_assocIndexOf'); - -/** - * Gets the associative array value for `key`. - * - * @private - * @param {Array} array The array to query. - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function assocGet(array, key) { - var index = assocIndexOf(array, key); - return index < 0 ? undefined : array[index][1]; -} - -module.exports = assocGet; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_assocHas.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_assocHas.js deleted file mode 100644 index a74bd39..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_assocHas.js +++ /dev/null @@ -1,15 +0,0 @@ -var assocIndexOf = require('./_assocIndexOf'); - -/** - * Checks if an associative array value for `key` exists. - * - * @private - * @param {Array} array The array to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function assocHas(array, key) { - return assocIndexOf(array, key) > -1; -} - -module.exports = assocHas; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_assocIndexOf.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_assocIndexOf.js deleted file mode 100644 index 958c8d8..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_assocIndexOf.js +++ /dev/null @@ -1,22 +0,0 @@ -var eq = require('./eq'); - -/** - * Gets the index at which the first occurrence of `key` is found in `array` - * of key-value pairs. - * - * @private - * @param {Array} array The array to search. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; -} - -module.exports = assocIndexOf; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_assocSet.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_assocSet.js deleted file mode 100644 index 524f341..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_assocSet.js +++ /dev/null @@ -1,20 +0,0 @@ -var assocIndexOf = require('./_assocIndexOf'); - -/** - * Sets the associative array `key` to `value`. - * - * @private - * @param {Array} array The array to modify. - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - */ -function assocSet(array, key, value) { - var index = assocIndexOf(array, key); - if (index < 0) { - array.push([key, value]); - } else { - array[index][1] = value; - } -} - -module.exports = assocSet; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseAggregator.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseAggregator.js deleted file mode 100644 index 4bc9e91..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseAggregator.js +++ /dev/null @@ -1,21 +0,0 @@ -var baseEach = require('./_baseEach'); - -/** - * Aggregates elements of `collection` on `accumulator` with keys transformed - * by `iteratee` and values set by `setter`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform keys. - * @param {Object} accumulator The initial aggregated object. - * @returns {Function} Returns `accumulator`. - */ -function baseAggregator(collection, setter, iteratee, accumulator) { - baseEach(collection, function(value, key, collection) { - setter(accumulator, value, iteratee(value), collection); - }); - return accumulator; -} - -module.exports = baseAggregator; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseAssign.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseAssign.js deleted file mode 100644 index e5c4a1a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseAssign.js +++ /dev/null @@ -1,17 +0,0 @@ -var copyObject = require('./_copyObject'), - keys = require('./keys'); - -/** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ -function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); -} - -module.exports = baseAssign; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseAt.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseAt.js deleted file mode 100644 index a077cb9..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseAt.js +++ /dev/null @@ -1,23 +0,0 @@ -var get = require('./get'); - -/** - * The base implementation of `_.at` without support for individual paths. - * - * @private - * @param {Object} object The object to iterate over. - * @param {string[]} paths The property paths of elements to pick. - * @returns {Array} Returns the new array of picked elements. - */ -function baseAt(object, paths) { - var index = -1, - isNil = object == null, - length = paths.length, - result = Array(length); - - while (++index < length) { - result[index] = isNil ? undefined : get(object, paths[index]); - } - return result; -} - -module.exports = baseAt; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseClamp.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseClamp.js deleted file mode 100644 index ceadeef..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseClamp.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * The base implementation of `_.clamp` which doesn't coerce arguments to numbers. - * - * @private - * @param {number} number The number to clamp. - * @param {number} [lower] The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the clamped number. - */ -function baseClamp(number, lower, upper) { - if (number === number) { - if (upper !== undefined) { - number = number <= upper ? number : upper; - } - if (lower !== undefined) { - number = number >= lower ? number : lower; - } - } - return number; -} - -module.exports = baseClamp; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseClone.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseClone.js deleted file mode 100644 index d57870f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseClone.js +++ /dev/null @@ -1,123 +0,0 @@ -var Stack = require('./_Stack'), - arrayEach = require('./_arrayEach'), - assignValue = require('./_assignValue'), - baseAssign = require('./_baseAssign'), - baseForOwn = require('./_baseForOwn'), - copyArray = require('./_copyArray'), - copySymbols = require('./_copySymbols'), - getTag = require('./_getTag'), - initCloneArray = require('./_initCloneArray'), - initCloneByTag = require('./_initCloneByTag'), - initCloneObject = require('./_initCloneObject'), - isArray = require('./isArray'), - isHostObject = require('./_isHostObject'), - isObject = require('./isObject'); - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - weakMapTag = '[object WeakMap]'; - -var arrayBufferTag = '[object ArrayBuffer]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - -/** Used to identify `toStringTag` values supported by `_.clone`. */ -var cloneableTags = {}; -cloneableTags[argsTag] = cloneableTags[arrayTag] = -cloneableTags[arrayBufferTag] = cloneableTags[boolTag] = -cloneableTags[dateTag] = cloneableTags[float32Tag] = -cloneableTags[float64Tag] = cloneableTags[int8Tag] = -cloneableTags[int16Tag] = cloneableTags[int32Tag] = -cloneableTags[mapTag] = cloneableTags[numberTag] = -cloneableTags[objectTag] = cloneableTags[regexpTag] = -cloneableTags[setTag] = cloneableTags[stringTag] = -cloneableTags[symbolTag] = cloneableTags[uint8Tag] = -cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = -cloneableTags[uint32Tag] = true; -cloneableTags[errorTag] = cloneableTags[funcTag] = -cloneableTags[weakMapTag] = false; - -/** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ -function baseClone(value, isDeep, customizer, key, object, stack) { - var result; - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; - - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - if (isHostObject(value)) { - return object ? value : {}; - } - result = initCloneObject(isFunc ? {} : value); - if (!isDeep) { - return copySymbols(value, baseAssign(result, value)); - } - } else { - return cloneableTags[tag] - ? initCloneByTag(value, tag, isDeep) - : (object ? value : {}); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); - - // Recursively populate clone (susceptible to call stack limits). - (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) { - assignValue(result, key, baseClone(subValue, isDeep, customizer, key, value, stack)); - }); - return isArr ? result : copySymbols(value, result); -} - -module.exports = baseClone; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseConforms.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseConforms.js deleted file mode 100644 index 888434d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseConforms.js +++ /dev/null @@ -1,32 +0,0 @@ -var keys = require('./keys'); - -/** - * The base implementation of `_.conforms` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property predicates to conform to. - * @returns {Function} Returns the new function. - */ -function baseConforms(source) { - var props = keys(source), - length = props.length; - - return function(object) { - if (object == null) { - return !length; - } - var index = length; - while (index--) { - var key = props[index], - predicate = source[key], - value = object[key]; - - if ((value === undefined && !(key in Object(object))) || !predicate(value)) { - return false; - } - } - return true; - }; -} - -module.exports = baseConforms; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseCreate.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseCreate.js deleted file mode 100644 index 64d53ec..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseCreate.js +++ /dev/null @@ -1,23 +0,0 @@ -var isObject = require('./isObject'); - -/** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} prototype The object to inherit from. - * @returns {Object} Returns the new object. - */ -var baseCreate = (function() { - function object() {} - return function(prototype) { - if (isObject(prototype)) { - object.prototype = prototype; - var result = new object; - object.prototype = undefined; - } - return result || {}; - }; -}()); - -module.exports = baseCreate; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseDelay.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseDelay.js deleted file mode 100644 index edd8356..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseDelay.js +++ /dev/null @@ -1,21 +0,0 @@ -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * The base implementation of `_.delay` and `_.defer` which accepts an array - * of `func` arguments. - * - * @private - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {Object} args The arguments provide to `func`. - * @returns {number} Returns the timer id. - */ -function baseDelay(func, wait, args) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return setTimeout(function() { func.apply(undefined, args); }, wait); -} - -module.exports = baseDelay; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseDifference.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseDifference.js deleted file mode 100644 index b266d7e..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseDifference.js +++ /dev/null @@ -1,66 +0,0 @@ -var SetCache = require('./_SetCache'), - arrayIncludes = require('./_arrayIncludes'), - arrayIncludesWith = require('./_arrayIncludesWith'), - arrayMap = require('./_arrayMap'), - baseUnary = require('./_baseUnary'), - cacheHas = require('./_cacheHas'); - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** - * The base implementation of methods like `_.difference` without support for - * excluding multiple arrays or iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Array} values The values to exclude. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - */ -function baseDifference(array, values, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - isCommon = true, - length = array.length, - result = [], - valuesLength = values.length; - - if (!length) { - return result; - } - if (iteratee) { - values = arrayMap(values, baseUnary(iteratee)); - } - if (comparator) { - includes = arrayIncludesWith; - isCommon = false; - } - else if (values.length >= LARGE_ARRAY_SIZE) { - includes = cacheHas; - isCommon = false; - values = new SetCache(values); - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - if (isCommon && computed === computed) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values[valuesIndex] === computed) { - continue outer; - } - } - result.push(value); - } - else if (!includes(values, computed, comparator)) { - result.push(value); - } - } - return result; -} - -module.exports = baseDifference; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseEach.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseEach.js deleted file mode 100644 index 512c067..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseEach.js +++ /dev/null @@ -1,14 +0,0 @@ -var baseForOwn = require('./_baseForOwn'), - createBaseEach = require('./_createBaseEach'); - -/** - * The base implementation of `_.forEach` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ -var baseEach = createBaseEach(baseForOwn); - -module.exports = baseEach; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseEachRight.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseEachRight.js deleted file mode 100644 index 0a8feec..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseEachRight.js +++ /dev/null @@ -1,14 +0,0 @@ -var baseForOwnRight = require('./_baseForOwnRight'), - createBaseEach = require('./_createBaseEach'); - -/** - * The base implementation of `_.forEachRight` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ -var baseEachRight = createBaseEach(baseForOwnRight, true); - -module.exports = baseEachRight; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseEvery.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseEvery.js deleted file mode 100644 index aafa00d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseEvery.js +++ /dev/null @@ -1,20 +0,0 @@ -var baseEach = require('./_baseEach'); - -/** - * The base implementation of `_.every` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, else `false` - */ -function baseEvery(collection, predicate) { - var result = true; - baseEach(collection, function(value, index, collection) { - result = !!predicate(value, index, collection); - return result; - }); - return result; -} - -module.exports = baseEvery; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseExtremum.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseExtremum.js deleted file mode 100644 index c6cb804..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseExtremum.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * The base implementation of methods like `_.max` and `_.min` which accepts a - * `comparator` to determine the extremum value. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The iteratee invoked per iteration. - * @param {Function} comparator The comparator used to compare values. - * @returns {*} Returns the extremum value. - */ -function baseExtremum(array, iteratee, comparator) { - var index = -1, - length = array.length; - - while (++index < length) { - var value = array[index], - current = iteratee(value); - - if (current != null && (computed === undefined - ? current === current - : comparator(current, computed) - )) { - var computed = current, - result = value; - } - } - return result; -} - -module.exports = baseExtremum; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseFill.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseFill.js deleted file mode 100644 index 46ef9c7..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseFill.js +++ /dev/null @@ -1,32 +0,0 @@ -var toInteger = require('./toInteger'), - toLength = require('./toLength'); - -/** - * The base implementation of `_.fill` without an iteratee call guard. - * - * @private - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - */ -function baseFill(array, value, start, end) { - var length = array.length; - - start = toInteger(start); - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = (end === undefined || end > length) ? length : toInteger(end); - if (end < 0) { - end += length; - } - end = start > end ? 0 : toLength(end); - while (start < end) { - array[start++] = value; - } - return array; -} - -module.exports = baseFill; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseFilter.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseFilter.js deleted file mode 100644 index 4678477..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseFilter.js +++ /dev/null @@ -1,21 +0,0 @@ -var baseEach = require('./_baseEach'); - -/** - * The base implementation of `_.filter` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ -function baseFilter(collection, predicate) { - var result = []; - baseEach(collection, function(value, index, collection) { - if (predicate(value, index, collection)) { - result.push(value); - } - }); - return result; -} - -module.exports = baseFilter; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseFind.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseFind.js deleted file mode 100644 index 535f7f3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseFind.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * The base implementation of methods like `_.find` and `_.findKey`, without - * support for iteratee shorthands, which iterates over `collection` using - * `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to search. - * @param {Function} predicate The function invoked per iteration. - * @param {Function} eachFunc The function to iterate over `collection`. - * @param {boolean} [retKey] Specify returning the key of the found element instead of the element itself. - * @returns {*} Returns the found element or its key, else `undefined`. - */ -function baseFind(collection, predicate, eachFunc, retKey) { - var result; - eachFunc(collection, function(value, key, collection) { - if (predicate(value, key, collection)) { - result = retKey ? key : value; - return false; - } - }); - return result; -} - -module.exports = baseFind; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseFindIndex.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseFindIndex.js deleted file mode 100644 index 61428f6..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseFindIndex.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to search. - * @param {Function} predicate The function invoked per iteration. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseFindIndex(array, predicate, fromRight) { - var length = array.length, - index = fromRight ? length : -1; - - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; -} - -module.exports = baseFindIndex; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseFlatten.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseFlatten.js deleted file mode 100644 index 8a4cb46..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseFlatten.js +++ /dev/null @@ -1,39 +0,0 @@ -var arrayPush = require('./_arrayPush'), - isArguments = require('./isArguments'), - isArray = require('./isArray'), - isArrayLikeObject = require('./isArrayLikeObject'); - -/** - * The base implementation of `_.flatten` with support for restricting flattening. - * - * @private - * @param {Array} array The array to flatten. - * @param {boolean} [isDeep] Specify a deep flatten. - * @param {boolean} [isStrict] Restrict flattening to arrays-like objects. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. - */ -function baseFlatten(array, isDeep, isStrict, result) { - result || (result = []); - - var index = -1, - length = array.length; - - while (++index < length) { - var value = array[index]; - if (isArrayLikeObject(value) && - (isStrict || isArray(value) || isArguments(value))) { - if (isDeep) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, isDeep, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; -} - -module.exports = baseFlatten; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseFor.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseFor.js deleted file mode 100644 index 97b70c9..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseFor.js +++ /dev/null @@ -1,17 +0,0 @@ -var createBaseFor = require('./_createBaseFor'); - -/** - * The base implementation of `baseForIn` and `baseForOwn` which iterates - * over `object` properties returned by `keysFunc` invoking `iteratee` for - * each property. Iteratee functions may exit iteration early by explicitly - * returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ -var baseFor = createBaseFor(); - -module.exports = baseFor; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseForIn.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseForIn.js deleted file mode 100644 index 4dcfdaf..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseForIn.js +++ /dev/null @@ -1,16 +0,0 @@ -var baseFor = require('./_baseFor'), - keysIn = require('./keysIn'); - -/** - * The base implementation of `_.forIn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ -function baseForIn(object, iteratee) { - return object == null ? object : baseFor(object, iteratee, keysIn); -} - -module.exports = baseForIn; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseForOwn.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseForOwn.js deleted file mode 100644 index 503d523..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseForOwn.js +++ /dev/null @@ -1,16 +0,0 @@ -var baseFor = require('./_baseFor'), - keys = require('./keys'); - -/** - * The base implementation of `_.forOwn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ -function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); -} - -module.exports = baseForOwn; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseForOwnRight.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseForOwnRight.js deleted file mode 100644 index a4b10e6..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseForOwnRight.js +++ /dev/null @@ -1,16 +0,0 @@ -var baseForRight = require('./_baseForRight'), - keys = require('./keys'); - -/** - * The base implementation of `_.forOwnRight` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ -function baseForOwnRight(object, iteratee) { - return object && baseForRight(object, iteratee, keys); -} - -module.exports = baseForOwnRight; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseForRight.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseForRight.js deleted file mode 100644 index 32842cd..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseForRight.js +++ /dev/null @@ -1,15 +0,0 @@ -var createBaseFor = require('./_createBaseFor'); - -/** - * This function is like `baseFor` except that it iterates over properties - * in the opposite order. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ -var baseForRight = createBaseFor(true); - -module.exports = baseForRight; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseFunctions.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseFunctions.js deleted file mode 100644 index b3dc8f9..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseFunctions.js +++ /dev/null @@ -1,19 +0,0 @@ -var arrayFilter = require('./_arrayFilter'), - isFunction = require('./isFunction'); - -/** - * The base implementation of `_.functions` which creates an array of - * `object` function property names filtered from those provided. - * - * @private - * @param {Object} object The object to inspect. - * @param {Array} props The property names to filter. - * @returns {Array} Returns the new array of filtered property names. - */ -function baseFunctions(object, props) { - return arrayFilter(props, function(key) { - return isFunction(object[key]); - }); -} - -module.exports = baseFunctions; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseGet.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseGet.js deleted file mode 100644 index d11de17..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseGet.js +++ /dev/null @@ -1,24 +0,0 @@ -var baseToPath = require('./_baseToPath'), - isKey = require('./_isKey'); - -/** - * The base implementation of `_.get` without support for default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. - */ -function baseGet(object, path) { - path = isKey(path, object) ? [path + ''] : baseToPath(path); - - var index = 0, - length = path.length; - - while (object != null && index < length) { - object = object[path[index++]]; - } - return (index && index == length) ? object : undefined; -} - -module.exports = baseGet; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseHas.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseHas.js deleted file mode 100644 index b393206..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseHas.js +++ /dev/null @@ -1,26 +0,0 @@ -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** Built-in value references. */ -var getPrototypeOf = Object.getPrototypeOf; - -/** - * The base implementation of `_.has` without support for deep paths. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ -function baseHas(object, key) { - // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`, - // that are composed entirely of index properties, return `false` for - // `hasOwnProperty` checks of them. - return hasOwnProperty.call(object, key) || - (typeof object == 'object' && key in object && getPrototypeOf(object) === null); -} - -module.exports = baseHas; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseHasIn.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseHasIn.js deleted file mode 100644 index 4a36558..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseHasIn.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * The base implementation of `_.hasIn` without support for deep paths. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ -function baseHasIn(object, key) { - return key in Object(object); -} - -module.exports = baseHasIn; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseInRange.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseInRange.js deleted file mode 100644 index 16d53f2..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseInRange.js +++ /dev/null @@ -1,18 +0,0 @@ -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max, - nativeMin = Math.min; - -/** - * The base implementation of `_.inRange` which doesn't coerce arguments to numbers. - * - * @private - * @param {number} number The number to check. - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `number` is in the range, else `false`. - */ -function baseInRange(number, start, end) { - return number >= nativeMin(start, end) && number < nativeMax(start, end); -} - -module.exports = baseInRange; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseIndexOf.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseIndexOf.js deleted file mode 100644 index 6cda802..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseIndexOf.js +++ /dev/null @@ -1,27 +0,0 @@ -var indexOfNaN = require('./_indexOfNaN'); - -/** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseIndexOf(array, value, fromIndex) { - if (value !== value) { - return indexOfNaN(array, fromIndex); - } - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; -} - -module.exports = baseIndexOf; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseIntersection.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseIntersection.js deleted file mode 100644 index 77e463f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseIntersection.js +++ /dev/null @@ -1,62 +0,0 @@ -var SetCache = require('./_SetCache'), - arrayIncludes = require('./_arrayIncludes'), - arrayIncludesWith = require('./_arrayIncludesWith'), - arrayMap = require('./_arrayMap'), - baseUnary = require('./_baseUnary'), - cacheHas = require('./_cacheHas'); - -/** - * The base implementation of methods like `_.intersection`, without support - * for iteratee shorthands, that accepts an array of arrays to inspect. - * - * @private - * @param {Array} arrays The arrays to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of shared values. - */ -function baseIntersection(arrays, iteratee, comparator) { - var includes = comparator ? arrayIncludesWith : arrayIncludes, - othLength = arrays.length, - othIndex = othLength, - caches = Array(othLength), - result = []; - - while (othIndex--) { - var array = arrays[othIndex]; - if (othIndex && iteratee) { - array = arrayMap(array, baseUnary(iteratee)); - } - caches[othIndex] = !comparator && (iteratee || array.length >= 120) - ? new SetCache(othIndex && array) - : undefined; - } - array = arrays[0]; - - var index = -1, - length = array.length, - seen = caches[0]; - - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - if (!(seen ? cacheHas(seen, computed) : includes(result, computed, comparator))) { - var othIndex = othLength; - while (--othIndex) { - var cache = caches[othIndex]; - if (!(cache ? cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator))) { - continue outer; - } - } - if (seen) { - seen.push(computed); - } - result.push(value); - } - } - return result; -} - -module.exports = baseIntersection; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseInverter.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseInverter.js deleted file mode 100644 index fbc337f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseInverter.js +++ /dev/null @@ -1,21 +0,0 @@ -var baseForOwn = require('./_baseForOwn'); - -/** - * The base implementation of `_.invert` and `_.invertBy` which inverts - * `object` with values transformed by `iteratee` and set by `setter`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform values. - * @param {Object} accumulator The initial inverted object. - * @returns {Function} Returns `accumulator`. - */ -function baseInverter(object, setter, iteratee, accumulator) { - baseForOwn(object, function(value, key, object) { - setter(accumulator, iteratee(value), key, object); - }); - return accumulator; -} - -module.exports = baseInverter; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseInvoke.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseInvoke.js deleted file mode 100644 index a19a5f8..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseInvoke.js +++ /dev/null @@ -1,27 +0,0 @@ -var apply = require('./_apply'), - baseToPath = require('./_baseToPath'), - isKey = require('./_isKey'), - last = require('./last'), - parent = require('./_parent'); - -/** - * The base implementation of `_.invoke` without support for individual - * method arguments. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {Array} args The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. - */ -function baseInvoke(object, path, args) { - if (!isKey(path, object)) { - path = baseToPath(path); - object = parent(object, path); - path = last(path); - } - var func = object == null ? object : object[path]; - return func == null ? undefined : apply(func, object, args); -} - -module.exports = baseInvoke; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseIsEqual.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseIsEqual.js deleted file mode 100644 index 3772dab..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseIsEqual.js +++ /dev/null @@ -1,30 +0,0 @@ -var baseIsEqualDeep = require('./_baseIsEqualDeep'), - isObject = require('./isObject'), - isObjectLike = require('./isObjectLike'); - -/** - * The base implementation of `_.isEqual` which supports partial comparisons - * and tracks traversed objects. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparisons. - * @param {boolean} [bitmask] The bitmask of comparison flags. - * The bitmask may be composed of the following flags: - * 1 - Unordered comparison - * 2 - Partial comparison - * @param {Object} [stack] Tracks traversed `value` and `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - */ -function baseIsEqual(value, other, customizer, bitmask, stack) { - if (value === other) { - return true; - } - if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { - return value !== value && other !== other; - } - return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); -} - -module.exports = baseIsEqual; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseIsEqualDeep.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseIsEqualDeep.js deleted file mode 100644 index 54eca35..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseIsEqualDeep.js +++ /dev/null @@ -1,83 +0,0 @@ -var Stack = require('./_Stack'), - equalArrays = require('./_equalArrays'), - equalByTag = require('./_equalByTag'), - equalObjects = require('./_equalObjects'), - getTag = require('./_getTag'), - isArray = require('./isArray'), - isHostObject = require('./_isHostObject'), - isTypedArray = require('./isTypedArray'); - -/** Used to compose bitmasks for comparison styles. */ -var PARTIAL_COMPARE_FLAG = 2; - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - objectTag = '[object Object]'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * A specialized version of `baseIsEqual` for arrays and objects which performs - * deep comparisons and tracks traversed objects enabling objects with circular - * references to be compared. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ -function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { - var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = arrayTag, - othTag = arrayTag; - - if (!objIsArr) { - objTag = getTag(object); - if (objTag == argsTag) { - objTag = objectTag; - } else if (objTag != objectTag) { - objIsArr = isTypedArray(object); - } - } - if (!othIsArr) { - othTag = getTag(other); - if (othTag == argsTag) { - othTag = objectTag; - } else if (othTag != objectTag) { - othIsArr = isTypedArray(other); - } - } - var objIsObj = objTag == objectTag && !isHostObject(object), - othIsObj = othTag == objectTag && !isHostObject(other), - isSameTag = objTag == othTag; - - if (isSameTag && !(objIsArr || objIsObj)) { - return equalByTag(object, other, objTag, equalFunc, customizer, bitmask); - } - var isPartial = bitmask & PARTIAL_COMPARE_FLAG; - if (!isPartial) { - var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), - othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - - if (objIsWrapped || othIsWrapped) { - return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, bitmask, stack); - } - } - if (!isSameTag) { - return false; - } - stack || (stack = new Stack); - return (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, bitmask, stack); -} - -module.exports = baseIsEqualDeep; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseIsMatch.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseIsMatch.js deleted file mode 100644 index c1dcafc..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseIsMatch.js +++ /dev/null @@ -1,61 +0,0 @@ -var Stack = require('./_Stack'), - baseIsEqual = require('./_baseIsEqual'); - -/** Used to compose bitmasks for comparison styles. */ -var UNORDERED_COMPARE_FLAG = 1, - PARTIAL_COMPARE_FLAG = 2; - -/** - * The base implementation of `_.isMatch` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Array} matchData The property names, values, and compare flags to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - */ -function baseIsMatch(object, source, matchData, customizer) { - var index = matchData.length, - length = index, - noCustomizer = !customizer; - - if (object == null) { - return !length; - } - object = Object(object); - while (index--) { - var data = matchData[index]; - if ((noCustomizer && data[2]) - ? data[1] !== object[data[0]] - : !(data[0] in object) - ) { - return false; - } - } - while (++index < length) { - data = matchData[index]; - var key = data[0], - objValue = object[key], - srcValue = data[1]; - - if (noCustomizer && data[2]) { - if (objValue === undefined && !(key in object)) { - return false; - } - } else { - var stack = new Stack, - result = customizer ? customizer(objValue, srcValue, key, object, source, stack) : undefined; - - if (!(result === undefined - ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) - : result - )) { - return false; - } - } - } - return true; -} - -module.exports = baseIsMatch; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseIteratee.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseIteratee.js deleted file mode 100644 index 19531af..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseIteratee.js +++ /dev/null @@ -1,30 +0,0 @@ -var baseMatches = require('./_baseMatches'), - baseMatchesProperty = require('./_baseMatchesProperty'), - identity = require('./identity'), - isArray = require('./isArray'), - property = require('./property'); - -/** - * The base implementation of `_.iteratee`. - * - * @private - * @param {*} [value=_.identity] The value to convert to an iteratee. - * @returns {Function} Returns the iteratee. - */ -function baseIteratee(value) { - var type = typeof value; - if (type == 'function') { - return value; - } - if (value == null) { - return identity; - } - if (type == 'object') { - return isArray(value) - ? baseMatchesProperty(value[0], value[1]) - : baseMatches(value); - } - return property(value); -} - -module.exports = baseIteratee; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseKeys.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseKeys.js deleted file mode 100644 index 4b747d5..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseKeys.js +++ /dev/null @@ -1,17 +0,0 @@ -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeKeys = Object.keys; - -/** - * The base implementation of `_.keys` which doesn't skip the constructor - * property of prototypes or treat sparse arrays as dense. - * - * @private - * @type Function - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeys(object) { - return nativeKeys(Object(object)); -} - -module.exports = baseKeys; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseKeysIn.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseKeysIn.js deleted file mode 100644 index 7455fd8..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseKeysIn.js +++ /dev/null @@ -1,36 +0,0 @@ -var Reflect = require('./_Reflect'), - iteratorToArray = require('./_iteratorToArray'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Built-in value references. */ -var enumerate = Reflect ? Reflect.enumerate : undefined, - propertyIsEnumerable = objectProto.propertyIsEnumerable; - -/** - * The base implementation of `_.keysIn` which doesn't skip the constructor - * property of prototypes or treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeysIn(object) { - object = object == null ? object : Object(object); - - var result = []; - for (var key in object) { - result.push(key); - } - return result; -} - -// Fallback for IE < 9 with es6-shim. -if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) { - baseKeysIn = function(object) { - return iteratorToArray(enumerate(object)); - }; -} - -module.exports = baseKeysIn; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseLodash.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseLodash.js deleted file mode 100644 index 15b79d3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseLodash.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * The function whose prototype all chaining wrappers inherit from. - * - * @private - */ -function baseLodash() { - // No operation performed. -} - -module.exports = baseLodash; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseMap.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseMap.js deleted file mode 100644 index 0bf5cea..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseMap.js +++ /dev/null @@ -1,22 +0,0 @@ -var baseEach = require('./_baseEach'), - isArrayLike = require('./isArrayLike'); - -/** - * The base implementation of `_.map` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ -function baseMap(collection, iteratee) { - var index = -1, - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value, key, collection) { - result[++index] = iteratee(value, key, collection); - }); - return result; -} - -module.exports = baseMap; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseMatches.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseMatches.js deleted file mode 100644 index 56c72e6..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseMatches.js +++ /dev/null @@ -1,30 +0,0 @@ -var baseIsMatch = require('./_baseIsMatch'), - getMatchData = require('./_getMatchData'); - -/** - * The base implementation of `_.matches` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new function. - */ -function baseMatches(source) { - var matchData = getMatchData(source); - if (matchData.length == 1 && matchData[0][2]) { - var key = matchData[0][0], - value = matchData[0][1]; - - return function(object) { - if (object == null) { - return false; - } - return object[key] === value && - (value !== undefined || (key in Object(object))); - }; - } - return function(object) { - return object === source || baseIsMatch(object, source, matchData); - }; -} - -module.exports = baseMatches; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseMatchesProperty.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseMatchesProperty.js deleted file mode 100644 index 256ad65..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseMatchesProperty.js +++ /dev/null @@ -1,26 +0,0 @@ -var baseIsEqual = require('./_baseIsEqual'), - get = require('./get'), - hasIn = require('./hasIn'); - -/** Used to compose bitmasks for comparison styles. */ -var UNORDERED_COMPARE_FLAG = 1, - PARTIAL_COMPARE_FLAG = 2; - -/** - * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. - * - * @private - * @param {string} path The path of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new function. - */ -function baseMatchesProperty(path, srcValue) { - return function(object) { - var objValue = get(object, path); - return (objValue === undefined && objValue === srcValue) - ? hasIn(object, path) - : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); - }; -} - -module.exports = baseMatchesProperty; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseMerge.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseMerge.js deleted file mode 100644 index 9778464..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseMerge.js +++ /dev/null @@ -1,44 +0,0 @@ -var Stack = require('./_Stack'), - arrayEach = require('./_arrayEach'), - assignMergeValue = require('./_assignMergeValue'), - baseMergeDeep = require('./_baseMergeDeep'), - isArray = require('./isArray'), - isObject = require('./isObject'), - isTypedArray = require('./isTypedArray'), - keysIn = require('./keysIn'); - -/** - * The base implementation of `_.merge` without support for multiple sources. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {number} srcIndex The index of `source`. - * @param {Function} [customizer] The function to customize merged values. - * @param {Object} [stack] Tracks traversed source values and their merged counterparts. - */ -function baseMerge(object, source, srcIndex, customizer, stack) { - if (object === source) { - return; - } - var props = (isArray(source) || isTypedArray(source)) ? undefined : keysIn(source); - arrayEach(props || source, function(srcValue, key) { - if (props) { - key = srcValue; - srcValue = source[key]; - } - if (isObject(srcValue)) { - stack || (stack = new Stack); - baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); - } - else { - var newValue = customizer ? customizer(object[key], srcValue, (key + ''), object, source, stack) : undefined; - if (newValue === undefined) { - newValue = srcValue; - } - assignMergeValue(object, key, newValue); - } - }); -} - -module.exports = baseMerge; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseMergeDeep.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseMergeDeep.js deleted file mode 100644 index d5caf3f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseMergeDeep.js +++ /dev/null @@ -1,78 +0,0 @@ -var assignMergeValue = require('./_assignMergeValue'), - baseClone = require('./_baseClone'), - copyArray = require('./_copyArray'), - isArguments = require('./isArguments'), - isArray = require('./isArray'), - isArrayLikeObject = require('./isArrayLikeObject'), - isFunction = require('./isFunction'), - isObject = require('./isObject'), - isPlainObject = require('./isPlainObject'), - isTypedArray = require('./isTypedArray'), - toPlainObject = require('./toPlainObject'); - -/** - * A specialized version of `baseMerge` for arrays and objects which performs - * deep merges and tracks traversed objects enabling objects with circular - * references to be merged. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {string} key The key of the value to merge. - * @param {number} srcIndex The index of `source`. - * @param {Function} mergeFunc The function to merge values. - * @param {Function} [customizer] The function to customize assigned values. - * @param {Object} [stack] Tracks traversed source values and their merged counterparts. - */ -function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { - var objValue = object[key], - srcValue = source[key], - stacked = stack.get(srcValue); - - if (stacked) { - assignMergeValue(object, key, stacked); - return; - } - var newValue = customizer ? customizer(objValue, srcValue, (key + ''), object, source, stack) : undefined, - isCommon = newValue === undefined; - - if (isCommon) { - newValue = srcValue; - if (isArray(srcValue) || isTypedArray(srcValue)) { - if (isArray(objValue)) { - newValue = srcIndex ? copyArray(objValue) : objValue; - } - else if (isArrayLikeObject(objValue)) { - newValue = copyArray(objValue); - } - else { - isCommon = false; - newValue = baseClone(srcValue); - } - } - else if (isPlainObject(srcValue) || isArguments(srcValue)) { - if (isArguments(objValue)) { - newValue = toPlainObject(objValue); - } - else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { - isCommon = false; - newValue = baseClone(srcValue); - } - else { - newValue = srcIndex ? baseClone(objValue) : objValue; - } - } - else { - isCommon = false; - } - } - stack.set(srcValue, newValue); - - if (isCommon) { - // Recursively merge objects and arrays (susceptible to call stack limits). - mergeFunc(newValue, srcValue, srcIndex, customizer, stack); - } - assignMergeValue(object, key, newValue); -} - -module.exports = baseMergeDeep; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseOrderBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseOrderBy.js deleted file mode 100644 index 4618680..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseOrderBy.js +++ /dev/null @@ -1,36 +0,0 @@ -var arrayMap = require('./_arrayMap'), - baseIteratee = require('./_baseIteratee'), - baseMap = require('./_baseMap'), - baseSortBy = require('./_baseSortBy'), - compareMultiple = require('./_compareMultiple'); - -/** - * The base implementation of `_.orderBy` without param guards. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. - * @param {string[]} orders The sort orders of `iteratees`. - * @returns {Array} Returns the new sorted array. - */ -function baseOrderBy(collection, iteratees, orders) { - var index = -1, - toIteratee = baseIteratee; - - iteratees = arrayMap(iteratees.length ? iteratees : Array(1), function(iteratee) { - return toIteratee(iteratee); - }); - - var result = baseMap(collection, function(value, key, collection) { - var criteria = arrayMap(iteratees, function(iteratee) { - return iteratee(value); - }); - return { 'criteria': criteria, 'index': ++index, 'value': value }; - }); - - return baseSortBy(result, function(object, other) { - return compareMultiple(object, other, orders); - }); -} - -module.exports = baseOrderBy; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_basePick.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_basePick.js deleted file mode 100644 index e2ce722..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_basePick.js +++ /dev/null @@ -1,22 +0,0 @@ -var arrayReduce = require('./_arrayReduce'); - -/** - * The base implementation of `_.pick` without support for individual - * property names. - * - * @private - * @param {Object} object The source object. - * @param {string[]} props The property names to pick. - * @returns {Object} Returns the new object. - */ -function basePick(object, props) { - object = Object(object); - return arrayReduce(props, function(result, key) { - if (key in object) { - result[key] = object[key]; - } - return result; - }, {}); -} - -module.exports = basePick; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_basePickBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_basePickBy.js deleted file mode 100644 index 37c4943..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_basePickBy.js +++ /dev/null @@ -1,21 +0,0 @@ -var baseForIn = require('./_baseForIn'); - -/** - * The base implementation of `_.pickBy` without support for iteratee shorthands. - * - * @private - * @param {Object} object The source object. - * @param {Function} predicate The function invoked per property. - * @returns {Object} Returns the new object. - */ -function basePickBy(object, predicate) { - var result = {}; - baseForIn(object, function(value, key) { - if (predicate(value, key)) { - result[key] = value; - } - }); - return result; -} - -module.exports = basePickBy; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseProperty.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseProperty.js deleted file mode 100644 index e515941..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseProperty.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; -} - -module.exports = baseProperty; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_basePropertyDeep.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_basePropertyDeep.js deleted file mode 100644 index acc2009..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_basePropertyDeep.js +++ /dev/null @@ -1,16 +0,0 @@ -var baseGet = require('./_baseGet'); - -/** - * A specialized version of `baseProperty` which supports deep paths. - * - * @private - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new function. - */ -function basePropertyDeep(path) { - return function(object) { - return baseGet(object, path); - }; -} - -module.exports = basePropertyDeep; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_basePullAll.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_basePullAll.js deleted file mode 100644 index d54d2b1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_basePullAll.js +++ /dev/null @@ -1,15 +0,0 @@ -var basePullAllBy = require('./_basePullAllBy'); - -/** - * The base implementation of `_.pullAll`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @returns {Array} Returns `array`. - */ -function basePullAll(array, values) { - return basePullAllBy(array, values); -} - -module.exports = basePullAll; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_basePullAllBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_basePullAllBy.js deleted file mode 100644 index 00167fa..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_basePullAllBy.js +++ /dev/null @@ -1,43 +0,0 @@ -var arrayMap = require('./_arrayMap'), - baseIndexOf = require('./_baseIndexOf'); - -/** Used for built-in method references. */ -var arrayProto = Array.prototype; - -/** Built-in value references. */ -var splice = arrayProto.splice; - -/** - * The base implementation of `_.pullAllBy` without support for iteratee - * shorthands. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [iteratee] The iteratee invoked per element. - * @returns {Array} Returns `array`. - */ -function basePullAllBy(array, values, iteratee) { - var index = -1, - length = values.length, - seen = array; - - if (iteratee) { - seen = arrayMap(array, function(value) { return iteratee(value); }); - } - while (++index < length) { - var fromIndex = 0, - value = values[index], - computed = iteratee ? iteratee(value) : value; - - while ((fromIndex = baseIndexOf(seen, computed, fromIndex)) > -1) { - if (seen !== array) { - splice.call(seen, fromIndex, 1); - } - splice.call(array, fromIndex, 1); - } - } - return array; -} - -module.exports = basePullAllBy; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_basePullAt.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_basePullAt.js deleted file mode 100644 index 206b196..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_basePullAt.js +++ /dev/null @@ -1,49 +0,0 @@ -var baseToPath = require('./_baseToPath'), - isIndex = require('./_isIndex'), - isKey = require('./_isKey'), - last = require('./last'), - parent = require('./_parent'); - -/** Used for built-in method references. */ -var arrayProto = Array.prototype; - -/** Built-in value references. */ -var splice = arrayProto.splice; - -/** - * The base implementation of `_.pullAt` without support for individual - * indexes or capturing the removed elements. - * - * @private - * @param {Array} array The array to modify. - * @param {number[]} indexes The indexes of elements to remove. - * @returns {Array} Returns `array`. - */ -function basePullAt(array, indexes) { - var length = array ? indexes.length : 0, - lastIndex = length - 1; - - while (length--) { - var index = indexes[length]; - if (lastIndex == length || index != previous) { - var previous = index; - if (isIndex(index)) { - splice.call(array, index, 1); - } - else if (!isKey(index, array)) { - var path = baseToPath(index), - object = parent(array, path); - - if (object != null) { - delete object[last(path)]; - } - } - else { - delete array[index]; - } - } - } - return array; -} - -module.exports = basePullAt; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseRandom.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseRandom.js deleted file mode 100644 index 94f76a7..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseRandom.js +++ /dev/null @@ -1,18 +0,0 @@ -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeFloor = Math.floor, - nativeRandom = Math.random; - -/** - * The base implementation of `_.random` without support for returning - * floating-point numbers. - * - * @private - * @param {number} lower The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the random number. - */ -function baseRandom(lower, upper) { - return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); -} - -module.exports = baseRandom; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseRange.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseRange.js deleted file mode 100644 index 2b39dd4..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseRange.js +++ /dev/null @@ -1,28 +0,0 @@ -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeCeil = Math.ceil, - nativeMax = Math.max; - -/** - * The base implementation of `_.range` and `_.rangeRight` which doesn't - * coerce arguments to numbers. - * - * @private - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @param {number} step The value to increment or decrement by. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the new array of numbers. - */ -function baseRange(start, end, step, fromRight) { - var index = -1, - length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), - result = Array(length); - - while (length--) { - result[fromRight ? length : ++index] = start; - start += step; - } - return result; -} - -module.exports = baseRange; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseReduce.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseReduce.js deleted file mode 100644 index 6ec5442..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseReduce.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * The base implementation of `_.reduce` and `_.reduceRight`, without support - * for iteratee shorthands, which iterates over `collection` using `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} accumulator The initial value. - * @param {boolean} initAccum Specify using the first or last element of `collection` as the initial value. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the accumulated value. - */ -function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { - eachFunc(collection, function(value, index, collection) { - accumulator = initAccum - ? (initAccum = false, value) - : iteratee(accumulator, value, index, collection); - }); - return accumulator; -} - -module.exports = baseReduce; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSet.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSet.js deleted file mode 100644 index 07b1840..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSet.js +++ /dev/null @@ -1,43 +0,0 @@ -var assignValue = require('./_assignValue'), - baseToPath = require('./_baseToPath'), - isIndex = require('./_isIndex'), - isKey = require('./_isKey'), - isObject = require('./isObject'); - -/** - * The base implementation of `_.set`. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @param {Function} [customizer] The function to customize path creation. - * @returns {Object} Returns `object`. - */ -function baseSet(object, path, value, customizer) { - path = isKey(path, object) ? [path + ''] : baseToPath(path); - - var index = -1, - length = path.length, - lastIndex = length - 1, - nested = object; - - while (nested != null && ++index < length) { - var key = path[index]; - if (isObject(nested)) { - var newValue = value; - if (index != lastIndex) { - var objValue = nested[key]; - newValue = customizer ? customizer(objValue, key, nested) : undefined; - if (newValue === undefined) { - newValue = objValue == null ? (isIndex(path[index + 1]) ? [] : {}) : objValue; - } - } - assignValue(nested, key, newValue); - } - nested = nested[key]; - } - return object; -} - -module.exports = baseSet; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSetData.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSetData.js deleted file mode 100644 index e689df2..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSetData.js +++ /dev/null @@ -1,17 +0,0 @@ -var identity = require('./identity'), - metaMap = require('./_metaMap'); - -/** - * The base implementation of `setData` without support for hot loop detection. - * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. - */ -var baseSetData = !metaMap ? identity : function(func, data) { - metaMap.set(func, data); - return func; -}; - -module.exports = baseSetData; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSlice.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSlice.js deleted file mode 100644 index 786f6c9..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSlice.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ -function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; -} - -module.exports = baseSlice; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSome.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSome.js deleted file mode 100644 index 8b6aa0a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSome.js +++ /dev/null @@ -1,21 +0,0 @@ -var baseEach = require('./_baseEach'); - -/** - * The base implementation of `_.some` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`. - */ -function baseSome(collection, predicate) { - var result; - - baseEach(collection, function(value, index, collection) { - result = predicate(value, index, collection); - return !result; - }); - return !!result; -} - -module.exports = baseSome; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSortBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSortBy.js deleted file mode 100644 index fec0afe..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSortBy.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * The base implementation of `_.sortBy` which uses `comparer` to define - * the sort order of `array` and replaces criteria objects with their - * corresponding values. - * - * @private - * @param {Array} array The array to sort. - * @param {Function} comparer The function to define sort order. - * @returns {Array} Returns `array`. - */ -function baseSortBy(array, comparer) { - var length = array.length; - - array.sort(comparer); - while (length--) { - array[length] = array[length].value; - } - return array; -} - -module.exports = baseSortBy; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSortedIndex.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSortedIndex.js deleted file mode 100644 index 3961063..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSortedIndex.js +++ /dev/null @@ -1,40 +0,0 @@ -var baseSortedIndexBy = require('./_baseSortedIndexBy'), - identity = require('./identity'); - -/** Used as references for the maximum length and index of an array. */ -var MAX_ARRAY_LENGTH = 4294967295, - HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; - -/** - * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which - * performs a binary search of `array` to determine the index at which `value` - * should be inserted into `array` in order to maintain its sort order. - * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - */ -function baseSortedIndex(array, value, retHighest) { - var low = 0, - high = array ? array.length : low; - - if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { - while (low < high) { - var mid = (low + high) >>> 1, - computed = array[mid]; - - if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) { - low = mid + 1; - } else { - high = mid; - } - } - return high; - } - return baseSortedIndexBy(array, value, identity, retHighest); -} - -module.exports = baseSortedIndex; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSortedIndexBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSortedIndexBy.js deleted file mode 100644 index 6e295f9..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSortedIndexBy.js +++ /dev/null @@ -1,56 +0,0 @@ -/** Used as references for the maximum length and index of an array. */ -var MAX_ARRAY_LENGTH = 4294967295, - MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeFloor = Math.floor, - nativeMin = Math.min; - -/** - * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` - * which invokes `iteratee` for `value` and each element of `array` to compute - * their sort ranking. The iteratee is invoked with one argument; (value). - * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} iteratee The iteratee invoked per element. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted into `array`. - */ -function baseSortedIndexBy(array, value, iteratee, retHighest) { - value = iteratee(value); - - var low = 0, - high = array ? array.length : 0, - valIsNaN = value !== value, - valIsNull = value === null, - valIsUndef = value === undefined; - - while (low < high) { - var mid = nativeFloor((low + high) / 2), - computed = iteratee(array[mid]), - isDef = computed !== undefined, - isReflexive = computed === computed; - - if (valIsNaN) { - var setLow = isReflexive || retHighest; - } else if (valIsNull) { - setLow = isReflexive && isDef && (retHighest || computed != null); - } else if (valIsUndef) { - setLow = isReflexive && (retHighest || isDef); - } else if (computed == null) { - setLow = false; - } else { - setLow = retHighest ? (computed <= value) : (computed < value); - } - if (setLow) { - low = mid + 1; - } else { - high = mid; - } - } - return nativeMin(high, MAX_ARRAY_INDEX); -} - -module.exports = baseSortedIndexBy; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSortedUniq.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSortedUniq.js deleted file mode 100644 index bf1eb2e..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSortedUniq.js +++ /dev/null @@ -1,14 +0,0 @@ -var baseSortedUniqBy = require('./_baseSortedUniqBy'); - -/** - * The base implementation of `_.sortedUniq`. - * - * @private - * @param {Array} array The array to inspect. - * @returns {Array} Returns the new duplicate free array. - */ -function baseSortedUniq(array) { - return baseSortedUniqBy(array); -} - -module.exports = baseSortedUniq; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSortedUniqBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSortedUniqBy.js deleted file mode 100644 index c95a83f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSortedUniqBy.js +++ /dev/null @@ -1,33 +0,0 @@ -var eq = require('./eq'); - -/** - * The base implementation of `_.sortedUniqBy` without support for iteratee - * shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - */ -function baseSortedUniqBy(array, iteratee) { - var index = 0, - length = array.length, - value = array[0], - computed = iteratee ? iteratee(value) : value, - seen = computed, - resIndex = 0, - result = [value]; - - while (++index < length) { - value = array[index], - computed = iteratee ? iteratee(value) : value; - - if (!eq(computed, seen)) { - seen = computed; - result[++resIndex] = value; - } - } - return result; -} - -module.exports = baseSortedUniqBy; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSum.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSum.js deleted file mode 100644 index 348b5e8..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseSum.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * The base implementation of `_.sum` without support for iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {number} Returns the sum. - */ -function baseSum(array, iteratee) { - var result, - index = -1, - length = array.length; - - while (++index < length) { - var current = iteratee(array[index]); - if (current !== undefined) { - result = result === undefined ? current : (result + current); - } - } - return result; -} - -module.exports = baseSum; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseTimes.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseTimes.js deleted file mode 100644 index 0603fc3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseTimes.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ -function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; -} - -module.exports = baseTimes; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseToPairs.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseToPairs.js deleted file mode 100644 index d80b402..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseToPairs.js +++ /dev/null @@ -1,18 +0,0 @@ -var arrayMap = require('./_arrayMap'); - -/** - * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array - * of key-value pairs for `object` corresponding to the property names of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the new array of key-value pairs. - */ -function baseToPairs(object, props) { - return arrayMap(props, function(key) { - return [key, object[key]]; - }); -} - -module.exports = baseToPairs; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseToPath.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseToPath.js deleted file mode 100644 index eb45827..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseToPath.js +++ /dev/null @@ -1,16 +0,0 @@ -var isArray = require('./isArray'), - stringToPath = require('./_stringToPath'); - -/** - * The base implementation of `_.toPath` which only converts `value` to a - * path if it's not one. - * - * @private - * @param {*} value The value to process. - * @returns {Array} Returns the property path array. - */ -function baseToPath(value) { - return isArray(value) ? value : stringToPath(value); -} - -module.exports = baseToPath; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseUnary.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseUnary.js deleted file mode 100644 index e584a99..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseUnary.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * The base implementation of `_.unary` without support for storing wrapper metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new function. - */ -function baseUnary(func) { - return function(value) { - return func(value); - }; -} - -module.exports = baseUnary; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseUniq.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseUniq.js deleted file mode 100644 index ecb6fe4..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseUniq.js +++ /dev/null @@ -1,71 +0,0 @@ -var SetCache = require('./_SetCache'), - arrayIncludes = require('./_arrayIncludes'), - arrayIncludesWith = require('./_arrayIncludesWith'), - cacheHas = require('./_cacheHas'), - createSet = require('./_createSet'), - setToArray = require('./_setToArray'); - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** - * The base implementation of `_.uniqBy` without support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. - */ -function baseUniq(array, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - length = array.length, - isCommon = true, - result = [], - seen = result; - - if (comparator) { - isCommon = false; - includes = arrayIncludesWith; - } - else if (length >= LARGE_ARRAY_SIZE) { - var set = iteratee ? null : createSet(array); - if (set) { - return setToArray(set); - } - isCommon = false; - includes = cacheHas; - seen = new SetCache; - } - else { - seen = iteratee ? [] : result; - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - if (isCommon && computed === computed) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee) { - seen.push(computed); - } - result.push(value); - } - else if (!includes(seen, computed, comparator)) { - if (seen !== result) { - seen.push(computed); - } - result.push(value); - } - } - return result; -} - -module.exports = baseUniq; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseUnset.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseUnset.js deleted file mode 100644 index 2be1c12..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseUnset.js +++ /dev/null @@ -1,22 +0,0 @@ -var baseToPath = require('./_baseToPath'), - has = require('./has'), - isKey = require('./_isKey'), - last = require('./last'), - parent = require('./_parent'); - -/** - * The base implementation of `_.unset`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to unset. - * @returns {boolean} Returns `true` if the property is deleted, else `false`. - */ -function baseUnset(object, path) { - path = isKey(path, object) ? [path + ''] : baseToPath(path); - object = parent(object, path); - var key = last(path); - return (object != null && has(object, key)) ? delete object[key] : true; -} - -module.exports = baseUnset; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseValues.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseValues.js deleted file mode 100644 index b95faad..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseValues.js +++ /dev/null @@ -1,19 +0,0 @@ -var arrayMap = require('./_arrayMap'); - -/** - * The base implementation of `_.values` and `_.valuesIn` which creates an - * array of `object` property values corresponding to the property names - * of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the array of property values. - */ -function baseValues(object, props) { - return arrayMap(props, function(key) { - return object[key]; - }); -} - -module.exports = baseValues; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseWhile.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseWhile.js deleted file mode 100644 index 07eac61..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseWhile.js +++ /dev/null @@ -1,26 +0,0 @@ -var baseSlice = require('./_baseSlice'); - -/** - * The base implementation of methods like `_.dropWhile` and `_.takeWhile` - * without support for iteratee shorthands. - * - * @private - * @param {Array} array The array to query. - * @param {Function} predicate The function invoked per iteration. - * @param {boolean} [isDrop] Specify dropping elements instead of taking them. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the slice of `array`. - */ -function baseWhile(array, predicate, isDrop, fromRight) { - var length = array.length, - index = fromRight ? length : -1; - - while ((fromRight ? index-- : ++index < length) && - predicate(array[index], index, array)) {} - - return isDrop - ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) - : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); -} - -module.exports = baseWhile; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseWrapperValue.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseWrapperValue.js deleted file mode 100644 index 443e0df..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseWrapperValue.js +++ /dev/null @@ -1,25 +0,0 @@ -var LazyWrapper = require('./_LazyWrapper'), - arrayPush = require('./_arrayPush'), - arrayReduce = require('./_arrayReduce'); - -/** - * The base implementation of `wrapperValue` which returns the result of - * performing a sequence of actions on the unwrapped `value`, where each - * successive action is supplied the return value of the previous. - * - * @private - * @param {*} value The unwrapped value. - * @param {Array} actions Actions to perform to resolve the unwrapped value. - * @returns {*} Returns the resolved value. - */ -function baseWrapperValue(value, actions) { - var result = value; - if (result instanceof LazyWrapper) { - result = result.value(); - } - return arrayReduce(actions, function(result, action) { - return action.func.apply(action.thisArg, arrayPush([result], action.args)); - }, result); -} - -module.exports = baseWrapperValue; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseXor.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseXor.js deleted file mode 100644 index 7e62d1b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseXor.js +++ /dev/null @@ -1,30 +0,0 @@ -var arrayPush = require('./_arrayPush'), - baseDifference = require('./_baseDifference'), - baseUniq = require('./_baseUniq'); - -/** - * The base implementation of methods like `_.xor`, without support for - * iteratee shorthands, that accepts an array of arrays to inspect. - * - * @private - * @param {Array} arrays The arrays to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of values. - */ -function baseXor(arrays, iteratee, comparator) { - var index = -1, - length = arrays.length; - - while (++index < length) { - var result = result - ? arrayPush( - baseDifference(result, arrays[index], iteratee, comparator), - baseDifference(arrays[index], result, iteratee, comparator) - ) - : arrays[index]; - } - return (result && result.length) ? baseUniq(result, iteratee, comparator) : []; -} - -module.exports = baseXor; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseZipObject.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseZipObject.js deleted file mode 100644 index c8a3e83..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_baseZipObject.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This base implementation of `_.zipObject` which assigns values using `assignFunc`. - * - * @private - * @param {Array} props The property names. - * @param {Array} values The property values. - * @param {Function} assignFunc The function to assign values. - * @returns {Object} Returns the new object. - */ -function baseZipObject(props, values, assignFunc) { - var index = -1, - length = props.length, - valsLength = values.length, - result = {}; - - while (++index < length) { - assignFunc(result, props[index], index < valsLength ? values[index] : undefined); - } - return result; -} - -module.exports = baseZipObject; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_cacheHas.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_cacheHas.js deleted file mode 100644 index 7f2ac48..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_cacheHas.js +++ /dev/null @@ -1,25 +0,0 @@ -var isKeyable = require('./_isKeyable'); - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** - * Checks if `value` is in `cache`. - * - * @private - * @param {Object} cache The set cache to search. - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. - */ -function cacheHas(cache, value) { - var map = cache.__data__; - if (isKeyable(value)) { - var data = map.__data__, - hash = typeof value == 'string' ? data.string : data.hash; - - return hash[value] === HASH_UNDEFINED; - } - return map.has(value); -} - -module.exports = cacheHas; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_cachePush.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_cachePush.js deleted file mode 100644 index 638383b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_cachePush.js +++ /dev/null @@ -1,27 +0,0 @@ -var isKeyable = require('./_isKeyable'); - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** - * Adds `value` to the set cache. - * - * @private - * @name push - * @memberOf SetCache - * @param {*} value The value to cache. - */ -function cachePush(value) { - var map = this.__data__; - if (isKeyable(value)) { - var data = map.__data__, - hash = typeof value == 'string' ? data.string : data.hash; - - hash[value] = HASH_UNDEFINED; - } - else { - map.set(value, HASH_UNDEFINED); - } -} - -module.exports = cachePush; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_charsEndIndex.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_charsEndIndex.js deleted file mode 100644 index 07908ff..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_charsEndIndex.js +++ /dev/null @@ -1,19 +0,0 @@ -var baseIndexOf = require('./_baseIndexOf'); - -/** - * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the last unmatched string symbol. - */ -function charsEndIndex(strSymbols, chrSymbols) { - var index = strSymbols.length; - - while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; -} - -module.exports = charsEndIndex; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_charsStartIndex.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_charsStartIndex.js deleted file mode 100644 index b17afd2..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_charsStartIndex.js +++ /dev/null @@ -1,20 +0,0 @@ -var baseIndexOf = require('./_baseIndexOf'); - -/** - * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the first unmatched string symbol. - */ -function charsStartIndex(strSymbols, chrSymbols) { - var index = -1, - length = strSymbols.length; - - while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; -} - -module.exports = charsStartIndex; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_checkGlobal.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_checkGlobal.js deleted file mode 100644 index b0ea47e..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_checkGlobal.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ -function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; -} - -module.exports = checkGlobal; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_cloneBuffer.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_cloneBuffer.js deleted file mode 100644 index defdb15..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_cloneBuffer.js +++ /dev/null @@ -1,19 +0,0 @@ -var Uint8Array = require('./_Uint8Array'); - -/** - * Creates a clone of `buffer`. - * - * @private - * @param {ArrayBuffer} buffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ -function cloneBuffer(buffer) { - var Ctor = buffer.constructor, - result = new Ctor(buffer.byteLength), - view = new Uint8Array(result); - - view.set(new Uint8Array(buffer)); - return result; -} - -module.exports = cloneBuffer; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_cloneMap.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_cloneMap.js deleted file mode 100644 index 1b5af07..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_cloneMap.js +++ /dev/null @@ -1,17 +0,0 @@ -var addMapEntry = require('./_addMapEntry'), - arrayReduce = require('./_arrayReduce'), - mapToArray = require('./_mapToArray'); - -/** - * Creates a clone of `map`. - * - * @private - * @param {Object} map The map to clone. - * @returns {Object} Returns the cloned map. - */ -function cloneMap(map) { - var Ctor = map.constructor; - return arrayReduce(mapToArray(map), addMapEntry, new Ctor); -} - -module.exports = cloneMap; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_cloneRegExp.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_cloneRegExp.js deleted file mode 100644 index f36fd57..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_cloneRegExp.js +++ /dev/null @@ -1,19 +0,0 @@ -/** Used to match `RegExp` flags from their coerced string values. */ -var reFlags = /\w*$/; - -/** - * Creates a clone of `regexp`. - * - * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. - */ -function cloneRegExp(regexp) { - var Ctor = regexp.constructor, - result = new Ctor(regexp.source, reFlags.exec(regexp)); - - result.lastIndex = regexp.lastIndex; - return result; -} - -module.exports = cloneRegExp; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_cloneSet.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_cloneSet.js deleted file mode 100644 index a6fa4a2..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_cloneSet.js +++ /dev/null @@ -1,17 +0,0 @@ -var addSetEntry = require('./_addSetEntry'), - arrayReduce = require('./_arrayReduce'), - setToArray = require('./_setToArray'); - -/** - * Creates a clone of `set`. - * - * @private - * @param {Object} set The set to clone. - * @returns {Object} Returns the cloned set. - */ -function cloneSet(set) { - var Ctor = set.constructor; - return arrayReduce(setToArray(set), addSetEntry, new Ctor); -} - -module.exports = cloneSet; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_cloneSymbol.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_cloneSymbol.js deleted file mode 100644 index ac0217d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_cloneSymbol.js +++ /dev/null @@ -1,18 +0,0 @@ -var Symbol = require('./_Symbol'); - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = Symbol ? symbolProto.valueOf : undefined; - -/** - * Creates a clone of the `symbol` object. - * - * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. - */ -function cloneSymbol(symbol) { - return Symbol ? Object(symbolValueOf.call(symbol)) : {}; -} - -module.exports = cloneSymbol; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_cloneTypedArray.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_cloneTypedArray.js deleted file mode 100644 index b17467d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_cloneTypedArray.js +++ /dev/null @@ -1,18 +0,0 @@ -var cloneBuffer = require('./_cloneBuffer'); - -/** - * Creates a clone of `typedArray`. - * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ -function cloneTypedArray(typedArray, isDeep) { - var buffer = typedArray.buffer, - Ctor = typedArray.constructor; - - return new Ctor(isDeep ? cloneBuffer(buffer) : buffer, typedArray.byteOffset, typedArray.length); -} - -module.exports = cloneTypedArray; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_compareAscending.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_compareAscending.js deleted file mode 100644 index 532866c..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_compareAscending.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Compares values to sort them in ascending order. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {number} Returns the sort order indicator for `value`. - */ -function compareAscending(value, other) { - if (value !== other) { - var valIsNull = value === null, - valIsUndef = value === undefined, - valIsReflexive = value === value; - - var othIsNull = other === null, - othIsUndef = other === undefined, - othIsReflexive = other === other; - - if ((value > other && !othIsNull) || !valIsReflexive || - (valIsNull && !othIsUndef && othIsReflexive) || - (valIsUndef && othIsReflexive)) { - return 1; - } - if ((value < other && !valIsNull) || !othIsReflexive || - (othIsNull && !valIsUndef && valIsReflexive) || - (othIsUndef && valIsReflexive)) { - return -1; - } - } - return 0; -} - -module.exports = compareAscending; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_compareMultiple.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_compareMultiple.js deleted file mode 100644 index a3f2d8b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_compareMultiple.js +++ /dev/null @@ -1,44 +0,0 @@ -var compareAscending = require('./_compareAscending'); - -/** - * Used by `_.orderBy` to compare multiple properties of a value to another - * and stable sort them. - * - * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, - * specify an order of "desc" for descending or "asc" for ascending sort order - * of corresponding values. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {boolean[]|string[]} orders The order to sort by for each property. - * @returns {number} Returns the sort order indicator for `object`. - */ -function compareMultiple(object, other, orders) { - var index = -1, - objCriteria = object.criteria, - othCriteria = other.criteria, - length = objCriteria.length, - ordersLength = orders.length; - - while (++index < length) { - var result = compareAscending(objCriteria[index], othCriteria[index]); - if (result) { - if (index >= ordersLength) { - return result; - } - var order = orders[index]; - return result * (order == 'desc' ? -1 : 1); - } - } - // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications - // that causes it, under certain circumstances, to provide the same value for - // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 - // for more details. - // - // This also ensures a stable sort in V8 and other engines. - // See https://code.google.com/p/v8/issues/detail?id=90 for more details. - return object.index - other.index; -} - -module.exports = compareMultiple; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_composeArgs.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_composeArgs.js deleted file mode 100644 index 863f71f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_composeArgs.js +++ /dev/null @@ -1,34 +0,0 @@ -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Creates an array that is the composition of partially applied arguments, - * placeholders, and provided arguments into a single array of arguments. - * - * @private - * @param {Array|Object} args The provided arguments. - * @param {Array} partials The arguments to prepend to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @returns {Array} Returns the new array of composed arguments. - */ -function composeArgs(args, partials, holders) { - var holdersLength = holders.length, - argsIndex = -1, - argsLength = nativeMax(args.length - holdersLength, 0), - leftIndex = -1, - leftLength = partials.length, - result = Array(leftLength + argsLength); - - while (++leftIndex < leftLength) { - result[leftIndex] = partials[leftIndex]; - } - while (++argsIndex < holdersLength) { - result[holders[argsIndex]] = args[argsIndex]; - } - while (argsLength--) { - result[leftIndex++] = args[argsIndex++]; - } - return result; -} - -module.exports = composeArgs; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_composeArgsRight.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_composeArgsRight.js deleted file mode 100644 index 4bb639b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_composeArgsRight.js +++ /dev/null @@ -1,36 +0,0 @@ -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * This function is like `composeArgs` except that the arguments composition - * is tailored for `_.partialRight`. - * - * @private - * @param {Array|Object} args The provided arguments. - * @param {Array} partials The arguments to append to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @returns {Array} Returns the new array of composed arguments. - */ -function composeArgsRight(args, partials, holders) { - var holdersIndex = -1, - holdersLength = holders.length, - argsIndex = -1, - argsLength = nativeMax(args.length - holdersLength, 0), - rightIndex = -1, - rightLength = partials.length, - result = Array(argsLength + rightLength); - - while (++argsIndex < argsLength) { - result[argsIndex] = args[argsIndex]; - } - var offset = argsIndex; - while (++rightIndex < rightLength) { - result[offset + rightIndex] = partials[rightIndex]; - } - while (++holdersIndex < holdersLength) { - result[offset + holders[holdersIndex]] = args[argsIndex++]; - } - return result; -} - -module.exports = composeArgsRight; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_copyArray.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_copyArray.js deleted file mode 100644 index cd94d5d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_copyArray.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ -function copyArray(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; -} - -module.exports = copyArray; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_copyObject.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_copyObject.js deleted file mode 100644 index f8406b6..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_copyObject.js +++ /dev/null @@ -1,16 +0,0 @@ -var copyObjectWith = require('./_copyObjectWith'); - -/** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. - * @param {Object} [object={}] The object to copy properties to. - * @returns {Object} Returns `object`. - */ -function copyObject(source, props, object) { - return copyObjectWith(source, props, object); -} - -module.exports = copyObject; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_copyObjectWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_copyObjectWith.js deleted file mode 100644 index ac5b9d3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_copyObjectWith.js +++ /dev/null @@ -1,29 +0,0 @@ -var assignValue = require('./_assignValue'); - -/** - * This function is like `copyObject` except that it accepts a function to - * customize copied values. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ -function copyObjectWith(source, props, object, customizer) { - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index], - newValue = customizer ? customizer(object[key], source[key], key, object, source) : source[key]; - - assignValue(object, key, newValue); - } - return object; -} - -module.exports = copyObjectWith; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_copySymbols.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_copySymbols.js deleted file mode 100644 index 1fac3c8..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_copySymbols.js +++ /dev/null @@ -1,16 +0,0 @@ -var copyObject = require('./_copyObject'), - getSymbols = require('./_getSymbols'); - -/** - * Copies own symbol properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ -function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); -} - -module.exports = copySymbols; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createAggregator.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createAggregator.js deleted file mode 100644 index 7f7afd2..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createAggregator.js +++ /dev/null @@ -1,23 +0,0 @@ -var arrayAggregator = require('./_arrayAggregator'), - baseAggregator = require('./_baseAggregator'), - baseIteratee = require('./_baseIteratee'), - isArray = require('./isArray'); - -/** - * Creates a function like `_.groupBy`. - * - * @private - * @param {Function} setter The function to set accumulator values. - * @param {Function} [initializer] The accumulator object initializer. - * @returns {Function} Returns the new aggregator function. - */ -function createAggregator(setter, initializer) { - return function(collection, iteratee) { - var func = isArray(collection) ? arrayAggregator : baseAggregator, - accumulator = initializer ? initializer() : {}; - - return func(collection, setter, baseIteratee(iteratee), accumulator); - }; -} - -module.exports = createAggregator; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createAssigner.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createAssigner.js deleted file mode 100644 index 72c3039..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createAssigner.js +++ /dev/null @@ -1,34 +0,0 @@ -var isIterateeCall = require('./_isIterateeCall'), - rest = require('./rest'); - -/** - * Creates a function like `_.assign`. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ -function createAssigner(assigner) { - return rest(function(object, sources) { - var index = -1, - length = sources.length, - customizer = length > 1 ? sources[length - 1] : undefined, - guard = length > 2 ? sources[2] : undefined; - - customizer = typeof customizer == 'function' ? (length--, customizer) : undefined; - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; - }); -} - -module.exports = createAssigner; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createBaseEach.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createBaseEach.js deleted file mode 100644 index d24fdd1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createBaseEach.js +++ /dev/null @@ -1,32 +0,0 @@ -var isArrayLike = require('./isArrayLike'); - -/** - * Creates a `baseEach` or `baseEachRight` function. - * - * @private - * @param {Function} eachFunc The function to iterate over a collection. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ -function createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee) { - if (collection == null) { - return collection; - } - if (!isArrayLike(collection)) { - return eachFunc(collection, iteratee); - } - var length = collection.length, - index = fromRight ? length : -1, - iterable = Object(collection); - - while ((fromRight ? index-- : ++index < length)) { - if (iteratee(iterable[index], index, iterable) === false) { - break; - } - } - return collection; - }; -} - -module.exports = createBaseEach; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createBaseFor.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createBaseFor.js deleted file mode 100644 index bc84c03..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createBaseFor.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Creates a base function for methods like `_.forIn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ -function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; -} - -module.exports = createBaseFor; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createBaseWrapper.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createBaseWrapper.js deleted file mode 100644 index fd3bb9a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createBaseWrapper.js +++ /dev/null @@ -1,28 +0,0 @@ -var createCtorWrapper = require('./_createCtorWrapper'), - root = require('./_root'); - -/** Used to compose bitmasks for wrapper metadata. */ -var BIND_FLAG = 1; - -/** - * Creates a function that wraps `func` to invoke it with the optional `this` - * binding of `thisArg`. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. - * @param {*} [thisArg] The `this` binding of `func`. - * @returns {Function} Returns the new wrapped function. - */ -function createBaseWrapper(func, bitmask, thisArg) { - var isBind = bitmask & BIND_FLAG, - Ctor = createCtorWrapper(func); - - function wrapper() { - var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - return fn.apply(isBind ? thisArg : this, arguments); - } - return wrapper; -} - -module.exports = createBaseWrapper; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createCaseFirst.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createCaseFirst.js deleted file mode 100644 index 5718f6f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createCaseFirst.js +++ /dev/null @@ -1,35 +0,0 @@ -var stringToArray = require('./_stringToArray'), - toString = require('./toString'); - -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', - rsComboSymbolsRange = '\\u20d0-\\u20f0', - rsVarRange = '\\ufe0e\\ufe0f'; - -/** Used to compose unicode capture groups. */ -var rsZWJ = '\\u200d'; - -/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ -var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); - -/** - * Creates a function like `_.lowerFirst`. - * - * @private - * @param {string} methodName The name of the `String` case method to use. - * @returns {Function} Returns the new function. - */ -function createCaseFirst(methodName) { - return function(string) { - string = toString(string); - - var strSymbols = reHasComplexSymbol.test(string) ? stringToArray(string) : undefined, - chr = strSymbols ? strSymbols[0] : string.charAt(0), - trailing = strSymbols ? strSymbols.slice(1).join('') : string.slice(1); - - return chr[methodName]() + trailing; - }; -} - -module.exports = createCaseFirst; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createCompounder.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createCompounder.js deleted file mode 100644 index bfa4ee5..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createCompounder.js +++ /dev/null @@ -1,18 +0,0 @@ -var arrayReduce = require('./_arrayReduce'), - deburr = require('./deburr'), - words = require('./words'); - -/** - * Creates a function like `_.camelCase`. - * - * @private - * @param {Function} callback The function to combine each word. - * @returns {Function} Returns the new compounder function. - */ -function createCompounder(callback) { - return function(string) { - return arrayReduce(words(deburr(string)), callback, ''); - }; -} - -module.exports = createCompounder; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createCtorWrapper.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createCtorWrapper.js deleted file mode 100644 index a0a7f83..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createCtorWrapper.js +++ /dev/null @@ -1,37 +0,0 @@ -var baseCreate = require('./_baseCreate'), - isObject = require('./isObject'); - -/** - * Creates a function that produces an instance of `Ctor` regardless of - * whether it was invoked as part of a `new` expression or by `call` or `apply`. - * - * @private - * @param {Function} Ctor The constructor to wrap. - * @returns {Function} Returns the new wrapped function. - */ -function createCtorWrapper(Ctor) { - return function() { - // Use a `switch` statement to work with class constructors. - // See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist - // for more details. - var args = arguments; - switch (args.length) { - case 0: return new Ctor; - case 1: return new Ctor(args[0]); - case 2: return new Ctor(args[0], args[1]); - case 3: return new Ctor(args[0], args[1], args[2]); - case 4: return new Ctor(args[0], args[1], args[2], args[3]); - case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); - case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); - case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); - } - var thisBinding = baseCreate(Ctor.prototype), - result = Ctor.apply(thisBinding, args); - - // Mimic the constructor's `return` behavior. - // See https://es5.github.io/#x13.2.2 for more details. - return isObject(result) ? result : thisBinding; - }; -} - -module.exports = createCtorWrapper; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createCurryWrapper.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createCurryWrapper.js deleted file mode 100644 index 2fc9f7e..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createCurryWrapper.js +++ /dev/null @@ -1,42 +0,0 @@ -var apply = require('./_apply'), - createCtorWrapper = require('./_createCtorWrapper'), - createHybridWrapper = require('./_createHybridWrapper'), - createRecurryWrapper = require('./_createRecurryWrapper'), - replaceHolders = require('./_replaceHolders'), - root = require('./_root'); - -/** - * Creates a function that wraps `func` to enable currying. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. - * @param {number} arity The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ -function createCurryWrapper(func, bitmask, arity) { - var Ctor = createCtorWrapper(func); - - function wrapper() { - var length = arguments.length, - index = length, - args = Array(length), - fn = (this && this !== root && this instanceof wrapper) ? Ctor : func, - placeholder = wrapper.placeholder; - - while (index--) { - args[index] = arguments[index]; - } - var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) - ? [] - : replaceHolders(args, placeholder); - - length -= holders.length; - return length < arity - ? createRecurryWrapper(func, bitmask, createHybridWrapper, placeholder, undefined, args, holders, undefined, undefined, arity - length) - : apply(fn, this, args); - } - return wrapper; -} - -module.exports = createCurryWrapper; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createFlow.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createFlow.js deleted file mode 100644 index 1d5e5f1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createFlow.js +++ /dev/null @@ -1,79 +0,0 @@ -var LodashWrapper = require('./_LodashWrapper'), - baseFlatten = require('./_baseFlatten'), - getData = require('./_getData'), - getFuncName = require('./_getFuncName'), - isArray = require('./isArray'), - isLaziable = require('./_isLaziable'), - rest = require('./rest'); - -/** Used to compose bitmasks for wrapper metadata. */ -var CURRY_FLAG = 8, - PARTIAL_FLAG = 32, - ARY_FLAG = 128, - REARG_FLAG = 256; - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * Creates a `_.flow` or `_.flowRight` function. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new flow function. - */ -function createFlow(fromRight) { - return rest(function(funcs) { - funcs = baseFlatten(funcs); - - var length = funcs.length, - index = length, - prereq = LodashWrapper.prototype.thru; - - if (fromRight) { - funcs.reverse(); - } - while (index--) { - var func = funcs[index]; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (prereq && !wrapper && getFuncName(func) == 'wrapper') { - var wrapper = new LodashWrapper([], true); - } - } - index = wrapper ? index : length; - while (++index < length) { - func = funcs[index]; - - var funcName = getFuncName(func), - data = funcName == 'wrapper' ? getData(func) : undefined; - - if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) { - wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); - } else { - wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func); - } - } - return function() { - var args = arguments, - value = args[0]; - - if (wrapper && args.length == 1 && isArray(value) && value.length >= LARGE_ARRAY_SIZE) { - return wrapper.plant(value).value(); - } - var index = 0, - result = length ? funcs[index].apply(this, args) : value; - - while (++index < length) { - result = funcs[index].call(this, result); - } - return result; - }; - }); -} - -module.exports = createFlow; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createHybridWrapper.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createHybridWrapper.js deleted file mode 100644 index 7d34c74..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createHybridWrapper.js +++ /dev/null @@ -1,85 +0,0 @@ -var composeArgs = require('./_composeArgs'), - composeArgsRight = require('./_composeArgsRight'), - createCtorWrapper = require('./_createCtorWrapper'), - createRecurryWrapper = require('./_createRecurryWrapper'), - reorder = require('./_reorder'), - replaceHolders = require('./_replaceHolders'), - root = require('./_root'); - -/** Used to compose bitmasks for wrapper metadata. */ -var BIND_FLAG = 1, - BIND_KEY_FLAG = 2, - CURRY_FLAG = 8, - CURRY_RIGHT_FLAG = 16, - ARY_FLAG = 128, - FLIP_FLAG = 512; - -/** - * Creates a function that wraps `func` to invoke it with optional `this` - * binding of `thisArg`, partial application, and currying. - * - * @private - * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to the new function. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [partialsRight] The arguments to append to those provided to the new function. - * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ -function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { - var isAry = bitmask & ARY_FLAG, - isBind = bitmask & BIND_FLAG, - isBindKey = bitmask & BIND_KEY_FLAG, - isCurry = bitmask & CURRY_FLAG, - isCurryRight = bitmask & CURRY_RIGHT_FLAG, - isFlip = bitmask & FLIP_FLAG, - Ctor = isBindKey ? undefined : createCtorWrapper(func); - - function wrapper() { - var length = arguments.length, - index = length, - args = Array(length); - - while (index--) { - args[index] = arguments[index]; - } - if (partials) { - args = composeArgs(args, partials, holders); - } - if (partialsRight) { - args = composeArgsRight(args, partialsRight, holdersRight); - } - if (isCurry || isCurryRight) { - var placeholder = wrapper.placeholder, - argsHolders = replaceHolders(args, placeholder); - - length -= argsHolders.length; - if (length < arity) { - return createRecurryWrapper(func, bitmask, createHybridWrapper, placeholder, thisArg, args, argsHolders, argPos, ary, arity - length); - } - } - var thisBinding = isBind ? thisArg : this, - fn = isBindKey ? thisBinding[func] : func; - - if (argPos) { - args = reorder(args, argPos); - } else if (isFlip && args.length > 1) { - args.reverse(); - } - if (isAry && ary < args.length) { - args.length = ary; - } - if (this && this !== root && this instanceof wrapper) { - fn = Ctor || createCtorWrapper(fn); - } - return fn.apply(thisBinding, args); - } - return wrapper; -} - -module.exports = createHybridWrapper; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createInverter.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createInverter.js deleted file mode 100644 index 6c0c562..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createInverter.js +++ /dev/null @@ -1,17 +0,0 @@ -var baseInverter = require('./_baseInverter'); - -/** - * Creates a function like `_.invertBy`. - * - * @private - * @param {Function} setter The function to set accumulator values. - * @param {Function} toIteratee The function to resolve iteratees. - * @returns {Function} Returns the new inverter function. - */ -function createInverter(setter, toIteratee) { - return function(object, iteratee) { - return baseInverter(object, setter, toIteratee(iteratee), {}); - }; -} - -module.exports = createInverter; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createOver.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createOver.js deleted file mode 100644 index 62fed02..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createOver.js +++ /dev/null @@ -1,26 +0,0 @@ -var apply = require('./_apply'), - arrayMap = require('./_arrayMap'), - baseFlatten = require('./_baseFlatten'), - baseIteratee = require('./_baseIteratee'), - rest = require('./rest'); - -/** - * Creates a function like `_.over`. - * - * @private - * @param {Function} arrayFunc The function to iterate over iteratees. - * @returns {Function} Returns the new invoker function. - */ -function createOver(arrayFunc) { - return rest(function(iteratees) { - iteratees = arrayMap(baseFlatten(iteratees), baseIteratee); - return rest(function(args) { - var thisArg = this; - return arrayFunc(iteratees, function(iteratee) { - return apply(iteratee, thisArg, args); - }); - }); - }); -} - -module.exports = createOver; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createPadding.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createPadding.js deleted file mode 100644 index e59cc52..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createPadding.js +++ /dev/null @@ -1,47 +0,0 @@ -var repeat = require('./repeat'), - stringSize = require('./_stringSize'), - stringToArray = require('./_stringToArray'), - toInteger = require('./toInteger'); - -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', - rsComboSymbolsRange = '\\u20d0-\\u20f0', - rsVarRange = '\\ufe0e\\ufe0f'; - -/** Used to compose unicode capture groups. */ -var rsZWJ = '\\u200d'; - -/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ -var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeCeil = Math.ceil; - -/** - * Creates the padding for `string` based on `length`. The `chars` string - * is truncated if the number of characters exceeds `length`. - * - * @private - * @param {string} string The string to create padding for. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padding for `string`. - */ -function createPadding(string, length, chars) { - length = toInteger(length); - - var strLength = stringSize(string); - if (!length || strLength >= length) { - return ''; - } - var padLength = length - strLength; - chars = chars === undefined ? ' ' : (chars + ''); - - var result = repeat(chars, nativeCeil(padLength / stringSize(chars))); - return reHasComplexSymbol.test(chars) - ? stringToArray(result).slice(0, padLength).join('') - : result.slice(0, padLength); -} - -module.exports = createPadding; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createPartialWrapper.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createPartialWrapper.js deleted file mode 100644 index 1fc3a9b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createPartialWrapper.js +++ /dev/null @@ -1,43 +0,0 @@ -var apply = require('./_apply'), - createCtorWrapper = require('./_createCtorWrapper'), - root = require('./_root'); - -/** Used to compose bitmasks for wrapper metadata. */ -var BIND_FLAG = 1; - -/** - * Creates a function that wraps `func` to invoke it with the optional `this` - * binding of `thisArg` and the `partials` prepended to those provided to - * the wrapper. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} partials The arguments to prepend to those provided to the new function. - * @returns {Function} Returns the new wrapped function. - */ -function createPartialWrapper(func, bitmask, thisArg, partials) { - var isBind = bitmask & BIND_FLAG, - Ctor = createCtorWrapper(func); - - function wrapper() { - var argsIndex = -1, - argsLength = arguments.length, - leftIndex = -1, - leftLength = partials.length, - args = Array(leftLength + argsLength), - fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - - while (++leftIndex < leftLength) { - args[leftIndex] = partials[leftIndex]; - } - while (argsLength--) { - args[leftIndex++] = arguments[++argsIndex]; - } - return apply(fn, isBind ? thisArg : this, args); - } - return wrapper; -} - -module.exports = createPartialWrapper; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createRange.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createRange.js deleted file mode 100644 index 9728563..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createRange.js +++ /dev/null @@ -1,31 +0,0 @@ -var baseRange = require('./_baseRange'), - isIterateeCall = require('./_isIterateeCall'), - toNumber = require('./toNumber'); - -/** - * Creates a `_.range` or `_.rangeRight` function. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new range function. - */ -function createRange(fromRight) { - return function(start, end, step) { - if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { - end = step = undefined; - } - // Ensure the sign of `-0` is preserved. - start = toNumber(start); - start = start === start ? start : 0; - if (end === undefined) { - end = start; - start = 0; - } else { - end = toNumber(end) || 0; - } - step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0); - return baseRange(start, end, step, fromRight); - }; -} - -module.exports = createRange; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createRecurryWrapper.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createRecurryWrapper.js deleted file mode 100644 index 2e3f10a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createRecurryWrapper.js +++ /dev/null @@ -1,53 +0,0 @@ -var copyArray = require('./_copyArray'), - isLaziable = require('./_isLaziable'), - setData = require('./_setData'); - -/** Used to compose bitmasks for wrapper metadata. */ -var BIND_FLAG = 1, - BIND_KEY_FLAG = 2, - CURRY_BOUND_FLAG = 4, - CURRY_FLAG = 8, - PARTIAL_FLAG = 32, - PARTIAL_RIGHT_FLAG = 64; - -/** - * Creates a function that wraps `func` to continue currying. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. - * @param {Function} wrapFunc The function to create the `func` wrapper. - * @param {*} placeholder The placeholder to replace. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to the new function. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ -function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { - var isCurry = bitmask & CURRY_FLAG, - newArgPos = argPos ? copyArray(argPos) : undefined, - newsHolders = isCurry ? holders : undefined, - newHoldersRight = isCurry ? undefined : holders, - newPartials = isCurry ? partials : undefined, - newPartialsRight = isCurry ? undefined : partials; - - bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG); - bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG); - - if (!(bitmask & CURRY_BOUND_FLAG)) { - bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); - } - var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, arity], - result = wrapFunc.apply(undefined, newData); - - if (isLaziable(func)) { - setData(result, newData); - } - result.placeholder = placeholder; - return result; -} - -module.exports = createRecurryWrapper; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createRound.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createRound.js deleted file mode 100644 index cb42ba2..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createRound.js +++ /dev/null @@ -1,30 +0,0 @@ -var toInteger = require('./toInteger'), - toNumber = require('./toNumber'), - toString = require('./toString'); - -/** - * Creates a function like `_.round`. - * - * @private - * @param {string} methodName The name of the `Math` method to use when rounding. - * @returns {Function} Returns the new round function. - */ -function createRound(methodName) { - var func = Math[methodName]; - return function(number, precision) { - number = toNumber(number); - precision = toInteger(precision); - if (precision) { - // Shift with exponential notation to avoid floating-point issues. - // See [MDN](https://mdn.io/round#Examples) for more details. - var pair = (toString(number) + 'e').split('e'), - value = func(pair[0] + 'e' + (+pair[1] + precision)); - - pair = (toString(value) + 'e').split('e'); - return +(pair[0] + 'e' + (+pair[1] - precision)); - } - return func(number); - }; -} - -module.exports = createRound; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createSet.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createSet.js deleted file mode 100644 index c67128f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createSet.js +++ /dev/null @@ -1,15 +0,0 @@ -var Set = require('./_Set'), - noop = require('./noop'); - -/** - * Creates a set of `values`. - * - * @private - * @param {Array} values The values to add to the set. - * @returns {Object} Returns the new set. - */ -var createSet = !(Set && new Set([1, 2]).size === 2) ? noop : function(values) { - return new Set(values); -}; - -module.exports = createSet; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createWrapper.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createWrapper.js deleted file mode 100644 index f391c1a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_createWrapper.js +++ /dev/null @@ -1,101 +0,0 @@ -var baseSetData = require('./_baseSetData'), - createBaseWrapper = require('./_createBaseWrapper'), - createCurryWrapper = require('./_createCurryWrapper'), - createHybridWrapper = require('./_createHybridWrapper'), - createPartialWrapper = require('./_createPartialWrapper'), - getData = require('./_getData'), - mergeData = require('./_mergeData'), - setData = require('./_setData'), - toInteger = require('./toInteger'); - -/** Used to compose bitmasks for wrapper metadata. */ -var BIND_FLAG = 1, - BIND_KEY_FLAG = 2, - CURRY_FLAG = 8, - CURRY_RIGHT_FLAG = 16, - PARTIAL_FLAG = 32, - PARTIAL_RIGHT_FLAG = 64; - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Creates a function that either curries or invokes `func` with optional - * `this` binding and partially applied arguments. - * - * @private - * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask of wrapper flags. - * The bitmask may be composed of the following flags: - * 1 - `_.bind` - * 2 - `_.bindKey` - * 4 - `_.curry` or `_.curryRight` of a bound function - * 8 - `_.curry` - * 16 - `_.curryRight` - * 32 - `_.partial` - * 64 - `_.partialRight` - * 128 - `_.rearg` - * 256 - `_.ary` - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to be partially applied. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ -function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { - var isBindKey = bitmask & BIND_KEY_FLAG; - if (!isBindKey && typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - var length = partials ? partials.length : 0; - if (!length) { - bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG); - partials = holders = undefined; - } - ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); - arity = arity === undefined ? arity : toInteger(arity); - length -= holders ? holders.length : 0; - - if (bitmask & PARTIAL_RIGHT_FLAG) { - var partialsRight = partials, - holdersRight = holders; - - partials = holders = undefined; - } - var data = isBindKey ? undefined : getData(func), - newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity]; - - if (data) { - mergeData(newData, data); - } - func = newData[0]; - bitmask = newData[1]; - thisArg = newData[2]; - partials = newData[3]; - holders = newData[4]; - arity = newData[9] = newData[9] == null - ? (isBindKey ? 0 : func.length) - : nativeMax(newData[9] - length, 0); - - if (!arity && bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG)) { - bitmask &= ~(CURRY_FLAG | CURRY_RIGHT_FLAG); - } - if (!bitmask || bitmask == BIND_FLAG) { - var result = createBaseWrapper(func, bitmask, thisArg); - } else if (bitmask == CURRY_FLAG || bitmask == CURRY_RIGHT_FLAG) { - result = createCurryWrapper(func, bitmask, arity); - } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !holders.length) { - result = createPartialWrapper(func, bitmask, thisArg, partials); - } else { - result = createHybridWrapper.apply(undefined, newData); - } - var setter = data ? baseSetData : setData; - return setter(result, newData); -} - -module.exports = createWrapper; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_deburrLetter.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_deburrLetter.js deleted file mode 100644 index e559dbe..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_deburrLetter.js +++ /dev/null @@ -1,33 +0,0 @@ -/** Used to map latin-1 supplementary letters to basic latin letters. */ -var deburredLetters = { - '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', - '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', - '\xc7': 'C', '\xe7': 'c', - '\xd0': 'D', '\xf0': 'd', - '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', - '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', - '\xcC': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', - '\xeC': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', - '\xd1': 'N', '\xf1': 'n', - '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', - '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', - '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', - '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', - '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', - '\xc6': 'Ae', '\xe6': 'ae', - '\xde': 'Th', '\xfe': 'th', - '\xdf': 'ss' -}; - -/** - * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters. - * - * @private - * @param {string} letter The matched letter to deburr. - * @returns {string} Returns the deburred letter. - */ -function deburrLetter(letter) { - return deburredLetters[letter]; -} - -module.exports = deburrLetter; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_equalArrays.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_equalArrays.js deleted file mode 100644 index f789ee5..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_equalArrays.js +++ /dev/null @@ -1,72 +0,0 @@ -var arraySome = require('./_arraySome'); - -/** Used to compose bitmasks for comparison styles. */ -var UNORDERED_COMPARE_FLAG = 1, - PARTIAL_COMPARE_FLAG = 2; - -/** - * A specialized version of `baseIsEqualDeep` for arrays with support for - * partial deep comparisons. - * - * @private - * @param {Array} array The array to compare. - * @param {Array} other The other array to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. - * @param {Object} [stack] Tracks traversed `array` and `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. - */ -function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { - var index = -1, - isPartial = bitmask & PARTIAL_COMPARE_FLAG, - isUnordered = bitmask & UNORDERED_COMPARE_FLAG, - arrLength = array.length, - othLength = other.length; - - if (arrLength != othLength && !(isPartial && othLength > arrLength)) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(array); - if (stacked) { - return stacked == other; - } - var result = true; - stack.set(array, other); - - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, arrValue, index, other, array, stack) - : customizer(arrValue, othValue, index, array, other, stack); - } - if (compared !== undefined) { - if (compared) { - continue; - } - result = false; - break; - } - // Recursively compare arrays (susceptible to call stack limits). - if (isUnordered) { - if (!arraySome(other, function(othValue) { - return arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack); - })) { - result = false; - break; - } - } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { - result = false; - break; - } - } - stack['delete'](array); - return result; -} - -module.exports = equalArrays; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_equalByTag.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_equalByTag.js deleted file mode 100644 index bc503f3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_equalByTag.js +++ /dev/null @@ -1,88 +0,0 @@ -var Symbol = require('./_Symbol'), - Uint8Array = require('./_Uint8Array'), - mapToArray = require('./_mapToArray'), - setToArray = require('./_setToArray'); - -/** Used to compose bitmasks for comparison styles. */ -var UNORDERED_COMPARE_FLAG = 1, - PARTIAL_COMPARE_FLAG = 2; - -/** `Object#toString` result references. */ -var boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - mapTag = '[object Map]', - numberTag = '[object Number]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]'; - -var arrayBufferTag = '[object ArrayBuffer]'; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = Symbol ? symbolProto.valueOf : undefined; - -/** - * A specialized version of `baseIsEqualDeep` for comparing objects of - * the same `toStringTag`. - * - * **Note:** This function only supports comparing values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {string} tag The `toStringTag` of the objects to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ -function equalByTag(object, other, tag, equalFunc, customizer, bitmask) { - switch (tag) { - case arrayBufferTag: - if ((object.byteLength != other.byteLength) || - !equalFunc(new Uint8Array(object), new Uint8Array(other))) { - return false; - } - return true; - - case boolTag: - case dateTag: - // Coerce dates and booleans to numbers, dates to milliseconds and booleans - // to `1` or `0` treating invalid dates coerced to `NaN` as not equal. - return +object == +other; - - case errorTag: - return object.name == other.name && object.message == other.message; - - case numberTag: - // Treat `NaN` vs. `NaN` as equal. - return (object != +object) ? other != +other : object == +other; - - case regexpTag: - case stringTag: - // Coerce regexes to strings and treat strings primitives and string - // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details. - return object == (other + ''); - - case mapTag: - var convert = mapToArray; - - case setTag: - var isPartial = bitmask & PARTIAL_COMPARE_FLAG; - convert || (convert = setToArray); - - // Recursively compare objects (susceptible to call stack limits). - return (isPartial || object.size == other.size) && - equalFunc(convert(object), convert(other), customizer, bitmask | UNORDERED_COMPARE_FLAG); - - case symbolTag: - return !!Symbol && (symbolValueOf.call(object) == symbolValueOf.call(other)); - } - return false; -} - -module.exports = equalByTag; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_equalObjects.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_equalObjects.js deleted file mode 100644 index 8e4a854..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_equalObjects.js +++ /dev/null @@ -1,82 +0,0 @@ -var baseHas = require('./_baseHas'), - keys = require('./keys'); - -/** Used to compose bitmasks for comparison styles. */ -var PARTIAL_COMPARE_FLAG = 2; - -/** - * A specialized version of `baseIsEqualDeep` for objects with support for - * partial deep comparisons. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ -function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { - var isPartial = bitmask & PARTIAL_COMPARE_FLAG, - objProps = keys(object), - objLength = objProps.length, - othProps = keys(other), - othLength = othProps.length; - - if (objLength != othLength && !isPartial) { - return false; - } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isPartial ? key in other : baseHas(other, key))) { - return false; - } - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked) { - return stacked == other; - } - var result = true; - stack.set(object, other); - - var skipCtor = isPartial; - while (++index < objLength) { - key = objProps[index]; - var objValue = object[key], - othValue = other[key]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, objValue, key, other, object, stack) - : customizer(objValue, othValue, key, object, other, stack); - } - // Recursively compare objects (susceptible to call stack limits). - if (!(compared === undefined - ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack)) - : compared - )) { - result = false; - break; - } - skipCtor || (skipCtor = key == 'constructor'); - } - if (result && !skipCtor) { - var objCtor = object.constructor, - othCtor = other.constructor; - - // Non `Object` object instances with different constructors are not equal. - if (objCtor != othCtor && - ('constructor' in object && 'constructor' in other) && - !(typeof objCtor == 'function' && objCtor instanceof objCtor && - typeof othCtor == 'function' && othCtor instanceof othCtor)) { - result = false; - } - } - stack['delete'](object); - return result; -} - -module.exports = equalObjects; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_escapeHtmlChar.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_escapeHtmlChar.js deleted file mode 100644 index b21e452..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_escapeHtmlChar.js +++ /dev/null @@ -1,22 +0,0 @@ -/** Used to map characters to HTML entities. */ -var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' -}; - -/** - * Used by `_.escape` to convert characters to HTML entities. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ -function escapeHtmlChar(chr) { - return htmlEscapes[chr]; -} - -module.exports = escapeHtmlChar; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_escapeStringChar.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_escapeStringChar.js deleted file mode 100644 index 44eca96..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_escapeStringChar.js +++ /dev/null @@ -1,22 +0,0 @@ -/** Used to escape characters for inclusion in compiled string literals. */ -var stringEscapes = { - '\\': '\\', - "'": "'", - '\n': 'n', - '\r': 'r', - '\u2028': 'u2028', - '\u2029': 'u2029' -}; - -/** - * Used by `_.template` to escape characters for inclusion in compiled string literals. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ -function escapeStringChar(chr) { - return '\\' + stringEscapes[chr]; -} - -module.exports = escapeStringChar; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_getData.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_getData.js deleted file mode 100644 index a1fe7b7..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_getData.js +++ /dev/null @@ -1,15 +0,0 @@ -var metaMap = require('./_metaMap'), - noop = require('./noop'); - -/** - * Gets metadata for `func`. - * - * @private - * @param {Function} func The function to query. - * @returns {*} Returns the metadata for `func`. - */ -var getData = !metaMap ? noop : function(func) { - return metaMap.get(func); -}; - -module.exports = getData; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_getFuncName.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_getFuncName.js deleted file mode 100644 index 21e15b3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_getFuncName.js +++ /dev/null @@ -1,31 +0,0 @@ -var realNames = require('./_realNames'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Gets the name of `func`. - * - * @private - * @param {Function} func The function to query. - * @returns {string} Returns the function name. - */ -function getFuncName(func) { - var result = (func.name + ''), - array = realNames[result], - length = hasOwnProperty.call(realNames, result) ? array.length : 0; - - while (length--) { - var data = array[length], - otherFunc = data.func; - if (otherFunc == null || otherFunc == func) { - return data.name; - } - } - return result; -} - -module.exports = getFuncName; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_getLength.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_getLength.js deleted file mode 100644 index 1848d49..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_getLength.js +++ /dev/null @@ -1,15 +0,0 @@ -var baseProperty = require('./_baseProperty'); - -/** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ -var getLength = baseProperty('length'); - -module.exports = getLength; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_getMatchData.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_getMatchData.js deleted file mode 100644 index a1456d2..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_getMatchData.js +++ /dev/null @@ -1,21 +0,0 @@ -var isStrictComparable = require('./_isStrictComparable'), - toPairs = require('./toPairs'); - -/** - * Gets the property names, values, and compare flags of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the match data of `object`. - */ -function getMatchData(object) { - var result = toPairs(object), - length = result.length; - - while (length--) { - result[length][2] = isStrictComparable(result[length][1]); - } - return result; -} - -module.exports = getMatchData; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_getNative.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_getNative.js deleted file mode 100644 index b85007a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_getNative.js +++ /dev/null @@ -1,16 +0,0 @@ -var isNative = require('./isNative'); - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = object == null ? undefined : object[key]; - return isNative(value) ? value : undefined; -} - -module.exports = getNative; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_getSymbols.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_getSymbols.js deleted file mode 100644 index 266906a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_getSymbols.js +++ /dev/null @@ -1,15 +0,0 @@ -/** Built-in value references. */ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; - -/** - * Creates an array of the own symbol properties of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ -var getSymbols = getOwnPropertySymbols || function() { - return []; -}; - -module.exports = getSymbols; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_getTag.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_getTag.js deleted file mode 100644 index ceacc4f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_getTag.js +++ /dev/null @@ -1,55 +0,0 @@ -var Map = require('./_Map'), - Set = require('./_Set'); - -/** `Object#toString` result references. */ -var mapTag = '[object Map]', - objectTag = '[object Object]', - setTag = '[object Set]'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var funcToString = Function.prototype.toString; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Used to detect maps and sets. */ -var mapCtorString = Map ? funcToString.call(Map) : '', - setCtorString = Set ? funcToString.call(Set) : ''; - -/** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -function getTag(value) { - return objectToString.call(value); -} - -// Fallback for IE 11 providing `toStringTag` values for maps and sets. -if ((Map && getTag(new Map) != mapTag) || (Set && getTag(new Set) != setTag)) { - getTag = function(value) { - var result = objectToString.call(value), - Ctor = result == objectTag ? value.constructor : null, - ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : ''; - - if (ctorString) { - if (ctorString == mapCtorString) { - return mapTag; - } - if (ctorString == setCtorString) { - return setTag; - } - } - return result; - }; -} - -module.exports = getTag; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_getView.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_getView.js deleted file mode 100644 index df1e5d4..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_getView.js +++ /dev/null @@ -1,33 +0,0 @@ -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max, - nativeMin = Math.min; - -/** - * Gets the view, applying any `transforms` to the `start` and `end` positions. - * - * @private - * @param {number} start The start of the view. - * @param {number} end The end of the view. - * @param {Array} transforms The transformations to apply to the view. - * @returns {Object} Returns an object containing the `start` and `end` - * positions of the view. - */ -function getView(start, end, transforms) { - var index = -1, - length = transforms.length; - - while (++index < length) { - var data = transforms[index], - size = data.size; - - switch (data.type) { - case 'drop': start += size; break; - case 'dropRight': end -= size; break; - case 'take': end = nativeMin(end, start + size); break; - case 'takeRight': start = nativeMax(start, end - size); break; - } - } - return { 'start': start, 'end': end }; -} - -module.exports = getView; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_hasPath.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_hasPath.js deleted file mode 100644 index c063592..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_hasPath.js +++ /dev/null @@ -1,40 +0,0 @@ -var baseToPath = require('./_baseToPath'), - isArguments = require('./isArguments'), - isArray = require('./isArray'), - isIndex = require('./_isIndex'), - isKey = require('./_isKey'), - isLength = require('./isLength'), - isString = require('./isString'), - last = require('./last'), - parent = require('./_parent'); - -/** - * Checks if `path` exists on `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @param {Function} hasFunc The function to check properties. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - */ -function hasPath(object, path, hasFunc) { - if (object == null) { - return false; - } - var result = hasFunc(object, path); - if (!result && !isKey(path)) { - path = baseToPath(path); - object = parent(object, path); - if (object != null) { - path = last(path); - result = hasFunc(object, path); - } - } - var length = object ? object.length : undefined; - return result || ( - !!length && isLength(length) && isIndex(path, length) && - (isArray(object) || isString(object) || isArguments(object)) - ); -} - -module.exports = hasPath; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_hashDelete.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_hashDelete.js deleted file mode 100644 index b562317..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_hashDelete.js +++ /dev/null @@ -1,15 +0,0 @@ -var hashHas = require('./_hashHas'); - -/** - * Removes `key` and its value from the hash. - * - * @private - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function hashDelete(hash, key) { - return hashHas(hash, key) && delete hash[key]; -} - -module.exports = hashDelete; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_hashGet.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_hashGet.js deleted file mode 100644 index ba509b6..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_hashGet.js +++ /dev/null @@ -1,28 +0,0 @@ -var nativeCreate = require('./_nativeCreate'); - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Gets the hash value for `key`. - * - * @private - * @param {Object} hash The hash to query. - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function hashGet(hash, key) { - if (nativeCreate) { - var result = hash[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(hash, key) ? hash[key] : undefined; -} - -module.exports = hashGet; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_hashHas.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_hashHas.js deleted file mode 100644 index 3bbff48..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_hashHas.js +++ /dev/null @@ -1,21 +0,0 @@ -var nativeCreate = require('./_nativeCreate'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Checks if a hash value for `key` exists. - * - * @private - * @param {Object} hash The hash to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function hashHas(hash, key) { - return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key); -} - -module.exports = hashHas; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_hashSet.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_hashSet.js deleted file mode 100644 index f7c3307..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_hashSet.js +++ /dev/null @@ -1,18 +0,0 @@ -var nativeCreate = require('./_nativeCreate'); - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** - * Sets the hash `key` to `value`. - * - * @private - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - */ -function hashSet(hash, key, value) { - hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; -} - -module.exports = hashSet; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_indexKeys.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_indexKeys.js deleted file mode 100644 index 0e2fc10..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_indexKeys.js +++ /dev/null @@ -1,24 +0,0 @@ -var baseTimes = require('./_baseTimes'), - isArguments = require('./isArguments'), - isArray = require('./isArray'), - isLength = require('./isLength'), - isString = require('./isString'); - -/** - * Creates an array of index keys for `object` values of arrays, - * `arguments` objects, and strings, otherwise `null` is returned. - * - * @private - * @param {Object} object The object to query. - * @returns {Array|null} Returns index keys, else `null`. - */ -function indexKeys(object) { - var length = object ? object.length : undefined; - if (isLength(length) && - (isArray(object) || isString(object) || isArguments(object))) { - return baseTimes(length, String); - } - return null; -} - -module.exports = indexKeys; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_indexOfNaN.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_indexOfNaN.js deleted file mode 100644 index 05b8207..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_indexOfNaN.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Gets the index at which the first occurrence of `NaN` is found in `array`. - * - * @private - * @param {Array} array The array to search. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched `NaN`, else `-1`. - */ -function indexOfNaN(array, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 0 : -1); - - while ((fromRight ? index-- : ++index < length)) { - var other = array[index]; - if (other !== other) { - return index; - } - } - return -1; -} - -module.exports = indexOfNaN; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_initCloneArray.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_initCloneArray.js deleted file mode 100644 index aef0212..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_initCloneArray.js +++ /dev/null @@ -1,26 +0,0 @@ -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ -function initCloneArray(array) { - var length = array.length, - result = array.constructor(length); - - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; - } - return result; -} - -module.exports = initCloneArray; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_initCloneByTag.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_initCloneByTag.js deleted file mode 100644 index c326ba9..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_initCloneByTag.js +++ /dev/null @@ -1,74 +0,0 @@ -var cloneBuffer = require('./_cloneBuffer'), - cloneMap = require('./_cloneMap'), - cloneRegExp = require('./_cloneRegExp'), - cloneSet = require('./_cloneSet'), - cloneSymbol = require('./_cloneSymbol'), - cloneTypedArray = require('./_cloneTypedArray'); - -/** `Object#toString` result references. */ -var boolTag = '[object Boolean]', - dateTag = '[object Date]', - mapTag = '[object Map]', - numberTag = '[object Number]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]'; - -var arrayBufferTag = '[object ArrayBuffer]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - -/** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneByTag(object, tag, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneBuffer(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); - - case mapTag: - return cloneMap(object); - - case numberTag: - case stringTag: - return new Ctor(object); - - case regexpTag: - return cloneRegExp(object); - - case setTag: - return cloneSet(object); - - case symbolTag: - return cloneSymbol(object); - } -} - -module.exports = initCloneByTag; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_initCloneObject.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_initCloneObject.js deleted file mode 100644 index b1da6cb..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_initCloneObject.js +++ /dev/null @@ -1,20 +0,0 @@ -var baseCreate = require('./_baseCreate'), - isFunction = require('./isFunction'), - isPrototype = require('./_isPrototype'); - -/** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneObject(object) { - if (isPrototype(object)) { - return {}; - } - var Ctor = object.constructor; - return baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined); -} - -module.exports = initCloneObject; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_isHostObject.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_isHostObject.js deleted file mode 100644 index e598c10..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_isHostObject.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; -} - -module.exports = isHostObject; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_isIndex.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_isIndex.js deleted file mode 100644 index c7ff607..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_isIndex.js +++ /dev/null @@ -1,21 +0,0 @@ -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** Used to detect unsigned integer values. */ -var reIsUint = /^(?:0|[1-9]\d*)$/; - -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; -} - -module.exports = isIndex; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_isIterateeCall.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_isIterateeCall.js deleted file mode 100644 index 34afa3e..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_isIterateeCall.js +++ /dev/null @@ -1,28 +0,0 @@ -var eq = require('./eq'), - isArrayLike = require('./isArrayLike'), - isIndex = require('./_isIndex'), - isObject = require('./isObject'); - -/** - * Checks if the provided arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. - */ -function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object)) { - return eq(object[index], value); - } - return false; -} - -module.exports = isIterateeCall; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_isKey.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_isKey.js deleted file mode 100644 index 0e34576..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_isKey.js +++ /dev/null @@ -1,24 +0,0 @@ -var isArray = require('./isArray'); - -/** Used to match property names within property paths. */ -var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/; - -/** - * Checks if `value` is a property name and not a property path. - * - * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. - */ -function isKey(value, object) { - if (typeof value == 'number') { - return true; - } - return !isArray(value) && - (reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object))); -} - -module.exports = isKey; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_isKeyable.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_isKeyable.js deleted file mode 100644 index a2521b2..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_isKeyable.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ -function isKeyable(value) { - var type = typeof value; - return type == 'number' || type == 'boolean' || - (type == 'string' && value !== '__proto__') || value == null; -} - -module.exports = isKeyable; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_isLaziable.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_isLaziable.js deleted file mode 100644 index faa17b9..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_isLaziable.js +++ /dev/null @@ -1,27 +0,0 @@ -var LazyWrapper = require('./_LazyWrapper'), - getData = require('./_getData'), - getFuncName = require('./_getFuncName'), - lodash = require('./wrapperLodash'); - -/** - * Checks if `func` has a lazy counterpart. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`. - */ -function isLaziable(func) { - var funcName = getFuncName(func), - other = lodash[funcName]; - - if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { - return false; - } - if (func === other) { - return true; - } - var data = getData(other); - return !!data && func === data[0]; -} - -module.exports = isLaziable; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_isPrototype.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_isPrototype.js deleted file mode 100644 index 0f29498..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_isPrototype.js +++ /dev/null @@ -1,18 +0,0 @@ -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ -function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; -} - -module.exports = isPrototype; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_isStrictComparable.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_isStrictComparable.js deleted file mode 100644 index b59f40b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_isStrictComparable.js +++ /dev/null @@ -1,15 +0,0 @@ -var isObject = require('./isObject'); - -/** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. - */ -function isStrictComparable(value) { - return value === value && !isObject(value); -} - -module.exports = isStrictComparable; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_iteratorToArray.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_iteratorToArray.js deleted file mode 100644 index 4768566..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_iteratorToArray.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Converts `iterator` to an array. - * - * @private - * @param {Object} iterator The iterator to convert. - * @returns {Array} Returns the converted array. - */ -function iteratorToArray(iterator) { - var data, - result = []; - - while (!(data = iterator.next()).done) { - result.push(data.value); - } - return result; -} - -module.exports = iteratorToArray; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_lazyClone.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_lazyClone.js deleted file mode 100644 index d8a51f8..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_lazyClone.js +++ /dev/null @@ -1,23 +0,0 @@ -var LazyWrapper = require('./_LazyWrapper'), - copyArray = require('./_copyArray'); - -/** - * Creates a clone of the lazy wrapper object. - * - * @private - * @name clone - * @memberOf LazyWrapper - * @returns {Object} Returns the cloned `LazyWrapper` object. - */ -function lazyClone() { - var result = new LazyWrapper(this.__wrapped__); - result.__actions__ = copyArray(this.__actions__); - result.__dir__ = this.__dir__; - result.__filtered__ = this.__filtered__; - result.__iteratees__ = copyArray(this.__iteratees__); - result.__takeCount__ = this.__takeCount__; - result.__views__ = copyArray(this.__views__); - return result; -} - -module.exports = lazyClone; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_lazyReverse.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_lazyReverse.js deleted file mode 100644 index c5b5219..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_lazyReverse.js +++ /dev/null @@ -1,23 +0,0 @@ -var LazyWrapper = require('./_LazyWrapper'); - -/** - * Reverses the direction of lazy iteration. - * - * @private - * @name reverse - * @memberOf LazyWrapper - * @returns {Object} Returns the new reversed `LazyWrapper` object. - */ -function lazyReverse() { - if (this.__filtered__) { - var result = new LazyWrapper(this); - result.__dir__ = -1; - result.__filtered__ = true; - } else { - result = this.clone(); - result.__dir__ *= -1; - } - return result; -} - -module.exports = lazyReverse; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_lazyValue.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_lazyValue.js deleted file mode 100644 index cc6ebcf..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_lazyValue.js +++ /dev/null @@ -1,72 +0,0 @@ -var baseWrapperValue = require('./_baseWrapperValue'), - getView = require('./_getView'), - isArray = require('./isArray'); - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** Used to indicate the type of lazy iteratees. */ -var LAZY_FILTER_FLAG = 1, - LAZY_MAP_FLAG = 2; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMin = Math.min; - -/** - * Extracts the unwrapped value from its lazy wrapper. - * - * @private - * @name value - * @memberOf LazyWrapper - * @returns {*} Returns the unwrapped value. - */ -function lazyValue() { - var array = this.__wrapped__.value(), - dir = this.__dir__, - isArr = isArray(array), - isRight = dir < 0, - arrLength = isArr ? array.length : 0, - view = getView(0, arrLength, this.__views__), - start = view.start, - end = view.end, - length = end - start, - index = isRight ? end : (start - 1), - iteratees = this.__iteratees__, - iterLength = iteratees.length, - resIndex = 0, - takeCount = nativeMin(length, this.__takeCount__); - - if (!isArr || arrLength < LARGE_ARRAY_SIZE || (arrLength == length && takeCount == length)) { - return baseWrapperValue(array, this.__actions__); - } - var result = []; - - outer: - while (length-- && resIndex < takeCount) { - index += dir; - - var iterIndex = -1, - value = array[index]; - - while (++iterIndex < iterLength) { - var data = iteratees[iterIndex], - iteratee = data.iteratee, - type = data.type, - computed = iteratee(value); - - if (type == LAZY_MAP_FLAG) { - value = computed; - } else if (!computed) { - if (type == LAZY_FILTER_FLAG) { - continue outer; - } else { - break outer; - } - } - } - result[resIndex++] = value; - } - return result; -} - -module.exports = lazyValue; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_mapClear.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_mapClear.js deleted file mode 100644 index c8ca3ef..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_mapClear.js +++ /dev/null @@ -1,15 +0,0 @@ -var Hash = require('./_Hash'), - Map = require('./_Map'); - -/** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ -function mapClear() { - this.__data__ = { 'hash': new Hash, 'map': Map ? new Map : [], 'string': new Hash }; -} - -module.exports = mapClear; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_mapDelete.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_mapDelete.js deleted file mode 100644 index 640eb0a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_mapDelete.js +++ /dev/null @@ -1,23 +0,0 @@ -var Map = require('./_Map'), - assocDelete = require('./_assocDelete'), - hashDelete = require('./_hashDelete'), - isKeyable = require('./_isKeyable'); - -/** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function mapDelete(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashDelete(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map['delete'](key) : assocDelete(data.map, key); -} - -module.exports = mapDelete; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_mapGet.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_mapGet.js deleted file mode 100644 index 8f33854..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_mapGet.js +++ /dev/null @@ -1,23 +0,0 @@ -var Map = require('./_Map'), - assocGet = require('./_assocGet'), - hashGet = require('./_hashGet'), - isKeyable = require('./_isKeyable'); - -/** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function mapGet(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashGet(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map.get(key) : assocGet(data.map, key); -} - -module.exports = mapGet; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_mapHas.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_mapHas.js deleted file mode 100644 index 9225537..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_mapHas.js +++ /dev/null @@ -1,23 +0,0 @@ -var Map = require('./_Map'), - assocHas = require('./_assocHas'), - hashHas = require('./_hashHas'), - isKeyable = require('./_isKeyable'); - -/** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function mapHas(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashHas(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map.has(key) : assocHas(data.map, key); -} - -module.exports = mapHas; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_mapSet.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_mapSet.js deleted file mode 100644 index 7a58786..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_mapSet.js +++ /dev/null @@ -1,28 +0,0 @@ -var Map = require('./_Map'), - assocSet = require('./_assocSet'), - hashSet = require('./_hashSet'), - isKeyable = require('./_isKeyable'); - -/** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache object. - */ -function mapSet(key, value) { - var data = this.__data__; - if (isKeyable(key)) { - hashSet(typeof key == 'string' ? data.string : data.hash, key, value); - } else if (Map) { - data.map.set(key, value); - } else { - assocSet(data.map, key, value); - } - return this; -} - -module.exports = mapSet; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_mapToArray.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_mapToArray.js deleted file mode 100644 index e2e8a24..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_mapToArray.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Converts `map` to an array. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the converted array. - */ -function mapToArray(map) { - var index = -1, - result = Array(map.size); - - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; -} - -module.exports = mapToArray; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_mergeData.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_mergeData.js deleted file mode 100644 index 3be23ce..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_mergeData.js +++ /dev/null @@ -1,90 +0,0 @@ -var composeArgs = require('./_composeArgs'), - composeArgsRight = require('./_composeArgsRight'), - copyArray = require('./_copyArray'), - replaceHolders = require('./_replaceHolders'); - -/** Used to compose bitmasks for wrapper metadata. */ -var BIND_FLAG = 1, - BIND_KEY_FLAG = 2, - CURRY_BOUND_FLAG = 4, - CURRY_FLAG = 8, - ARY_FLAG = 128, - REARG_FLAG = 256; - -/** Used as the internal argument placeholder. */ -var PLACEHOLDER = '__lodash_placeholder__'; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMin = Math.min; - -/** - * Merges the function metadata of `source` into `data`. - * - * Merging metadata reduces the number of wrappers used to invoke a function. - * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` - * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg` - * modify function arguments, making the order in which they are executed important, - * preventing the merging of metadata. However, we make an exception for a safe - * combined case where curried functions have `_.ary` and or `_.rearg` applied. - * - * @private - * @param {Array} data The destination metadata. - * @param {Array} source The source metadata. - * @returns {Array} Returns `data`. - */ -function mergeData(data, source) { - var bitmask = data[1], - srcBitmask = source[1], - newBitmask = bitmask | srcBitmask, - isCommon = newBitmask < (BIND_FLAG | BIND_KEY_FLAG | ARY_FLAG); - - var isCombo = - (srcBitmask == ARY_FLAG && (bitmask == CURRY_FLAG)) || - (srcBitmask == ARY_FLAG && (bitmask == REARG_FLAG) && (data[7].length <= source[8])) || - (srcBitmask == (ARY_FLAG | REARG_FLAG) && (source[7].length <= source[8]) && (bitmask == CURRY_FLAG)); - - // Exit early if metadata can't be merged. - if (!(isCommon || isCombo)) { - return data; - } - // Use source `thisArg` if available. - if (srcBitmask & BIND_FLAG) { - data[2] = source[2]; - // Set when currying a bound function. - newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG; - } - // Compose partial arguments. - var value = source[3]; - if (value) { - var partials = data[3]; - data[3] = partials ? composeArgs(partials, value, source[4]) : copyArray(value); - data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : copyArray(source[4]); - } - // Compose partial right arguments. - value = source[5]; - if (value) { - partials = data[5]; - data[5] = partials ? composeArgsRight(partials, value, source[6]) : copyArray(value); - data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : copyArray(source[6]); - } - // Use source `argPos` if available. - value = source[7]; - if (value) { - data[7] = copyArray(value); - } - // Use source `ary` if it's smaller. - if (srcBitmask & ARY_FLAG) { - data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); - } - // Use source `arity` if one is not provided. - if (data[9] == null) { - data[9] = source[9]; - } - // Use source `func` and merge bitmasks. - data[0] = source[0]; - data[1] = newBitmask; - - return data; -} - -module.exports = mergeData; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_mergeDefaults.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_mergeDefaults.js deleted file mode 100644 index b09c66b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_mergeDefaults.js +++ /dev/null @@ -1,24 +0,0 @@ -var baseMerge = require('./_baseMerge'), - isObject = require('./isObject'); - -/** - * Used by `_.defaultsDeep` to customize its `_.merge` use. - * - * @private - * @param {*} objValue The destination value. - * @param {*} srcValue The source value. - * @param {string} key The key of the property to merge. - * @param {Object} object The parent object of `objValue`. - * @param {Object} source The parent object of `srcValue`. - * @param {Object} [stack] Tracks traversed source values and their merged counterparts. - * @returns {*} Returns the value to assign. - */ -function mergeDefaults(objValue, srcValue, key, object, source, stack) { - if (isObject(objValue) && isObject(srcValue)) { - stack.set(srcValue, objValue); - baseMerge(objValue, srcValue, undefined, mergeDefaults, stack); - } - return objValue; -} - -module.exports = mergeDefaults; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_metaMap.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_metaMap.js deleted file mode 100644 index 0157a0b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_metaMap.js +++ /dev/null @@ -1,6 +0,0 @@ -var WeakMap = require('./_WeakMap'); - -/** Used to store function metadata. */ -var metaMap = WeakMap && new WeakMap; - -module.exports = metaMap; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_nativeCreate.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_nativeCreate.js deleted file mode 100644 index c7aede8..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_nativeCreate.js +++ /dev/null @@ -1,6 +0,0 @@ -var getNative = require('./_getNative'); - -/* Built-in method references that are verified to be native. */ -var nativeCreate = getNative(Object, 'create'); - -module.exports = nativeCreate; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_parent.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_parent.js deleted file mode 100644 index e04ff6e..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_parent.js +++ /dev/null @@ -1,16 +0,0 @@ -var baseSlice = require('./_baseSlice'), - get = require('./get'); - -/** - * Gets the parent value at `path` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} path The path to get the parent value of. - * @returns {*} Returns the parent value. - */ -function parent(object, path) { - return path.length == 1 ? object : get(object, baseSlice(path, 0, -1)); -} - -module.exports = parent; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_reEscape.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_reEscape.js deleted file mode 100644 index 7f47eda..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_reEscape.js +++ /dev/null @@ -1,4 +0,0 @@ -/** Used to match template delimiters. */ -var reEscape = /<%-([\s\S]+?)%>/g; - -module.exports = reEscape; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_reEvaluate.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_reEvaluate.js deleted file mode 100644 index 6adfc31..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_reEvaluate.js +++ /dev/null @@ -1,4 +0,0 @@ -/** Used to match template delimiters. */ -var reEvaluate = /<%([\s\S]+?)%>/g; - -module.exports = reEvaluate; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_reInterpolate.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_reInterpolate.js deleted file mode 100644 index d02ff0b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_reInterpolate.js +++ /dev/null @@ -1,4 +0,0 @@ -/** Used to match template delimiters. */ -var reInterpolate = /<%=([\s\S]+?)%>/g; - -module.exports = reInterpolate; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_realNames.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_realNames.js deleted file mode 100644 index aa0d529..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_realNames.js +++ /dev/null @@ -1,4 +0,0 @@ -/** Used to lookup unminified function names. */ -var realNames = {}; - -module.exports = realNames; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_reorder.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_reorder.js deleted file mode 100644 index a3502b0..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_reorder.js +++ /dev/null @@ -1,29 +0,0 @@ -var copyArray = require('./_copyArray'), - isIndex = require('./_isIndex'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMin = Math.min; - -/** - * Reorder `array` according to the specified indexes where the element at - * the first index is assigned as the first element, the element at - * the second index is assigned as the second element, and so on. - * - * @private - * @param {Array} array The array to reorder. - * @param {Array} indexes The arranged array indexes. - * @returns {Array} Returns `array`. - */ -function reorder(array, indexes) { - var arrLength = array.length, - length = nativeMin(indexes.length, arrLength), - oldArray = copyArray(array); - - while (length--) { - var index = indexes[length]; - array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; - } - return array; -} - -module.exports = reorder; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_replaceHolders.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_replaceHolders.js deleted file mode 100644 index 3089e75..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_replaceHolders.js +++ /dev/null @@ -1,28 +0,0 @@ -/** Used as the internal argument placeholder. */ -var PLACEHOLDER = '__lodash_placeholder__'; - -/** - * Replaces all `placeholder` elements in `array` with an internal placeholder - * and returns an array of their indexes. - * - * @private - * @param {Array} array The array to modify. - * @param {*} placeholder The placeholder to replace. - * @returns {Array} Returns the new array of placeholder indexes. - */ -function replaceHolders(array, placeholder) { - var index = -1, - length = array.length, - resIndex = -1, - result = []; - - while (++index < length) { - if (array[index] === placeholder) { - array[index] = PLACEHOLDER; - result[++resIndex] = index; - } - } - return result; -} - -module.exports = replaceHolders; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_root.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_root.js deleted file mode 100644 index b491ca4..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_root.js +++ /dev/null @@ -1,35 +0,0 @@ -var checkGlobal = require('./_checkGlobal'); - -/** Used to determine if values are of the language type `Object`. */ -var objectTypes = { - 'function': true, - 'object': true -}; - -/** Detect free variable `exports`. */ -var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; - -/** Detect free variable `module`. */ -var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); - -/** Detect free variable `self`. */ -var freeSelf = checkGlobal(objectTypes[typeof self] && self); - -/** Detect free variable `window`. */ -var freeWindow = checkGlobal(objectTypes[typeof window] && window); - -/** Detect `this` as the global object. */ -var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - -/** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ -var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')(); - -module.exports = root; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_setData.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_setData.js deleted file mode 100644 index 8b2efca..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_setData.js +++ /dev/null @@ -1,41 +0,0 @@ -var baseSetData = require('./_baseSetData'), - now = require('./now'); - -/** Used to detect hot functions by number of calls within a span of milliseconds. */ -var HOT_COUNT = 150, - HOT_SPAN = 16; - -/** - * Sets metadata for `func`. - * - * **Note:** If this function becomes hot, i.e. is invoked a lot in a short - * period of time, it will trip its breaker and transition to an identity function - * to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070) - * for more details. - * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. - */ -var setData = (function() { - var count = 0, - lastCalled = 0; - - return function(key, value) { - var stamp = now(), - remaining = HOT_SPAN - (stamp - lastCalled); - - lastCalled = stamp; - if (remaining > 0) { - if (++count >= HOT_COUNT) { - return key; - } - } else { - count = 0; - } - return baseSetData(key, value); - }; -}()); - -module.exports = setData; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_setToArray.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_setToArray.js deleted file mode 100644 index 6b24f30..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_setToArray.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Converts `set` to an array. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the converted array. - */ -function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; -} - -module.exports = setToArray; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_stackClear.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_stackClear.js deleted file mode 100644 index 8255536..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_stackClear.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Removes all key-value entries from the stack. - * - * @private - * @name clear - * @memberOf Stack - */ -function stackClear() { - this.__data__ = { 'array': [], 'map': null }; -} - -module.exports = stackClear; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_stackDelete.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_stackDelete.js deleted file mode 100644 index 7e38a13..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_stackDelete.js +++ /dev/null @@ -1,19 +0,0 @@ -var assocDelete = require('./_assocDelete'); - -/** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function stackDelete(key) { - var data = this.__data__, - array = data.array; - - return array ? assocDelete(array, key) : data.map['delete'](key); -} - -module.exports = stackDelete; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_stackGet.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_stackGet.js deleted file mode 100644 index 20b9d9a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_stackGet.js +++ /dev/null @@ -1,19 +0,0 @@ -var assocGet = require('./_assocGet'); - -/** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function stackGet(key) { - var data = this.__data__, - array = data.array; - - return array ? assocGet(array, key) : data.map.get(key); -} - -module.exports = stackGet; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_stackHas.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_stackHas.js deleted file mode 100644 index 7a3b0b9..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_stackHas.js +++ /dev/null @@ -1,19 +0,0 @@ -var assocHas = require('./_assocHas'); - -/** - * Checks if a stack value for `key` exists. - * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function stackHas(key) { - var data = this.__data__, - array = data.array; - - return array ? assocHas(array, key) : data.map.has(key); -} - -module.exports = stackHas; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_stackSet.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_stackSet.js deleted file mode 100644 index 0194d10..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_stackSet.js +++ /dev/null @@ -1,36 +0,0 @@ -var MapCache = require('./_MapCache'), - assocSet = require('./_assocSet'); - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** - * Sets the stack `key` to `value`. - * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache object. - */ -function stackSet(key, value) { - var data = this.__data__, - array = data.array; - - if (array) { - if (array.length < (LARGE_ARRAY_SIZE - 1)) { - assocSet(array, key, value); - } else { - data.array = null; - data.map = new MapCache(array); - } - } - var map = data.map; - if (map) { - map.set(key, value); - } - return this; -} - -module.exports = stackSet; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_stringSize.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_stringSize.js deleted file mode 100644 index 7aa9f41..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_stringSize.js +++ /dev/null @@ -1,48 +0,0 @@ -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', - rsComboSymbolsRange = '\\u20d0-\\u20f0', - rsVarRange = '\\ufe0e\\ufe0f'; - -/** Used to compose unicode capture groups. */ -var rsAstral = '[' + rsAstralRange + ']', - rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsZWJ = '\\u200d'; - -/** Used to compose unicode regexes. */ -var reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - -/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ -var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); - -/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ -var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); - -/** - * Gets the number of symbols in `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the string size. - */ -function stringSize(string) { - if (!(string && reHasComplexSymbol.test(string))) { - return string.length; - } - var result = reComplexSymbol.lastIndex = 0; - while (reComplexSymbol.test(string)) { - result++; - } - return result; -} - -module.exports = stringSize; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_stringToArray.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_stringToArray.js deleted file mode 100644 index 90986f0..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_stringToArray.js +++ /dev/null @@ -1,38 +0,0 @@ -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', - rsComboSymbolsRange = '\\u20d0-\\u20f0', - rsVarRange = '\\ufe0e\\ufe0f'; - -/** Used to compose unicode capture groups. */ -var rsAstral = '[' + rsAstralRange + ']', - rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsZWJ = '\\u200d'; - -/** Used to compose unicode regexes. */ -var reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - -/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ -var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); - -/** - * Converts `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function stringToArray(string) { - return string.match(reComplexSymbol); -} - -module.exports = stringToArray; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_stringToPath.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_stringToPath.js deleted file mode 100644 index a8fd82a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_stringToPath.js +++ /dev/null @@ -1,24 +0,0 @@ -var toString = require('./toString'); - -/** Used to match property names within property paths. */ -var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g; - -/** Used to match backslashes in property paths. */ -var reEscapeChar = /\\(\\)?/g; - -/** - * Converts `string` to a property path array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the property path array. - */ -function stringToPath(string) { - var result = []; - toString(string).replace(rePropName, function(match, number, quote, string) { - result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; -} - -module.exports = stringToPath; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_toArrayLikeObject.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_toArrayLikeObject.js deleted file mode 100644 index be01dab..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_toArrayLikeObject.js +++ /dev/null @@ -1,14 +0,0 @@ -var isArrayLikeObject = require('./isArrayLikeObject'); - -/** - * Converts `value` to an array-like object if it's not one. - * - * @private - * @param {*} value The value to process. - * @returns {Array} Returns the array-like object. - */ -function toArrayLikeObject(value) { - return isArrayLikeObject(value) ? value : []; -} - -module.exports = toArrayLikeObject; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_toFunction.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_toFunction.js deleted file mode 100644 index 4fa85d1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_toFunction.js +++ /dev/null @@ -1,14 +0,0 @@ -var identity = require('./identity'); - -/** - * Converts `value` to a function if it's not one. - * - * @private - * @param {*} value The value to process. - * @returns {Function} Returns the function. - */ -function toFunction(value) { - return typeof value == 'function' ? value : identity; -} - -module.exports = toFunction; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_unescapeHtmlChar.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_unescapeHtmlChar.js deleted file mode 100644 index 28b3454..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_unescapeHtmlChar.js +++ /dev/null @@ -1,22 +0,0 @@ -/** Used to map HTML entities to characters. */ -var htmlUnescapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': "'", - '`': '`' -}; - -/** - * Used by `_.unescape` to convert HTML entities to characters. - * - * @private - * @param {string} chr The matched character to unescape. - * @returns {string} Returns the unescaped character. - */ -function unescapeHtmlChar(chr) { - return htmlUnescapes[chr]; -} - -module.exports = unescapeHtmlChar; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_wrapperClone.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_wrapperClone.js deleted file mode 100644 index 7bb58a2..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/_wrapperClone.js +++ /dev/null @@ -1,23 +0,0 @@ -var LazyWrapper = require('./_LazyWrapper'), - LodashWrapper = require('./_LodashWrapper'), - copyArray = require('./_copyArray'); - -/** - * Creates a clone of `wrapper`. - * - * @private - * @param {Object} wrapper The wrapper to clone. - * @returns {Object} Returns the cloned wrapper. - */ -function wrapperClone(wrapper) { - if (wrapper instanceof LazyWrapper) { - return wrapper.clone(); - } - var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); - result.__actions__ = copyArray(wrapper.__actions__); - result.__index__ = wrapper.__index__; - result.__values__ = wrapper.__values__; - return result; -} - -module.exports = wrapperClone; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/add.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/add.js deleted file mode 100644 index 3be02f0..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/add.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Adds two numbers. - * - * @static - * @memberOf _ - * @category Math - * @param {number} augend The first number in an addition. - * @param {number} addend The second number in an addition. - * @returns {number} Returns the total. - * @example - * - * _.add(6, 4); - * // => 10 - */ -function add(augend, addend) { - var result; - if (augend !== undefined) { - result = augend; - } - if (addend !== undefined) { - result = result === undefined ? addend : (result + addend); - } - return result; -} - -module.exports = add; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/after.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/after.js deleted file mode 100644 index 41b0146..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/after.js +++ /dev/null @@ -1,41 +0,0 @@ -var toInteger = require('./toInteger'); - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * The opposite of `_.before`; this method creates a function that invokes - * `func` once it's called `n` or more times. - * - * @static - * @memberOf _ - * @category Function - * @param {number} n The number of calls before `func` is invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var saves = ['profile', 'settings']; - * - * var done = _.after(saves.length, function() { - * console.log('done saving!'); - * }); - * - * _.forEach(saves, function(type) { - * asyncSave({ 'type': type, 'complete': done }); - * }); - * // => logs 'done saving!' after the two async saves have completed - */ -function after(n, func) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - n = toInteger(n); - return function() { - if (--n < 1) { - return func.apply(this, arguments); - } - }; -} - -module.exports = after; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array.js deleted file mode 100644 index 01c1216..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array.js +++ /dev/null @@ -1,63 +0,0 @@ -module.exports = { - 'chunk': require('./chunk'), - 'compact': require('./compact'), - 'concat': require('./concat'), - 'difference': require('./difference'), - 'differenceBy': require('./differenceBy'), - 'differenceWith': require('./differenceWith'), - 'drop': require('./drop'), - 'dropRight': require('./dropRight'), - 'dropRightWhile': require('./dropRightWhile'), - 'dropWhile': require('./dropWhile'), - 'fill': require('./fill'), - 'findIndex': require('./findIndex'), - 'findLastIndex': require('./findLastIndex'), - 'flatten': require('./flatten'), - 'flattenDeep': require('./flattenDeep'), - 'fromPairs': require('./fromPairs'), - 'head': require('./head'), - 'indexOf': require('./indexOf'), - 'initial': require('./initial'), - 'intersection': require('./intersection'), - 'intersectionBy': require('./intersectionBy'), - 'intersectionWith': require('./intersectionWith'), - 'join': require('./join'), - 'last': require('./last'), - 'lastIndexOf': require('./lastIndexOf'), - 'pull': require('./pull'), - 'pullAll': require('./pullAll'), - 'pullAllBy': require('./pullAllBy'), - 'pullAt': require('./pullAt'), - 'remove': require('./remove'), - 'reverse': require('./reverse'), - 'slice': require('./slice'), - 'sortedIndex': require('./sortedIndex'), - 'sortedIndexBy': require('./sortedIndexBy'), - 'sortedIndexOf': require('./sortedIndexOf'), - 'sortedLastIndex': require('./sortedLastIndex'), - 'sortedLastIndexBy': require('./sortedLastIndexBy'), - 'sortedLastIndexOf': require('./sortedLastIndexOf'), - 'sortedUniq': require('./sortedUniq'), - 'sortedUniqBy': require('./sortedUniqBy'), - 'tail': require('./tail'), - 'take': require('./take'), - 'takeRight': require('./takeRight'), - 'takeRightWhile': require('./takeRightWhile'), - 'takeWhile': require('./takeWhile'), - 'union': require('./union'), - 'unionBy': require('./unionBy'), - 'unionWith': require('./unionWith'), - 'uniq': require('./uniq'), - 'uniqBy': require('./uniqBy'), - 'uniqWith': require('./uniqWith'), - 'unzip': require('./unzip'), - 'unzipWith': require('./unzipWith'), - 'without': require('./without'), - 'xor': require('./xor'), - 'xorBy': require('./xorBy'), - 'xorWith': require('./xorWith'), - 'zip': require('./zip'), - 'zipObject': require('./zipObject'), - 'zipObjectDeep': require('./zipObjectDeep'), - 'zipWith': require('./zipWith') -}; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/ary.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/ary.js deleted file mode 100644 index b3906ac..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/ary.js +++ /dev/null @@ -1,28 +0,0 @@ -var createWrapper = require('./_createWrapper'); - -/** Used to compose bitmasks for wrapper metadata. */ -var ARY_FLAG = 128; - -/** - * Creates a function that accepts up to `n` arguments, ignoring any - * additional arguments. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to cap arguments for. - * @param {number} [n=func.length] The arity cap. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {Function} Returns the new function. - * @example - * - * _.map(['6', '8', '10'], _.ary(parseInt, 1)); - * // => [6, 8, 10] - */ -function ary(func, n, guard) { - n = guard ? undefined : n; - n = (func && n == null) ? func.length : n; - return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n); -} - -module.exports = ary; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/assign.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/assign.js deleted file mode 100644 index d766dd0..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/assign.js +++ /dev/null @@ -1,39 +0,0 @@ -var copyObject = require('./_copyObject'), - createAssigner = require('./_createAssigner'), - keys = require('./keys'); - -/** - * Assigns own enumerable properties of source objects to the destination - * object. Source objects are applied from left to right. Subsequent sources - * overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.c = 3; - * } - * - * function Bar() { - * this.e = 5; - * } - * - * Foo.prototype.d = 4; - * Bar.prototype.f = 6; - * - * _.assign({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3, 'e': 5 } - */ -var assign = createAssigner(function(object, source) { - copyObject(source, keys(source), object); -}); - -module.exports = assign; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/assignIn.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/assignIn.js deleted file mode 100644 index b4177e6..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/assignIn.js +++ /dev/null @@ -1,38 +0,0 @@ -var copyObject = require('./_copyObject'), - createAssigner = require('./_createAssigner'), - keysIn = require('./keysIn'); - -/** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @alias extend - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ -var assignIn = createAssigner(function(object, source) { - copyObject(source, keysIn(source), object); -}); - -module.exports = assignIn; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/assignInWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/assignInWith.js deleted file mode 100644 index da73ef7..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/assignInWith.js +++ /dev/null @@ -1,36 +0,0 @@ -var copyObjectWith = require('./_copyObjectWith'), - createAssigner = require('./_createAssigner'), - keysIn = require('./keysIn'); - -/** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @alias extendWith - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ -var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObjectWith(source, keysIn(source), object, customizer); -}); - -module.exports = assignInWith; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/assignWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/assignWith.js deleted file mode 100644 index eb7915b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/assignWith.js +++ /dev/null @@ -1,35 +0,0 @@ -var copyObjectWith = require('./_copyObjectWith'), - createAssigner = require('./_createAssigner'), - keys = require('./keys'); - -/** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ -var assignWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObjectWith(source, keys(source), object, customizer); -}); - -module.exports = assignWith; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/at.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/at.js deleted file mode 100644 index cc36188..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/at.js +++ /dev/null @@ -1,29 +0,0 @@ -var baseAt = require('./_baseAt'), - baseFlatten = require('./_baseFlatten'), - rest = require('./rest'); - -/** - * Creates an array of values corresponding to `paths` of `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {...(string|string[])} [paths] The property paths of elements to pick, - * specified individually or in arrays. - * @returns {Array} Returns the new array of picked elements. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; - * - * _.at(object, ['a[0].b.c', 'a[1]']); - * // => [3, 4] - * - * _.at(['a', 'b', 'c'], 0, 2); - * // => ['a', 'c'] - */ -var at = rest(function(object, paths) { - return baseAt(object, baseFlatten(paths)); -}); - -module.exports = at; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/attempt.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/attempt.js deleted file mode 100644 index 322bf2f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/attempt.js +++ /dev/null @@ -1,33 +0,0 @@ -var apply = require('./_apply'), - isObject = require('./isObject'), - rest = require('./rest'); - -/** - * Attempts to invoke `func`, returning either the result or the caught error - * object. Any additional arguments are provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @category Util - * @param {Function} func The function to attempt. - * @returns {*} Returns the `func` result or error object. - * @example - * - * // Avoid throwing errors for invalid selectors. - * var elements = _.attempt(function(selector) { - * return document.querySelectorAll(selector); - * }, '>_>'); - * - * if (_.isError(elements)) { - * elements = []; - * } - */ -var attempt = rest(function(func, args) { - try { - return apply(func, undefined, args); - } catch (e) { - return isObject(e) ? e : new Error(e); - } -}); - -module.exports = attempt; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/before.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/before.js deleted file mode 100644 index 47148b1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/before.js +++ /dev/null @@ -1,39 +0,0 @@ -var toInteger = require('./toInteger'); - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * Creates a function that invokes `func`, with the `this` binding and arguments - * of the created function, while it's called less than `n` times. Subsequent - * calls to the created function return the result of the last `func` invocation. - * - * @static - * @memberOf _ - * @category Function - * @param {number} n The number of calls at which `func` is no longer invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * jQuery(element).on('click', _.before(5, addContactToList)); - * // => allows adding up to 4 contacts to the list - */ -function before(n, func) { - var result; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - n = toInteger(n); - return function() { - if (--n > 0) { - result = func.apply(this, arguments); - } - if (n <= 1) { - func = undefined; - } - return result; - }; -} - -module.exports = before; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/bind.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/bind.js deleted file mode 100644 index 2a50568..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/bind.js +++ /dev/null @@ -1,55 +0,0 @@ -var createWrapper = require('./_createWrapper'), - replaceHolders = require('./_replaceHolders'), - rest = require('./rest'); - -/** Used to compose bitmasks for wrapper metadata. */ -var BIND_FLAG = 1, - PARTIAL_FLAG = 32; - -/** - * Creates a function that invokes `func` with the `this` binding of `thisArg` - * and prepends any additional `_.bind` arguments to those provided to the - * bound function. - * - * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for partially applied arguments. - * - * **Note:** Unlike native `Function#bind` this method doesn't set the "length" - * property of bound functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var greet = function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * }; - * - * var object = { 'user': 'fred' }; - * - * var bound = _.bind(greet, object, 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * // Bound with placeholders. - * var bound = _.bind(greet, object, _, '!'); - * bound('hi'); - * // => 'hi fred!' - */ -var bind = rest(function(func, thisArg, partials) { - var bitmask = BIND_FLAG; - if (partials.length) { - var placeholder = bind.placeholder, - holders = replaceHolders(partials, placeholder); - - bitmask |= PARTIAL_FLAG; - } - return createWrapper(func, bitmask, thisArg, partials, holders); -}); - -module.exports = bind; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/bindAll.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/bindAll.js deleted file mode 100644 index d5bde42..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/bindAll.js +++ /dev/null @@ -1,39 +0,0 @@ -var arrayEach = require('./_arrayEach'), - baseFlatten = require('./_baseFlatten'), - bind = require('./bind'), - rest = require('./rest'); - -/** - * Binds methods of an object to the object itself, overwriting the existing - * method. - * - * **Note:** This method doesn't set the "length" property of bound functions. - * - * @static - * @memberOf _ - * @category Util - * @param {Object} object The object to bind and assign the bound methods to. - * @param {...(string|string[])} methodNames The object method names to bind, - * specified individually or in arrays. - * @returns {Object} Returns `object`. - * @example - * - * var view = { - * 'label': 'docs', - * 'onClick': function() { - * console.log('clicked ' + this.label); - * } - * }; - * - * _.bindAll(view, 'onClick'); - * jQuery(element).on('click', view.onClick); - * // => logs 'clicked docs' when clicked - */ -var bindAll = rest(function(object, methodNames) { - arrayEach(baseFlatten(methodNames), function(key) { - object[key] = bind(object[key], object); - }); - return object; -}); - -module.exports = bindAll; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/bindKey.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/bindKey.js deleted file mode 100644 index ba8e1cb..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/bindKey.js +++ /dev/null @@ -1,65 +0,0 @@ -var createWrapper = require('./_createWrapper'), - replaceHolders = require('./_replaceHolders'), - rest = require('./rest'); - -/** Used to compose bitmasks for wrapper metadata. */ -var BIND_FLAG = 1, - BIND_KEY_FLAG = 2, - PARTIAL_FLAG = 32; - -/** - * Creates a function that invokes the method at `object[key]` and prepends - * any additional `_.bindKey` arguments to those provided to the bound function. - * - * This method differs from `_.bind` by allowing bound functions to reference - * methods that may be redefined or don't yet exist. - * See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) - * for more details. - * - * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * @static - * @memberOf _ - * @category Function - * @param {Object} object The object to invoke the method on. - * @param {string} key The key of the method. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var object = { - * 'user': 'fred', - * 'greet': function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * }; - * - * var bound = _.bindKey(object, 'greet', 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * object.greet = function(greeting, punctuation) { - * return greeting + 'ya ' + this.user + punctuation; - * }; - * - * bound('!'); - * // => 'hiya fred!' - * - * // Bound with placeholders. - * var bound = _.bindKey(object, 'greet', _, '!'); - * bound('hi'); - * // => 'hiya fred!' - */ -var bindKey = rest(function(object, key, partials) { - var bitmask = BIND_FLAG | BIND_KEY_FLAG; - if (partials.length) { - var placeholder = bindKey.placeholder, - holders = replaceHolders(partials, placeholder); - - bitmask |= PARTIAL_FLAG; - } - return createWrapper(key, bitmask, object, partials, holders); -}); - -module.exports = bindKey; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/camelCase.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/camelCase.js deleted file mode 100644 index 00239e3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/camelCase.js +++ /dev/null @@ -1,28 +0,0 @@ -var capitalize = require('./capitalize'), - createCompounder = require('./_createCompounder'); - -/** - * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the camel cased string. - * @example - * - * _.camelCase('Foo Bar'); - * // => 'fooBar' - * - * _.camelCase('--foo-bar'); - * // => 'fooBar' - * - * _.camelCase('__foo_bar__'); - * // => 'fooBar' - */ -var camelCase = createCompounder(function(result, word, index) { - word = word.toLowerCase(); - return result + (index ? capitalize(word) : word); -}); - -module.exports = camelCase; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/capitalize.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/capitalize.js deleted file mode 100644 index 4daec03..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/capitalize.js +++ /dev/null @@ -1,22 +0,0 @@ -var toString = require('./toString'), - upperFirst = require('./upperFirst'); - -/** - * Converts the first character of `string` to upper case and the remaining - * to lower case. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to capitalize. - * @returns {string} Returns the capitalized string. - * @example - * - * _.capitalize('FRED'); - * // => 'Fred' - */ -function capitalize(string) { - return upperFirst(toString(string).toLowerCase()); -} - -module.exports = capitalize; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/ceil.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/ceil.js deleted file mode 100644 index ecf2f12..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/ceil.js +++ /dev/null @@ -1,25 +0,0 @@ -var createRound = require('./_createRound'); - -/** - * Computes `number` rounded up to `precision`. - * - * @static - * @memberOf _ - * @category Math - * @param {number} number The number to round up. - * @param {number} [precision=0] The precision to round up to. - * @returns {number} Returns the rounded up number. - * @example - * - * _.ceil(4.006); - * // => 5 - * - * _.ceil(6.004, 2); - * // => 6.01 - * - * _.ceil(6040, -2); - * // => 6100 - */ -var ceil = createRound('ceil'); - -module.exports = ceil; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain.js deleted file mode 100644 index 3300933..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain.js +++ /dev/null @@ -1,36 +0,0 @@ -var lodash = require('./wrapperLodash'); - -/** - * Creates a `lodash` object that wraps `value` with explicit method chaining enabled. - * The result of such method chaining must be unwrapped with `_#value`. - * - * @static - * @memberOf _ - * @category Seq - * @param {*} value The value to wrap. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'pebbles', 'age': 1 } - * ]; - * - * var youngest = _ - * .chain(users) - * .sortBy('age') - * .map(function(o) { - * return o.user + ' is ' + o.age; - * }) - * .head() - * .value(); - * // => 'pebbles is 1' - */ -function chain(value) { - var result = lodash(value); - result.__chain__ = true; - return result; -} - -module.exports = chain; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chunk.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chunk.js deleted file mode 100644 index b4bbc7b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chunk.js +++ /dev/null @@ -1,44 +0,0 @@ -var baseSlice = require('./_baseSlice'), - toInteger = require('./toInteger'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeCeil = Math.ceil, - nativeMax = Math.max; - -/** - * Creates an array of elements split into groups the length of `size`. - * If `array` can't be split evenly, the final chunk will be the remaining - * elements. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to process. - * @param {number} [size=0] The length of each chunk. - * @returns {Array} Returns the new array containing chunks. - * @example - * - * _.chunk(['a', 'b', 'c', 'd'], 2); - * // => [['a', 'b'], ['c', 'd']] - * - * _.chunk(['a', 'b', 'c', 'd'], 3); - * // => [['a', 'b', 'c'], ['d']] - */ -function chunk(array, size) { - size = nativeMax(toInteger(size), 0); - - var length = array ? array.length : 0; - if (!length || size < 1) { - return []; - } - var index = 0, - resIndex = -1, - result = Array(nativeCeil(length / size)); - - while (index < length) { - result[++resIndex] = baseSlice(array, index, (index += size)); - } - return result; -} - -module.exports = chunk; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/clamp.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/clamp.js deleted file mode 100644 index 9e186d8..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/clamp.js +++ /dev/null @@ -1,38 +0,0 @@ -var baseClamp = require('./_baseClamp'), - toNumber = require('./toNumber'); - -/** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @static - * @memberOf _ - * @category Number - * @param {number} number The number to clamp. - * @param {number} [lower] The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ -function clamp(number, lower, upper) { - if (upper === undefined) { - upper = lower; - lower = undefined; - } - if (upper !== undefined) { - upper = toNumber(upper); - upper = upper === upper ? upper : 0; - } - if (lower !== undefined) { - lower = toNumber(lower); - lower = lower === lower ? lower : 0; - } - return baseClamp(toNumber(number), lower, upper); -} - -module.exports = clamp; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/clone.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/clone.js deleted file mode 100644 index 08e9744..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/clone.js +++ /dev/null @@ -1,31 +0,0 @@ -var baseClone = require('./_baseClone'); - -/** - * Creates a shallow clone of `value`. - * - * **Note:** This method is loosely based on the - * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) - * and supports cloning arrays, array buffers, booleans, date objects, maps, - * numbers, `Object` objects, regexes, sets, strings, symbols, and typed - * arrays. The own enumerable properties of `arguments` objects are cloned - * as plain objects. An empty object is returned for uncloneable values such - * as error objects, functions, DOM nodes, and WeakMaps. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to clone. - * @returns {*} Returns the cloned value. - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var shallow = _.clone(objects); - * console.log(shallow[0] === objects[0]); - * // => true - */ -function clone(value) { - return baseClone(value); -} - -module.exports = clone; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/cloneDeep.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/cloneDeep.js deleted file mode 100644 index 9fbf338..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/cloneDeep.js +++ /dev/null @@ -1,23 +0,0 @@ -var baseClone = require('./_baseClone'); - -/** - * This method is like `_.clone` except that it recursively clones `value`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to recursively clone. - * @returns {*} Returns the deep cloned value. - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var deep = _.cloneDeep(objects); - * console.log(deep[0] === objects[0]); - * // => false - */ -function cloneDeep(value) { - return baseClone(value, true); -} - -module.exports = cloneDeep; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/cloneDeepWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/cloneDeepWith.js deleted file mode 100644 index be5bb57..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/cloneDeepWith.js +++ /dev/null @@ -1,33 +0,0 @@ -var baseClone = require('./_baseClone'); - -/** - * This method is like `_.cloneWith` except that it recursively clones `value`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to recursively clone. - * @param {Function} [customizer] The function to customize cloning. - * @returns {*} Returns the deep cloned value. - * @example - * - * function customizer(value) { - * if (_.isElement(value)) { - * return value.cloneNode(true); - * } - * } - * - * var el = _.cloneDeepWith(document.body, customizer); - * - * console.log(el === document.body); - * // => false - * console.log(el.nodeName); - * // => 'BODY' - * console.log(el.childNodes.length); - * // => 20 - */ -function cloneDeepWith(value, customizer) { - return baseClone(value, true, customizer); -} - -module.exports = cloneDeepWith; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/cloneWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/cloneWith.js deleted file mode 100644 index 1bc6035..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/cloneWith.js +++ /dev/null @@ -1,36 +0,0 @@ -var baseClone = require('./_baseClone'); - -/** - * This method is like `_.clone` except that it accepts `customizer` which - * is invoked to produce the cloned value. If `customizer` returns `undefined` - * cloning is handled by the method instead. The `customizer` is invoked with - * up to four arguments; (value [, index|key, object, stack]). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to clone. - * @param {Function} [customizer] The function to customize cloning. - * @returns {*} Returns the cloned value. - * @example - * - * function customizer(value) { - * if (_.isElement(value)) { - * return value.cloneNode(false); - * } - * } - * - * var el = _.cloneWith(document.body, customizer); - * - * console.log(el === document.body); - * // => false - * console.log(el.nodeName); - * // => 'BODY' - * console.log(el.childNodes.length); - * // => 0 - */ -function cloneWith(value, customizer) { - return baseClone(value, false, customizer); -} - -module.exports = cloneWith; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection.js deleted file mode 100644 index 6d37b3f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection.js +++ /dev/null @@ -1,29 +0,0 @@ -module.exports = { - 'at': require('./at'), - 'countBy': require('./countBy'), - 'each': require('./each'), - 'eachRight': require('./eachRight'), - 'every': require('./every'), - 'filter': require('./filter'), - 'find': require('./find'), - 'findLast': require('./findLast'), - 'flatMap': require('./flatMap'), - 'forEach': require('./forEach'), - 'forEachRight': require('./forEachRight'), - 'groupBy': require('./groupBy'), - 'includes': require('./includes'), - 'invokeMap': require('./invokeMap'), - 'keyBy': require('./keyBy'), - 'map': require('./map'), - 'orderBy': require('./orderBy'), - 'partition': require('./partition'), - 'reduce': require('./reduce'), - 'reduceRight': require('./reduceRight'), - 'reject': require('./reject'), - 'sample': require('./sample'), - 'sampleSize': require('./sampleSize'), - 'shuffle': require('./shuffle'), - 'size': require('./size'), - 'some': require('./some'), - 'sortBy': require('./sortBy') -}; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/commit.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/commit.js deleted file mode 100644 index 1f87f50..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/commit.js +++ /dev/null @@ -1,32 +0,0 @@ -var LodashWrapper = require('./_LodashWrapper'); - -/** - * Executes the chained sequence and returns the wrapped result. - * - * @name commit - * @memberOf _ - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2]; - * var wrapped = _(array).push(3); - * - * console.log(array); - * // => [1, 2] - * - * wrapped = wrapped.commit(); - * console.log(array); - * // => [1, 2, 3] - * - * wrapped.last(); - * // => 3 - * - * console.log(array); - * // => [1, 2, 3] - */ -function wrapperCommit() { - return new LodashWrapper(this.value(), this.__chain__); -} - -module.exports = wrapperCommit; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/compact.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/compact.js deleted file mode 100644 index 1dc1c55..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/compact.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Creates an array with all falsey values removed. The values `false`, `null`, - * `0`, `""`, `undefined`, and `NaN` are falsey. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to compact. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.compact([0, 1, false, 2, '', 3]); - * // => [1, 2, 3] - */ -function compact(array) { - var index = -1, - length = array ? array.length : 0, - resIndex = -1, - result = []; - - while (++index < length) { - var value = array[index]; - if (value) { - result[++resIndex] = value; - } - } - return result; -} - -module.exports = compact; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/concat.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/concat.js deleted file mode 100644 index a3a78df..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/concat.js +++ /dev/null @@ -1,35 +0,0 @@ -var arrayConcat = require('./_arrayConcat'), - baseFlatten = require('./_baseFlatten'), - isArray = require('./isArray'), - rest = require('./rest'); - -/** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to concatenate. - * @param {...*} [values] The values to concatenate. - * @returns {Array} Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ -var concat = rest(function(array, values) { - if (!isArray(array)) { - array = array == null ? [] : [Object(array)]; - } - values = baseFlatten(values); - return arrayConcat(array, values); -}); - -module.exports = concat; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/cond.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/cond.js deleted file mode 100644 index 593ac9e..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/cond.js +++ /dev/null @@ -1,58 +0,0 @@ -var apply = require('./_apply'), - arrayMap = require('./_arrayMap'), - baseIteratee = require('./_baseIteratee'), - rest = require('./rest'); - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * Creates a function that iterates over `pairs` invoking the corresponding - * function of the first predicate to return truthy. The predicate-function - * pairs are invoked with the `this` binding and arguments of the created - * function. - * - * @static - * @memberOf _ - * @category Util - * @param {Array} pairs The predicate-function pairs. - * @returns {Function} Returns the new function. - * @example - * - * var func = _.cond([ - * [_.matches({ 'a': 1 }), _.constant('matches A')], - * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], - * [_.constant(true), _.constant('no match')] - * ]); - * - * func({ 'a': 1, 'b': 2 }); - * // => 'matches A' - * - * func({ 'a': 0, 'b': 1 }); - * // => 'matches B' - * - * func({ 'a': '1', 'b': '2' }); - * // => 'no match' - */ -function cond(pairs) { - var length = pairs ? pairs.length : 0; - - pairs = !length ? [] : arrayMap(pairs, function(pair) { - if (typeof pair[1] != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return [baseIteratee(pair[0]), pair[1]]; - }); - - return rest(function(args) { - var index = -1; - while (++index < length) { - var pair = pairs[index]; - if (apply(pair[0], this, args)) { - return apply(pair[1], this, args); - } - } - }); -} - -module.exports = cond; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/conforms.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/conforms.js deleted file mode 100644 index 2bfeca2..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/conforms.js +++ /dev/null @@ -1,28 +0,0 @@ -var baseClone = require('./_baseClone'), - baseConforms = require('./_baseConforms'); - -/** - * Creates a function that invokes the predicate properties of `source` with - * the corresponding property values of a given object, returning `true` if - * all predicates return truthy, else `false`. - * - * @static - * @memberOf _ - * @category Util - * @param {Object} source The object of property predicates to conform to. - * @returns {Function} Returns the new function. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * _.filter(users, _.conforms({ 'age': _.partial(_.gt, _, 38) })); - * // => [{ 'user': 'fred', 'age': 40 }] - */ -function conforms(source) { - return baseConforms(baseClone(source, true)); -} - -module.exports = conforms; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/constant.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/constant.js deleted file mode 100644 index 5844804..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/constant.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Creates a function that returns `value`. - * - * @static - * @memberOf _ - * @category Util - * @param {*} value The value to return from the new function. - * @returns {Function} Returns the new function. - * @example - * - * var object = { 'user': 'fred' }; - * var getter = _.constant(object); - * - * getter() === object; - * // => true - */ -function constant(value) { - return function() { - return value; - }; -} - -module.exports = constant; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/core.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/core.js deleted file mode 100644 index 120fdd8..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/core.js +++ /dev/null @@ -1,3814 +0,0 @@ -/** - * @license - * lodash 4.2.1 (Custom Build) - * Build: `lodash core -o ./dist/lodash.core.js` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -;(function() { - - /** Used as a safe reference for `undefined` in pre-ES5 environments. */ - var undefined; - - /** Used as the semantic version number. */ - var VERSION = '4.2.1'; - - /** Used to compose bitmasks for wrapper metadata. */ - var BIND_FLAG = 1, - PARTIAL_FLAG = 32; - - /** Used to compose bitmasks for comparison styles. */ - var UNORDERED_COMPARE_FLAG = 1, - PARTIAL_COMPARE_FLAG = 2; - - /** Used as the `TypeError` message for "Functions" methods. */ - var FUNC_ERROR_TEXT = 'Expected a function'; - - /** Used as references for various `Number` constants. */ - var MAX_SAFE_INTEGER = 9007199254740991; - - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - stringTag = '[object String]'; - - /** Used to match HTML entities and HTML characters. */ - var reUnescapedHtml = /[&<>"'`]/g, - reHasUnescapedHtml = RegExp(reUnescapedHtml.source); - - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; - - /** Used to map characters to HTML entities. */ - var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' - }; - - /** Used to determine if values are of the language type `Object`. */ - var objectTypes = { - 'function': true, - 'object': true - }; - - /** Detect free variable `exports`. */ - var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; - - /** Detect free variable `module`. */ - var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; - - /** Detect free variable `global` from Node.js. */ - var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); - - /** Detect free variable `self`. */ - var freeSelf = checkGlobal(objectTypes[typeof self] && self); - - /** Detect free variable `window`. */ - var freeWindow = checkGlobal(objectTypes[typeof window] && window); - - /** Detect the popular CommonJS extension `module.exports`. */ - var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null; - - /** Detect `this` as the global object. */ - var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - - /** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ - var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')(); - - /*--------------------------------------------------------------------------*/ - - /** - * Creates a new array concatenating `array` with `other`. - * - * @private - * @param {Array} array The first array to concatenate. - * @param {Array} other The second array to concatenate. - * @returns {Array} Returns the new concatenated array. - */ - function arrayConcat(array, other) { - return arrayPush(copyArray(array), values); - } - - /** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ - function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; - } - - /** - * The base implementation of methods like `_.max` and `_.min` which accepts a - * `comparator` to determine the extremum value. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The iteratee invoked per iteration. - * @param {Function} comparator The comparator used to compare values. - * @returns {*} Returns the extremum value. - */ - function baseExtremum(array, iteratee, comparator) { - var index = -1, - length = array.length; - - while (++index < length) { - var value = array[index], - current = iteratee(value); - - if (current != null && (computed === undefined - ? current === current - : comparator(current, computed) - )) { - var computed = current, - result = value; - } - } - return result; - } - - /** - * The base implementation of methods like `_.find` and `_.findKey`, without - * support for iteratee shorthands, which iterates over `collection` using - * `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to search. - * @param {Function} predicate The function invoked per iteration. - * @param {Function} eachFunc The function to iterate over `collection`. - * @param {boolean} [retKey] Specify returning the key of the found element instead of the element itself. - * @returns {*} Returns the found element or its key, else `undefined`. - */ - function baseFind(collection, predicate, eachFunc, retKey) { - var result; - eachFunc(collection, function(value, key, collection) { - if (predicate(value, key, collection)) { - result = retKey ? key : value; - return false; - } - }); - return result; - } - - /** - * The base implementation of `_.reduce` and `_.reduceRight`, without support - * for iteratee shorthands, which iterates over `collection` using `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} accumulator The initial value. - * @param {boolean} initAccum Specify using the first or last element of `collection` as the initial value. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the accumulated value. - */ - function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { - eachFunc(collection, function(value, index, collection) { - accumulator = initAccum - ? (initAccum = false, value) - : iteratee(accumulator, value, index, collection); - }); - return accumulator; - } - - /** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ - function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; - } - - /** - * The base implementation of `_.values` and `_.valuesIn` which creates an - * array of `object` property values corresponding to the property names - * of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the array of property values. - */ - function baseValues(object, props) { - return baseMap(props, function(key) { - return object[key]; - }); - } - - /** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ - function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; - } - - /** - * Compares values to sort them in ascending order. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {number} Returns the sort order indicator for `value`. - */ - function compareAscending(value, other) { - if (value !== other) { - var valIsNull = value === null, - valIsUndef = value === undefined, - valIsReflexive = value === value; - - var othIsNull = other === null, - othIsUndef = other === undefined, - othIsReflexive = other === other; - - if ((value > other && !othIsNull) || !valIsReflexive || - (valIsNull && !othIsUndef && othIsReflexive) || - (valIsUndef && othIsReflexive)) { - return 1; - } - if ((value < other && !valIsNull) || !othIsReflexive || - (othIsNull && !valIsUndef && valIsReflexive) || - (othIsUndef && valIsReflexive)) { - return -1; - } - } - return 0; - } - - /** - * Used by `_.escape` to convert characters to HTML entities. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - function escapeHtmlChar(chr) { - return htmlEscapes[chr]; - } - - /** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ - function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; - } - - /** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; - } - - /** - * Converts `iterator` to an array. - * - * @private - * @param {Object} iterator The iterator to convert. - * @returns {Array} Returns the converted array. - */ - function iteratorToArray(iterator) { - var data, - result = []; - - while (!(data = iterator.next()).done) { - result.push(data.value); - } - return result; - } - - /*--------------------------------------------------------------------------*/ - - /** Used for built-in method references. */ - var arrayProto = Array.prototype, - objectProto = Object.prototype; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** Used to generate unique IDs. */ - var idCounter = 0; - - /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; - - /** Used to restore the original `_` reference in `_.noConflict`. */ - var oldDash = root._; - - /** Built-in value references. */ - var Reflect = root.Reflect, - Symbol = root.Symbol, - Uint8Array = root.Uint8Array, - enumerate = Reflect ? Reflect.enumerate : undefined, - propertyIsEnumerable = objectProto.propertyIsEnumerable; - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeIsFinite = root.isFinite, - nativeKeys = Object.keys, - nativeMax = Math.max; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a `lodash` object which wraps `value` to enable implicit method - * chaining. Methods that operate on and return arrays, collections, and - * functions can be chained together. Methods that retrieve a single value or - * may return a primitive value will automatically end the chain sequence and - * return the unwrapped value. Otherwise, the value must be unwrapped with - * `_#value`. - * - * Explicit chaining, which must be unwrapped with `_#value` in all cases, - * may be enabled using `_.chain`. - * - * The execution of chained methods is lazy, that is, it's deferred until - * `_#value` is implicitly or explicitly called. - * - * Lazy evaluation allows several methods to support shortcut fusion. Shortcut - * fusion is an optimization to merge iteratee calls; this avoids the creation - * of intermediate arrays and can greatly reduce the number of iteratee executions. - * Sections of a chain sequence qualify for shortcut fusion if the section is - * applied to an array of at least two hundred elements and any iteratees - * accept only one argument. The heuristic for whether a section qualifies - * for shortcut fusion is subject to change. - * - * Chaining is supported in custom builds as long as the `_#value` method is - * directly or indirectly included in the build. - * - * In addition to lodash methods, wrappers have `Array` and `String` methods. - * - * The wrapper `Array` methods are: - * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` - * - * The wrapper `String` methods are: - * `replace` and `split` - * - * The wrapper methods that support shortcut fusion are: - * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, - * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, - * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` - * - * The chainable wrapper methods are: - * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, - * `at`, `before`, `bind`, `bindAll`, `bindKey`, `chain`, `chunk`, `commit`, - * `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, `curry`, - * `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`, - * `differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`, - * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flip`, `flow`, - * `flowRight`, `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, - * `intersection`, `intersectionBy`, `intersectionWith`, `invert`, `invertBy`, - * `invokeMap`, `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, - * `mapValues`, `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, - * `method`, `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, - * `orderBy`, `over`, `overArgs`, `overEvery`, `overSome`, `partial`, - * `partialRight`, `partition`, `pick`, `pickBy`, `plant`, `property`, - * `propertyOf`, `pull`, `pullAll`, `pullAllBy`, `pullAt`, `push`, `range`, - * `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`, `sampleSize`, - * `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`, - * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, - * `thru`, `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, - * `transform`, `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, - * `uniqWith`, `unset`, `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, - * `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`, - * `zipObjectDeep`, and `zipWith` - * - * The wrapper methods that are **not** chainable by default are: - * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, - * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `endsWith`, `eq`, - * `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, - * `findLast`, `findLastIndex`, `findLastKey`, `floor`, `forEach`, `forEachRight`, - * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, - * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, - * `isArguments`, `isArray`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, - * `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`, - * `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMatch`, `isMatchWith`, - * `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, `isObjectLike`, - * `isPlainObject`, `isRegExp`, `isSafeInteger`, `isString`, `isUndefined`, - * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, - * `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `min`, `minBy`, - * `noConflict`, `noop`, `now`, `pad`, `padEnd`, `padStart`, `parseInt`, - * `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`, - * `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, - * `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, - * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toLower`, - * `toInteger`, `toLength`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, - * `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, - * `upperCase`, `upperFirst`, `value`, and `words` - * - * @name _ - * @constructor - * @category Seq - * @param {*} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var wrapped = _([1, 2, 3]); - * - * // Returns an unwrapped value. - * wrapped.reduce(_.add); - * // => 6 - * - * // Returns a wrapped value. - * var squares = wrapped.map(square); - * - * _.isArray(squares); - * // => false - * - * _.isArray(squares.value()); - * // => true - */ - function lodash(value) { - if (isObjectLike(value) && !isArray(value)) { - if (value instanceof LodashWrapper) { - return value; - } - if (hasOwnProperty.call(value, '__wrapped__')) { - return wrapperClone(value); - } - } - return new LodashWrapper(value); - } - - /** - * The base constructor for creating `lodash` wrapper objects. - * - * @private - * @param {*} value The value to wrap. - * @param {boolean} [chainAll] Enable chaining for all wrapper methods. - */ - function LodashWrapper(value, chainAll) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__chain__ = !!chainAll; - } - - /*------------------------------------------------------------------------*/ - - /** - * Used by `_.defaults` to customize its `_.assignIn` use. - * - * @private - * @param {*} objValue The destination value. - * @param {*} srcValue The source value. - * @param {string} key The key of the property to assign. - * @param {Object} object The parent object of `objValue`. - * @returns {*} Returns the value to assign. - */ - function assignInDefaults(objValue, srcValue, key, object) { - if (objValue === undefined || - (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { - return srcValue; - } - return objValue; - } - - /** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function assignValue(object, key, value) { - var objValue = object[key]; - if ((!eq(objValue, value) || - (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) || - (value === undefined && !(key in object))) { - object[key] = value; - } - } - - /** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} prototype The object to inherit from. - * @returns {Object} Returns the new object. - */ - var baseCreate = (function() { - function object() {} - return function(prototype) { - if (isObject(prototype)) { - object.prototype = prototype; - var result = new object; - object.prototype = undefined; - } - return result || {}; - }; - }()); - - /** - * The base implementation of `_.delay` and `_.defer` which accepts an array - * of `func` arguments. - * - * @private - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {Object} args The arguments provide to `func`. - * @returns {number} Returns the timer id. - */ - function baseDelay(func, wait, args) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return setTimeout(function() { func.apply(undefined, args); }, wait); - } - - /** - * The base implementation of `_.forEach` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ - var baseEach = createBaseEach(baseForOwn); - - /** - * The base implementation of `_.every` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, else `false` - */ - function baseEvery(collection, predicate) { - var result = true; - baseEach(collection, function(value, index, collection) { - result = !!predicate(value, index, collection); - return result; - }); - return result; - } - - /** - * The base implementation of `_.filter` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function baseFilter(collection, predicate) { - var result = []; - baseEach(collection, function(value, index, collection) { - if (predicate(value, index, collection)) { - result.push(value); - } - }); - return result; - } - - /** - * The base implementation of `_.flatten` with support for restricting flattening. - * - * @private - * @param {Array} array The array to flatten. - * @param {boolean} [isDeep] Specify a deep flatten. - * @param {boolean} [isStrict] Restrict flattening to arrays-like objects. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. - */ - function baseFlatten(array, isDeep, isStrict, result) { - result || (result = []); - - var index = -1, - length = array.length; - - while (++index < length) { - var value = array[index]; - if (isArrayLikeObject(value) && - (isStrict || isArray(value) || isArguments(value))) { - if (isDeep) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, isDeep, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; - } - - /** - * The base implementation of `baseForIn` and `baseForOwn` which iterates - * over `object` properties returned by `keysFunc` invoking `iteratee` for - * each property. Iteratee functions may exit iteration early by explicitly - * returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - var baseFor = createBaseFor(); - - /** - * The base implementation of `_.forOwn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); - } - - /** - * The base implementation of `_.functions` which creates an array of - * `object` function property names filtered from those provided. - * - * @private - * @param {Object} object The object to inspect. - * @param {Array} props The property names to filter. - * @returns {Array} Returns the new array of filtered property names. - */ - function baseFunctions(object, props) { - return baseFilter(props, function(key) { - return isFunction(object[key]); - }); - } - - /** - * The base implementation of `_.isEqual` which supports partial comparisons - * and tracks traversed objects. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparisons. - * @param {boolean} [bitmask] The bitmask of comparison flags. - * The bitmask may be composed of the following flags: - * 1 - Unordered comparison - * 2 - Partial comparison - * @param {Object} [stack] Tracks traversed `value` and `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - */ - function baseIsEqual(value, other, customizer, bitmask, stack) { - if (value === other) { - return true; - } - if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { - return value !== value && other !== other; - } - return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); - } - - /** - * A specialized version of `baseIsEqual` for arrays and objects which performs - * deep comparisons and tracks traversed objects enabling objects with circular - * references to be compared. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { - var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = arrayTag, - othTag = arrayTag; - - if (!objIsArr) { - objTag = objectToString.call(object); - if (objTag == argsTag) { - objTag = objectTag; - } - } - if (!othIsArr) { - othTag = objectToString.call(other); - if (othTag == argsTag) { - othTag = objectTag; - } - } - var objIsObj = objTag == objectTag && !isHostObject(object), - othIsObj = othTag == objectTag && !isHostObject(other), - isSameTag = objTag == othTag; - - if (isSameTag && !(objIsArr || objIsObj)) { - return equalByTag(object, other, objTag, equalFunc, customizer, bitmask); - } - var isPartial = bitmask & PARTIAL_COMPARE_FLAG; - if (!isPartial) { - var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), - othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - - if (objIsWrapped || othIsWrapped) { - return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, bitmask, stack); - } - } - if (!isSameTag) { - return false; - } - stack || (stack = []); - var stacked = find(stack, function(entry) { - return entry[0] === object; - }); - if (stacked && stacked[1]) { - return stacked[1] == other; - } - stack.push([object, other]); - var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, bitmask, stack); - stack.pop(); - return result; - } - - /** - * The base implementation of `_.iteratee`. - * - * @private - * @param {*} [value=_.identity] The value to convert to an iteratee. - * @returns {Function} Returns the iteratee. - */ - function baseIteratee(func) { - var type = typeof func; - if (type == 'function') { - return func; - } - return func == null - ? identity - : (type == 'object' ? baseMatches : baseProperty)(func); - } - - /** - * The base implementation of `_.keys` which doesn't skip the constructor - * property of prototypes or treat sparse arrays as dense. - * - * @private - * @type Function - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function baseKeys(object) { - return nativeKeys(Object(object)); - } - - /** - * The base implementation of `_.keysIn` which doesn't skip the constructor - * property of prototypes or treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function baseKeysIn(object) { - object = object == null ? object : Object(object); - - var result = []; - for (var key in object) { - result.push(key); - } - return result; - } - - // Fallback for IE < 9 with es6-shim. - if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) { - baseKeysIn = function(object) { - return iteratorToArray(enumerate(object)); - }; - } - - /** - * The base implementation of `_.map` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function baseMap(collection, iteratee) { - var index = -1, - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value, key, collection) { - result[++index] = iteratee(value, key, collection); - }); - return result; - } - - /** - * The base implementation of `_.matches` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new function. - */ - function baseMatches(source) { - var props = keys(source); - return function(object) { - var length = props.length; - if (object == null) { - return !length; - } - object = Object(object); - while (length--) { - var key = props[length]; - if (!(key in object && - baseIsEqual(source[key], object[key], undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG) - )) { - return false; - } - } - return true; - }; - } - - /** - * The base implementation of `_.pick` without support for individual - * property names. - * - * @private - * @param {Object} object The source object. - * @param {string[]} props The property names to pick. - * @returns {Object} Returns the new object. - */ - function basePick(object, props) { - object = Object(object); - return reduce(props, function(result, key) { - if (key in object) { - result[key] = object[key]; - } - return result; - }, {}); - } - - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ - function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; - } - - /** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; - } - - /** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ - function copyArray(source) { - return baseSlice(source, 0, source.length); - } - - /** - * The base implementation of `_.some` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`. - */ - function baseSome(collection, predicate) { - var result; - - baseEach(collection, function(value, index, collection) { - result = predicate(value, index, collection); - return !result; - }); - return !!result; - } - - /** - * The base implementation of `wrapperValue` which returns the result of - * performing a sequence of actions on the unwrapped `value`, where each - * successive action is supplied the return value of the previous. - * - * @private - * @param {*} value The unwrapped value. - * @param {Array} actions Actions to perform to resolve the unwrapped value. - * @returns {*} Returns the resolved value. - */ - function baseWrapperValue(value, actions) { - var result = value; - return reduce(actions, function(result, action) { - return action.func.apply(action.thisArg, arrayPush([result], action.args)); - }, result); - } - - /** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. - * @param {Object} [object={}] The object to copy properties to. - * @returns {Object} Returns `object`. - */ - var copyObject = copyObjectWith; - - /** - * This function is like `copyObject` except that it accepts a function to - * customize copied values. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ - function copyObjectWith(source, props, object, customizer) { - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index], - newValue = customizer ? customizer(object[key], source[key], key, object, source) : source[key]; - - assignValue(object, key, newValue); - } - return object; - } - - /** - * Creates a function like `_.assign`. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ - function createAssigner(assigner) { - return rest(function(object, sources) { - var index = -1, - length = sources.length, - customizer = length > 1 ? sources[length - 1] : undefined; - - customizer = typeof customizer == 'function' ? (length--, customizer) : undefined; - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; - }); - } - - /** - * Creates a `baseEach` or `baseEachRight` function. - * - * @private - * @param {Function} eachFunc The function to iterate over a collection. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee) { - if (collection == null) { - return collection; - } - if (!isArrayLike(collection)) { - return eachFunc(collection, iteratee); - } - var length = collection.length, - index = fromRight ? length : -1, - iterable = Object(collection); - - while ((fromRight ? index-- : ++index < length)) { - if (iteratee(iterable[index], index, iterable) === false) { - break; - } - } - return collection; - }; - } - - /** - * Creates a base function for methods like `_.forIn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; - } - - /** - * Creates a function that produces an instance of `Ctor` regardless of - * whether it was invoked as part of a `new` expression or by `call` or `apply`. - * - * @private - * @param {Function} Ctor The constructor to wrap. - * @returns {Function} Returns the new wrapped function. - */ - function createCtorWrapper(Ctor) { - return function() { - // Use a `switch` statement to work with class constructors. - // See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist - // for more details. - var args = arguments; - var thisBinding = baseCreate(Ctor.prototype), - result = Ctor.apply(thisBinding, args); - - // Mimic the constructor's `return` behavior. - // See https://es5.github.io/#x13.2.2 for more details. - return isObject(result) ? result : thisBinding; - }; - } - - /** - * Creates a function that wraps `func` to invoke it with the optional `this` - * binding of `thisArg` and the `partials` prepended to those provided to - * the wrapper. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} partials The arguments to prepend to those provided to the new function. - * @returns {Function} Returns the new wrapped function. - */ - function createPartialWrapper(func, bitmask, thisArg, partials) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - var isBind = bitmask & BIND_FLAG, - Ctor = createCtorWrapper(func); - - function wrapper() { - var argsIndex = -1, - argsLength = arguments.length, - leftIndex = -1, - leftLength = partials.length, - args = Array(leftLength + argsLength), - fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - - while (++leftIndex < leftLength) { - args[leftIndex] = partials[leftIndex]; - } - while (argsLength--) { - args[leftIndex++] = arguments[++argsIndex]; - } - return fn.apply(isBind ? thisArg : this, args); - } - return wrapper; - } - - /** - * A specialized version of `baseIsEqualDeep` for arrays with support for - * partial deep comparisons. - * - * @private - * @param {Array} array The array to compare. - * @param {Array} other The other array to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. - * @param {Object} [stack] Tracks traversed `array` and `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. - */ - function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { - var index = -1, - isPartial = bitmask & PARTIAL_COMPARE_FLAG, - isUnordered = bitmask & UNORDERED_COMPARE_FLAG, - arrLength = array.length, - othLength = other.length; - - if (arrLength != othLength && !(isPartial && othLength > arrLength)) { - return false; - } - var result = true; - - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index]; - - var compared; - if (compared !== undefined) { - if (compared) { - continue; - } - result = false; - break; - } - // Recursively compare arrays (susceptible to call stack limits). - if (isUnordered) { - if (!baseSome(other, function(othValue) { - return arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack); - })) { - result = false; - break; - } - } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { - result = false; - break; - } - } - return result; - } - - /** - * A specialized version of `baseIsEqualDeep` for comparing objects of - * the same `toStringTag`. - * - * **Note:** This function only supports comparing values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {string} tag The `toStringTag` of the objects to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalByTag(object, other, tag, equalFunc, customizer, bitmask) { - switch (tag) { - - case boolTag: - case dateTag: - // Coerce dates and booleans to numbers, dates to milliseconds and booleans - // to `1` or `0` treating invalid dates coerced to `NaN` as not equal. - return +object == +other; - - case errorTag: - return object.name == other.name && object.message == other.message; - - case numberTag: - // Treat `NaN` vs. `NaN` as equal. - return (object != +object) ? other != +other : object == +other; - - case regexpTag: - case stringTag: - // Coerce regexes to strings and treat strings primitives and string - // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details. - return object == (other + ''); - - } - return false; - } - - /** - * A specialized version of `baseIsEqualDeep` for objects with support for - * partial deep comparisons. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { - var isPartial = bitmask & PARTIAL_COMPARE_FLAG, - objProps = keys(object), - objLength = objProps.length, - othProps = keys(other), - othLength = othProps.length; - - if (objLength != othLength && !isPartial) { - return false; - } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { - return false; - } - } - var result = true; - - var skipCtor = isPartial; - while (++index < objLength) { - key = objProps[index]; - var objValue = object[key], - othValue = other[key]; - - var compared; - // Recursively compare objects (susceptible to call stack limits). - if (!(compared === undefined - ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack)) - : compared - )) { - result = false; - break; - } - skipCtor || (skipCtor = key == 'constructor'); - } - if (result && !skipCtor) { - var objCtor = object.constructor, - othCtor = other.constructor; - - // Non `Object` object instances with different constructors are not equal. - if (objCtor != othCtor && - ('constructor' in object && 'constructor' in other) && - !(typeof objCtor == 'function' && objCtor instanceof objCtor && - typeof othCtor == 'function' && othCtor instanceof othCtor)) { - result = false; - } - } - return result; - } - - /** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ - var getLength = baseProperty('length'); - - /** - * Creates an array of index keys for `object` values of arrays, - * `arguments` objects, and strings, otherwise `null` is returned. - * - * @private - * @param {Object} object The object to query. - * @returns {Array|null} Returns index keys, else `null`. - */ - function indexKeys(object) { - var length = object ? object.length : undefined; - if (isLength(length) && - (isArray(object) || isString(object) || isArguments(object))) { - return baseTimes(length, String); - } - return null; - } - - /** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ - function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; - } - - /** - * Converts `value` to a function if it's not one. - * - * @private - * @param {*} value The value to process. - * @returns {Function} Returns the function. - */ - function toFunction(value) { - return typeof value == 'function' ? value : identity; - } - - /** - * Creates a clone of `wrapper`. - * - * @private - * @param {Object} wrapper The wrapper to clone. - * @returns {Object} Returns the cloned wrapper. - */ - function wrapperClone(wrapper) { - var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); - result.__actions__ = copyArray(wrapper.__actions__); - return result; - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates an array with all falsey values removed. The values `false`, `null`, - * `0`, `""`, `undefined`, and `NaN` are falsey. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to compact. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.compact([0, 1, false, 2, '', 3]); - * // => [1, 2, 3] - */ - function compact(array) { - return baseFilter(array, Boolean); - } - - /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to concatenate. - * @param {...*} [values] The values to concatenate. - * @returns {Array} Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ - var concat = rest(function(array, values) { - if (!isArray(array)) { - array = array == null ? [] : [Object(array)]; - } - values = baseFlatten(values); - return arrayConcat(array, values); - }); - - /** - * Flattens `array` a single level. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flatten([1, [2, 3, [4]]]); - * // => [1, 2, 3, [4]] - */ - function flatten(array) { - var length = array ? array.length : 0; - return length ? baseFlatten(array) : []; - } - - /** - * This method is like `_.flatten` except that it recursively flattens `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to recursively flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flattenDeep([1, [2, 3, [4]]]); - * // => [1, 2, 3, 4] - */ - function flattenDeep(array) { - var length = array ? array.length : 0; - return length ? baseFlatten(array, true) : []; - } - - /** - * Gets the first element of `array`. - * - * @static - * @memberOf _ - * @alias first - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the first element of `array`. - * @example - * - * _.head([1, 2, 3]); - * // => 1 - * - * _.head([]); - * // => undefined - */ - function head(array) { - return array ? array[0] : undefined; - } - - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // Search from the `fromIndex`. - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - function indexOf(array, value, fromIndex) { - var length = array ? array.length : 0; - if (typeof fromIndex == 'number') { - fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex; - } else { - fromIndex = 0; - } - var index = (fromIndex || 0) - 1, - isReflexive = value === value; - - while (++index < length) { - var other = array[index]; - if ((isReflexive ? other === value : other !== other)) { - return index; - } - } - return -1; - } - - /** - * Gets the last element of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the last element of `array`. - * @example - * - * _.last([1, 2, 3]); - * // => 3 - */ - function last(array) { - var length = array ? array.length : 0; - return length ? array[length - 1] : undefined; - } - - /** - * Creates a slice of `array` from `start` up to, but not including, `end`. - * - * **Note:** This method is used instead of [`Array#slice`](https://mdn.io/Array/slice) - * to ensure dense arrays are returned. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function slice(array, start, end) { - var length = array ? array.length : 0; - start = start == null ? 0 : +start; - end = end === undefined ? length : +end; - return length ? baseSlice(array, start, end) : []; - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates a `lodash` object that wraps `value` with explicit method chaining enabled. - * The result of such method chaining must be unwrapped with `_#value`. - * - * @static - * @memberOf _ - * @category Seq - * @param {*} value The value to wrap. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'pebbles', 'age': 1 } - * ]; - * - * var youngest = _ - * .chain(users) - * .sortBy('age') - * .map(function(o) { - * return o.user + ' is ' + o.age; - * }) - * .head() - * .value(); - * // => 'pebbles is 1' - */ - function chain(value) { - var result = lodash(value); - result.__chain__ = true; - return result; - } - - /** - * This method invokes `interceptor` and returns `value`. The interceptor - * is invoked with one argument; (value). The purpose of this method is to - * "tap into" a method chain in order to modify intermediate results. - * - * @static - * @memberOf _ - * @category Seq - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @returns {*} Returns `value`. - * @example - * - * _([1, 2, 3]) - * .tap(function(array) { - * // Mutate input array. - * array.pop(); - * }) - * .reverse() - * .value(); - * // => [2, 1] - */ - function tap(value, interceptor) { - interceptor(value); - return value; - } - - /** - * This method is like `_.tap` except that it returns the result of `interceptor`. - * The purpose of this method is to "pass thru" values replacing intermediate - * results in a method chain. - * - * @static - * @memberOf _ - * @category Seq - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @returns {*} Returns the result of `interceptor`. - * @example - * - * _(' abc ') - * .chain() - * .trim() - * .thru(function(value) { - * return [value]; - * }) - * .value(); - * // => ['abc'] - */ - function thru(value, interceptor) { - return interceptor(value); - } - - /** - * Enables explicit method chaining on the wrapper object. - * - * @name chain - * @memberOf _ - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // A sequence without explicit chaining. - * _(users).head(); - * // => { 'user': 'barney', 'age': 36 } - * - * // A sequence with explicit chaining. - * _(users) - * .chain() - * .head() - * .pick('user') - * .value(); - * // => { 'user': 'barney' } - */ - function wrapperChain() { - return chain(this); - } - - /** - * Executes the chained sequence to extract the unwrapped value. - * - * @name value - * @memberOf _ - * @alias toJSON, valueOf - * @category Seq - * @returns {*} Returns the resolved unwrapped value. - * @example - * - * _([1, 2, 3]).value(); - * // => [1, 2, 3] - */ - function wrapperValue() { - return baseWrapperValue(this.__wrapped__, this.__actions__); - } - - /*------------------------------------------------------------------------*/ - - /** - * Checks if `predicate` returns truthy for **all** elements of `collection`. - * Iteration is stopped once `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {boolean} Returns `true` if all elements pass the predicate check, else `false`. - * @example - * - * _.every([true, 1, null, 'yes'], Boolean); - * // => false - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.every(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.every(users, ['active', false]); - * // => true - * - * // The `_.property` iteratee shorthand. - * _.every(users, 'active'); - * // => false - */ - function every(collection, predicate, guard) { - predicate = guard ? undefined : predicate; - return baseEvery(collection, baseIteratee(predicate)); - } - - /** - * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is invoked with three arguments: - * (value, index|key, collection). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * _.filter(users, function(o) { return !o.active; }); - * // => objects for ['fred'] - * - * // The `_.matches` iteratee shorthand. - * _.filter(users, { 'age': 36, 'active': true }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.filter(users, ['active', false]); - * // => objects for ['fred'] - * - * // The `_.property` iteratee shorthand. - * _.filter(users, 'active'); - * // => objects for ['barney'] - */ - function filter(collection, predicate) { - return baseFilter(collection, baseIteratee(predicate)); - } - - /** - * Iterates over elements of `collection`, returning the first element - * `predicate` returns truthy for. The predicate is invoked with three arguments: - * (value, index|key, collection). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false }, - * { 'user': 'pebbles', 'age': 1, 'active': true } - * ]; - * - * _.find(users, function(o) { return o.age < 40; }); - * // => object for 'barney' - * - * // The `_.matches` iteratee shorthand. - * _.find(users, { 'age': 1, 'active': true }); - * // => object for 'pebbles' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.find(users, ['active', false]); - * // => object for 'fred' - * - * // The `_.property` iteratee shorthand. - * _.find(users, 'active'); - * // => object for 'barney' - */ - function find(collection, predicate) { - return baseFind(collection, baseIteratee(predicate), baseEach); - } - - /** - * Iterates over elements of `collection` invoking `iteratee` for each element. - * The iteratee is invoked with three arguments: (value, index|key, collection). - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * **Note:** As with other "Collections" methods, objects with a "length" property - * are iterated like arrays. To avoid this behavior use `_.forIn` or `_.forOwn` - * for object iteration. - * - * @static - * @memberOf _ - * @alias each - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - * @example - * - * _([1, 2]).forEach(function(value) { - * console.log(value); - * }); - * // => logs `1` then `2` - * - * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { - * console.log(key); - * }); - * // => logs 'a' then 'b' (iteration order is not guaranteed) - */ - function forEach(collection, iteratee) { - return baseEach(collection, toFunction(iteratee)); - } - - /** - * Creates an array of values by running each element in `collection` through - * `iteratee`. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. - * - * The guarded methods are: - * `ary`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`, - * `invert`, `parseInt`, `random`, `range`, `rangeRight`, `slice`, `some`, - * `sortBy`, `take`, `takeRight`, `template`, `trim`, `trimEnd`, `trimStart`, - * and `words` - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - * @example - * - * function square(n) { - * return n * n; - * } - * - * _.map([4, 8], square); - * // => [16, 64] - * - * _.map({ 'a': 4, 'b': 8 }, square); - * // => [16, 64] (iteration order is not guaranteed) - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * // The `_.property` iteratee shorthand. - * _.map(users, 'user'); - * // => ['barney', 'fred'] - */ - function map(collection, iteratee) { - return baseMap(collection, baseIteratee(iteratee)); - } - - /** - * Reduces `collection` to a value which is the accumulated result of running - * each element in `collection` through `iteratee`, where each successive - * invocation is supplied the return value of the previous. If `accumulator` - * is not provided the first element of `collection` is used as the initial - * value. The iteratee is invoked with four arguments: - * (accumulator, value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.reduce`, `_.reduceRight`, and `_.transform`. - * - * The guarded methods are: - * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, - * and `sortBy` - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @returns {*} Returns the accumulated value. - * @example - * - * _.reduce([1, 2], function(sum, n) { - * return sum + n; - * }, 0); - * // => 3 - * - * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { - * (result[value] || (result[value] = [])).push(key); - * return result; - * }, {}); - * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) - */ - function reduce(collection, iteratee, accumulator) { - return baseReduce(collection, baseIteratee(iteratee), accumulator, arguments.length < 3, baseEach); - } - - /** - * Gets the size of `collection` by returning its length for array-like - * values or the number of own enumerable properties for objects. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to inspect. - * @returns {number} Returns the collection size. - * @example - * - * _.size([1, 2, 3]); - * // => 3 - * - * _.size({ 'a': 1, 'b': 2 }); - * // => 2 - * - * _.size('pebbles'); - * // => 7 - */ - function size(collection) { - if (collection == null) { - return 0; - } - collection = isArrayLike(collection) ? collection : keys(collection); - return collection.length; - } - - /** - * Checks if `predicate` returns truthy for **any** element of `collection`. - * Iteration is stopped once `predicate` returns truthy. The predicate is - * invoked with three arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`. - * @example - * - * _.some([null, 0, 'yes', false], Boolean); - * // => true - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.some(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.some(users, ['active', false]); - * // => true - * - * // The `_.property` iteratee shorthand. - * _.some(users, 'active'); - * // => true - */ - function some(collection, predicate, guard) { - predicate = guard ? undefined : predicate; - return baseSome(collection, baseIteratee(predicate)); - } - - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {...(Function|Function[]|Object|Object[]|string|string[])} [iteratees=[_.identity]] - * The iteratees to sort by, specified individually or in arrays. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, function(o) { return o.user; }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.sortBy(users, 'user', function(o) { - * return Math.floor(o.age / 10); - * }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - function sortBy(collection, iteratee) { - var index = 0; - iteratee = baseIteratee(iteratee); - - return baseMap(baseMap(collection, function(value, key, collection) { - return { 'value': value, 'index': index++, 'criteria': iteratee(value, key, collection) }; - }).sort(function(object, other) { - return compareAscending(object.criteria, other.criteria) || (object.index - other.index); - }), baseProperty('value')); - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates a function that invokes `func`, with the `this` binding and arguments - * of the created function, while it's called less than `n` times. Subsequent - * calls to the created function return the result of the last `func` invocation. - * - * @static - * @memberOf _ - * @category Function - * @param {number} n The number of calls at which `func` is no longer invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * jQuery(element).on('click', _.before(5, addContactToList)); - * // => allows adding up to 4 contacts to the list - */ - function before(n, func) { - var result; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - n = toInteger(n); - return function() { - if (--n > 0) { - result = func.apply(this, arguments); - } - if (n <= 1) { - func = undefined; - } - return result; - }; - } - - /** - * Creates a function that invokes `func` with the `this` binding of `thisArg` - * and prepends any additional `_.bind` arguments to those provided to the - * bound function. - * - * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for partially applied arguments. - * - * **Note:** Unlike native `Function#bind` this method doesn't set the "length" - * property of bound functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var greet = function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * }; - * - * var object = { 'user': 'fred' }; - * - * var bound = _.bind(greet, object, 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * // Bound with placeholders. - * var bound = _.bind(greet, object, _, '!'); - * bound('hi'); - * // => 'hi fred!' - */ - var bind = rest(function(func, thisArg, partials) { - return createPartialWrapper(func, BIND_FLAG | PARTIAL_FLAG, thisArg, partials); - }); - - /** - * Defers invoking the `func` until the current call stack has cleared. Any - * additional arguments are provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to defer. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. - * @example - * - * _.defer(function(text) { - * console.log(text); - * }, 'deferred'); - * // => logs 'deferred' after one or more milliseconds - */ - var defer = rest(function(func, args) { - return baseDelay(func, 1, args); - }); - - /** - * Invokes `func` after `wait` milliseconds. Any additional arguments are - * provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. - * @example - * - * _.delay(function(text) { - * console.log(text); - * }, 1000, 'later'); - * // => logs 'later' after one second - */ - var delay = rest(function(func, wait, args) { - return baseDelay(func, toNumber(wait) || 0, args); - }); - - /** - * Creates a function that negates the result of the predicate `func`. The - * `func` predicate is invoked with the `this` binding and arguments of the - * created function. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} predicate The predicate to negate. - * @returns {Function} Returns the new function. - * @example - * - * function isEven(n) { - * return n % 2 == 0; - * } - * - * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); - * // => [1, 3, 5] - */ - function negate(predicate) { - if (typeof predicate != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function() { - return !predicate.apply(this, arguments); - }; - } - - /** - * Creates a function that is restricted to invoking `func` once. Repeat calls - * to the function return the value of the first invocation. The `func` is - * invoked with the `this` binding and arguments of the created function. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var initialize = _.once(createApplication); - * initialize(); - * initialize(); - * // `initialize` invokes `createApplication` once - */ - function once(func) { - return before(2, func); - } - - /** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as an array. - * - * **Note:** This method is based on the [rest parameter](https://mdn.io/rest_parameters). - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.rest(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' - */ - function rest(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - var otherArgs = Array(start + 1); - index = -1; - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = array; - return func.apply(this, otherArgs); - }; - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates a shallow clone of `value`. - * - * **Note:** This method is loosely based on the - * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) - * and supports cloning arrays, array buffers, booleans, date objects, maps, - * numbers, `Object` objects, regexes, sets, strings, symbols, and typed - * arrays. The own enumerable properties of `arguments` objects are cloned - * as plain objects. An empty object is returned for uncloneable values such - * as error objects, functions, DOM nodes, and WeakMaps. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to clone. - * @returns {*} Returns the cloned value. - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var shallow = _.clone(objects); - * console.log(shallow[0] === objects[0]); - * // => true - */ - function clone(value) { - if (!isObject(value)) { - return value; - } - return isArray(value) ? copyArray(value) : copyObject(value, keys(value)); - } - - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - function eq(value, other) { - return value === other || (value !== value && other !== other); - } - - /** - * Checks if `value` is greater than `other`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`. - * @example - * - * _.gt(3, 1); - * // => true - * - * _.gt(3, 3); - * // => false - * - * _.gt(1, 3); - * // => false - */ - function gt(value, other) { - return value > other; - } - - /** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - function isArguments(value) { - // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); - } - - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @type Function - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ - var isArray = Array.isArray; - - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @type Function - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - function isArrayLike(value) { - return value != null && - !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value)); - } - - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @type Function - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } - - /** - * Checks if `value` is classified as a boolean primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isBoolean(false); - * // => true - * - * _.isBoolean(null); - * // => false - */ - function isBoolean(value) { - return value === true || value === false || - (isObjectLike(value) && objectToString.call(value) == boolTag); - } - - /** - * Checks if `value` is classified as a `Date` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isDate(new Date); - * // => true - * - * _.isDate('Mon April 23 2012'); - * // => false - */ - function isDate(value) { - return isObjectLike(value) && objectToString.call(value) == dateTag; - } - - /** - * Checks if `value` is empty. A value is considered empty unless it's an - * `arguments` object, array, string, or jQuery-like collection with a length - * greater than `0` or an object with own enumerable properties. - * - * @static - * @memberOf _ - * @category Lang - * @param {Array|Object|string} value The value to inspect. - * @returns {boolean} Returns `true` if `value` is empty, else `false`. - * @example - * - * _.isEmpty(null); - * // => true - * - * _.isEmpty(true); - * // => true - * - * _.isEmpty(1); - * // => true - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({ 'a': 1 }); - * // => false - */ - function isEmpty(value) { - if (isArrayLike(value) && - (isArray(value) || isString(value) || isFunction(value.splice) || isArguments(value))) { - return !value.length; - } - for (var key in value) { - if (hasOwnProperty.call(value, key)) { - return false; - } - } - return true; - } - - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - function isEqual(value, other) { - return baseIsEqual(value, other); - } - - /** - * Checks if `value` is a finite primitive number. - * - * **Note:** This method is based on [`Number.isFinite`](https://mdn.io/Number/isFinite). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. - * @example - * - * _.isFinite(3); - * // => true - * - * _.isFinite(Number.MAX_VALUE); - * // => true - * - * _.isFinite(3.14); - * // => true - * - * _.isFinite(Infinity); - * // => false - */ - function isFinite(value) { - return typeof value == 'number' && nativeIsFinite(value); - } - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array constructors, and - // PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; - } - - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - - /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } - - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return !!value && typeof value == 'object'; - } - - /** - * Checks if `value` is `NaN`. - * - * **Note:** This method is not the same as [`isNaN`](https://es5.github.io/#x15.1.2.4) - * which returns `true` for `undefined` and other non-numeric values. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - * @example - * - * _.isNaN(NaN); - * // => true - * - * _.isNaN(new Number(NaN)); - * // => true - * - * isNaN(undefined); - * // => true - * - * _.isNaN(undefined); - * // => false - */ - function isNaN(value) { - // An `NaN` primitive is the only value that is not equal to itself. - // Perform the `toStringTag` check first to avoid errors with some ActiveX objects in IE. - return isNumber(value) && value != +value; - } - - /** - * Checks if `value` is `null`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `null`, else `false`. - * @example - * - * _.isNull(null); - * // => true - * - * _.isNull(void 0); - * // => false - */ - function isNull(value) { - return value === null; - } - - /** - * Checks if `value` is classified as a `Number` primitive or object. - * - * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified - * as numbers, use the `_.isFinite` method. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isNumber(3); - * // => true - * - * _.isNumber(Number.MIN_VALUE); - * // => true - * - * _.isNumber(Infinity); - * // => true - * - * _.isNumber('3'); - * // => false - */ - function isNumber(value) { - return typeof value == 'number' || - (isObjectLike(value) && objectToString.call(value) == numberTag); - } - - /** - * Checks if `value` is classified as a `RegExp` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isRegExp(/abc/); - * // => true - * - * _.isRegExp('/abc/'); - * // => false - */ - function isRegExp(value) { - return isObject(value) && objectToString.call(value) == regexpTag; - } - - /** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ - function isString(value) { - return typeof value == 'string' || - (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag); - } - - /** - * Checks if `value` is `undefined`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. - * @example - * - * _.isUndefined(void 0); - * // => true - * - * _.isUndefined(null); - * // => false - */ - function isUndefined(value) { - return value === undefined; - } - - /** - * Checks if `value` is less than `other`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`. - * @example - * - * _.lt(1, 3); - * // => true - * - * _.lt(3, 3); - * // => false - * - * _.lt(3, 1); - * // => false - */ - function lt(value, other) { - return value < other; - } - - /** - * Converts `value` to an array. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {Array} Returns the converted array. - * @example - * - * _.toArray({ 'a': 1, 'b': 2 }); - * // => [1, 2] - * - * _.toArray('abc'); - * // => ['a', 'b', 'c'] - * - * _.toArray(1); - * // => [] - * - * _.toArray(null); - * // => [] - */ - function toArray(value) { - if (!isArrayLike(value)) { - return values(value); - } - return value.length ? copyArray(value) : []; - } - - /** - * Converts `value` to an integer. - * - * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3'); - * // => 3 - */ - var toInteger = Number; - - /** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3); - * // => 3 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3'); - * // => 3 - */ - var toNumber = Number; - - /** - * Converts `value` to a string if it's not one. An empty string is returned - * for `null` and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ - function toString(value) { - if (typeof value == 'string') { - return value; - } - return value == null ? '' : (value + ''); - } - - /*------------------------------------------------------------------------*/ - - /** - * Assigns own enumerable properties of source objects to the destination - * object. Source objects are applied from left to right. Subsequent sources - * overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.c = 3; - * } - * - * function Bar() { - * this.e = 5; - * } - * - * Foo.prototype.d = 4; - * Bar.prototype.f = 6; - * - * _.assign({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3, 'e': 5 } - */ - var assign = createAssigner(function(object, source) { - copyObject(source, keys(source), object); - }); - - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @alias extend - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - var assignIn = createAssigner(function(object, source) { - copyObject(source, keysIn(source), object); - }); - - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @alias extendWith - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObjectWith(source, keysIn(source), object, customizer); - }); - - /** - * Creates an object that inherits from the `prototype` object. If a `properties` - * object is provided its own enumerable properties are assigned to the created object. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} prototype The object to inherit from. - * @param {Object} [properties] The properties to assign to the object. - * @returns {Object} Returns the new object. - * @example - * - * function Shape() { - * this.x = 0; - * this.y = 0; - * } - * - * function Circle() { - * Shape.call(this); - * } - * - * Circle.prototype = _.create(Shape.prototype, { - * 'constructor': Circle - * }); - * - * var circle = new Circle; - * circle instanceof Circle; - * // => true - * - * circle instanceof Shape; - * // => true - */ - function create(prototype, properties) { - var result = baseCreate(prototype); - return properties ? assign(result, properties) : result; - } - - /** - * Assigns own and inherited enumerable properties of source objects to the - * destination object for all destination properties that resolve to `undefined`. - * Source objects are applied from left to right. Once a property is set, - * additional values of the same property are ignored. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); - * // => { 'user': 'barney', 'age': 36 } - */ - var defaults = rest(function(args) { - args.push(undefined, assignInDefaults); - return assignInWith.apply(undefined, args); - }); - - /** - * Checks if `path` is a direct property of `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b.c'); - * // => true - * - * _.has(object, ['a', 'b', 'c']); - * // => true - * - * _.has(other, 'a'); - * // => false - */ - function has(object, path) { - return object != null && hasOwnProperty.call(object, path); - } - - /** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) - * for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ - function keys(object) { - var isProto = isPrototype(object); - if (!(isProto || isArrayLike(object))) { - return baseKeys(object); - } - var indexes = indexKeys(object), - skipIndexes = !!indexes, - result = indexes || [], - length = result.length; - - for (var key in object) { - if (hasOwnProperty.call(object, key) && - !(skipIndexes && (key == 'length' || isIndex(key, length))) && - !(isProto && key == 'constructor')) { - result.push(key); - } - } - return result; - } - - /** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ - function keysIn(object) { - var index = -1, - isProto = isPrototype(object), - props = baseKeysIn(object), - propsLength = props.length, - indexes = indexKeys(object), - skipIndexes = !!indexes, - result = indexes || [], - length = result.length; - - while (++index < propsLength) { - var key = props[index]; - if (!(skipIndexes && (key == 'length' || isIndex(key, length))) && - !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; - } - - /** - * Creates an object composed of the picked `object` properties. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [props] The property names to pick, specified - * individually or in arrays. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - var pick = rest(function(object, props) { - return object == null ? {} : basePick(object, baseFlatten(props)); - }); - - /** - * This method is like `_.get` except that if the resolved value is a function - * it's invoked with the `this` binding of its parent object and its result - * is returned. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to resolve. - * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; - * - * _.result(object, 'a[0].b.c1'); - * // => 3 - * - * _.result(object, 'a[0].b.c2'); - * // => 4 - * - * _.result(object, 'a[0].b.c3', 'default'); - * // => 'default' - * - * _.result(object, 'a[0].b.c3', _.constant('default')); - * // => 'default' - */ - function result(object, path, defaultValue) { - var value = object == null ? undefined : object[path]; - if (value === undefined) { - value = defaultValue; - } - return isFunction(value) ? value.call(object) : value; - } - - /** - * Creates an array of the own enumerable property values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.values(new Foo); - * // => [1, 2] (iteration order is not guaranteed) - * - * _.values('hi'); - * // => ['h', 'i'] - */ - function values(object) { - return object ? baseValues(object, keys(object)) : []; - } - - /*------------------------------------------------------------------------*/ - - /** - * Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to - * their corresponding HTML entities. - * - * **Note:** No other characters are escaped. To escape additional - * characters use a third-party library like [_he_](https://mths.be/he). - * - * Though the ">" character is escaped for symmetry, characters like - * ">" and "/" don't need escaping in HTML and have no special meaning - * unless they're part of a tag or unquoted attribute value. - * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) - * (under "semi-related fun fact") for more details. - * - * Backticks are escaped because in IE < 9, they can break out of - * attribute values or HTML comments. See [#59](https://html5sec.org/#59), - * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and - * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/) - * for more details. - * - * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping) - * to reduce XSS vectors. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escape('fred, barney, & pebbles'); - * // => 'fred, barney, & pebbles' - */ - function escape(string) { - string = toString(string); - return (string && reHasUnescapedHtml.test(string)) - ? string.replace(reUnescapedHtml, escapeHtmlChar) - : string; - } - - /*------------------------------------------------------------------------*/ - - /** - * This method returns the first argument provided to it. - * - * @static - * @memberOf _ - * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'user': 'fred' }; - * - * _.identity(object) === object; - * // => true - */ - function identity(value) { - return value; - } - - /** - * Creates a function that invokes `func` with the arguments of the created - * function. If `func` is a property name the created callback returns the - * property value for a given element. If `func` is an object the created - * callback returns `true` for elements that contain the equivalent object properties, otherwise it returns `false`. - * - * @static - * @memberOf _ - * @category Util - * @param {*} [func=_.identity] The value to convert to a callback. - * @returns {Function} Returns the callback. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // Create custom iteratee shorthands. - * _.iteratee = _.wrap(_.iteratee, function(callback, func) { - * var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func); - * return !p ? callback(func) : function(object) { - * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]); - * }; - * }); - * - * _.filter(users, 'age > 36'); - * // => [{ 'user': 'fred', 'age': 40 }] - */ - var iteratee = baseIteratee; - - /** - * Creates a function that performs a deep partial comparison between a given - * object and `source`, returning `true` if the given object has equivalent - * property values, else `false`. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @static - * @memberOf _ - * @category Util - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new function. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * _.filter(users, _.matches({ 'age': 40, 'active': false })); - * // => [{ 'user': 'fred', 'age': 40, 'active': false }] - */ - function matches(source) { - return baseMatches(assign({}, source)); - } - - /** - * Adds all own enumerable function properties of a source object to the - * destination object. If `object` is a function then methods are added to - * its prototype as well. - * - * **Note:** Use `_.runInContext` to create a pristine `lodash` function to - * avoid conflicts caused by modifying the original. - * - * @static - * @memberOf _ - * @category Util - * @param {Function|Object} [object=lodash] The destination object. - * @param {Object} source The object of functions to add. - * @param {Object} [options] The options object. - * @param {boolean} [options.chain=true] Specify whether the functions added - * are chainable. - * @returns {Function|Object} Returns `object`. - * @example - * - * function vowels(string) { - * return _.filter(string, function(v) { - * return /[aeiou]/i.test(v); - * }); - * } - * - * _.mixin({ 'vowels': vowels }); - * _.vowels('fred'); - * // => ['e'] - * - * _('fred').vowels().value(); - * // => ['e'] - * - * _.mixin({ 'vowels': vowels }, { 'chain': false }); - * _('fred').vowels(); - * // => ['e'] - */ - function mixin(object, source, options) { - var props = keys(source), - methodNames = baseFunctions(source, props); - - if (options == null && - !(isObject(source) && (methodNames.length || !props.length))) { - options = source; - source = object; - object = this; - methodNames = baseFunctions(source, keys(source)); - } - var chain = (isObject(options) && 'chain' in options) ? options.chain : true, - isFunc = isFunction(object); - - baseEach(methodNames, function(methodName) { - var func = source[methodName]; - object[methodName] = func; - if (isFunc) { - object.prototype[methodName] = function() { - var chainAll = this.__chain__; - if (chain || chainAll) { - var result = object(this.__wrapped__), - actions = result.__actions__ = copyArray(this.__actions__); - - actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); - result.__chain__ = chainAll; - return result; - } - return func.apply(object, arrayPush([this.value()], arguments)); - }; - } - }); - - return object; - } - - /** - * Reverts the `_` variable to its previous value and returns a reference to - * the `lodash` function. - * - * @static - * @memberOf _ - * @category Util - * @returns {Function} Returns the `lodash` function. - * @example - * - * var lodash = _.noConflict(); - */ - function noConflict() { - if (root._ === this) { - root._ = oldDash; - } - return this; - } - - /** - * A no-operation function that returns `undefined` regardless of the - * arguments it receives. - * - * @static - * @memberOf _ - * @category Util - * @example - * - * var object = { 'user': 'fred' }; - * - * _.noop(object) === undefined; - * // => true - */ - function noop() { - // No operation performed. - } - - /** - * Generates a unique ID. If `prefix` is provided the ID is appended to it. - * - * @static - * @memberOf _ - * @category Util - * @param {string} [prefix] The value to prefix the ID with. - * @returns {string} Returns the unique ID. - * @example - * - * _.uniqueId('contact_'); - * // => 'contact_104' - * - * _.uniqueId(); - * // => '105' - */ - function uniqueId(prefix) { - var id = ++idCounter; - return toString(prefix) + id; - } - - /*------------------------------------------------------------------------*/ - - /** - * Computes the maximum value of `array`. If `array` is empty or falsey - * `undefined` is returned. - * - * @static - * @memberOf _ - * @category Math - * @param {Array} array The array to iterate over. - * @returns {*} Returns the maximum value. - * @example - * - * _.max([4, 2, 8, 6]); - * // => 8 - * - * _.max([]); - * // => undefined - */ - function max(array) { - return (array && array.length) - ? baseExtremum(array, identity, gt) - : undefined; - } - - /** - * Computes the minimum value of `array`. If `array` is empty or falsey - * `undefined` is returned. - * - * @static - * @memberOf _ - * @category Math - * @param {Array} array The array to iterate over. - * @returns {*} Returns the minimum value. - * @example - * - * _.min([4, 2, 8, 6]); - * // => 2 - * - * _.min([]); - * // => undefined - */ - function min(array) { - return (array && array.length) - ? baseExtremum(array, identity, lt) - : undefined; - } - - /*------------------------------------------------------------------------*/ - - LodashWrapper.prototype = baseCreate(lodash.prototype); - LodashWrapper.prototype.constructor = LodashWrapper; - - // Add functions that return wrapped values when chaining. - lodash.assignIn = assignIn; - lodash.before = before; - lodash.bind = bind; - lodash.chain = chain; - lodash.compact = compact; - lodash.concat = concat; - lodash.create = create; - lodash.defaults = defaults; - lodash.defer = defer; - lodash.delay = delay; - lodash.filter = filter; - lodash.flatten = flatten; - lodash.flattenDeep = flattenDeep; - lodash.iteratee = iteratee; - lodash.keys = keys; - lodash.map = map; - lodash.matches = matches; - lodash.mixin = mixin; - lodash.negate = negate; - lodash.once = once; - lodash.pick = pick; - lodash.slice = slice; - lodash.sortBy = sortBy; - lodash.tap = tap; - lodash.thru = thru; - lodash.toArray = toArray; - lodash.values = values; - - // Add aliases. - lodash.extend = assignIn; - - // Add functions to `lodash.prototype`. - mixin(lodash, lodash); - - /*------------------------------------------------------------------------*/ - - // Add functions that return unwrapped values when chaining. - lodash.clone = clone; - lodash.escape = escape; - lodash.every = every; - lodash.find = find; - lodash.forEach = forEach; - lodash.has = has; - lodash.head = head; - lodash.identity = identity; - lodash.indexOf = indexOf; - lodash.isArguments = isArguments; - lodash.isArray = isArray; - lodash.isBoolean = isBoolean; - lodash.isDate = isDate; - lodash.isEmpty = isEmpty; - lodash.isEqual = isEqual; - lodash.isFinite = isFinite; - lodash.isFunction = isFunction; - lodash.isNaN = isNaN; - lodash.isNull = isNull; - lodash.isNumber = isNumber; - lodash.isObject = isObject; - lodash.isRegExp = isRegExp; - lodash.isString = isString; - lodash.isUndefined = isUndefined; - lodash.last = last; - lodash.max = max; - lodash.min = min; - lodash.noConflict = noConflict; - lodash.noop = noop; - lodash.reduce = reduce; - lodash.result = result; - lodash.size = size; - lodash.some = some; - lodash.uniqueId = uniqueId; - - // Add aliases. - lodash.each = forEach; - lodash.first = head; - - mixin(lodash, (function() { - var source = {}; - baseForOwn(lodash, function(func, methodName) { - if (!hasOwnProperty.call(lodash.prototype, methodName)) { - source[methodName] = func; - } - }); - return source; - }()), { 'chain': false }); - - /*------------------------------------------------------------------------*/ - - /** - * The semantic version number. - * - * @static - * @memberOf _ - * @type string - */ - lodash.VERSION = VERSION; - - // Add `Array` and `String` methods to `lodash.prototype`. - baseEach(['pop', 'join', 'replace', 'reverse', 'split', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { - var func = (/^(?:replace|split)$/.test(methodName) ? String.prototype : arrayProto)[methodName], - chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', - retUnwrapped = /^(?:pop|join|replace|shift)$/.test(methodName); - - lodash.prototype[methodName] = function() { - var args = arguments; - if (retUnwrapped && !this.__chain__) { - return func.apply(this.value(), args); - } - return this[chainName](function(value) { - return func.apply(value, args); - }); - }; - }); - - // Add chaining functions to the `lodash` wrapper. - lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; - - /*--------------------------------------------------------------------------*/ - - // Expose lodash on the free variable `window` or `self` when available. This - // prevents errors in cases where lodash is loaded by a script tag in the presence - // of an AMD loader. See http://requirejs.org/docs/errors.html#mismatch for more details. - (freeWindow || freeSelf || {})._ = lodash; - - // Some AMD build optimizers like r.js check for condition patterns like the following: - if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { - // Define as an anonymous module so, through path mapping, it can be - // referenced as the "underscore" module. - define(function() { - return lodash; - }); - } - // Check for `exports` after `define` in case a build optimizer adds an `exports` object. - else if (freeExports && freeModule) { - // Export for Node.js. - if (moduleExports) { - (freeModule.exports = lodash)._ = lodash; - } - // Export for CommonJS support. - freeExports._ = lodash; - } - else { - // Export to the global object. - root._ = lodash; - } -}.call(this)); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/countBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/countBy.js deleted file mode 100644 index aff966d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/countBy.js +++ /dev/null @@ -1,33 +0,0 @@ -var createAggregator = require('./_createAggregator'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is the number of times the key was returned by `iteratee`. - * The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.countBy([6.1, 4.2, 6.3], Math.floor); - * // => { '4': 1, '6': 2 } - * - * _.countBy(['one', 'two', 'three'], 'length'); - * // => { '3': 2, '5': 1 } - */ -var countBy = createAggregator(function(result, value, key) { - hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1); -}); - -module.exports = countBy; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/create.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/create.js deleted file mode 100644 index 1965123..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/create.js +++ /dev/null @@ -1,41 +0,0 @@ -var baseAssign = require('./_baseAssign'), - baseCreate = require('./_baseCreate'); - -/** - * Creates an object that inherits from the `prototype` object. If a `properties` - * object is provided its own enumerable properties are assigned to the created object. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} prototype The object to inherit from. - * @param {Object} [properties] The properties to assign to the object. - * @returns {Object} Returns the new object. - * @example - * - * function Shape() { - * this.x = 0; - * this.y = 0; - * } - * - * function Circle() { - * Shape.call(this); - * } - * - * Circle.prototype = _.create(Shape.prototype, { - * 'constructor': Circle - * }); - * - * var circle = new Circle; - * circle instanceof Circle; - * // => true - * - * circle instanceof Shape; - * // => true - */ -function create(prototype, properties) { - var result = baseCreate(prototype); - return properties ? baseAssign(result, properties) : result; -} - -module.exports = create; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/curry.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/curry.js deleted file mode 100644 index 13874ce..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/curry.js +++ /dev/null @@ -1,53 +0,0 @@ -var createWrapper = require('./_createWrapper'); - -/** Used to compose bitmasks for wrapper metadata. */ -var CURRY_FLAG = 8; - -/** - * Creates a function that accepts arguments of `func` and either invokes - * `func` returning its result, if at least `arity` number of arguments have - * been provided, or returns a function that accepts the remaining `func` - * arguments, and so on. The arity of `func` may be specified if `func.length` - * is not sufficient. - * - * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for provided arguments. - * - * **Note:** This method doesn't set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curry(abc); - * - * curried(1)(2)(3); - * // => [1, 2, 3] - * - * curried(1, 2)(3); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // Curried with placeholders. - * curried(1)(_, 3)(2); - * // => [1, 2, 3] - */ -function curry(func, arity, guard) { - arity = guard ? undefined : arity; - var result = createWrapper(func, CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = curry.placeholder; - return result; -} - -module.exports = curry; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/curryRight.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/curryRight.js deleted file mode 100644 index f809955..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/curryRight.js +++ /dev/null @@ -1,50 +0,0 @@ -var createWrapper = require('./_createWrapper'); - -/** Used to compose bitmasks for wrapper metadata. */ -var CURRY_RIGHT_FLAG = 16; - -/** - * This method is like `_.curry` except that arguments are applied to `func` - * in the manner of `_.partialRight` instead of `_.partial`. - * - * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for provided arguments. - * - * **Note:** This method doesn't set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curryRight(abc); - * - * curried(3)(2)(1); - * // => [1, 2, 3] - * - * curried(2, 3)(1); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // Curried with placeholders. - * curried(3)(1, _)(2); - * // => [1, 2, 3] - */ -function curryRight(func, arity, guard) { - arity = guard ? undefined : arity; - var result = createWrapper(func, CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = curryRight.placeholder; - return result; -} - -module.exports = curryRight; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/date.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/date.js deleted file mode 100644 index cbf5b41..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/date.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - 'now': require('./now') -}; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/debounce.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/debounce.js deleted file mode 100644 index fadf716..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/debounce.js +++ /dev/null @@ -1,175 +0,0 @@ -var isObject = require('./isObject'), - now = require('./now'), - toNumber = require('./toNumber'); - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked. The debounced function comes with a `cancel` method to cancel - * delayed `func` invocations and a `flush` method to immediately invoke them. - * Provide an options object to indicate whether `func` should be invoked on - * the leading and/or trailing edge of the `wait` timeout. The `func` is invoked - * with the last arguments provided to the debounced function. Subsequent calls - * to the debounced function return the result of the last `func` invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked - * on the trailing edge of the timeout only if the debounced function is - * invoked more than once during the `wait` timeout. - * - * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) - * for details over the differences between `_.debounce` and `_.throttle`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options] The options object. - * @param {boolean} [options.leading=false] Specify invoking on the leading - * edge of the timeout. - * @param {number} [options.maxWait] The maximum time `func` is allowed to be - * delayed before it's invoked. - * @param {boolean} [options.trailing=true] Specify invoking on the trailing - * edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // Avoid costly calculations while the window size is in flux. - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // Invoke `sendMail` when clicked, debouncing subsequent calls. - * jQuery(element).on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // Ensure `batchLog` is invoked once after 1 second of debounced calls. - * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); - * var source = new EventSource('/stream'); - * jQuery(source).on('message', debounced); - * - * // Cancel the trailing debounced invocation. - * jQuery(window).on('popstate', debounced.cancel); - */ -function debounce(func, wait, options) { - var args, - maxTimeoutId, - result, - stamp, - thisArg, - timeoutId, - trailingCall, - lastCalled = 0, - leading = false, - maxWait = false, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = toNumber(wait) || 0; - if (isObject(options)) { - leading = !!options.leading; - maxWait = 'maxWait' in options && nativeMax(toNumber(options.maxWait) || 0, wait); - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - - function cancel() { - if (timeoutId) { - clearTimeout(timeoutId); - } - if (maxTimeoutId) { - clearTimeout(maxTimeoutId); - } - lastCalled = 0; - args = maxTimeoutId = thisArg = timeoutId = trailingCall = undefined; - } - - function complete(isCalled, id) { - if (id) { - clearTimeout(id); - } - maxTimeoutId = timeoutId = trailingCall = undefined; - if (isCalled) { - lastCalled = now(); - result = func.apply(thisArg, args); - if (!timeoutId && !maxTimeoutId) { - args = thisArg = undefined; - } - } - } - - function delayed() { - var remaining = wait - (now() - stamp); - if (remaining <= 0 || remaining > wait) { - complete(trailingCall, maxTimeoutId); - } else { - timeoutId = setTimeout(delayed, remaining); - } - } - - function flush() { - if ((timeoutId && trailingCall) || (maxTimeoutId && trailing)) { - result = func.apply(thisArg, args); - } - cancel(); - return result; - } - - function maxDelayed() { - complete(trailing, timeoutId); - } - - function debounced() { - args = arguments; - stamp = now(); - thisArg = this; - trailingCall = trailing && (timeoutId || !leading); - - if (maxWait === false) { - var leadingCall = leading && !timeoutId; - } else { - if (!maxTimeoutId && !leading) { - lastCalled = stamp; - } - var remaining = maxWait - (stamp - lastCalled), - isCalled = remaining <= 0 || remaining > maxWait; - - if (isCalled) { - if (maxTimeoutId) { - maxTimeoutId = clearTimeout(maxTimeoutId); - } - lastCalled = stamp; - result = func.apply(thisArg, args); - } - else if (!maxTimeoutId) { - maxTimeoutId = setTimeout(maxDelayed, remaining); - } - } - if (isCalled && timeoutId) { - timeoutId = clearTimeout(timeoutId); - } - else if (!timeoutId && wait !== maxWait) { - timeoutId = setTimeout(delayed, wait); - } - if (leadingCall) { - isCalled = true; - result = func.apply(thisArg, args); - } - if (isCalled && !timeoutId && !maxTimeoutId) { - args = thisArg = undefined; - } - return result; - } - debounced.cancel = cancel; - debounced.flush = flush; - return debounced; -} - -module.exports = debounce; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/deburr.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/deburr.js deleted file mode 100644 index 7e75034..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/deburr.js +++ /dev/null @@ -1,39 +0,0 @@ -var deburrLetter = require('./_deburrLetter'), - toString = require('./toString'); - -/** Used to match latin-1 supplementary letters (excluding mathematical operators). */ -var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g; - -/** Used to compose unicode character classes. */ -var rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', - rsComboSymbolsRange = '\\u20d0-\\u20f0'; - -/** Used to compose unicode capture groups. */ -var rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']'; - -/** - * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and - * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). - */ -var reComboMark = RegExp(rsCombo, 'g'); - -/** - * Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) - * to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to deburr. - * @returns {string} Returns the deburred string. - * @example - * - * _.deburr('déjà vu'); - * // => 'deja vu' - */ -function deburr(string) { - string = toString(string); - return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, ''); -} - -module.exports = deburr; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/defaults.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/defaults.js deleted file mode 100644 index eded284..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/defaults.js +++ /dev/null @@ -1,30 +0,0 @@ -var apply = require('./_apply'), - assignInDefaults = require('./_assignInDefaults'), - assignInWith = require('./assignInWith'), - rest = require('./rest'); - -/** - * Assigns own and inherited enumerable properties of source objects to the - * destination object for all destination properties that resolve to `undefined`. - * Source objects are applied from left to right. Once a property is set, - * additional values of the same property are ignored. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); - * // => { 'user': 'barney', 'age': 36 } - */ -var defaults = rest(function(args) { - args.push(undefined, assignInDefaults); - return apply(assignInWith, undefined, args); -}); - -module.exports = defaults; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/defaultsDeep.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/defaultsDeep.js deleted file mode 100644 index c495aee..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/defaultsDeep.js +++ /dev/null @@ -1,29 +0,0 @@ -var apply = require('./_apply'), - mergeDefaults = require('./_mergeDefaults'), - mergeWith = require('./mergeWith'), - rest = require('./rest'); - -/** - * This method is like `_.defaults` except that it recursively assigns - * default properties. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } }); - * // => { 'user': { 'name': 'barney', 'age': 36 } } - * - */ -var defaultsDeep = rest(function(args) { - args.push(undefined, mergeDefaults); - return apply(mergeWith, undefined, args); -}); - -module.exports = defaultsDeep; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/defer.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/defer.js deleted file mode 100644 index f492b3d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/defer.js +++ /dev/null @@ -1,25 +0,0 @@ -var baseDelay = require('./_baseDelay'), - rest = require('./rest'); - -/** - * Defers invoking the `func` until the current call stack has cleared. Any - * additional arguments are provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to defer. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. - * @example - * - * _.defer(function(text) { - * console.log(text); - * }, 'deferred'); - * // => logs 'deferred' after one or more milliseconds - */ -var defer = rest(function(func, args) { - return baseDelay(func, 1, args); -}); - -module.exports = defer; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/delay.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/delay.js deleted file mode 100644 index 28d070c..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/delay.js +++ /dev/null @@ -1,27 +0,0 @@ -var baseDelay = require('./_baseDelay'), - rest = require('./rest'), - toNumber = require('./toNumber'); - -/** - * Invokes `func` after `wait` milliseconds. Any additional arguments are - * provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. - * @example - * - * _.delay(function(text) { - * console.log(text); - * }, 1000, 'later'); - * // => logs 'later' after one second - */ -var delay = rest(function(func, wait, args) { - return baseDelay(func, toNumber(wait) || 0, args); -}); - -module.exports = delay; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/difference.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/difference.js deleted file mode 100644 index a1495b3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/difference.js +++ /dev/null @@ -1,28 +0,0 @@ -var baseDifference = require('./_baseDifference'), - baseFlatten = require('./_baseFlatten'), - isArrayLikeObject = require('./isArrayLikeObject'), - rest = require('./rest'); - -/** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.difference([3, 2, 1], [4, 2]); - * // => [3, 1] - */ -var difference = rest(function(array, values) { - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, false, true)) - : []; -}); - -module.exports = difference; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/differenceBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/differenceBy.js deleted file mode 100644 index 550ccfa..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/differenceBy.js +++ /dev/null @@ -1,39 +0,0 @@ -var baseDifference = require('./_baseDifference'), - baseFlatten = require('./_baseFlatten'), - baseIteratee = require('./_baseIteratee'), - isArrayLikeObject = require('./isArrayLikeObject'), - last = require('./last'), - rest = require('./rest'); - -/** - * This method is like `_.difference` except that it accepts `iteratee` which - * is invoked for each element of `array` and `values` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.differenceBy([3.1, 2.2, 1.3], [4.4, 2.5], Math.floor); - * // => [3.1, 1.3] - * - * // The `_.property` iteratee shorthand. - * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ -var differenceBy = rest(function(array, values) { - var iteratee = last(values); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; - } - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, false, true), baseIteratee(iteratee)) - : []; -}); - -module.exports = differenceBy; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/differenceWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/differenceWith.js deleted file mode 100644 index b60f3a0..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/differenceWith.js +++ /dev/null @@ -1,36 +0,0 @@ -var baseDifference = require('./_baseDifference'), - baseFlatten = require('./_baseFlatten'), - isArrayLikeObject = require('./isArrayLikeObject'), - last = require('./last'), - rest = require('./rest'); - -/** - * This method is like `_.difference` except that it accepts `comparator` - * which is invoked to compare elements of `array` to `values`. The comparator - * is invoked with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ -var differenceWith = rest(function(array, values) { - var comparator = last(values); - if (isArrayLikeObject(comparator)) { - comparator = undefined; - } - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, false, true), undefined, comparator) - : []; -}); - -module.exports = differenceWith; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/drop.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/drop.js deleted file mode 100644 index 3094995..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/drop.js +++ /dev/null @@ -1,37 +0,0 @@ -var baseSlice = require('./_baseSlice'), - toInteger = require('./toInteger'); - -/** - * Creates a slice of `array` with `n` elements dropped from the beginning. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.drop([1, 2, 3]); - * // => [2, 3] - * - * _.drop([1, 2, 3], 2); - * // => [3] - * - * _.drop([1, 2, 3], 5); - * // => [] - * - * _.drop([1, 2, 3], 0); - * // => [1, 2, 3] - */ -function drop(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - return baseSlice(array, n < 0 ? 0 : n, length); -} - -module.exports = drop; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/dropRight.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/dropRight.js deleted file mode 100644 index 61e1268..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/dropRight.js +++ /dev/null @@ -1,38 +0,0 @@ -var baseSlice = require('./_baseSlice'), - toInteger = require('./toInteger'); - -/** - * Creates a slice of `array` with `n` elements dropped from the end. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropRight([1, 2, 3]); - * // => [1, 2] - * - * _.dropRight([1, 2, 3], 2); - * // => [1] - * - * _.dropRight([1, 2, 3], 5); - * // => [] - * - * _.dropRight([1, 2, 3], 0); - * // => [1, 2, 3] - */ -function dropRight(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - n = length - n; - return baseSlice(array, 0, n < 0 ? 0 : n); -} - -module.exports = dropRight; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/dropRightWhile.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/dropRightWhile.js deleted file mode 100644 index 0c04ed2..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/dropRightWhile.js +++ /dev/null @@ -1,44 +0,0 @@ -var baseIteratee = require('./_baseIteratee'), - baseWhile = require('./_baseWhile'); - -/** - * Creates a slice of `array` excluding elements dropped from the end. - * Elements are dropped until `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.dropRightWhile(users, function(o) { return !o.active; }); - * // => objects for ['barney'] - * - * // The `_.matches` iteratee shorthand. - * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); - * // => objects for ['barney', 'fred'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.dropRightWhile(users, ['active', false]); - * // => objects for ['barney'] - * - * // The `_.property` iteratee shorthand. - * _.dropRightWhile(users, 'active'); - * // => objects for ['barney', 'fred', 'pebbles'] - */ -function dropRightWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, baseIteratee(predicate, 3), true, true) - : []; -} - -module.exports = dropRightWhile; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/dropWhile.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/dropWhile.js deleted file mode 100644 index 72f9448..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/dropWhile.js +++ /dev/null @@ -1,44 +0,0 @@ -var baseIteratee = require('./_baseIteratee'), - baseWhile = require('./_baseWhile'); - -/** - * Creates a slice of `array` excluding elements dropped from the beginning. - * Elements are dropped until `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.dropWhile(users, function(o) { return !o.active; }); - * // => objects for ['pebbles'] - * - * // The `_.matches` iteratee shorthand. - * _.dropWhile(users, { 'user': 'barney', 'active': false }); - * // => objects for ['fred', 'pebbles'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.dropWhile(users, ['active', false]); - * // => objects for ['pebbles'] - * - * // The `_.property` iteratee shorthand. - * _.dropWhile(users, 'active'); - * // => objects for ['barney', 'fred', 'pebbles'] - */ -function dropWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, baseIteratee(predicate, 3), true) - : []; -} - -module.exports = dropWhile; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/each.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/each.js deleted file mode 100644 index 8800f42..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/each.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./forEach'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/eachRight.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/eachRight.js deleted file mode 100644 index 3252b2a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/eachRight.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./forEachRight'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/endsWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/endsWith.js deleted file mode 100644 index 5da6b5e..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/endsWith.js +++ /dev/null @@ -1,39 +0,0 @@ -var baseClamp = require('./_baseClamp'), - toInteger = require('./toInteger'), - toString = require('./toString'); - -/** - * Checks if `string` ends with the given target string. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to search. - * @param {string} [target] The string to search for. - * @param {number} [position=string.length] The position to search from. - * @returns {boolean} Returns `true` if `string` ends with `target`, else `false`. - * @example - * - * _.endsWith('abc', 'c'); - * // => true - * - * _.endsWith('abc', 'b'); - * // => false - * - * _.endsWith('abc', 'b', 2); - * // => true - */ -function endsWith(string, target, position) { - string = toString(string); - target = typeof target == 'string' ? target : (target + ''); - - var length = string.length; - position = position === undefined - ? length - : baseClamp(toInteger(position), 0, length); - - position -= target.length; - return position >= 0 && string.indexOf(target, position) == position; -} - -module.exports = endsWith; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/eq.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/eq.js deleted file mode 100644 index 5df222d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/eq.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || (value !== value && other !== other); -} - -module.exports = eq; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/escape.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/escape.js deleted file mode 100644 index 62857ed..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/escape.js +++ /dev/null @@ -1,47 +0,0 @@ -var escapeHtmlChar = require('./_escapeHtmlChar'), - toString = require('./toString'); - -/** Used to match HTML entities and HTML characters. */ -var reUnescapedHtml = /[&<>"'`]/g, - reHasUnescapedHtml = RegExp(reUnescapedHtml.source); - -/** - * Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to - * their corresponding HTML entities. - * - * **Note:** No other characters are escaped. To escape additional - * characters use a third-party library like [_he_](https://mths.be/he). - * - * Though the ">" character is escaped for symmetry, characters like - * ">" and "/" don't need escaping in HTML and have no special meaning - * unless they're part of a tag or unquoted attribute value. - * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) - * (under "semi-related fun fact") for more details. - * - * Backticks are escaped because in IE < 9, they can break out of - * attribute values or HTML comments. See [#59](https://html5sec.org/#59), - * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and - * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/) - * for more details. - * - * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping) - * to reduce XSS vectors. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escape('fred, barney, & pebbles'); - * // => 'fred, barney, & pebbles' - */ -function escape(string) { - string = toString(string); - return (string && reHasUnescapedHtml.test(string)) - ? string.replace(reUnescapedHtml, escapeHtmlChar) - : string; -} - -module.exports = escape; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/escapeRegExp.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/escapeRegExp.js deleted file mode 100644 index 52878c1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/escapeRegExp.js +++ /dev/null @@ -1,28 +0,0 @@ -var toString = require('./toString'); - -/** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, - reHasRegExpChar = RegExp(reRegExpChar.source); - -/** - * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", - * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escapeRegExp('[lodash](https://lodash.com/)'); - * // => '\[lodash\]\(https://lodash\.com/\)' - */ -function escapeRegExp(string) { - string = toString(string); - return (string && reHasRegExpChar.test(string)) - ? string.replace(reRegExpChar, '\\$&') - : string; -} - -module.exports = escapeRegExp; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/every.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/every.js deleted file mode 100644 index d100d0d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/every.js +++ /dev/null @@ -1,49 +0,0 @@ -var arrayEvery = require('./_arrayEvery'), - baseEvery = require('./_baseEvery'), - baseIteratee = require('./_baseIteratee'), - isArray = require('./isArray'), - isIterateeCall = require('./_isIterateeCall'); - -/** - * Checks if `predicate` returns truthy for **all** elements of `collection`. - * Iteration is stopped once `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {boolean} Returns `true` if all elements pass the predicate check, else `false`. - * @example - * - * _.every([true, 1, null, 'yes'], Boolean); - * // => false - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.every(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.every(users, ['active', false]); - * // => true - * - * // The `_.property` iteratee shorthand. - * _.every(users, 'active'); - * // => false - */ -function every(collection, predicate, guard) { - var func = isArray(collection) ? arrayEvery : baseEvery; - if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined; - } - return func(collection, baseIteratee(predicate, 3)); -} - -module.exports = every; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/extend.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/extend.js deleted file mode 100644 index e00166c..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/extend.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./assignIn'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/extendWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/extendWith.js deleted file mode 100644 index dbdcb3b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/extendWith.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./assignInWith'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fill.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fill.js deleted file mode 100644 index 4c0119f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fill.js +++ /dev/null @@ -1,44 +0,0 @@ -var baseFill = require('./_baseFill'), - isIterateeCall = require('./_isIterateeCall'); - -/** - * Fills elements of `array` with `value` from `start` up to, but not - * including, `end`. - * - * **Note:** This method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.fill(array, 'a'); - * console.log(array); - * // => ['a', 'a', 'a'] - * - * _.fill(Array(3), 2); - * // => [2, 2, 2] - * - * _.fill([4, 6, 8, 10], '*', 1, 3); - * // => [4, '*', '*', 10] - */ -function fill(array, value, start, end) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { - start = 0; - end = length; - } - return baseFill(array, value, start, end); -} - -module.exports = fill; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/filter.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/filter.js deleted file mode 100644 index 1df81c4..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/filter.js +++ /dev/null @@ -1,44 +0,0 @@ -var arrayFilter = require('./_arrayFilter'), - baseFilter = require('./_baseFilter'), - baseIteratee = require('./_baseIteratee'), - isArray = require('./isArray'); - -/** - * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is invoked with three arguments: - * (value, index|key, collection). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * _.filter(users, function(o) { return !o.active; }); - * // => objects for ['fred'] - * - * // The `_.matches` iteratee shorthand. - * _.filter(users, { 'age': 36, 'active': true }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.filter(users, ['active', false]); - * // => objects for ['fred'] - * - * // The `_.property` iteratee shorthand. - * _.filter(users, 'active'); - * // => objects for ['barney'] - */ -function filter(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, baseIteratee(predicate, 3)); -} - -module.exports = filter; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/find.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/find.js deleted file mode 100644 index c2ba356..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/find.js +++ /dev/null @@ -1,50 +0,0 @@ -var baseEach = require('./_baseEach'), - baseFind = require('./_baseFind'), - baseFindIndex = require('./_baseFindIndex'), - baseIteratee = require('./_baseIteratee'), - isArray = require('./isArray'); - -/** - * Iterates over elements of `collection`, returning the first element - * `predicate` returns truthy for. The predicate is invoked with three arguments: - * (value, index|key, collection). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false }, - * { 'user': 'pebbles', 'age': 1, 'active': true } - * ]; - * - * _.find(users, function(o) { return o.age < 40; }); - * // => object for 'barney' - * - * // The `_.matches` iteratee shorthand. - * _.find(users, { 'age': 1, 'active': true }); - * // => object for 'pebbles' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.find(users, ['active', false]); - * // => object for 'fred' - * - * // The `_.property` iteratee shorthand. - * _.find(users, 'active'); - * // => object for 'barney' - */ -function find(collection, predicate) { - predicate = baseIteratee(predicate, 3); - if (isArray(collection)) { - var index = baseFindIndex(collection, predicate); - return index > -1 ? collection[index] : undefined; - } - return baseFind(collection, predicate, baseEach); -} - -module.exports = find; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/findIndex.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/findIndex.js deleted file mode 100644 index 5343fd1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/findIndex.js +++ /dev/null @@ -1,43 +0,0 @@ -var baseFindIndex = require('./_baseFindIndex'), - baseIteratee = require('./_baseIteratee'); - -/** - * This method is like `_.find` except that it returns the index of the first - * element `predicate` returns truthy for instead of the element itself. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.findIndex(users, function(o) { return o.user == 'barney'; }); - * // => 0 - * - * // The `_.matches` iteratee shorthand. - * _.findIndex(users, { 'user': 'fred', 'active': false }); - * // => 1 - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findIndex(users, ['active', false]); - * // => 0 - * - * // The `_.property` iteratee shorthand. - * _.findIndex(users, 'active'); - * // => 2 - */ -function findIndex(array, predicate) { - return (array && array.length) - ? baseFindIndex(array, baseIteratee(predicate, 3)) - : -1; -} - -module.exports = findIndex; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/findKey.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/findKey.js deleted file mode 100644 index 95d01f3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/findKey.js +++ /dev/null @@ -1,42 +0,0 @@ -var baseFind = require('./_baseFind'), - baseForOwn = require('./_baseForOwn'), - baseIteratee = require('./_baseIteratee'); - -/** - * This method is like `_.find` except that it returns the key of the first - * element `predicate` returns truthy for instead of the element itself. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {string|undefined} Returns the key of the matched element, else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findKey(users, function(o) { return o.age < 40; }); - * // => 'barney' (iteration order is not guaranteed) - * - * // The `_.matches` iteratee shorthand. - * _.findKey(users, { 'age': 1, 'active': true }); - * // => 'pebbles' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findKey(users, ['active', false]); - * // => 'fred' - * - * // The `_.property` iteratee shorthand. - * _.findKey(users, 'active'); - * // => 'barney' - */ -function findKey(object, predicate) { - return baseFind(object, baseIteratee(predicate, 3), baseForOwn, true); -} - -module.exports = findKey; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/findLast.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/findLast.js deleted file mode 100644 index 0e5d593..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/findLast.js +++ /dev/null @@ -1,33 +0,0 @@ -var baseEachRight = require('./_baseEachRight'), - baseFind = require('./_baseFind'), - baseFindIndex = require('./_baseFindIndex'), - baseIteratee = require('./_baseIteratee'), - isArray = require('./isArray'); - -/** - * This method is like `_.find` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * _.findLast([1, 2, 3, 4], function(n) { - * return n % 2 == 1; - * }); - * // => 3 - */ -function findLast(collection, predicate) { - predicate = baseIteratee(predicate, 3); - if (isArray(collection)) { - var index = baseFindIndex(collection, predicate, true); - return index > -1 ? collection[index] : undefined; - } - return baseFind(collection, predicate, baseEachRight); -} - -module.exports = findLast; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/findLastIndex.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/findLastIndex.js deleted file mode 100644 index 2e62b36..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/findLastIndex.js +++ /dev/null @@ -1,43 +0,0 @@ -var baseFindIndex = require('./_baseFindIndex'), - baseIteratee = require('./_baseIteratee'); - -/** - * This method is like `_.findIndex` except that it iterates over elements - * of `collection` from right to left. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); - * // => 2 - * - * // The `_.matches` iteratee shorthand. - * _.findLastIndex(users, { 'user': 'barney', 'active': true }); - * // => 0 - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findLastIndex(users, ['active', false]); - * // => 2 - * - * // The `_.property` iteratee shorthand. - * _.findLastIndex(users, 'active'); - * // => 0 - */ -function findLastIndex(array, predicate) { - return (array && array.length) - ? baseFindIndex(array, baseIteratee(predicate, 3), true) - : -1; -} - -module.exports = findLastIndex; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/findLastKey.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/findLastKey.js deleted file mode 100644 index 0380b07..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/findLastKey.js +++ /dev/null @@ -1,42 +0,0 @@ -var baseFind = require('./_baseFind'), - baseForOwnRight = require('./_baseForOwnRight'), - baseIteratee = require('./_baseIteratee'); - -/** - * This method is like `_.findKey` except that it iterates over elements of - * a collection in the opposite order. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {string|undefined} Returns the key of the matched element, else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findLastKey(users, function(o) { return o.age < 40; }); - * // => returns 'pebbles' assuming `_.findKey` returns 'barney' - * - * // The `_.matches` iteratee shorthand. - * _.findLastKey(users, { 'age': 36, 'active': true }); - * // => 'barney' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findLastKey(users, ['active', false]); - * // => 'fred' - * - * // The `_.property` iteratee shorthand. - * _.findLastKey(users, 'active'); - * // => 'pebbles' - */ -function findLastKey(object, predicate) { - return baseFind(object, baseIteratee(predicate, 3), baseForOwnRight, true); -} - -module.exports = findLastKey; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/flatMap.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/flatMap.js deleted file mode 100644 index 1aaf28c..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/flatMap.js +++ /dev/null @@ -1,28 +0,0 @@ -var baseFlatten = require('./_baseFlatten'), - map = require('./map'); - -/** - * Creates an array of flattened values by running each element in `collection` - * through `iteratee` and concating its result to the other mapped values. - * The iteratee is invoked with three arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [n, n]; - * } - * - * _.flatMap([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ -function flatMap(collection, iteratee) { - return baseFlatten(map(collection, iteratee)); -} - -module.exports = flatMap; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/flatten.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/flatten.js deleted file mode 100644 index 6a6b8cf..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/flatten.js +++ /dev/null @@ -1,21 +0,0 @@ -var baseFlatten = require('./_baseFlatten'); - -/** - * Flattens `array` a single level. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flatten([1, [2, 3, [4]]]); - * // => [1, 2, 3, [4]] - */ -function flatten(array) { - var length = array ? array.length : 0; - return length ? baseFlatten(array) : []; -} - -module.exports = flatten; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/flattenDeep.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/flattenDeep.js deleted file mode 100644 index 3daab79..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/flattenDeep.js +++ /dev/null @@ -1,21 +0,0 @@ -var baseFlatten = require('./_baseFlatten'); - -/** - * This method is like `_.flatten` except that it recursively flattens `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to recursively flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flattenDeep([1, [2, 3, [4]]]); - * // => [1, 2, 3, 4] - */ -function flattenDeep(array) { - var length = array ? array.length : 0; - return length ? baseFlatten(array, true) : []; -} - -module.exports = flattenDeep; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/flip.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/flip.js deleted file mode 100644 index 6e14896..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/flip.js +++ /dev/null @@ -1,27 +0,0 @@ -var createWrapper = require('./_createWrapper'); - -/** Used to compose bitmasks for wrapper metadata. */ -var FLIP_FLAG = 512; - -/** - * Creates a function that invokes `func` with arguments reversed. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to flip arguments for. - * @returns {Function} Returns the new function. - * @example - * - * var flipped = _.flip(function() { - * return _.toArray(arguments); - * }); - * - * flipped('a', 'b', 'c', 'd'); - * // => ['d', 'c', 'b', 'a'] - */ -function flip(func) { - return createWrapper(func, FLIP_FLAG); -} - -module.exports = flip; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/floor.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/floor.js deleted file mode 100644 index 9bbf097..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/floor.js +++ /dev/null @@ -1,25 +0,0 @@ -var createRound = require('./_createRound'); - -/** - * Computes `number` rounded down to `precision`. - * - * @static - * @memberOf _ - * @category Math - * @param {number} number The number to round down. - * @param {number} [precision=0] The precision to round down to. - * @returns {number} Returns the rounded down number. - * @example - * - * _.floor(4.006); - * // => 4 - * - * _.floor(0.046, 2); - * // => 0.04 - * - * _.floor(4060, -2); - * // => 4000 - */ -var floor = createRound('floor'); - -module.exports = floor; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/flow.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/flow.js deleted file mode 100644 index a69e914..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/flow.js +++ /dev/null @@ -1,25 +0,0 @@ -var createFlow = require('./_createFlow'); - -/** - * Creates a function that returns the result of invoking the provided - * functions with the `this` binding of the created function, where each - * successive invocation is supplied the return value of the previous. - * - * @static - * @memberOf _ - * @category Util - * @param {...(Function|Function[])} [funcs] Functions to invoke. - * @returns {Function} Returns the new function. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var addSquare = _.flow(_.add, square); - * addSquare(1, 2); - * // => 9 - */ -var flow = createFlow(); - -module.exports = flow; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/flowRight.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/flowRight.js deleted file mode 100644 index 4164a8b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/flowRight.js +++ /dev/null @@ -1,24 +0,0 @@ -var createFlow = require('./_createFlow'); - -/** - * This method is like `_.flow` except that it creates a function that - * invokes the provided functions from right to left. - * - * @static - * @memberOf _ - * @category Util - * @param {...(Function|Function[])} [funcs] Functions to invoke. - * @returns {Function} Returns the new function. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var addSquare = _.flowRight(square, _.add); - * addSquare(1, 2); - * // => 9 - */ -var flowRight = createFlow(true); - -module.exports = flowRight; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/forEach.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/forEach.js deleted file mode 100644 index e7bde6d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/forEach.js +++ /dev/null @@ -1,40 +0,0 @@ -var arrayEach = require('./_arrayEach'), - baseEach = require('./_baseEach'), - isArray = require('./isArray'), - toFunction = require('./_toFunction'); - -/** - * Iterates over elements of `collection` invoking `iteratee` for each element. - * The iteratee is invoked with three arguments: (value, index|key, collection). - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * **Note:** As with other "Collections" methods, objects with a "length" property - * are iterated like arrays. To avoid this behavior use `_.forIn` or `_.forOwn` - * for object iteration. - * - * @static - * @memberOf _ - * @alias each - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - * @example - * - * _([1, 2]).forEach(function(value) { - * console.log(value); - * }); - * // => logs `1` then `2` - * - * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { - * console.log(key); - * }); - * // => logs 'a' then 'b' (iteration order is not guaranteed) - */ -function forEach(collection, iteratee) { - return (typeof iteratee == 'function' && isArray(collection)) - ? arrayEach(collection, iteratee) - : baseEach(collection, toFunction(iteratee)); -} - -module.exports = forEach; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/forEachRight.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/forEachRight.js deleted file mode 100644 index 68f2e2f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/forEachRight.js +++ /dev/null @@ -1,30 +0,0 @@ -var arrayEachRight = require('./_arrayEachRight'), - baseEachRight = require('./_baseEachRight'), - isArray = require('./isArray'), - toFunction = require('./_toFunction'); - -/** - * This method is like `_.forEach` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @alias eachRight - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - * @example - * - * _.forEachRight([1, 2], function(value) { - * console.log(value); - * }); - * // => logs `2` then `1` - */ -function forEachRight(collection, iteratee) { - return (typeof iteratee == 'function' && isArray(collection)) - ? arrayEachRight(collection, iteratee) - : baseEachRight(collection, toFunction(iteratee)); -} - -module.exports = forEachRight; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/forIn.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/forIn.js deleted file mode 100644 index d68dd3a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/forIn.js +++ /dev/null @@ -1,35 +0,0 @@ -var baseFor = require('./_baseFor'), - keysIn = require('./keysIn'), - toFunction = require('./_toFunction'); - -/** - * Iterates over own and inherited enumerable properties of an object invoking - * `iteratee` for each property. The iteratee is invoked with three arguments: - * (value, key, object). Iteratee functions may exit iteration early by explicitly - * returning `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forIn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'a', 'b', then 'c' (iteration order is not guaranteed) - */ -function forIn(object, iteratee) { - return object == null ? object : baseFor(object, toFunction(iteratee), keysIn); -} - -module.exports = forIn; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/forInRight.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/forInRight.js deleted file mode 100644 index 9dedc25..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/forInRight.js +++ /dev/null @@ -1,33 +0,0 @@ -var baseForRight = require('./_baseForRight'), - keysIn = require('./keysIn'), - toFunction = require('./_toFunction'); - -/** - * This method is like `_.forIn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forInRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c' - */ -function forInRight(object, iteratee) { - return object == null ? object : baseForRight(object, toFunction(iteratee), keysIn); -} - -module.exports = forInRight; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/forOwn.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/forOwn.js deleted file mode 100644 index ee066cc..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/forOwn.js +++ /dev/null @@ -1,34 +0,0 @@ -var baseForOwn = require('./_baseForOwn'), - toFunction = require('./_toFunction'); - -/** - * Iterates over own enumerable properties of an object invoking `iteratee` - * for each property. The iteratee is invoked with three arguments: - * (value, key, object). Iteratee functions may exit iteration early by - * explicitly returning `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'a' then 'b' (iteration order is not guaranteed) - */ -function forOwn(object, iteratee) { - return object && baseForOwn(object, toFunction(iteratee)); -} - -module.exports = forOwn; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/forOwnRight.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/forOwnRight.js deleted file mode 100644 index 1016195..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/forOwnRight.js +++ /dev/null @@ -1,32 +0,0 @@ -var baseForOwnRight = require('./_baseForOwnRight'), - toFunction = require('./_toFunction'); - -/** - * This method is like `_.forOwn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwnRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b' - */ -function forOwnRight(object, iteratee) { - return object && baseForOwnRight(object, toFunction(iteratee)); -} - -module.exports = forOwnRight; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp.js deleted file mode 100644 index d8887e0..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp.js +++ /dev/null @@ -1,2 +0,0 @@ -var _ = require('./lodash').noConflict().runInContext(); -module.exports = require('./fp/convert')(_); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/_baseConvert.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/_baseConvert.js deleted file mode 100644 index 2af63a7..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/_baseConvert.js +++ /dev/null @@ -1,237 +0,0 @@ -var mapping = require('./_mapping'), - mutateMap = mapping.mutate, - placeholder = {}; - -/** - * The base implementation of `convert` which accepts a `util` object of methods - * required to perform conversions. - * - * @param {Object} util The util object. - * @param {string} name The name of the function to wrap. - * @param {Function} func The function to wrap. - * @returns {Function|Object} Returns the converted function or object. - */ -function baseConvert(util, name, func) { - if (typeof func != 'function') { - func = name; - name = undefined; - } - if (func == null) { - throw new TypeError; - } - var isLib = name === undefined && typeof func.VERSION == 'string'; - - var _ = isLib ? func : { - 'ary': util.ary, - 'cloneDeep': util.cloneDeep, - 'curry': util.curry, - 'forEach': util.forEach, - 'isFunction': util.isFunction, - 'iteratee': util.iteratee, - 'keys': util.keys, - 'rearg': util.rearg, - 'spread': util.spread - }; - - var ary = _.ary, - cloneDeep = _.cloneDeep, - curry = _.curry, - each = _.forEach, - isFunction = _.isFunction, - keys = _.keys, - rearg = _.rearg, - spread = _.spread; - - var baseArity = function(func, n) { - return n == 2 - ? function(a, b) { return func.apply(undefined, arguments); } - : function(a) { return func.apply(undefined, arguments); }; - }; - - var baseAry = function(func, n) { - return n == 2 - ? function(a, b) { return func(a, b); } - : function(a) { return func(a); }; - }; - - var cloneArray = function(array) { - var length = array ? array.length : 0, - result = Array(length); - - while (length--) { - result[length] = array[length]; - } - return result; - }; - - var createCloner = function(func) { - return function(object) { - return func({}, object); - }; - }; - - var immutWrap = function(func, cloner) { - return overArg(func, cloner, true); - }; - - var iterateeAry = function(func, n) { - return overArg(func, function(func) { - return baseAry(func, n); - }); - }; - - var iterateeRearg = function(func, indexes) { - return overArg(func, function(func) { - var n = indexes.length; - return baseArity(rearg(baseAry(func, n), indexes), n); - }); - }; - - var overArg = function(func, iteratee, retArg) { - return function() { - var length = arguments.length, - args = Array(length); - - while (length--) { - args[length] = arguments[length]; - } - args[0] = iteratee(args[0]); - var result = func.apply(undefined, args); - return retArg ? args[0] : result; - }; - }; - - var wrappers = { - 'iteratee': function(iteratee) { - return function() { - var func = arguments[0], - arity = arguments[1]; - - arity = arity > 2 ? (arity - 2) : 1; - func = iteratee(func); - var length = func.length; - return (length && length <= arity) ? func : baseAry(func, arity); - }; - }, - 'mixin': function(mixin) { - return function(source) { - var func = this; - if (!isFunction(func)) { - return mixin(func, Object(source)); - } - var methods = [], - methodNames = []; - - each(keys(source), function(key) { - var value = source[key]; - if (isFunction(value)) { - methodNames.push(key); - methods.push(func.prototype[key]); - } - }); - - mixin(func, Object(source)); - - each(methodNames, function(methodName, index) { - var method = methods[index]; - if (isFunction(method)) { - func.prototype[methodName] = method; - } else { - delete func.prototype[methodName]; - } - }); - return func; - }; - }, - 'runInContext': function(runInContext) { - return function(context) { - return baseConvert(util, runInContext(context)); - }; - } - }; - - var wrap = function(name, func) { - name = mapping.aliasToReal[name] || name; - var wrapper = wrappers[name]; - if (wrapper) { - return wrapper(func); - } - var wrapped = func; - if (mutateMap.array[name]) { - wrapped = immutWrap(func, cloneArray); - } - else if (mutateMap.object[name]) { - wrapped = immutWrap(func, createCloner(func)); - } - else if (mutateMap.set[name]) { - wrapped = immutWrap(func, cloneDeep); - } - var result; - each(mapping.caps, function(cap) { - each(mapping.aryMethod[cap], function(otherName) { - if (name == otherName) { - var aryN = !isLib && mapping.iterateeAry[name], - reargIndexes = mapping.iterateeRearg[name], - spreadStart = mapping.methodSpread[name]; - - result = spreadStart === undefined - ? ary(wrapped, cap) - : spread(wrapped, spreadStart); - - if (cap > 1 && !mapping.skipRearg[name]) { - result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[cap]); - } - if (reargIndexes) { - result = iterateeRearg(result, reargIndexes); - } else if (aryN) { - result = iterateeAry(result, aryN); - } - if (cap > 1) { - result = curry(result, cap); - } - return false; - } - }); - return !result; - }); - - result || (result = func); - if (mapping.placeholder[name]) { - func.placeholder = result.placeholder = placeholder; - } - return result; - }; - - if (!isLib) { - return wrap(name, func); - } - // Add placeholder. - _.placeholder = placeholder; - - // Iterate over methods for the current ary cap. - var pairs = []; - each(mapping.caps, function(cap) { - each(mapping.aryMethod[cap], function(key) { - var func = _[mapping.rename[key] || key]; - if (func) { - pairs.push([key, wrap(key, func)]); - } - }); - }); - - // Assign to `_` leaving `_.prototype` unchanged to allow chaining. - each(pairs, function(pair) { - _[pair[0]] = pair[1]; - }); - - // Wrap the lodash method and its aliases. - each(keys(_), function(key) { - each(mapping.realToAlias[key] || [], function(alias) { - _[alias] = _[key]; - }); - }); - - return _; -} - -module.exports = baseConvert; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/_convertBrowser.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/_convertBrowser.js deleted file mode 100644 index b076778..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/_convertBrowser.js +++ /dev/null @@ -1,13 +0,0 @@ -var baseConvert = require('./_baseConvert'); - -/** - * Converts `lodash` to an immutable auto-curried iteratee-first data-last version. - * - * @param {Function} lodash The lodash function. - * @returns {Function} Returns the converted `lodash`. - */ -function browserConvert(lodash) { - return baseConvert(lodash, lodash); -} - -module.exports = browserConvert; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/_mapping.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/_mapping.js deleted file mode 100644 index 8b8e24b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/_mapping.js +++ /dev/null @@ -1,239 +0,0 @@ -/** Used to map aliases to their real names. */ -exports.aliasToReal = { - '__': 'placeholder', - 'all': 'some', - 'allPass': 'overEvery', - 'apply': 'spread', - 'assoc': 'set', - 'assocPath': 'set', - 'compose': 'flowRight', - 'contains': 'includes', - 'dissoc': 'unset', - 'dissocPath': 'unset', - 'each': 'forEach', - 'eachRight': 'forEachRight', - 'equals': 'isEqual', - 'extend': 'assignIn', - 'extendWith': 'assignInWith', - 'first': 'head', - 'init': 'initial', - 'mapObj': 'mapValues', - 'omitAll': 'omit', - 'nAry': 'ary', - 'path': 'get', - 'pathEq': 'matchesProperty', - 'pathOr': 'getOr', - 'pickAll': 'pick', - 'pipe': 'flow', - 'prop': 'get', - 'propOf': 'propertyOf', - 'propOr': 'getOr', - 'somePass': 'overSome', - 'unapply': 'rest', - 'unnest': 'flatten', - 'useWith': 'overArgs', - 'whereEq': 'filter', - 'zipObj': 'zipObject' -}; - -/** Used to map ary to method names. */ -exports.aryMethod = { - 1: [ - 'attempt', 'ceil', 'create', 'curry', 'curryRight', 'floor', 'fromPairs', - 'invert', 'iteratee', 'memoize', 'method', 'methodOf', 'mixin', 'over', - 'overEvery', 'overSome', 'rest', 'reverse', 'round', 'runInContext', - 'spread', 'template', 'trim', 'trimEnd', 'trimStart', 'uniqueId', 'words' - ], - 2: [ - 'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindKey', - 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN', - 'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference', - 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', 'every', - 'filter', 'find', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex', - 'findLastKey', 'flatMap', 'forEach', 'forEachRight', 'forIn', 'forInRight', - 'forOwn', 'forOwnRight', 'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', - 'includes', 'indexOf', 'intersection', 'invertBy', 'invoke', 'invokeMap', - 'isEqual', 'isMatch', 'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', - 'mapKeys', 'mapValues', 'matchesProperty', 'maxBy', 'merge', 'minBy', 'omit', - 'omitBy', 'orderBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', - 'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll', - 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', - 'repeat', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', - 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', - 'split', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile', - 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars', 'trimCharsEnd', - 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith', 'unset', - 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject', 'zipObjectDeep' - ], - 3: [ - 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', - 'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'isEqualWith', - 'isMatchWith', 'mergeWith', 'pullAllBy', 'reduce', 'reduceRight', 'replace', - 'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', - 'unionWith', 'xorBy', 'xorWith', 'zipWith' - ], - 4: [ - 'fill', 'setWith' - ] -}; - -/** Used to map ary to rearg configs. */ -exports.aryRearg = { - 2: [1, 0], - 3: [2, 1, 0], - 4: [3, 2, 0, 1] -}; - -/** Used to iterate `mapping.aryMethod` keys. */ -exports.caps = [1, 2, 3, 4]; - -/** Used to map method names to their iteratee ary. */ -exports.iterateeAry = { - 'assignWith': 2, - 'assignInWith': 2, - 'cloneDeepWith': 1, - 'cloneWith': 1, - 'dropRightWhile': 1, - 'dropWhile': 1, - 'every': 1, - 'filter': 1, - 'find': 1, - 'findIndex': 1, - 'findKey': 1, - 'findLast': 1, - 'findLastIndex': 1, - 'findLastKey': 1, - 'flatMap': 1, - 'forEach': 1, - 'forEachRight': 1, - 'forIn': 1, - 'forInRight': 1, - 'forOwn': 1, - 'forOwnRight': 1, - 'isEqualWith': 2, - 'isMatchWith': 2, - 'map': 1, - 'mapKeys': 1, - 'mapValues': 1, - 'partition': 1, - 'reduce': 2, - 'reduceRight': 2, - 'reject': 1, - 'remove': 1, - 'some': 1, - 'takeRightWhile': 1, - 'takeWhile': 1, - 'times': 1, - 'transform': 2 -}; - -/** Used to map method names to iteratee rearg configs. */ -exports.iterateeRearg = { - 'findKey': [1], - 'findLastKey': [1], - 'mapKeys': [1] -}; - -/** Used to map method names to rearg configs. */ -exports.methodRearg = { - 'assignInWith': [1, 2, 0], - 'assignWith': [1, 2, 0], - 'clamp': [2, 0, 1], - 'mergeWith': [1, 2, 0], - 'reduce': [2, 0, 1], - 'reduceRight': [2, 0, 1], - 'set': [2, 0, 1], - 'setWith': [3, 1, 2, 0], - 'slice': [2, 0, 1], - 'transform': [2, 0, 1] -}; - -/** Used to map method names to spread configs. */ -exports.methodSpread = { - 'partial': 1, - 'partialRight': 1 -}; - -/** Used to identify methods which mutate arrays or objects. */ -exports.mutate = { - 'array': { - 'fill': true, - 'pull': true, - 'pullAll': true, - 'pullAllBy': true, - 'pullAt': true, - 'remove': true, - 'reverse': true - }, - 'object': { - 'assign': true, - 'assignIn': true, - 'assignInWith': true, - 'assignWith': true, - 'defaults': true, - 'defaultsDeep': true, - 'merge': true, - 'mergeWith': true - }, - 'set': { - 'set': true, - 'setWith': true, - 'unset': true - } -}; - -/** Used to track methods with placeholder support */ -exports.placeholder = { - 'bind': true, - 'bindKey': true, - 'curry': true, - 'curryRight': true, - 'partial': true, - 'partialRight': true -}; - -/** Used to map real names to their aliases. */ -exports.realToAlias = (function() { - var hasOwnProperty = Object.prototype.hasOwnProperty, - object = exports.aliasToReal, - result = {}; - - for (var key in object) { - var value = object[key]; - if (hasOwnProperty.call(result, value)) { - result[value].push(key); - } else { - result[value] = [key]; - } - } - return result; -}()); - -/** Used to map method names to other names. */ -exports.rename = { - 'curryN': 'curry', - 'curryRightN': 'curryRight', - 'getOr': 'get', - 'trimChars': 'trim', - 'trimCharsEnd': 'trimEnd', - 'trimCharsStart': 'trimStart' -}; - -/** Used to track methods that skip `_.rearg`. */ -exports.skipRearg = { - 'add': true, - 'assign': true, - 'assignIn': true, - 'concat': true, - 'difference': true, - 'matchesProperty': true, - 'merge': true, - 'partial': true, - 'partialRight': true, - 'random': true, - 'range': true, - 'rangeRight': true, - 'subtract': true, - 'zip': true, - 'zipObject': true -}; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/_util.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/_util.js deleted file mode 100644 index e1baf3b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/_util.js +++ /dev/null @@ -1,11 +0,0 @@ -module.exports = { - 'ary': require('../ary'), - 'cloneDeep': require('../cloneDeep'), - 'curry': require('../curry'), - 'forEach': require('../_arrayEach'), - 'isFunction': require('../isFunction'), - 'iteratee': require('../iteratee'), - 'keys': require('../_baseKeys'), - 'rearg': require('../rearg'), - 'spread': require('../spread') -}; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/add.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/add.js deleted file mode 100644 index c51b8fa..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/add.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('add', require('../add')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/after.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/after.js deleted file mode 100644 index 83691b7..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/after.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('after', require('../after')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/all.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/all.js deleted file mode 100644 index 900ac25..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/all.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./some'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/allPass.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/allPass.js deleted file mode 100644 index 79b73ef..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/allPass.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./overEvery'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/apply.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/apply.js deleted file mode 100644 index 2b75712..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/apply.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./spread'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/array.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/array.js deleted file mode 100644 index fe939c2..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/array.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert(require('../array')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/ary.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/ary.js deleted file mode 100644 index 0f75d18..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/ary.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('ary', require('../ary')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/assign.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/assign.js deleted file mode 100644 index ad02bcb..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/assign.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('assign', require('../assign')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/assignIn.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/assignIn.js deleted file mode 100644 index 1ed4f0d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/assignIn.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('assignIn', require('../assignIn')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/assignInWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/assignInWith.js deleted file mode 100644 index 882145d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/assignInWith.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('assignInWith', require('../assignInWith')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/assignWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/assignWith.js deleted file mode 100644 index 1ff0527..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/assignWith.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('assignWith', require('../assignWith')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/assoc.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/assoc.js deleted file mode 100644 index 7648820..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/assoc.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./set'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/assocPath.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/assocPath.js deleted file mode 100644 index 7648820..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/assocPath.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./set'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/at.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/at.js deleted file mode 100644 index 5da3525..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/at.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('at', require('../at')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/attempt.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/attempt.js deleted file mode 100644 index d8a3be5..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/attempt.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('attempt', require('../attempt')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/before.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/before.js deleted file mode 100644 index f2954a6..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/before.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('before', require('../before')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/bind.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/bind.js deleted file mode 100644 index e054a48..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/bind.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('bind', require('../bind')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/bindAll.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/bindAll.js deleted file mode 100644 index 495b75c..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/bindAll.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../bindAll'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/bindKey.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/bindKey.js deleted file mode 100644 index 0b588c7..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/bindKey.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('bindKey', require('../bindKey')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/camelCase.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/camelCase.js deleted file mode 100644 index 328041e..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/camelCase.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../camelCase'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/capitalize.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/capitalize.js deleted file mode 100644 index 186e6d9..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/capitalize.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../capitalize'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/ceil.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/ceil.js deleted file mode 100644 index 7c3774b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/ceil.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('ceil', require('../ceil')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/chain.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/chain.js deleted file mode 100644 index 2f139cc..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/chain.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../chain'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/chunk.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/chunk.js deleted file mode 100644 index 9d32b8a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('chunk', require('../chunk')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/clamp.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/clamp.js deleted file mode 100644 index 8ec3d9d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/clamp.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('clamp', require('../clamp')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/clone.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/clone.js deleted file mode 100644 index afd2c15..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/clone.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../clone'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/cloneDeep.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/cloneDeep.js deleted file mode 100644 index a17a6f8..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/cloneDeep.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../cloneDeep'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/cloneDeepWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/cloneDeepWith.js deleted file mode 100644 index 01c7fef..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/cloneDeepWith.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('cloneDeepWith', require('../cloneDeepWith')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/cloneWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/cloneWith.js deleted file mode 100644 index 9e9d783..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/cloneWith.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('cloneWith', require('../cloneWith')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/collection.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/collection.js deleted file mode 100644 index fc8b328..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/collection.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert(require('../collection')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/commit.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/commit.js deleted file mode 100644 index 04e9eb9..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/commit.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../commit'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/compact.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/compact.js deleted file mode 100644 index b2ed9c7..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/compact.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../compact'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/compose.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/compose.js deleted file mode 100644 index 1954e94..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/compose.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./flowRight'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/concat.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/concat.js deleted file mode 100644 index c13a92a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/concat.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('concat', require('../concat')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/cond.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/cond.js deleted file mode 100644 index a150a89..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/cond.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../cond'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/conforms.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/conforms.js deleted file mode 100644 index 387dde1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/conforms.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../conforms'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/constant.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/constant.js deleted file mode 100644 index 3bcd276..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/constant.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../constant'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/contains.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/contains.js deleted file mode 100644 index 594722a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/contains.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./includes'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/convert.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/convert.js deleted file mode 100644 index 85f3b75..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/convert.js +++ /dev/null @@ -1,16 +0,0 @@ -var baseConvert = require('./_baseConvert'), - util = require('./_util'); - -/** - * Converts `func` of `name` to an immutable auto-curried iteratee-first data-last - * version. If `name` is an object its methods will be converted. - * - * @param {string} name The name of the function to wrap. - * @param {Function} [func] The function to wrap. - * @returns {Function|Object} Returns the converted function or object. - */ -function convert(name, func) { - return baseConvert(util, name, func); -} - -module.exports = convert; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/countBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/countBy.js deleted file mode 100644 index ee4b942..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/countBy.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('countBy', require('../countBy')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/create.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/create.js deleted file mode 100644 index bdad771..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/create.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('create', require('../create')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/curry.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/curry.js deleted file mode 100644 index d64722c..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/curry.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('curry', require('../curry')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/curryN.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/curryN.js deleted file mode 100644 index f33f7fc..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/curryN.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('curryN', require('../curry')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/curryRight.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/curryRight.js deleted file mode 100644 index 2e04709..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/curryRight.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('curryRight', require('../curryRight')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/curryRightN.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/curryRightN.js deleted file mode 100644 index 510e4e4..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/curryRightN.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('curryRightN', require('../curryRight')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/date.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/date.js deleted file mode 100644 index 82cb952..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/date.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert(require('../date')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/debounce.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/debounce.js deleted file mode 100644 index a6b0407..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/debounce.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('debounce', require('../debounce')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/deburr.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/deburr.js deleted file mode 100644 index f8e1a49..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/deburr.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../deburr'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/defaults.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/defaults.js deleted file mode 100644 index 7c3b3ab..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/defaults.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('defaults', require('../defaults')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/defaultsDeep.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/defaultsDeep.js deleted file mode 100644 index c7480e2..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/defaultsDeep.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('defaultsDeep', require('../defaultsDeep')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/defer.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/defer.js deleted file mode 100644 index 4126727..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/defer.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../defer'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/delay.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/delay.js deleted file mode 100644 index cd3b1c3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/delay.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('delay', require('../delay')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/difference.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/difference.js deleted file mode 100644 index aea9ab8..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/difference.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('difference', require('../difference')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/differenceBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/differenceBy.js deleted file mode 100644 index ab65554..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/differenceBy.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('differenceBy', require('../differenceBy')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/differenceWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/differenceWith.js deleted file mode 100644 index f932a2e..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/differenceWith.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('differenceWith', require('../differenceWith')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/dissoc.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/dissoc.js deleted file mode 100644 index 7ec7be1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/dissoc.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./unset'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/dissocPath.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/dissocPath.js deleted file mode 100644 index 7ec7be1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/dissocPath.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./unset'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/drop.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/drop.js deleted file mode 100644 index ccca2d0..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/drop.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('drop', require('../drop')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/dropRight.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/dropRight.js deleted file mode 100644 index bd9a2bd..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/dropRight.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('dropRight', require('../dropRight')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/dropRightWhile.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/dropRightWhile.js deleted file mode 100644 index 2dbb2a3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/dropRightWhile.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('dropRightWhile', require('../dropRightWhile')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/dropWhile.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/dropWhile.js deleted file mode 100644 index 17e46ff..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/dropWhile.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('dropWhile', require('../dropWhile')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/each.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/each.js deleted file mode 100644 index 8800f42..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/each.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./forEach'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/eachRight.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/eachRight.js deleted file mode 100644 index 3252b2a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/eachRight.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./forEachRight'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/endsWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/endsWith.js deleted file mode 100644 index cbe8f8c..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/endsWith.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('endsWith', require('../endsWith')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/eq.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/eq.js deleted file mode 100644 index 518a54d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/eq.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('eq', require('../eq')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/equals.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/equals.js deleted file mode 100644 index e6a5ce0..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/equals.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./isEqual'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/escape.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/escape.js deleted file mode 100644 index e5de9f2..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/escape.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../escape'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/escapeRegExp.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/escapeRegExp.js deleted file mode 100644 index ab18963..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/escapeRegExp.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../escapeRegExp'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/every.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/every.js deleted file mode 100644 index 965f889..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/every.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('every', require('../every')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/extend.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/extend.js deleted file mode 100644 index e00166c..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/extend.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./assignIn'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/extendWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/extendWith.js deleted file mode 100644 index dbdcb3b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/extendWith.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./assignInWith'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/fill.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/fill.js deleted file mode 100644 index e16f8bf..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/fill.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('fill', require('../fill')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/filter.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/filter.js deleted file mode 100644 index 7191a82..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/filter.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('filter', require('../filter')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/find.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/find.js deleted file mode 100644 index 5915bbd..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/find.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('find', require('../find')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/findIndex.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/findIndex.js deleted file mode 100644 index 6bf435c..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/findIndex.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('findIndex', require('../findIndex')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/findKey.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/findKey.js deleted file mode 100644 index 3ff9844..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/findKey.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('findKey', require('../findKey')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/findLast.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/findLast.js deleted file mode 100644 index 31e169b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/findLast.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('findLast', require('../findLast')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/findLastIndex.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/findLastIndex.js deleted file mode 100644 index db41e88..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/findLastIndex.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('findLastIndex', require('../findLastIndex')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/findLastKey.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/findLastKey.js deleted file mode 100644 index ffe9e2a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/findLastKey.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('findLastKey', require('../findLastKey')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/first.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/first.js deleted file mode 100644 index 53f4ad1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/first.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./head'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/flatMap.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/flatMap.js deleted file mode 100644 index da249a8..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/flatMap.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('flatMap', require('../flatMap')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/flatten.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/flatten.js deleted file mode 100644 index f1c1a62..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/flatten.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../flatten'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/flattenDeep.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/flattenDeep.js deleted file mode 100644 index c2ff987..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/flattenDeep.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../flattenDeep'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/flip.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/flip.js deleted file mode 100644 index 730bbd1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/flip.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../flip'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/floor.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/floor.js deleted file mode 100644 index f130f8b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/floor.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('floor', require('../floor')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/flow.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/flow.js deleted file mode 100644 index d9943c6..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/flow.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../flow'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/flowRight.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/flowRight.js deleted file mode 100644 index 556dc37..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/flowRight.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../flowRight'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/forEach.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/forEach.js deleted file mode 100644 index d715ea6..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/forEach.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('forEach', require('../forEach')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/forEachRight.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/forEachRight.js deleted file mode 100644 index 90dd8dd..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/forEachRight.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('forEachRight', require('../forEachRight')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/forIn.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/forIn.js deleted file mode 100644 index 90a8f07..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/forIn.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('forIn', require('../forIn')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/forInRight.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/forInRight.js deleted file mode 100644 index 505258f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/forInRight.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('forInRight', require('../forInRight')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/forOwn.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/forOwn.js deleted file mode 100644 index 6fef1e3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/forOwn.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('forOwn', require('../forOwn')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/forOwnRight.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/forOwnRight.js deleted file mode 100644 index 11ff1fd..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/forOwnRight.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('forOwnRight', require('../forOwnRight')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/fromPairs.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/fromPairs.js deleted file mode 100644 index f5c3cb8..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/fromPairs.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('fromPairs', require('../fromPairs')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/function.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/function.js deleted file mode 100644 index dfe69b1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/function.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert(require('../function')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/functions.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/functions.js deleted file mode 100644 index bb1cb93..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/functions.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../functions'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/functionsIn.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/functionsIn.js deleted file mode 100644 index d375213..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/functionsIn.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../functionsIn'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/get.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/get.js deleted file mode 100644 index a054c9d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/get.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('get', require('../get')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/getOr.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/getOr.js deleted file mode 100644 index c46f2e9..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/getOr.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('getOr', require('../get')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/groupBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/groupBy.js deleted file mode 100644 index 6588856..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/groupBy.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('groupBy', require('../groupBy')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/gt.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/gt.js deleted file mode 100644 index 5b92de9..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/gt.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('gt', require('../gt')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/gte.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/gte.js deleted file mode 100644 index 3a40250..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/gte.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('gte', require('../gte')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/has.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/has.js deleted file mode 100644 index e37db9a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/has.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('has', require('../has')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/hasIn.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/hasIn.js deleted file mode 100644 index 84d7815..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/hasIn.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('hasIn', require('../hasIn')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/head.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/head.js deleted file mode 100644 index bd97a7b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/head.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../head'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/identity.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/identity.js deleted file mode 100644 index 6d007dc..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/identity.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../identity'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/inRange.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/inRange.js deleted file mode 100644 index fc55e1c..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/inRange.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('inRange', require('../inRange')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/includes.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/includes.js deleted file mode 100644 index 91f1eec..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/includes.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('includes', require('../includes')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/indexOf.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/indexOf.js deleted file mode 100644 index 65345ce..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/indexOf.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('indexOf', require('../indexOf')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/init.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/init.js deleted file mode 100644 index 2f88d8b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/init.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./initial'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/initial.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/initial.js deleted file mode 100644 index 9fc94e0..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/initial.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../initial'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/intersection.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/intersection.js deleted file mode 100644 index 784f4d1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/intersection.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('intersection', require('../intersection')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/intersectionBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/intersectionBy.js deleted file mode 100644 index 4aa93b6..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/intersectionBy.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('intersectionBy', require('../intersectionBy')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/intersectionWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/intersectionWith.js deleted file mode 100644 index 879fe9d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/intersectionWith.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('intersectionWith', require('../intersectionWith')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/invert.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/invert.js deleted file mode 100644 index 231d5ca..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/invert.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('invert', require('../invert')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/invertBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/invertBy.js deleted file mode 100644 index 90820e6..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/invertBy.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('invertBy', require('../invertBy')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/invoke.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/invoke.js deleted file mode 100644 index a8635e8..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/invoke.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('invoke', require('../invoke')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/invokeMap.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/invokeMap.js deleted file mode 100644 index 2691ae3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/invokeMap.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('invokeMap', require('../invokeMap')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isArguments.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isArguments.js deleted file mode 100644 index 093aa35..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isArguments.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isArguments'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isArray.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isArray.js deleted file mode 100644 index ec7fad3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isArray.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isArray'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isArrayLike.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isArrayLike.js deleted file mode 100644 index 1595b2f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isArrayLike.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isArrayLike'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isArrayLikeObject.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isArrayLikeObject.js deleted file mode 100644 index 4d1d202..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isArrayLikeObject.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isArrayLikeObject'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isBoolean.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isBoolean.js deleted file mode 100644 index 30d4a4a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isBoolean.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isBoolean'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isDate.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isDate.js deleted file mode 100644 index ac002f4..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isDate.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isDate'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isElement.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isElement.js deleted file mode 100644 index 458a348..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isElement.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isElement'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isEmpty.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isEmpty.js deleted file mode 100644 index b1a04cd..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isEmpty.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isEmpty'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isEqual.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isEqual.js deleted file mode 100644 index 91b7d66..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isEqual.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('isEqual', require('../isEqual')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isEqualWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isEqualWith.js deleted file mode 100644 index 37a6e35..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isEqualWith.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('isEqualWith', require('../isEqualWith')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isError.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isError.js deleted file mode 100644 index da2710c..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isError.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isError'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isFinite.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isFinite.js deleted file mode 100644 index a71e53d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isFinite.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isFinite'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isFunction.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isFunction.js deleted file mode 100644 index 1fc73f6..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isFunction.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isFunction'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isInteger.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isInteger.js deleted file mode 100644 index f990b01..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isInteger.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isInteger'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isLength.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isLength.js deleted file mode 100644 index f40c362..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isLength.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isLength'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isMatch.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isMatch.js deleted file mode 100644 index 749c903..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isMatch.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('isMatch', require('../isMatch')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isMatchWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isMatchWith.js deleted file mode 100644 index b1311fc..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isMatchWith.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('isMatchWith', require('../isMatchWith')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isNaN.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isNaN.js deleted file mode 100644 index 74daf0a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isNaN.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isNaN'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isNative.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isNative.js deleted file mode 100644 index 9eeded4..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isNative.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isNative'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isNil.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isNil.js deleted file mode 100644 index beace9d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isNil.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isNil'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isNull.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isNull.js deleted file mode 100644 index 44689a7..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isNull.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isNull'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isNumber.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isNumber.js deleted file mode 100644 index d7e8615..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isNumber.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isNumber'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isObject.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isObject.js deleted file mode 100644 index bb48630..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isObject.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isObject'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isObjectLike.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isObjectLike.js deleted file mode 100644 index 5ef6f62..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isObjectLike.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isObjectLike'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isPlainObject.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isPlainObject.js deleted file mode 100644 index 2d34d86..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isPlainObject.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isPlainObject'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isRegExp.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isRegExp.js deleted file mode 100644 index 4d0727b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isRegExp.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isRegExp'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isSafeInteger.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isSafeInteger.js deleted file mode 100644 index ed08cab..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isSafeInteger.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isSafeInteger'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isString.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isString.js deleted file mode 100644 index 2f22d0e..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isString.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isString'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isSymbol.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isSymbol.js deleted file mode 100644 index 9ce6731..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isSymbol.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isSymbol'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isTypedArray.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isTypedArray.js deleted file mode 100644 index 72349c5..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isTypedArray.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isTypedArray'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isUndefined.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isUndefined.js deleted file mode 100644 index a65c5be..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/isUndefined.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../isUndefined'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/iteratee.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/iteratee.js deleted file mode 100644 index 2884465..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/iteratee.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('iteratee', require('../iteratee')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/join.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/join.js deleted file mode 100644 index fdaa488..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/join.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('join', require('../join')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/kebabCase.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/kebabCase.js deleted file mode 100644 index f251a4d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/kebabCase.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../kebabCase'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/keyBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/keyBy.js deleted file mode 100644 index ad9abac..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/keyBy.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('keyBy', require('../keyBy')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/keys.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/keys.js deleted file mode 100644 index 23dc6b7..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/keys.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../keys'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/keysIn.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/keysIn.js deleted file mode 100644 index 2b738b9..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/keysIn.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../keysIn'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/lang.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/lang.js deleted file mode 100644 index 08cc9c1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/lang.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert(require('../lang')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/last.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/last.js deleted file mode 100644 index 222be23..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/last.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../last'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/lastIndexOf.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/lastIndexOf.js deleted file mode 100644 index e27480e..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/lastIndexOf.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('lastIndexOf', require('../lastIndexOf')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/lowerCase.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/lowerCase.js deleted file mode 100644 index 4da15ce..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/lowerCase.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../lowerCase'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/lowerFirst.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/lowerFirst.js deleted file mode 100644 index afd1ba5..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/lowerFirst.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../lowerFirst'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/lt.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/lt.js deleted file mode 100644 index dd4cba0..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/lt.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('lt', require('../lt')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/lte.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/lte.js deleted file mode 100644 index f9bf725..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/lte.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('lte', require('../lte')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/map.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/map.js deleted file mode 100644 index b74c1a1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/map.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('map', require('../map')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/mapKeys.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/mapKeys.js deleted file mode 100644 index a8156c1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/mapKeys.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('mapKeys', require('../mapKeys')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/mapObj.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/mapObj.js deleted file mode 100644 index 9f1872d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/mapObj.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./mapValues'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/mapValues.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/mapValues.js deleted file mode 100644 index 9375d73..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/mapValues.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('mapValues', require('../mapValues')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/matches.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/matches.js deleted file mode 100644 index eea5916..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/matches.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../matches'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/matchesProperty.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/matchesProperty.js deleted file mode 100644 index c4343a1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/matchesProperty.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('matchesProperty', require('../matchesProperty')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/math.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/math.js deleted file mode 100644 index e8f50f7..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/math.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert(require('../math')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/max.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/max.js deleted file mode 100644 index f7258c6..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/max.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../max'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/maxBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/maxBy.js deleted file mode 100644 index b81243f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/maxBy.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('maxBy', require('../maxBy')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/mean.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/mean.js deleted file mode 100644 index b78e427..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/mean.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../mean'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/memoize.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/memoize.js deleted file mode 100644 index 1a45e09..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/memoize.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('memoize', require('../memoize')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/merge.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/merge.js deleted file mode 100644 index 3dca641..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/merge.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('merge', require('../merge')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/mergeWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/mergeWith.js deleted file mode 100644 index ba45644..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/mergeWith.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('mergeWith', require('../mergeWith')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/method.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/method.js deleted file mode 100644 index c2f95c3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/method.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('method', require('../method')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/methodOf.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/methodOf.js deleted file mode 100644 index 223f651..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/methodOf.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('methodOf', require('../methodOf')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/min.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/min.js deleted file mode 100644 index 10db02c..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/min.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../min'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/minBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/minBy.js deleted file mode 100644 index 10edfd4..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/minBy.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('minBy', require('../minBy')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/mixin.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/mixin.js deleted file mode 100644 index 965f180..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/mixin.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('mixin', require('../mixin')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/nAry.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/nAry.js deleted file mode 100644 index f262a76..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/nAry.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./ary'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/negate.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/negate.js deleted file mode 100644 index 345b425..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/negate.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../negate'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/next.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/next.js deleted file mode 100644 index 5cad70e..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/next.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../next'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/noop.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/noop.js deleted file mode 100644 index ca10050..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/noop.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../noop'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/now.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/now.js deleted file mode 100644 index aa5ed67..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/now.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../now'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/nthArg.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/nthArg.js deleted file mode 100644 index dd47ac6..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/nthArg.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../nthArg'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/number.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/number.js deleted file mode 100644 index 5c10b88..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/number.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert(require('../number')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/object.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/object.js deleted file mode 100644 index ae39a13..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/object.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert(require('../object')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/omit.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/omit.js deleted file mode 100644 index 404b551..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/omit.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('omit', require('../omit')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/omitAll.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/omitAll.js deleted file mode 100644 index 144cf4b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/omitAll.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./omit'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/omitBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/omitBy.js deleted file mode 100644 index 745efa5..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/omitBy.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('omitBy', require('../omitBy')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/once.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/once.js deleted file mode 100644 index 6bd0beb..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/once.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../once'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/orderBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/orderBy.js deleted file mode 100644 index b32244f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/orderBy.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('orderBy', require('../orderBy')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/over.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/over.js deleted file mode 100644 index 0a5a797..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/over.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('over', require('../over')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/overArgs.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/overArgs.js deleted file mode 100644 index 8188387..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/overArgs.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('overArgs', require('../overArgs')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/overEvery.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/overEvery.js deleted file mode 100644 index 36dc552..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/overEvery.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('overEvery', require('../overEvery')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/overSome.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/overSome.js deleted file mode 100644 index b02d464..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/overSome.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('overSome', require('../overSome')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pad.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pad.js deleted file mode 100644 index e59cfc9..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pad.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('pad', require('../pad')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/padEnd.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/padEnd.js deleted file mode 100644 index 0b6dbb7..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/padEnd.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('padEnd', require('../padEnd')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/padStart.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/padStart.js deleted file mode 100644 index c97f098..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/padStart.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('padStart', require('../padStart')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/parseInt.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/parseInt.js deleted file mode 100644 index 35be713..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/parseInt.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('parseInt', require('../parseInt')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/partial.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/partial.js deleted file mode 100644 index a687d0c..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/partial.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('partial', require('../partial')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/partialRight.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/partialRight.js deleted file mode 100644 index 28428c0..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/partialRight.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('partialRight', require('../partialRight')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/partition.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/partition.js deleted file mode 100644 index b1495e6..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/partition.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('partition', require('../partition')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/path.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/path.js deleted file mode 100644 index b29cfb2..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/path.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./get'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pathEq.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pathEq.js deleted file mode 100644 index 36c027a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pathEq.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./matchesProperty'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pathOr.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pathOr.js deleted file mode 100644 index 4ab5820..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pathOr.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./getOr'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pick.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pick.js deleted file mode 100644 index e84b366..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pick.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('pick', require('../pick')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pickAll.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pickAll.js deleted file mode 100644 index a8ecd46..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pickAll.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./pick'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pickBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pickBy.js deleted file mode 100644 index 4d14a0b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pickBy.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('pickBy', require('../pickBy')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pipe.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pipe.js deleted file mode 100644 index b2e1e2c..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pipe.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./flow'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/plant.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/plant.js deleted file mode 100644 index c85596a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/plant.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../plant'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/prop.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/prop.js deleted file mode 100644 index b29cfb2..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/prop.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./get'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/propOf.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/propOf.js deleted file mode 100644 index cf0d197..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/propOf.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./propertyOf'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/propOr.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/propOr.js deleted file mode 100644 index 4ab5820..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/propOr.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./getOr'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/property.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/property.js deleted file mode 100644 index fab6f23..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/property.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../property'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/propertyOf.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/propertyOf.js deleted file mode 100644 index d941cdb..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/propertyOf.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../propertyOf'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pull.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pull.js deleted file mode 100644 index 47f49ae..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pull.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('pull', require('../pull')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pullAll.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pullAll.js deleted file mode 100644 index ffb663b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pullAll.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('pullAll', require('../pullAll')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pullAllBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pullAllBy.js deleted file mode 100644 index 23b11b7..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pullAllBy.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('pullAllBy', require('../pullAllBy')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pullAt.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pullAt.js deleted file mode 100644 index 5836d2d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/pullAt.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('pullAt', require('../pullAt')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/random.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/random.js deleted file mode 100644 index 607d63a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/random.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('random', require('../random')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/range.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/range.js deleted file mode 100644 index 1142304..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/range.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('range', require('../range')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/rangeRight.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/rangeRight.js deleted file mode 100644 index 2248287..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/rangeRight.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('rangeRight', require('../rangeRight')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/rearg.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/rearg.js deleted file mode 100644 index b2753e9..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/rearg.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('rearg', require('../rearg')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/reduce.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/reduce.js deleted file mode 100644 index 2f1b425..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/reduce.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('reduce', require('../reduce')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/reduceRight.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/reduceRight.js deleted file mode 100644 index b110e9e..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/reduceRight.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('reduceRight', require('../reduceRight')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/reject.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/reject.js deleted file mode 100644 index 30bd3bc..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/reject.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('reject', require('../reject')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/remove.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/remove.js deleted file mode 100644 index 4b67a94..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/remove.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('remove', require('../remove')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/repeat.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/repeat.js deleted file mode 100644 index bc0704b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/repeat.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('repeat', require('../repeat')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/replace.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/replace.js deleted file mode 100644 index a4462e7..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/replace.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('replace', require('../replace')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/rest.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/rest.js deleted file mode 100644 index 69dfc18..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/rest.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('rest', require('../rest')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/result.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/result.js deleted file mode 100644 index 1d3fb58..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/result.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('result', require('../result')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/reverse.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/reverse.js deleted file mode 100644 index a6d960d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/reverse.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('reverse', require('../reverse')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/round.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/round.js deleted file mode 100644 index 9eb69b1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/round.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('round', require('../round')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sample.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sample.js deleted file mode 100644 index 008cb06..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sample.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../sample'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sampleSize.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sampleSize.js deleted file mode 100644 index 920c075..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sampleSize.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('sampleSize', require('../sampleSize')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/seq.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/seq.js deleted file mode 100644 index d8f42b0..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/seq.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert(require('../seq')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/set.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/set.js deleted file mode 100644 index fc2a75b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/set.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('set', require('../set')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/setWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/setWith.js deleted file mode 100644 index fd836ea..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/setWith.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('setWith', require('../setWith')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/shuffle.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/shuffle.js deleted file mode 100644 index 85d5699..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/shuffle.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../shuffle'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/size.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/size.js deleted file mode 100644 index efba2ca..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/size.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../size'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/slice.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/slice.js deleted file mode 100644 index 6fb1898..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/slice.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('slice', require('../slice')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/snakeCase.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/snakeCase.js deleted file mode 100644 index 2893f7b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/snakeCase.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../snakeCase'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/some.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/some.js deleted file mode 100644 index 64727fe..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/some.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('some', require('../some')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/somePass.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/somePass.js deleted file mode 100644 index 2774ab3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/somePass.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./overSome'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortBy.js deleted file mode 100644 index 80fe4dd..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortBy.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('sortBy', require('../sortBy')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortedIndex.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortedIndex.js deleted file mode 100644 index 509dcb8..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortedIndex.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('sortedIndex', require('../sortedIndex')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortedIndexBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortedIndexBy.js deleted file mode 100644 index aa2d219..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortedIndexBy.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('sortedIndexBy', require('../sortedIndexBy')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortedIndexOf.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortedIndexOf.js deleted file mode 100644 index c127420..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortedIndexOf.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('sortedIndexOf', require('../sortedIndexOf')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortedLastIndex.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortedLastIndex.js deleted file mode 100644 index 7ec9e33..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortedLastIndex.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('sortedLastIndex', require('../sortedLastIndex')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortedLastIndexBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortedLastIndexBy.js deleted file mode 100644 index e03f185..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortedLastIndexBy.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('sortedLastIndexBy', require('../sortedLastIndexBy')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortedLastIndexOf.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortedLastIndexOf.js deleted file mode 100644 index 0130801..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortedLastIndexOf.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('sortedLastIndexOf', require('../sortedLastIndexOf')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortedUniq.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortedUniq.js deleted file mode 100644 index c0df750..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortedUniq.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../sortedUniq'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortedUniqBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortedUniqBy.js deleted file mode 100644 index f5c65ad..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sortedUniqBy.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('sortedUniqBy', require('../sortedUniqBy')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/split.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/split.js deleted file mode 100644 index 79f2693..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/split.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('split', require('../split')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/spread.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/spread.js deleted file mode 100644 index 0348df2..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/spread.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('spread', require('../spread')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/startCase.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/startCase.js deleted file mode 100644 index 2a6a66e..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/startCase.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../startCase'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/startsWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/startsWith.js deleted file mode 100644 index 730a141..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/startsWith.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('startsWith', require('../startsWith')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/string.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/string.js deleted file mode 100644 index 773b037..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/string.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert(require('../string')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/subtract.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/subtract.js deleted file mode 100644 index 46b83db..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/subtract.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('subtract', require('../subtract')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sum.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sum.js deleted file mode 100644 index e8a59c5..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sum.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../sum'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sumBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sumBy.js deleted file mode 100644 index 2692dc1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/sumBy.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('sumBy', require('../sumBy')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/tail.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/tail.js deleted file mode 100644 index 36c6494..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/tail.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../tail'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/take.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/take.js deleted file mode 100644 index e0984a4..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/take.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('take', require('../take')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/takeRight.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/takeRight.js deleted file mode 100644 index 7b7c3ce..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/takeRight.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('takeRight', require('../takeRight')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/takeRightWhile.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/takeRightWhile.js deleted file mode 100644 index 305b254..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/takeRightWhile.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('takeRightWhile', require('../takeRightWhile')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/takeWhile.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/takeWhile.js deleted file mode 100644 index a90126d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/takeWhile.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('takeWhile', require('../takeWhile')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/tap.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/tap.js deleted file mode 100644 index 3bec2bd..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/tap.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('tap', require('../tap')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/template.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/template.js deleted file mode 100644 index 0130d14..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/template.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('template', require('../template')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/templateSettings.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/templateSettings.js deleted file mode 100644 index ddbbb58..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/templateSettings.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../templateSettings'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/throttle.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/throttle.js deleted file mode 100644 index 36f76d6..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/throttle.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('throttle', require('../throttle')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/thru.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/thru.js deleted file mode 100644 index 05ddaef..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/thru.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('thru', require('../thru')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/times.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/times.js deleted file mode 100644 index 02fd3b7..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/times.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('times', require('../times')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toArray.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toArray.js deleted file mode 100644 index 1ea0b52..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toArray.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../toArray'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toInteger.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toInteger.js deleted file mode 100644 index 17e59a3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toInteger.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../toInteger'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toIterator.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toIterator.js deleted file mode 100644 index 13bf21c..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toIterator.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../toIterator'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toJSON.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toJSON.js deleted file mode 100644 index 5f6cb92..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toJSON.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../toJSON'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toLength.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toLength.js deleted file mode 100644 index 38529fb..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toLength.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../toLength'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toLower.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toLower.js deleted file mode 100644 index 01d3432..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toLower.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../toLower'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toNumber.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toNumber.js deleted file mode 100644 index 071e320..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toNumber.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../toNumber'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toPairs.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toPairs.js deleted file mode 100644 index 4b4dcb7..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toPairs.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../toPairs'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toPairsIn.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toPairsIn.js deleted file mode 100644 index 53076cc..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toPairsIn.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../toPairsIn'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toPath.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toPath.js deleted file mode 100644 index 62762ec..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toPath.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../toPath'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toPlainObject.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toPlainObject.js deleted file mode 100644 index 6a6aebd..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toPlainObject.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../toPlainObject'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toSafeInteger.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toSafeInteger.js deleted file mode 100644 index 3f5b817..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toSafeInteger.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../toSafeInteger'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toString.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toString.js deleted file mode 100644 index c309058..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toString.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../[object Object]'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toUpper.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toUpper.js deleted file mode 100644 index 428eb33..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/toUpper.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../toUpper'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/transform.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/transform.js deleted file mode 100644 index 30bed49..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/transform.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('transform', require('../transform')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/trim.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/trim.js deleted file mode 100644 index b7cafe9..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/trim.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('trim', require('../trim')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/trimChars.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/trimChars.js deleted file mode 100644 index 051ea1e..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/trimChars.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('trimChars', require('../trim')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/trimCharsEnd.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/trimCharsEnd.js deleted file mode 100644 index 54c5cff..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/trimCharsEnd.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('trimCharsEnd', require('../trimEnd')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/trimCharsStart.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/trimCharsStart.js deleted file mode 100644 index 44f9866..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/trimCharsStart.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('trimCharsStart', require('../trimStart')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/trimEnd.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/trimEnd.js deleted file mode 100644 index 1666596..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/trimEnd.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('trimEnd', require('../trimEnd')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/trimStart.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/trimStart.js deleted file mode 100644 index 4921b03..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/trimStart.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('trimStart', require('../trimStart')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/truncate.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/truncate.js deleted file mode 100644 index 0c4d158..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/truncate.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('truncate', require('../truncate')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unapply.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unapply.js deleted file mode 100644 index c5dfe77..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unapply.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./rest'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unary.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unary.js deleted file mode 100644 index 3bc6483..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unary.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../unary'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unescape.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unescape.js deleted file mode 100644 index 4233b15..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unescape.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../unescape'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/union.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/union.js deleted file mode 100644 index 9deef12..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/union.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('union', require('../union')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unionBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unionBy.js deleted file mode 100644 index 029b359..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unionBy.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('unionBy', require('../unionBy')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unionWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unionWith.js deleted file mode 100644 index 631eda0..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unionWith.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('unionWith', require('../unionWith')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/uniq.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/uniq.js deleted file mode 100644 index c64510f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/uniq.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../uniq'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/uniqBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/uniqBy.js deleted file mode 100644 index 1b6c03f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/uniqBy.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('uniqBy', require('../uniqBy')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/uniqWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/uniqWith.js deleted file mode 100644 index be4c48d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/uniqWith.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('uniqWith', require('../uniqWith')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/uniqueId.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/uniqueId.js deleted file mode 100644 index daa41cb..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/uniqueId.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('uniqueId', require('../uniqueId')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unnest.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unnest.js deleted file mode 100644 index 5d34060..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unnest.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./flatten'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unset.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unset.js deleted file mode 100644 index 0c4c1a6..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unset.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('unset', require('../unset')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unzip.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unzip.js deleted file mode 100644 index e0ac2db..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unzip.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../unzip'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unzipWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unzipWith.js deleted file mode 100644 index de25cf7..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/unzipWith.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('unzipWith', require('../unzipWith')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/upperCase.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/upperCase.js deleted file mode 100644 index ddcb369..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/upperCase.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../upperCase'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/upperFirst.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/upperFirst.js deleted file mode 100644 index 34f1e20..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/upperFirst.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../upperFirst'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/useWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/useWith.js deleted file mode 100644 index d8b3df5..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/useWith.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./overArgs'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/util.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/util.js deleted file mode 100644 index 18c00ba..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/util.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert(require('../util')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/value.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/value.js deleted file mode 100644 index 4dc0e7e..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/value.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../value'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/valueOf.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/valueOf.js deleted file mode 100644 index c309058..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/valueOf.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../[object Object]'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/values.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/values.js deleted file mode 100644 index 3843170..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/values.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../values'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/valuesIn.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/valuesIn.js deleted file mode 100644 index f81c171..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/valuesIn.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../valuesIn'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/whereEq.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/whereEq.js deleted file mode 100644 index ade80f6..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/whereEq.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./filter'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/without.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/without.js deleted file mode 100644 index 5238e94..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/without.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('without', require('../without')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/words.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/words.js deleted file mode 100644 index b58a485..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/words.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('words', require('../words')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/wrap.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/wrap.js deleted file mode 100644 index 56465a2..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/wrap.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('wrap', require('../wrap')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/wrapperAt.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/wrapperAt.js deleted file mode 100644 index f8d37a1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/wrapperAt.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../wrapperAt'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/wrapperChain.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/wrapperChain.js deleted file mode 100644 index 964a846..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/wrapperChain.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../wrapperChain'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/wrapperFlatMap.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/wrapperFlatMap.js deleted file mode 100644 index fa030c0..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/wrapperFlatMap.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../wrapperFlatMap'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/wrapperLodash.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/wrapperLodash.js deleted file mode 100644 index d62a996..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/wrapperLodash.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../wrapperLodash'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/wrapperReverse.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/wrapperReverse.js deleted file mode 100644 index cf70388..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/wrapperReverse.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../wrapperReverse'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/wrapperValue.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/wrapperValue.js deleted file mode 100644 index 494dfb1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/wrapperValue.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../wrapperValue'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/xor.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/xor.js deleted file mode 100644 index 0f3e025..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/xor.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('xor', require('../xor')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/xorBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/xorBy.js deleted file mode 100644 index e48fc41..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/xorBy.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('xorBy', require('../xorBy')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/xorWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/xorWith.js deleted file mode 100644 index 5c2eebe..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/xorWith.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('xorWith', require('../xorWith')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/zip.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/zip.js deleted file mode 100644 index 0cae73b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/zip.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('zip', require('../zip')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/zipObj.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/zipObj.js deleted file mode 100644 index f4a3453..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/zipObj.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./zipObject'); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/zipObject.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/zipObject.js deleted file mode 100644 index 8c2ff3b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/zipObject.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('zipObject', require('../zipObject')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/zipObjectDeep.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/zipObjectDeep.js deleted file mode 100644 index a0ee4e3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/zipObjectDeep.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('zipObjectDeep', require('../zipObjectDeep')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/zipWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/zipWith.js deleted file mode 100644 index da75f3d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fp/zipWith.js +++ /dev/null @@ -1,2 +0,0 @@ -var convert = require('./convert'); -module.exports = convert('zipWith', require('../zipWith')); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fromPairs.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fromPairs.js deleted file mode 100644 index c18c1e3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/fromPairs.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * The inverse of `_.toPairs`; this method returns an object composed - * from key-value `pairs`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} pairs The key-value pairs. - * @returns {Object} Returns the new object. - * @example - * - * _.fromPairs([['fred', 30], ['barney', 40]]); - * // => { 'fred': 30, 'barney': 40 } - */ -function fromPairs(pairs) { - var index = -1, - length = pairs ? pairs.length : 0, - result = {}; - - while (++index < length) { - var pair = pairs[index]; - result[pair[0]] = pair[1]; - } - return result; -} - -module.exports = fromPairs; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function.js deleted file mode 100644 index b0fc6d9..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function.js +++ /dev/null @@ -1,25 +0,0 @@ -module.exports = { - 'after': require('./after'), - 'ary': require('./ary'), - 'before': require('./before'), - 'bind': require('./bind'), - 'bindKey': require('./bindKey'), - 'curry': require('./curry'), - 'curryRight': require('./curryRight'), - 'debounce': require('./debounce'), - 'defer': require('./defer'), - 'delay': require('./delay'), - 'flip': require('./flip'), - 'memoize': require('./memoize'), - 'negate': require('./negate'), - 'once': require('./once'), - 'overArgs': require('./overArgs'), - 'partial': require('./partial'), - 'partialRight': require('./partialRight'), - 'rearg': require('./rearg'), - 'rest': require('./rest'), - 'spread': require('./spread'), - 'throttle': require('./throttle'), - 'unary': require('./unary'), - 'wrap': require('./wrap') -}; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/functions.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/functions.js deleted file mode 100644 index b50a197..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/functions.js +++ /dev/null @@ -1,29 +0,0 @@ -var baseFunctions = require('./_baseFunctions'), - keys = require('./keys'); - -/** - * Creates an array of function property names from own enumerable properties - * of `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the new array of property names. - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functions(new Foo); - * // => ['a', 'b'] - */ -function functions(object) { - return object == null ? [] : baseFunctions(object, keys(object)); -} - -module.exports = functions; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/functionsIn.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/functionsIn.js deleted file mode 100644 index b48e5a6..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/functionsIn.js +++ /dev/null @@ -1,29 +0,0 @@ -var baseFunctions = require('./_baseFunctions'), - keysIn = require('./keysIn'); - -/** - * Creates an array of function property names from own and inherited - * enumerable properties of `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the new array of property names. - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functionsIn(new Foo); - * // => ['a', 'b', 'c'] - */ -function functionsIn(object) { - return object == null ? [] : baseFunctions(object, keysIn(object)); -} - -module.exports = functionsIn; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/get.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/get.js deleted file mode 100644 index 755fa05..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/get.js +++ /dev/null @@ -1,32 +0,0 @@ -var baseGet = require('./_baseGet'); - -/** - * Gets the value at `path` of `object`. If the resolved value is - * `undefined` the `defaultValue` is used in its place. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 - * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 - * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' - */ -function get(object, path, defaultValue) { - var result = object == null ? undefined : baseGet(object, path); - return result === undefined ? defaultValue : result; -} - -module.exports = get; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/groupBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/groupBy.js deleted file mode 100644 index 728a6da..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/groupBy.js +++ /dev/null @@ -1,38 +0,0 @@ -var createAggregator = require('./_createAggregator'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is an array of elements responsible for generating the key. - * The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.groupBy([6.1, 4.2, 6.3], Math.floor); - * // => { '4': [4.2], '6': [6.1, 6.3] } - * - * // The `_.property` iteratee shorthand. - * _.groupBy(['one', 'two', 'three'], 'length'); - * // => { '3': ['one', 'two'], '5': ['three'] } - */ -var groupBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - result[key].push(value); - } else { - result[key] = [value]; - } -}); - -module.exports = groupBy; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/gt.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/gt.js deleted file mode 100644 index ddaf5ea..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/gt.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Checks if `value` is greater than `other`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`. - * @example - * - * _.gt(3, 1); - * // => true - * - * _.gt(3, 3); - * // => false - * - * _.gt(1, 3); - * // => false - */ -function gt(value, other) { - return value > other; -} - -module.exports = gt; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/gte.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/gte.js deleted file mode 100644 index 4a5ffb5..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/gte.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Checks if `value` is greater than or equal to `other`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than or equal to `other`, else `false`. - * @example - * - * _.gte(3, 1); - * // => true - * - * _.gte(3, 3); - * // => true - * - * _.gte(1, 3); - * // => false - */ -function gte(value, other) { - return value >= other; -} - -module.exports = gte; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/has.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/has.js deleted file mode 100644 index d66d2de..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/has.js +++ /dev/null @@ -1,34 +0,0 @@ -var baseHas = require('./_baseHas'), - hasPath = require('./_hasPath'); - -/** - * Checks if `path` is a direct property of `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b.c'); - * // => true - * - * _.has(object, ['a', 'b', 'c']); - * // => true - * - * _.has(other, 'a'); - * // => false - */ -function has(object, path) { - return hasPath(object, path, baseHas); -} - -module.exports = has; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/hasIn.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/hasIn.js deleted file mode 100644 index 7da6b7d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/hasIn.js +++ /dev/null @@ -1,33 +0,0 @@ -var baseHasIn = require('./_baseHasIn'), - hasPath = require('./_hasPath'); - -/** - * Checks if `path` is a direct or inherited property of `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b.c'); - * // => true - * - * _.hasIn(object, ['a', 'b', 'c']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ -function hasIn(object, path) { - return hasPath(object, path, baseHasIn); -} - -module.exports = hasIn; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/head.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/head.js deleted file mode 100644 index 30b47b0..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/head.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Gets the first element of `array`. - * - * @static - * @memberOf _ - * @alias first - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the first element of `array`. - * @example - * - * _.head([1, 2, 3]); - * // => 1 - * - * _.head([]); - * // => undefined - */ -function head(array) { - return array ? array[0] : undefined; -} - -module.exports = head; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/identity.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/identity.js deleted file mode 100644 index fa30e17..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/identity.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * This method returns the first argument provided to it. - * - * @static - * @memberOf _ - * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'user': 'fred' }; - * - * _.identity(object) === object; - * // => true - */ -function identity(value) { - return value; -} - -module.exports = identity; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/inRange.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/inRange.js deleted file mode 100644 index 69c6110..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/inRange.js +++ /dev/null @@ -1,52 +0,0 @@ -var baseInRange = require('./_baseInRange'), - toNumber = require('./toNumber'); - -/** - * Checks if `n` is between `start` and up to but not including, `end`. If - * `end` is not specified it's set to `start` with `start` then set to `0`. - * If `start` is greater than `end` the params are swapped to support - * negative ranges. - * - * @static - * @memberOf _ - * @category Number - * @param {number} number The number to check. - * @param {number} [start=0] The start of the range. - * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `number` is in the range, else `false`. - * @example - * - * _.inRange(3, 2, 4); - * // => true - * - * _.inRange(4, 8); - * // => true - * - * _.inRange(4, 2); - * // => false - * - * _.inRange(2, 2); - * // => false - * - * _.inRange(1.2, 2); - * // => true - * - * _.inRange(5.2, 4); - * // => false - * - * _.inRange(-3, -2, -6); - * // => true - */ -function inRange(number, start, end) { - start = toNumber(start) || 0; - if (end === undefined) { - end = start; - start = 0; - } else { - end = toNumber(end) || 0; - } - number = toNumber(number); - return baseInRange(number, start, end); -} - -module.exports = inRange; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/includes.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/includes.js deleted file mode 100644 index 01d6844..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/includes.js +++ /dev/null @@ -1,51 +0,0 @@ -var baseIndexOf = require('./_baseIndexOf'), - isArrayLike = require('./isArrayLike'), - isString = require('./isString'), - toInteger = require('./toInteger'), - values = require('./values'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Checks if `value` is in `collection`. If `collection` is a string it's checked - * for a substring of `value`, otherwise [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * is used for equality comparisons. If `fromIndex` is negative, it's used as - * the offset from the end of `collection`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns {boolean} Returns `true` if `value` is found, else `false`. - * @example - * - * _.includes([1, 2, 3], 1); - * // => true - * - * _.includes([1, 2, 3], 1, 2); - * // => false - * - * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); - * // => true - * - * _.includes('pebbles', 'eb'); - * // => true - */ -function includes(collection, value, fromIndex, guard) { - collection = isArrayLike(collection) ? collection : values(collection); - fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; - - var length = collection.length; - if (fromIndex < 0) { - fromIndex = nativeMax(length + fromIndex, 0); - } - return isString(collection) - ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) - : (!!length && baseIndexOf(collection, value, fromIndex) > -1); -} - -module.exports = includes; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/index.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/index.js deleted file mode 100644 index 5d063e2..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lodash'); \ No newline at end of file diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/indexOf.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/indexOf.js deleted file mode 100644 index 4474d0c..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/indexOf.js +++ /dev/null @@ -1,41 +0,0 @@ -var baseIndexOf = require('./_baseIndexOf'), - toInteger = require('./toInteger'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // Search from the `fromIndex`. - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ -function indexOf(array, value, fromIndex) { - var length = array ? array.length : 0; - if (!length) { - return -1; - } - fromIndex = toInteger(fromIndex); - if (fromIndex < 0) { - fromIndex = nativeMax(length + fromIndex, 0); - } - return baseIndexOf(array, value, fromIndex); -} - -module.exports = indexOf; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/initial.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/initial.js deleted file mode 100644 index 59b7a7d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/initial.js +++ /dev/null @@ -1,20 +0,0 @@ -var dropRight = require('./dropRight'); - -/** - * Gets all but the last element of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.initial([1, 2, 3]); - * // => [1, 2] - */ -function initial(array) { - return dropRight(array, 1); -} - -module.exports = initial; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/intersection.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/intersection.js deleted file mode 100644 index 8e1b8c3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/intersection.js +++ /dev/null @@ -1,28 +0,0 @@ -var arrayMap = require('./_arrayMap'), - baseIntersection = require('./_baseIntersection'), - rest = require('./rest'), - toArrayLikeObject = require('./_toArrayLikeObject'); - -/** - * Creates an array of unique values that are included in all of the provided - * arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of shared values. - * @example - * - * _.intersection([2, 1], [4, 2], [1, 2]); - * // => [2] - */ -var intersection = rest(function(arrays) { - var mapped = arrayMap(arrays, toArrayLikeObject); - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped) - : []; -}); - -module.exports = intersection; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/intersectionBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/intersectionBy.js deleted file mode 100644 index 2c9e0d3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/intersectionBy.js +++ /dev/null @@ -1,42 +0,0 @@ -var arrayMap = require('./_arrayMap'), - baseIntersection = require('./_baseIntersection'), - baseIteratee = require('./_baseIteratee'), - last = require('./last'), - rest = require('./rest'), - toArrayLikeObject = require('./_toArrayLikeObject'); - -/** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of shared values. - * @example - * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1] - * - * // The `_.property` iteratee shorthand. - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ -var intersectionBy = rest(function(arrays) { - var iteratee = last(arrays), - mapped = arrayMap(arrays, toArrayLikeObject); - - if (iteratee === last(mapped)) { - iteratee = undefined; - } else { - mapped.pop(); - } - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped, baseIteratee(iteratee)) - : []; -}); - -module.exports = intersectionBy; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/intersectionWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/intersectionWith.js deleted file mode 100644 index c39e38f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/intersectionWith.js +++ /dev/null @@ -1,40 +0,0 @@ -var arrayMap = require('./_arrayMap'), - baseIntersection = require('./_baseIntersection'), - last = require('./last'), - rest = require('./rest'), - toArrayLikeObject = require('./_toArrayLikeObject'); - -/** - * This method is like `_.intersection` except that it accepts `comparator` - * which is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of shared values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ -var intersectionWith = rest(function(arrays) { - var comparator = last(arrays), - mapped = arrayMap(arrays, toArrayLikeObject); - - if (comparator === last(mapped)) { - comparator = undefined; - } else { - mapped.pop(); - } - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped, undefined, comparator) - : []; -}); - -module.exports = intersectionWith; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/invert.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/invert.js deleted file mode 100644 index 11628b1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/invert.js +++ /dev/null @@ -1,26 +0,0 @@ -var constant = require('./constant'), - createInverter = require('./_createInverter'), - identity = require('./identity'); - -/** - * Creates an object composed of the inverted keys and values of `object`. - * If `object` contains duplicate values, subsequent values overwrite property - * assignments of previous values. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to invert. - * @returns {Object} Returns the new inverted object. - * @example - * - * var object = { 'a': 1, 'b': 2, 'c': 1 }; - * - * _.invert(object); - * // => { '1': 'c', '2': 'b' } - */ -var invert = createInverter(function(result, value, key) { - result[value] = key; -}, constant(identity)); - -module.exports = invert; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/invertBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/invertBy.js deleted file mode 100644 index 513f62b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/invertBy.js +++ /dev/null @@ -1,43 +0,0 @@ -var baseIteratee = require('./_baseIteratee'), - createInverter = require('./_createInverter'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * This method is like `_.invert` except that the inverted object is generated - * from the results of running each element of `object` through `iteratee`. - * The corresponding inverted value of each inverted key is an array of keys - * responsible for generating the inverted value. The iteratee is invoked - * with one argument: (value). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to invert. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Object} Returns the new inverted object. - * @example - * - * var object = { 'a': 1, 'b': 2, 'c': 1 }; - * - * _.invertBy(object); - * // => { '1': ['a', 'c'], '2': ['b'] } - * - * _.invertBy(object, function(value) { - * return 'group' + value; - * }); - * // => { 'group1': ['a', 'c'], 'group2': ['b'] } - */ -var invertBy = createInverter(function(result, value, key) { - if (hasOwnProperty.call(result, value)) { - result[value].push(key); - } else { - result[value] = [key]; - } -}, baseIteratee); - -module.exports = invertBy; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/invoke.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/invoke.js deleted file mode 100644 index f090a72..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/invoke.js +++ /dev/null @@ -1,23 +0,0 @@ -var baseInvoke = require('./_baseInvoke'), - rest = require('./rest'); - -/** - * Invokes the method at `path` of `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {...*} [args] The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. - * @example - * - * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; - * - * _.invoke(object, 'a[0].b.c.slice', 1, 3); - * // => [2, 3] - */ -var invoke = rest(baseInvoke); - -module.exports = invoke; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/invokeMap.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/invokeMap.js deleted file mode 100644 index 42c8fbe..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/invokeMap.js +++ /dev/null @@ -1,43 +0,0 @@ -var apply = require('./_apply'), - baseEach = require('./_baseEach'), - baseInvoke = require('./_baseInvoke'), - isArrayLike = require('./isArrayLike'), - isKey = require('./_isKey'), - rest = require('./rest'); - -/** - * Invokes the method at `path` of each element in `collection`, returning - * an array of the results of each invoked method. Any additional arguments - * are provided to each invoked method. If `methodName` is a function it's - * invoked for, and `this` bound to, each element in `collection`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|string} path The path of the method to invoke or - * the function invoked per iteration. - * @param {...*} [args] The arguments to invoke each method with. - * @returns {Array} Returns the array of results. - * @example - * - * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); - * // => [[1, 5, 7], [1, 2, 3]] - * - * _.invokeMap([123, 456], String.prototype.split, ''); - * // => [['1', '2', '3'], ['4', '5', '6']] - */ -var invokeMap = rest(function(collection, path, args) { - var index = -1, - isFunc = typeof path == 'function', - isProp = isKey(path), - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value) { - var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined); - result[++index] = func ? apply(func, value, args) : baseInvoke(value, path, args); - }); - return result; -}); - -module.exports = invokeMap; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isArguments.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isArguments.js deleted file mode 100644 index 73fbafe..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isArguments.js +++ /dev/null @@ -1,43 +0,0 @@ -var isArrayLikeObject = require('./isArrayLikeObject'); - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var propertyIsEnumerable = objectProto.propertyIsEnumerable; - -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -function isArguments(value) { - // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); -} - -module.exports = isArguments; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isArray.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isArray.js deleted file mode 100644 index 22a1a22..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isArray.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @type Function - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; - -module.exports = isArray; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isArrayLike.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isArrayLike.js deleted file mode 100644 index 9f4ddd5..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isArrayLike.js +++ /dev/null @@ -1,35 +0,0 @@ -var getLength = require('./_getLength'), - isFunction = require('./isFunction'), - isLength = require('./isLength'); - -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @type Function - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && - !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value)); -} - -module.exports = isArrayLike; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isArrayLikeObject.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isArrayLikeObject.js deleted file mode 100644 index 22b3577..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isArrayLikeObject.js +++ /dev/null @@ -1,32 +0,0 @@ -var isArrayLike = require('./isArrayLike'), - isObjectLike = require('./isObjectLike'); - -/** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @type Function - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); -} - -module.exports = isArrayLikeObject; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isBoolean.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isBoolean.js deleted file mode 100644 index 53ec5d6..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isBoolean.js +++ /dev/null @@ -1,36 +0,0 @@ -var isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var boolTag = '[object Boolean]'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** - * Checks if `value` is classified as a boolean primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isBoolean(false); - * // => true - * - * _.isBoolean(null); - * // => false - */ -function isBoolean(value) { - return value === true || value === false || - (isObjectLike(value) && objectToString.call(value) == boolTag); -} - -module.exports = isBoolean; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isDate.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isDate.js deleted file mode 100644 index 6e3611a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isDate.js +++ /dev/null @@ -1,35 +0,0 @@ -var isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var dateTag = '[object Date]'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** - * Checks if `value` is classified as a `Date` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isDate(new Date); - * // => true - * - * _.isDate('Mon April 23 2012'); - * // => false - */ -function isDate(value) { - return isObjectLike(value) && objectToString.call(value) == dateTag; -} - -module.exports = isDate; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isElement.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isElement.js deleted file mode 100644 index 447d6bc..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isElement.js +++ /dev/null @@ -1,24 +0,0 @@ -var isObjectLike = require('./isObjectLike'), - isPlainObject = require('./isPlainObject'); - -/** - * Checks if `value` is likely a DOM element. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. - * @example - * - * _.isElement(document.body); - * // => true - * - * _.isElement(''); - * // => false - */ -function isElement(value) { - return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value); -} - -module.exports = isElement; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isEmpty.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isEmpty.js deleted file mode 100644 index 29062ed..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isEmpty.js +++ /dev/null @@ -1,53 +0,0 @@ -var isArguments = require('./isArguments'), - isArray = require('./isArray'), - isArrayLike = require('./isArrayLike'), - isFunction = require('./isFunction'), - isString = require('./isString'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Checks if `value` is empty. A value is considered empty unless it's an - * `arguments` object, array, string, or jQuery-like collection with a length - * greater than `0` or an object with own enumerable properties. - * - * @static - * @memberOf _ - * @category Lang - * @param {Array|Object|string} value The value to inspect. - * @returns {boolean} Returns `true` if `value` is empty, else `false`. - * @example - * - * _.isEmpty(null); - * // => true - * - * _.isEmpty(true); - * // => true - * - * _.isEmpty(1); - * // => true - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({ 'a': 1 }); - * // => false - */ -function isEmpty(value) { - if (isArrayLike(value) && - (isArray(value) || isString(value) || isFunction(value.splice) || isArguments(value))) { - return !value.length; - } - for (var key in value) { - if (hasOwnProperty.call(value, key)) { - return false; - } - } - return true; -} - -module.exports = isEmpty; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isEqual.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isEqual.js deleted file mode 100644 index 43a3a2b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isEqual.js +++ /dev/null @@ -1,34 +0,0 @@ -var baseIsEqual = require('./_baseIsEqual'); - -/** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ -function isEqual(value, other) { - return baseIsEqual(value, other); -} - -module.exports = isEqual; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isEqualWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isEqualWith.js deleted file mode 100644 index 60fe95d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isEqualWith.js +++ /dev/null @@ -1,40 +0,0 @@ -var baseIsEqual = require('./_baseIsEqual'); - -/** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to six arguments: - * (objValue, othValue [, index|key, object, other, stack]). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ -function isEqualWith(value, other, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - var result = customizer ? customizer(value, other) : undefined; - return result === undefined ? baseIsEqual(value, other, customizer) : !!result; -} - -module.exports = isEqualWith; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isError.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isError.js deleted file mode 100644 index e66b443..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isError.js +++ /dev/null @@ -1,37 +0,0 @@ -var isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var errorTag = '[object Error]'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** - * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, - * `SyntaxError`, `TypeError`, or `URIError` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an error object, else `false`. - * @example - * - * _.isError(new Error); - * // => true - * - * _.isError(Error); - * // => false - */ -function isError(value) { - return isObjectLike(value) && - typeof value.message == 'string' && objectToString.call(value) == errorTag; -} - -module.exports = isError; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isFinite.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isFinite.js deleted file mode 100644 index 44be4bc..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isFinite.js +++ /dev/null @@ -1,34 +0,0 @@ -var root = require('./_root'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeIsFinite = root.isFinite; - -/** - * Checks if `value` is a finite primitive number. - * - * **Note:** This method is based on [`Number.isFinite`](https://mdn.io/Number/isFinite). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. - * @example - * - * _.isFinite(3); - * // => true - * - * _.isFinite(Number.MAX_VALUE); - * // => true - * - * _.isFinite(3.14); - * // => true - * - * _.isFinite(Infinity); - * // => false - */ -function isFinite(value) { - return typeof value == 'number' && nativeIsFinite(value); -} - -module.exports = isFinite; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isFunction.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isFunction.js deleted file mode 100644 index a1d9530..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isFunction.js +++ /dev/null @@ -1,40 +0,0 @@ -var isObject = require('./isObject'); - -/** `Object#toString` result references. */ -var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array constructors, and - // PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -module.exports = isFunction; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isInteger.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isInteger.js deleted file mode 100644 index 1bfcc65..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isInteger.js +++ /dev/null @@ -1,31 +0,0 @@ -var toInteger = require('./toInteger'); - -/** - * Checks if `value` is an integer. - * - * **Note:** This method is based on [`Number.isInteger`](https://mdn.io/Number/isInteger). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an integer, else `false`. - * @example - * - * _.isInteger(3); - * // => true - * - * _.isInteger(Number.MIN_VALUE); - * // => false - * - * _.isInteger(Infinity); - * // => false - * - * _.isInteger('3'); - * // => false - */ -function isInteger(value) { - return typeof value == 'number' && value == toInteger(value); -} - -module.exports = isInteger; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isLength.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isLength.js deleted file mode 100644 index 2f04aca..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isLength.js +++ /dev/null @@ -1,32 +0,0 @@ -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -module.exports = isLength; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isMatch.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isMatch.js deleted file mode 100644 index a14131f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isMatch.js +++ /dev/null @@ -1,30 +0,0 @@ -var baseIsMatch = require('./_baseIsMatch'), - getMatchData = require('./_getMatchData'); - -/** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @static - * @memberOf _ - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ -function isMatch(object, source) { - return object === source || baseIsMatch(object, source, getMatchData(source)); -} - -module.exports = isMatch; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isMatchWith.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isMatchWith.js deleted file mode 100644 index 2460eb3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isMatchWith.js +++ /dev/null @@ -1,40 +0,0 @@ -var baseIsMatch = require('./_baseIsMatch'), - getMatchData = require('./_getMatchData'); - -/** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with five - * arguments: (objValue, srcValue, index|key, object, source). - * - * @static - * @memberOf _ - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ -function isMatchWith(object, source, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseIsMatch(object, source, getMatchData(source), customizer); -} - -module.exports = isMatchWith; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isNaN.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isNaN.js deleted file mode 100644 index 5b757b1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isNaN.js +++ /dev/null @@ -1,34 +0,0 @@ -var isNumber = require('./isNumber'); - -/** - * Checks if `value` is `NaN`. - * - * **Note:** This method is not the same as [`isNaN`](https://es5.github.io/#x15.1.2.4) - * which returns `true` for `undefined` and other non-numeric values. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - * @example - * - * _.isNaN(NaN); - * // => true - * - * _.isNaN(new Number(NaN)); - * // => true - * - * isNaN(undefined); - * // => true - * - * _.isNaN(undefined); - * // => false - */ -function isNaN(value) { - // An `NaN` primitive is the only value that is not equal to itself. - // Perform the `toStringTag` check first to avoid errors with some ActiveX objects in IE. - return isNumber(value) && value != +value; -} - -module.exports = isNaN; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isNative.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isNative.js deleted file mode 100644 index 616a832..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isNative.js +++ /dev/null @@ -1,53 +0,0 @@ -var isFunction = require('./isFunction'), - isHostObject = require('./_isHostObject'), - isObjectLike = require('./isObjectLike'); - -/** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - -/** Used to detect host constructors (Safari > 5). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var funcToString = Function.prototype.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ -function isNative(value) { - if (value == null) { - return false; - } - if (isFunction(value)) { - return reIsNative.test(funcToString.call(value)); - } - return isObjectLike(value) && - (isHostObject(value) ? reIsNative : reIsHostCtor).test(value); -} - -module.exports = isNative; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isNil.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isNil.js deleted file mode 100644 index c4197fb..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isNil.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Checks if `value` is `null` or `undefined`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is nullish, else `false`. - * @example - * - * _.isNil(null); - * // => true - * - * _.isNil(void 0); - * // => true - * - * _.isNil(NaN); - * // => false - */ -function isNil(value) { - return value == null; -} - -module.exports = isNil; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isNull.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isNull.js deleted file mode 100644 index ec66c4d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isNull.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Checks if `value` is `null`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `null`, else `false`. - * @example - * - * _.isNull(null); - * // => true - * - * _.isNull(void 0); - * // => false - */ -function isNull(value) { - return value === null; -} - -module.exports = isNull; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isNumber.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isNumber.js deleted file mode 100644 index 0c8fb9a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isNumber.js +++ /dev/null @@ -1,45 +0,0 @@ -var isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var numberTag = '[object Number]'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** - * Checks if `value` is classified as a `Number` primitive or object. - * - * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified - * as numbers, use the `_.isFinite` method. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isNumber(3); - * // => true - * - * _.isNumber(Number.MIN_VALUE); - * // => true - * - * _.isNumber(Infinity); - * // => true - * - * _.isNumber('3'); - * // => false - */ -function isNumber(value) { - return typeof value == 'number' || - (isObjectLike(value) && objectToString.call(value) == numberTag); -} - -module.exports = isNumber; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isObject.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isObject.js deleted file mode 100644 index 41993db..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isObject.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -module.exports = isObject; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isObjectLike.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isObjectLike.js deleted file mode 100644 index 240167a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isObjectLike.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -module.exports = isObjectLike; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isPlainObject.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isPlainObject.js deleted file mode 100644 index 1d68332..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isPlainObject.js +++ /dev/null @@ -1,68 +0,0 @@ -var isHostObject = require('./_isHostObject'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var objectTag = '[object Object]'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var funcToString = Function.prototype.toString; - -/** Used to infer the `Object` constructor. */ -var objectCtorString = funcToString.call(Object); - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var getPrototypeOf = Object.getPrototypeOf; - -/** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ -function isPlainObject(value) { - if (!isObjectLike(value) || objectToString.call(value) != objectTag || isHostObject(value)) { - return false; - } - var proto = objectProto; - if (typeof value.constructor == 'function') { - proto = getPrototypeOf(value); - } - if (proto === null) { - return true; - } - var Ctor = proto.constructor; - return (typeof Ctor == 'function' && - Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); -} - -module.exports = isPlainObject; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isRegExp.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isRegExp.js deleted file mode 100644 index e127e5a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isRegExp.js +++ /dev/null @@ -1,35 +0,0 @@ -var isObject = require('./isObject'); - -/** `Object#toString` result references. */ -var regexpTag = '[object RegExp]'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** - * Checks if `value` is classified as a `RegExp` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isRegExp(/abc/); - * // => true - * - * _.isRegExp('/abc/'); - * // => false - */ -function isRegExp(value) { - return isObject(value) && objectToString.call(value) == regexpTag; -} - -module.exports = isRegExp; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isSafeInteger.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isSafeInteger.js deleted file mode 100644 index f601243..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isSafeInteger.js +++ /dev/null @@ -1,35 +0,0 @@ -var isInteger = require('./isInteger'); - -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** - * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 - * double precision number which isn't the result of a rounded unsafe integer. - * - * **Note:** This method is based on [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. - * @example - * - * _.isSafeInteger(3); - * // => true - * - * _.isSafeInteger(Number.MIN_VALUE); - * // => false - * - * _.isSafeInteger(Infinity); - * // => false - * - * _.isSafeInteger('3'); - * // => false - */ -function isSafeInteger(value) { - return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; -} - -module.exports = isSafeInteger; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isString.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isString.js deleted file mode 100644 index 5ed392e..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isString.js +++ /dev/null @@ -1,37 +0,0 @@ -var isArray = require('./isArray'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var stringTag = '[object String]'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ -function isString(value) { - return typeof value == 'string' || - (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag); -} - -module.exports = isString; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isSymbol.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isSymbol.js deleted file mode 100644 index 5e11a00..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isSymbol.js +++ /dev/null @@ -1,36 +0,0 @@ -var isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -module.exports = isSymbol; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isTypedArray.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isTypedArray.js deleted file mode 100644 index 9e9b0a2..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isTypedArray.js +++ /dev/null @@ -1,74 +0,0 @@ -var isLength = require('./isLength'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - weakMapTag = '[object WeakMap]'; - -var arrayBufferTag = '[object ArrayBuffer]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - -/** Used to identify `toStringTag` values of typed arrays. */ -var typedArrayTags = {}; -typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = -typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = -typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = -typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = -typedArrayTags[uint32Tag] = true; -typedArrayTags[argsTag] = typedArrayTags[arrayTag] = -typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = -typedArrayTags[dateTag] = typedArrayTags[errorTag] = -typedArrayTags[funcTag] = typedArrayTags[mapTag] = -typedArrayTags[numberTag] = typedArrayTags[objectTag] = -typedArrayTags[regexpTag] = typedArrayTags[setTag] = -typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ -function isTypedArray(value) { - return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; -} - -module.exports = isTypedArray; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isUndefined.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isUndefined.js deleted file mode 100644 index d64e560..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/isUndefined.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Checks if `value` is `undefined`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. - * @example - * - * _.isUndefined(void 0); - * // => true - * - * _.isUndefined(null); - * // => false - */ -function isUndefined(value) { - return value === undefined; -} - -module.exports = isUndefined; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/iteratee.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/iteratee.js deleted file mode 100644 index c761adb..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/iteratee.js +++ /dev/null @@ -1,37 +0,0 @@ -var baseClone = require('./_baseClone'), - baseIteratee = require('./_baseIteratee'); - -/** - * Creates a function that invokes `func` with the arguments of the created - * function. If `func` is a property name the created callback returns the - * property value for a given element. If `func` is an object the created - * callback returns `true` for elements that contain the equivalent object properties, otherwise it returns `false`. - * - * @static - * @memberOf _ - * @category Util - * @param {*} [func=_.identity] The value to convert to a callback. - * @returns {Function} Returns the callback. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // Create custom iteratee shorthands. - * _.iteratee = _.wrap(_.iteratee, function(callback, func) { - * var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func); - * return !p ? callback(func) : function(object) { - * return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]); - * }; - * }); - * - * _.filter(users, 'age > 36'); - * // => [{ 'user': 'fred', 'age': 40 }] - */ -function iteratee(func) { - return baseIteratee(typeof func == 'function' ? func : baseClone(func, true)); -} - -module.exports = iteratee; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/join.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/join.js deleted file mode 100644 index 79d308d..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/join.js +++ /dev/null @@ -1,25 +0,0 @@ -/** Used for built-in method references. */ -var arrayProto = Array.prototype; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeJoin = arrayProto.join; - -/** - * Converts all elements in `array` into a string separated by `separator`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to convert. - * @param {string} [separator=','] The element separator. - * @returns {string} Returns the joined string. - * @example - * - * _.join(['a', 'b', 'c'], '~'); - * // => 'a~b~c' - */ -function join(array, separator) { - return array ? nativeJoin.call(array, separator) : ''; -} - -module.exports = join; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/kebabCase.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/kebabCase.js deleted file mode 100644 index f29124f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/kebabCase.js +++ /dev/null @@ -1,26 +0,0 @@ -var createCompounder = require('./_createCompounder'); - -/** - * Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the kebab cased string. - * @example - * - * _.kebabCase('Foo Bar'); - * // => 'foo-bar' - * - * _.kebabCase('fooBar'); - * // => 'foo-bar' - * - * _.kebabCase('__foo_bar__'); - * // => 'foo-bar' - */ -var kebabCase = createCompounder(function(result, word, index) { - return result + (index ? '-' : '') + word.toLowerCase(); -}); - -module.exports = kebabCase; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/keyBy.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/keyBy.js deleted file mode 100644 index febc86b..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/keyBy.js +++ /dev/null @@ -1,34 +0,0 @@ -var createAggregator = require('./_createAggregator'); - -/** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is the last element responsible for generating the key. The - * iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * var array = [ - * { 'dir': 'left', 'code': 97 }, - * { 'dir': 'right', 'code': 100 } - * ]; - * - * _.keyBy(array, function(o) { - * return String.fromCharCode(o.code); - * }); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } - * - * _.keyBy(array, 'dir'); - * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } - */ -var keyBy = createAggregator(function(result, value, key) { - result[key] = value; -}); - -module.exports = keyBy; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/keys.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/keys.js deleted file mode 100644 index eac239f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/keys.js +++ /dev/null @@ -1,55 +0,0 @@ -var baseHas = require('./_baseHas'), - baseKeys = require('./_baseKeys'), - indexKeys = require('./_indexKeys'), - isArrayLike = require('./isArrayLike'), - isIndex = require('./_isIndex'), - isPrototype = require('./_isPrototype'); - -/** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) - * for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ -function keys(object) { - var isProto = isPrototype(object); - if (!(isProto || isArrayLike(object))) { - return baseKeys(object); - } - var indexes = indexKeys(object), - skipIndexes = !!indexes, - result = indexes || [], - length = result.length; - - for (var key in object) { - if (baseHas(object, key) && - !(skipIndexes && (key == 'length' || isIndex(key, length))) && - !(isProto && key == 'constructor')) { - result.push(key); - } - } - return result; -} - -module.exports = keys; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/keysIn.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/keysIn.js deleted file mode 100644 index e327b87..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/keysIn.js +++ /dev/null @@ -1,54 +0,0 @@ -var baseKeysIn = require('./_baseKeysIn'), - indexKeys = require('./_indexKeys'), - isIndex = require('./_isIndex'), - isPrototype = require('./_isPrototype'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ -function keysIn(object) { - var index = -1, - isProto = isPrototype(object), - props = baseKeysIn(object), - propsLength = props.length, - indexes = indexKeys(object), - skipIndexes = !!indexes, - result = indexes || [], - length = result.length; - - while (++index < propsLength) { - var key = props[index]; - if (!(skipIndexes && (key == 'length' || isIndex(key, length))) && - !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; -} - -module.exports = keysIn; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang.js deleted file mode 100644 index f42b140..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lang.js +++ /dev/null @@ -1,49 +0,0 @@ -module.exports = { - 'clone': require('./clone'), - 'cloneDeep': require('./cloneDeep'), - 'cloneDeepWith': require('./cloneDeepWith'), - 'cloneWith': require('./cloneWith'), - 'eq': require('./eq'), - 'gt': require('./gt'), - 'gte': require('./gte'), - 'isArguments': require('./isArguments'), - 'isArray': require('./isArray'), - 'isArrayLike': require('./isArrayLike'), - 'isArrayLikeObject': require('./isArrayLikeObject'), - 'isBoolean': require('./isBoolean'), - 'isDate': require('./isDate'), - 'isElement': require('./isElement'), - 'isEmpty': require('./isEmpty'), - 'isEqual': require('./isEqual'), - 'isEqualWith': require('./isEqualWith'), - 'isError': require('./isError'), - 'isFinite': require('./isFinite'), - 'isFunction': require('./isFunction'), - 'isInteger': require('./isInteger'), - 'isLength': require('./isLength'), - 'isMatch': require('./isMatch'), - 'isMatchWith': require('./isMatchWith'), - 'isNaN': require('./isNaN'), - 'isNative': require('./isNative'), - 'isNil': require('./isNil'), - 'isNull': require('./isNull'), - 'isNumber': require('./isNumber'), - 'isObject': require('./isObject'), - 'isObjectLike': require('./isObjectLike'), - 'isPlainObject': require('./isPlainObject'), - 'isRegExp': require('./isRegExp'), - 'isSafeInteger': require('./isSafeInteger'), - 'isString': require('./isString'), - 'isSymbol': require('./isSymbol'), - 'isTypedArray': require('./isTypedArray'), - 'isUndefined': require('./isUndefined'), - 'lt': require('./lt'), - 'lte': require('./lte'), - 'toArray': require('./toArray'), - 'toInteger': require('./toInteger'), - 'toLength': require('./toLength'), - 'toNumber': require('./toNumber'), - 'toPlainObject': require('./toPlainObject'), - 'toSafeInteger': require('./toSafeInteger'), - 'toString': require('./toString') -}; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/last.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/last.js deleted file mode 100644 index 299af31..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/last.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Gets the last element of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the last element of `array`. - * @example - * - * _.last([1, 2, 3]); - * // => 3 - */ -function last(array) { - var length = array ? array.length : 0; - return length ? array[length - 1] : undefined; -} - -module.exports = last; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lastIndexOf.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lastIndexOf.js deleted file mode 100644 index 1eb2f28..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lastIndexOf.js +++ /dev/null @@ -1,49 +0,0 @@ -var indexOfNaN = require('./_indexOfNaN'), - toInteger = require('./toInteger'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max, - nativeMin = Math.min; - -/** - * This method is like `_.indexOf` except that it iterates over elements of - * `array` from right to left. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {number} [fromIndex=array.length-1] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.lastIndexOf([1, 2, 1, 2], 2); - * // => 3 - * - * // Search from the `fromIndex`. - * _.lastIndexOf([1, 2, 1, 2], 2, 2); - * // => 1 - */ -function lastIndexOf(array, value, fromIndex) { - var length = array ? array.length : 0; - if (!length) { - return -1; - } - var index = length; - if (fromIndex !== undefined) { - index = toInteger(fromIndex); - index = (index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1)) + 1; - } - if (value !== value) { - return indexOfNaN(array, index, true); - } - while (index--) { - if (array[index] === value) { - return index; - } - } - return -1; -} - -module.exports = lastIndexOf; diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lodash.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lodash.js deleted file mode 100644 index 97f4b4a..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/lodash.js +++ /dev/null @@ -1,14572 +0,0 @@ -/** - * @license - * lodash 4.2.1 (Custom Build) - * Build: `lodash -d -o ./foo/lodash.js` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -;(function() { - - /** Used as a safe reference for `undefined` in pre-ES5 environments. */ - var undefined; - - /** Used as the semantic version number. */ - var VERSION = '4.2.1'; - - /** Used to compose bitmasks for wrapper metadata. */ - var BIND_FLAG = 1, - BIND_KEY_FLAG = 2, - CURRY_BOUND_FLAG = 4, - CURRY_FLAG = 8, - CURRY_RIGHT_FLAG = 16, - PARTIAL_FLAG = 32, - PARTIAL_RIGHT_FLAG = 64, - ARY_FLAG = 128, - REARG_FLAG = 256, - FLIP_FLAG = 512; - - /** Used to compose bitmasks for comparison styles. */ - var UNORDERED_COMPARE_FLAG = 1, - PARTIAL_COMPARE_FLAG = 2; - - /** Used as default options for `_.truncate`. */ - var DEFAULT_TRUNC_LENGTH = 30, - DEFAULT_TRUNC_OMISSION = '...'; - - /** Used to detect hot functions by number of calls within a span of milliseconds. */ - var HOT_COUNT = 150, - HOT_SPAN = 16; - - /** Used as the size to enable large array optimizations. */ - var LARGE_ARRAY_SIZE = 200; - - /** Used to indicate the type of lazy iteratees. */ - var LAZY_FILTER_FLAG = 1, - LAZY_MAP_FLAG = 2, - LAZY_WHILE_FLAG = 3; - - /** Used as the `TypeError` message for "Functions" methods. */ - var FUNC_ERROR_TEXT = 'Expected a function'; - - /** Used to stand-in for `undefined` hash values. */ - var HASH_UNDEFINED = '__lodash_hash_undefined__'; - - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; - - /** Used as references for the maximum length and index of an array. */ - var MAX_ARRAY_LENGTH = 4294967295, - MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, - HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; - - /** Used as the internal argument placeholder. */ - var PLACEHOLDER = '__lodash_placeholder__'; - - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - weakMapTag = '[object WeakMap]'; - - var arrayBufferTag = '[object ArrayBuffer]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - - /** Used to match empty string literals in compiled template source. */ - var reEmptyStringLeading = /\b__p \+= '';/g, - reEmptyStringMiddle = /\b(__p \+=) '' \+/g, - reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; - - /** Used to match HTML entities and HTML characters. */ - var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g, - reUnescapedHtml = /[&<>"'`]/g, - reHasEscapedHtml = RegExp(reEscapedHtml.source), - reHasUnescapedHtml = RegExp(reUnescapedHtml.source); - - /** Used to match template delimiters. */ - var reEscape = /<%-([\s\S]+?)%>/g, - reEvaluate = /<%([\s\S]+?)%>/g, - reInterpolate = /<%=([\s\S]+?)%>/g; - - /** Used to match property names within property paths. */ - var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g; - - /** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */ - var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, - reHasRegExpChar = RegExp(reRegExpChar.source); - - /** Used to match leading and trailing whitespace. */ - var reTrim = /^\s+|\s+$/g, - reTrimStart = /^\s+/, - reTrimEnd = /\s+$/; - - /** Used to match backslashes in property paths. */ - var reEscapeChar = /\\(\\)?/g; - - /** Used to match [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components). */ - var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; - - /** Used to match `RegExp` flags from their coerced string values. */ - var reFlags = /\w*$/; - - /** Used to detect hexadecimal string values. */ - var reHasHexPrefix = /^0x/i; - - /** Used to detect bad signed hexadecimal string values. */ - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - - /** Used to detect binary string values. */ - var reIsBinary = /^0b[01]+$/i; - - /** Used to detect host constructors (Safari > 5). */ - var reIsHostCtor = /^\[object .+?Constructor\]$/; - - /** Used to detect octal string values. */ - var reIsOctal = /^0o[0-7]+$/i; - - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; - - /** Used to match latin-1 supplementary letters (excluding mathematical operators). */ - var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g; - - /** Used to ensure capturing order of template delimiters. */ - var reNoMatch = /($^)/; - - /** Used to match unescaped characters in compiled string literals. */ - var reUnescapedString = /['\n\r\u2028\u2029\\]/g; - - /** Used to compose unicode character classes. */ - var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', - rsComboSymbolsRange = '\\u20d0-\\u20f0', - rsDingbatRange = '\\u2700-\\u27bf', - rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', - rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', - rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', - rsQuoteRange = '\\u2018\\u2019\\u201c\\u201d', - rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', - rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', - rsVarRange = '\\ufe0e\\ufe0f', - rsBreakRange = rsMathOpRange + rsNonCharRange + rsQuoteRange + rsSpaceRange; - - /** Used to compose unicode capture groups. */ - var rsAstral = '[' + rsAstralRange + ']', - rsBreak = '[' + rsBreakRange + ']', - rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', - rsDigits = '\\d+', - rsDingbat = '[' + rsDingbatRange + ']', - rsLower = '[' + rsLowerRange + ']', - rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsUpper = '[' + rsUpperRange + ']', - rsZWJ = '\\u200d'; - - /** Used to compose unicode regexes. */ - var rsLowerMisc = '(?:' + rsLower + '|' + rsMisc + ')', - rsUpperMisc = '(?:' + rsUpper + '|' + rsMisc + ')', - reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, - rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - - /** - * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and - * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). - */ - var reComboMark = RegExp(rsCombo, 'g'); - - /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ - var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); - - /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ - var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); - - /** Used to match non-compound words composed of alphanumeric characters. */ - var reBasicWord = /[a-zA-Z0-9]+/g; - - /** Used to match complex or compound words. */ - var reComplexWord = RegExp([ - rsUpper + '?' + rsLower + '+(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', - rsUpperMisc + '+(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')', - rsUpper + '?' + rsLowerMisc + '+', - rsUpper + '+', - rsDigits, - rsEmoji - ].join('|'), 'g'); - - /** Used to detect strings that need a more robust regexp to match words. */ - var reHasComplexWord = /[a-z][A-Z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; - - /** Used to assign default `context` object properties. */ - var contextProps = [ - 'Array', 'Date', 'Error', 'Float32Array', 'Float64Array', 'Function', - 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', - 'Reflect', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', - 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', '_', - 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' - ]; - - /** Used to make template sourceURLs easier to identify. */ - var templateCounter = -1; - - /** Used to identify `toStringTag` values of typed arrays. */ - var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = - typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = - typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = - typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = - typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = - typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = - typedArrayTags[dateTag] = typedArrayTags[errorTag] = - typedArrayTags[funcTag] = typedArrayTags[mapTag] = - typedArrayTags[numberTag] = typedArrayTags[objectTag] = - typedArrayTags[regexpTag] = typedArrayTags[setTag] = - typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; - - /** Used to identify `toStringTag` values supported by `_.clone`. */ - var cloneableTags = {}; - cloneableTags[argsTag] = cloneableTags[arrayTag] = - cloneableTags[arrayBufferTag] = cloneableTags[boolTag] = - cloneableTags[dateTag] = cloneableTags[float32Tag] = - cloneableTags[float64Tag] = cloneableTags[int8Tag] = - cloneableTags[int16Tag] = cloneableTags[int32Tag] = - cloneableTags[mapTag] = cloneableTags[numberTag] = - cloneableTags[objectTag] = cloneableTags[regexpTag] = - cloneableTags[setTag] = cloneableTags[stringTag] = - cloneableTags[symbolTag] = cloneableTags[uint8Tag] = - cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = - cloneableTags[uint32Tag] = true; - cloneableTags[errorTag] = cloneableTags[funcTag] = - cloneableTags[weakMapTag] = false; - - /** Used to map latin-1 supplementary letters to basic latin letters. */ - var deburredLetters = { - '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', - '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', - '\xc7': 'C', '\xe7': 'c', - '\xd0': 'D', '\xf0': 'd', - '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', - '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', - '\xcC': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', - '\xeC': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', - '\xd1': 'N', '\xf1': 'n', - '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', - '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', - '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', - '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', - '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', - '\xc6': 'Ae', '\xe6': 'ae', - '\xde': 'Th', '\xfe': 'th', - '\xdf': 'ss' - }; - - /** Used to map characters to HTML entities. */ - var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' - }; - - /** Used to map HTML entities to characters. */ - var htmlUnescapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': "'", - '`': '`' - }; - - /** Used to determine if values are of the language type `Object`. */ - var objectTypes = { - 'function': true, - 'object': true - }; - - /** Used to escape characters for inclusion in compiled string literals. */ - var stringEscapes = { - '\\': '\\', - "'": "'", - '\n': 'n', - '\r': 'r', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - /** Built-in method references without a dependency on `root`. */ - var freeParseFloat = parseFloat, - freeParseInt = parseInt; - - /** Detect free variable `exports`. */ - var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; - - /** Detect free variable `module`. */ - var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; - - /** Detect free variable `global` from Node.js. */ - var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); - - /** Detect free variable `self`. */ - var freeSelf = checkGlobal(objectTypes[typeof self] && self); - - /** Detect free variable `window`. */ - var freeWindow = checkGlobal(objectTypes[typeof window] && window); - - /** Detect the popular CommonJS extension `module.exports`. */ - var moduleExports = (freeModule && freeModule.exports === freeExports) ? freeExports : null; - - /** Detect `this` as the global object. */ - var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - - /** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ - var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')(); - - /*--------------------------------------------------------------------------*/ - - /** - * Adds the key-value `pair` to `map`. - * - * @private - * @param {Object} map The map to modify. - * @param {Array} pair The key-value pair to add. - * @returns {Object} Returns `map`. - */ - function addMapEntry(map, pair) { - map.set(pair[0], pair[1]); - return map; - } - - /** - * Adds `value` to `set`. - * - * @private - * @param {Object} set The set to modify. - * @param {*} value The value to add. - * @returns {Object} Returns `set`. - */ - function addSetEntry(set, value) { - set.add(value); - return set; - } - - /** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {...*} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ - function apply(func, thisArg, args) { - var length = args.length; - switch (length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); - } - - /** - * A specialized version of `baseAggregator` for arrays. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform keys. - * @param {Object} accumulator The initial aggregated object. - * @returns {Function} Returns `accumulator`. - */ - function arrayAggregator(array, setter, iteratee, accumulator) { - var index = -1, - length = array.length; - - while (++index < length) { - var value = array[index]; - setter(accumulator, value, iteratee(value), array); - } - return accumulator; - } - - /** - * Creates a new array concatenating `array` with `other`. - * - * @private - * @param {Array} array The first array to concatenate. - * @param {Array} other The second array to concatenate. - * @returns {Array} Returns the new concatenated array. - */ - function arrayConcat(array, other) { - var index = -1, - length = array.length, - othIndex = -1, - othLength = other.length, - result = Array(length + othLength); - - while (++index < length) { - result[index] = array[index]; - } - while (++othIndex < othLength) { - result[index++] = other[othIndex]; - } - return result; - } - - /** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEach(array, iteratee) { - var index = -1, - length = array.length; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; - } - - /** - * A specialized version of `_.forEachRight` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEachRight(array, iteratee) { - var length = array.length; - - while (length--) { - if (iteratee(array[length], length, array) === false) { - break; - } - } - return array; - } - - /** - * A specialized version of `_.every` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, else `false`. - */ - function arrayEvery(array, predicate) { - var index = -1, - length = array.length; - - while (++index < length) { - if (!predicate(array[index], index, array)) { - return false; - } - } - return true; - } - - /** - * A specialized version of `_.filter` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function arrayFilter(array, predicate) { - var index = -1, - length = array.length, - resIndex = -1, - result = []; - - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[++resIndex] = value; - } - } - return result; - } - - /** - * A specialized version of `_.includes` for arrays without support for - * specifying an index to search from. - * - * @private - * @param {Array} array The array to search. - * @param {*} target The value to search for. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ - function arrayIncludes(array, value) { - return !!array.length && baseIndexOf(array, value, 0) > -1; - } - - /** - * A specialized version of `_.includesWith` for arrays without support for - * specifying an index to search from. - * - * @private - * @param {Array} array The array to search. - * @param {*} target The value to search for. - * @param {Function} comparator The comparator invoked per element. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ - function arrayIncludesWith(array, value, comparator) { - var index = -1, - length = array.length; - - while (++index < length) { - if (comparator(value, array[index])) { - return true; - } - } - return false; - } - - /** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function arrayMap(array, iteratee) { - var index = -1, - length = array.length, - result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; - } - - /** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ - function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; - } - - /** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array.length; - - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; - } - - /** - * A specialized version of `_.reduceRight` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the last element of `array` as the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduceRight(array, iteratee, accumulator, initAccum) { - var length = array.length; - if (initAccum && length) { - accumulator = array[--length]; - } - while (length--) { - accumulator = iteratee(accumulator, array[length], length, array); - } - return accumulator; - } - - /** - * A specialized version of `_.some` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`. - */ - function arraySome(array, predicate) { - var index = -1, - length = array.length; - - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; - } - } - return false; - } - - /** - * The base implementation of methods like `_.max` and `_.min` which accepts a - * `comparator` to determine the extremum value. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The iteratee invoked per iteration. - * @param {Function} comparator The comparator used to compare values. - * @returns {*} Returns the extremum value. - */ - function baseExtremum(array, iteratee, comparator) { - var index = -1, - length = array.length; - - while (++index < length) { - var value = array[index], - current = iteratee(value); - - if (current != null && (computed === undefined - ? current === current - : comparator(current, computed) - )) { - var computed = current, - result = value; - } - } - return result; - } - - /** - * The base implementation of methods like `_.find` and `_.findKey`, without - * support for iteratee shorthands, which iterates over `collection` using - * `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to search. - * @param {Function} predicate The function invoked per iteration. - * @param {Function} eachFunc The function to iterate over `collection`. - * @param {boolean} [retKey] Specify returning the key of the found element instead of the element itself. - * @returns {*} Returns the found element or its key, else `undefined`. - */ - function baseFind(collection, predicate, eachFunc, retKey) { - var result; - eachFunc(collection, function(value, key, collection) { - if (predicate(value, key, collection)) { - result = retKey ? key : value; - return false; - } - }); - return result; - } - - /** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to search. - * @param {Function} predicate The function invoked per iteration. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseFindIndex(array, predicate, fromRight) { - var length = array.length, - index = fromRight ? length : -1; - - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; - } - - /** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseIndexOf(array, value, fromIndex) { - if (value !== value) { - return indexOfNaN(array, fromIndex); - } - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; - } - - /** - * The base implementation of `_.reduce` and `_.reduceRight`, without support - * for iteratee shorthands, which iterates over `collection` using `eachFunc`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} accumulator The initial value. - * @param {boolean} initAccum Specify using the first or last element of `collection` as the initial value. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the accumulated value. - */ - function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { - eachFunc(collection, function(value, index, collection) { - accumulator = initAccum - ? (initAccum = false, value) - : iteratee(accumulator, value, index, collection); - }); - return accumulator; - } - - /** - * The base implementation of `_.sortBy` which uses `comparer` to define - * the sort order of `array` and replaces criteria objects with their - * corresponding values. - * - * @private - * @param {Array} array The array to sort. - * @param {Function} comparer The function to define sort order. - * @returns {Array} Returns `array`. - */ - function baseSortBy(array, comparer) { - var length = array.length; - - array.sort(comparer); - while (length--) { - array[length] = array[length].value; - } - return array; - } - - /** - * The base implementation of `_.sum` without support for iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {number} Returns the sum. - */ - function baseSum(array, iteratee) { - var result, - index = -1, - length = array.length; - - while (++index < length) { - var current = iteratee(array[index]); - if (current !== undefined) { - result = result === undefined ? current : (result + current); - } - } - return result; - } - - /** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ - function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; - } - - /** - * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array - * of key-value pairs for `object` corresponding to the property names of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the new array of key-value pairs. - */ - function baseToPairs(object, props) { - return arrayMap(props, function(key) { - return [key, object[key]]; - }); - } - - /** - * The base implementation of `_.unary` without support for storing wrapper metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new function. - */ - function baseUnary(func) { - return function(value) { - return func(value); - }; - } - - /** - * The base implementation of `_.values` and `_.valuesIn` which creates an - * array of `object` property values corresponding to the property names - * of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the array of property values. - */ - function baseValues(object, props) { - return arrayMap(props, function(key) { - return object[key]; - }); - } - - /** - * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the first unmatched string symbol. - */ - function charsStartIndex(strSymbols, chrSymbols) { - var index = -1, - length = strSymbols.length; - - while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; - } - - /** - * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the last unmatched string symbol. - */ - function charsEndIndex(strSymbols, chrSymbols) { - var index = strSymbols.length; - - while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; - } - - /** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ - function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; - } - - /** - * Compares values to sort them in ascending order. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {number} Returns the sort order indicator for `value`. - */ - function compareAscending(value, other) { - if (value !== other) { - var valIsNull = value === null, - valIsUndef = value === undefined, - valIsReflexive = value === value; - - var othIsNull = other === null, - othIsUndef = other === undefined, - othIsReflexive = other === other; - - if ((value > other && !othIsNull) || !valIsReflexive || - (valIsNull && !othIsUndef && othIsReflexive) || - (valIsUndef && othIsReflexive)) { - return 1; - } - if ((value < other && !valIsNull) || !othIsReflexive || - (othIsNull && !valIsUndef && valIsReflexive) || - (othIsUndef && valIsReflexive)) { - return -1; - } - } - return 0; - } - - /** - * Used by `_.orderBy` to compare multiple properties of a value to another - * and stable sort them. - * - * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, - * specify an order of "desc" for descending or "asc" for ascending sort order - * of corresponding values. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {boolean[]|string[]} orders The order to sort by for each property. - * @returns {number} Returns the sort order indicator for `object`. - */ - function compareMultiple(object, other, orders) { - var index = -1, - objCriteria = object.criteria, - othCriteria = other.criteria, - length = objCriteria.length, - ordersLength = orders.length; - - while (++index < length) { - var result = compareAscending(objCriteria[index], othCriteria[index]); - if (result) { - if (index >= ordersLength) { - return result; - } - var order = orders[index]; - return result * (order == 'desc' ? -1 : 1); - } - } - // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications - // that causes it, under certain circumstances, to provide the same value for - // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 - // for more details. - // - // This also ensures a stable sort in V8 and other engines. - // See https://code.google.com/p/v8/issues/detail?id=90 for more details. - return object.index - other.index; - } - - /** - * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters. - * - * @private - * @param {string} letter The matched letter to deburr. - * @returns {string} Returns the deburred letter. - */ - function deburrLetter(letter) { - return deburredLetters[letter]; - } - - /** - * Used by `_.escape` to convert characters to HTML entities. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - function escapeHtmlChar(chr) { - return htmlEscapes[chr]; - } - - /** - * Used by `_.template` to escape characters for inclusion in compiled string literals. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - function escapeStringChar(chr) { - return '\\' + stringEscapes[chr]; - } - - /** - * Gets the index at which the first occurrence of `NaN` is found in `array`. - * - * @private - * @param {Array} array The array to search. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched `NaN`, else `-1`. - */ - function indexOfNaN(array, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 0 : -1); - - while ((fromRight ? index-- : ++index < length)) { - var other = array[index]; - if (other !== other) { - return index; - } - } - return -1; - } - - /** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ - function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; - } - - /** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; - } - - /** - * Converts `iterator` to an array. - * - * @private - * @param {Object} iterator The iterator to convert. - * @returns {Array} Returns the converted array. - */ - function iteratorToArray(iterator) { - var data, - result = []; - - while (!(data = iterator.next()).done) { - result.push(data.value); - } - return result; - } - - /** - * Converts `map` to an array. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the converted array. - */ - function mapToArray(map) { - var index = -1, - result = Array(map.size); - - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; - } - - /** - * Replaces all `placeholder` elements in `array` with an internal placeholder - * and returns an array of their indexes. - * - * @private - * @param {Array} array The array to modify. - * @param {*} placeholder The placeholder to replace. - * @returns {Array} Returns the new array of placeholder indexes. - */ - function replaceHolders(array, placeholder) { - var index = -1, - length = array.length, - resIndex = -1, - result = []; - - while (++index < length) { - if (array[index] === placeholder) { - array[index] = PLACEHOLDER; - result[++resIndex] = index; - } - } - return result; - } - - /** - * Converts `set` to an array. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the converted array. - */ - function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; - } - - /** - * Gets the number of symbols in `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the string size. - */ - function stringSize(string) { - if (!(string && reHasComplexSymbol.test(string))) { - return string.length; - } - var result = reComplexSymbol.lastIndex = 0; - while (reComplexSymbol.test(string)) { - result++; - } - return result; - } - - /** - * Converts `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ - function stringToArray(string) { - return string.match(reComplexSymbol); - } - - /** - * Used by `_.unescape` to convert HTML entities to characters. - * - * @private - * @param {string} chr The matched character to unescape. - * @returns {string} Returns the unescaped character. - */ - function unescapeHtmlChar(chr) { - return htmlUnescapes[chr]; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Create a new pristine `lodash` function using the `context` object. - * - * @static - * @memberOf _ - * @category Util - * @param {Object} [context=root] The context object. - * @returns {Function} Returns a new `lodash` function. - * @example - * - * _.mixin({ 'foo': _.constant('foo') }); - * - * var lodash = _.runInContext(); - * lodash.mixin({ 'bar': lodash.constant('bar') }); - * - * _.isFunction(_.foo); - * // => true - * _.isFunction(_.bar); - * // => false - * - * lodash.isFunction(lodash.foo); - * // => false - * lodash.isFunction(lodash.bar); - * // => true - * - * // Use `context` to mock `Date#getTime` use in `_.now`. - * var mock = _.runInContext({ - * 'Date': function() { - * return { 'getTime': getTimeMock }; - * } - * }); - * - * // Create a suped-up `defer` in Node.js. - * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; - */ - function runInContext(context) { - context = context ? _.defaults({}, context, _.pick(root, contextProps)) : root; - - /** Built-in constructor references. */ - var Date = context.Date, - Error = context.Error, - Math = context.Math, - RegExp = context.RegExp, - TypeError = context.TypeError; - - /** Used for built-in method references. */ - var arrayProto = context.Array.prototype, - objectProto = context.Object.prototype; - - /** Used to resolve the decompiled source of functions. */ - var funcToString = context.Function.prototype.toString; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** Used to generate unique IDs. */ - var idCounter = 0; - - /** Used to infer the `Object` constructor. */ - var objectCtorString = funcToString.call(Object); - - /** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString = objectProto.toString; - - /** Used to restore the original `_` reference in `_.noConflict`. */ - var oldDash = root._; - - /** Used to detect if a method is native. */ - var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' - ); - - /** Built-in value references. */ - var Reflect = context.Reflect, - Symbol = context.Symbol, - Uint8Array = context.Uint8Array, - clearTimeout = context.clearTimeout, - enumerate = Reflect ? Reflect.enumerate : undefined, - getPrototypeOf = Object.getPrototypeOf, - getOwnPropertySymbols = Object.getOwnPropertySymbols, - iteratorSymbol = typeof (iteratorSymbol = Symbol && Symbol.iterator) == 'symbol' ? iteratorSymbol : undefined, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - setTimeout = context.setTimeout, - splice = arrayProto.splice; - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeCeil = Math.ceil, - nativeFloor = Math.floor, - nativeIsFinite = context.isFinite, - nativeJoin = arrayProto.join, - nativeKeys = Object.keys, - nativeMax = Math.max, - nativeMin = Math.min, - nativeParseInt = context.parseInt, - nativeRandom = Math.random, - nativeReverse = arrayProto.reverse; - - /* Built-in method references that are verified to be native. */ - var Map = getNative(context, 'Map'), - Set = getNative(context, 'Set'), - WeakMap = getNative(context, 'WeakMap'), - nativeCreate = getNative(Object, 'create'); - - /** Used to store function metadata. */ - var metaMap = WeakMap && new WeakMap; - - /** Used to detect maps and sets. */ - var mapCtorString = Map ? funcToString.call(Map) : '', - setCtorString = Set ? funcToString.call(Set) : ''; - - /** Used to convert symbols to primitives and strings. */ - var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = Symbol ? symbolProto.valueOf : undefined, - symbolToString = Symbol ? symbolProto.toString : undefined; - - /** Used to lookup unminified function names. */ - var realNames = {}; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a `lodash` object which wraps `value` to enable implicit method - * chaining. Methods that operate on and return arrays, collections, and - * functions can be chained together. Methods that retrieve a single value or - * may return a primitive value will automatically end the chain sequence and - * return the unwrapped value. Otherwise, the value must be unwrapped with - * `_#value`. - * - * Explicit chaining, which must be unwrapped with `_#value` in all cases, - * may be enabled using `_.chain`. - * - * The execution of chained methods is lazy, that is, it's deferred until - * `_#value` is implicitly or explicitly called. - * - * Lazy evaluation allows several methods to support shortcut fusion. Shortcut - * fusion is an optimization to merge iteratee calls; this avoids the creation - * of intermediate arrays and can greatly reduce the number of iteratee executions. - * Sections of a chain sequence qualify for shortcut fusion if the section is - * applied to an array of at least two hundred elements and any iteratees - * accept only one argument. The heuristic for whether a section qualifies - * for shortcut fusion is subject to change. - * - * Chaining is supported in custom builds as long as the `_#value` method is - * directly or indirectly included in the build. - * - * In addition to lodash methods, wrappers have `Array` and `String` methods. - * - * The wrapper `Array` methods are: - * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` - * - * The wrapper `String` methods are: - * `replace` and `split` - * - * The wrapper methods that support shortcut fusion are: - * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, - * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, - * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` - * - * The chainable wrapper methods are: - * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, - * `at`, `before`, `bind`, `bindAll`, `bindKey`, `chain`, `chunk`, `commit`, - * `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, `curry`, - * `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`, - * `differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`, - * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flip`, `flow`, - * `flowRight`, `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, - * `intersection`, `intersectionBy`, `intersectionWith`, `invert`, `invertBy`, - * `invokeMap`, `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, - * `mapValues`, `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, - * `method`, `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, - * `orderBy`, `over`, `overArgs`, `overEvery`, `overSome`, `partial`, - * `partialRight`, `partition`, `pick`, `pickBy`, `plant`, `property`, - * `propertyOf`, `pull`, `pullAll`, `pullAllBy`, `pullAt`, `push`, `range`, - * `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`, `sampleSize`, - * `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`, - * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, - * `thru`, `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, - * `transform`, `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, - * `uniqWith`, `unset`, `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, - * `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`, - * `zipObjectDeep`, and `zipWith` - * - * The wrapper methods that are **not** chainable by default are: - * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, - * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `endsWith`, `eq`, - * `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, - * `findLast`, `findLastIndex`, `findLastKey`, `floor`, `forEach`, `forEachRight`, - * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, - * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, - * `isArguments`, `isArray`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, - * `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`, - * `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMatch`, `isMatchWith`, - * `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, `isObjectLike`, - * `isPlainObject`, `isRegExp`, `isSafeInteger`, `isString`, `isUndefined`, - * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, - * `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `min`, `minBy`, - * `noConflict`, `noop`, `now`, `pad`, `padEnd`, `padStart`, `parseInt`, - * `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`, - * `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, - * `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, - * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toLower`, - * `toInteger`, `toLength`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, - * `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, - * `upperCase`, `upperFirst`, `value`, and `words` - * - * @name _ - * @constructor - * @category Seq - * @param {*} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var wrapped = _([1, 2, 3]); - * - * // Returns an unwrapped value. - * wrapped.reduce(_.add); - * // => 6 - * - * // Returns a wrapped value. - * var squares = wrapped.map(square); - * - * _.isArray(squares); - * // => false - * - * _.isArray(squares.value()); - * // => true - */ - function lodash(value) { - if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { - if (value instanceof LodashWrapper) { - return value; - } - if (hasOwnProperty.call(value, '__wrapped__')) { - return wrapperClone(value); - } - } - return new LodashWrapper(value); - } - - /** - * The function whose prototype all chaining wrappers inherit from. - * - * @private - */ - function baseLodash() { - // No operation performed. - } - - /** - * The base constructor for creating `lodash` wrapper objects. - * - * @private - * @param {*} value The value to wrap. - * @param {boolean} [chainAll] Enable chaining for all wrapper methods. - */ - function LodashWrapper(value, chainAll) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__chain__ = !!chainAll; - this.__index__ = 0; - this.__values__ = undefined; - } - - /** - * By default, the template delimiters used by lodash are like those in - * embedded Ruby (ERB). Change the following template settings to use - * alternative delimiters. - * - * @static - * @memberOf _ - * @type Object - */ - lodash.templateSettings = { - - /** - * Used to detect `data` property values to be HTML-escaped. - * - * @memberOf _.templateSettings - * @type RegExp - */ - 'escape': reEscape, - - /** - * Used to detect code to be evaluated. - * - * @memberOf _.templateSettings - * @type RegExp - */ - 'evaluate': reEvaluate, - - /** - * Used to detect `data` property values to inject. - * - * @memberOf _.templateSettings - * @type RegExp - */ - 'interpolate': reInterpolate, - - /** - * Used to reference the data object in the template text. - * - * @memberOf _.templateSettings - * @type string - */ - 'variable': '', - - /** - * Used to import variables into the compiled template. - * - * @memberOf _.templateSettings - * @type Object - */ - 'imports': { - - /** - * A reference to the `lodash` function. - * - * @memberOf _.templateSettings.imports - * @type Function - */ - '_': lodash - } - }; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. - * - * @private - * @param {*} value The value to wrap. - */ - function LazyWrapper(value) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__dir__ = 1; - this.__filtered__ = false; - this.__iteratees__ = []; - this.__takeCount__ = MAX_ARRAY_LENGTH; - this.__views__ = []; - } - - /** - * Creates a clone of the lazy wrapper object. - * - * @private - * @name clone - * @memberOf LazyWrapper - * @returns {Object} Returns the cloned `LazyWrapper` object. - */ - function lazyClone() { - var result = new LazyWrapper(this.__wrapped__); - result.__actions__ = copyArray(this.__actions__); - result.__dir__ = this.__dir__; - result.__filtered__ = this.__filtered__; - result.__iteratees__ = copyArray(this.__iteratees__); - result.__takeCount__ = this.__takeCount__; - result.__views__ = copyArray(this.__views__); - return result; - } - - /** - * Reverses the direction of lazy iteration. - * - * @private - * @name reverse - * @memberOf LazyWrapper - * @returns {Object} Returns the new reversed `LazyWrapper` object. - */ - function lazyReverse() { - if (this.__filtered__) { - var result = new LazyWrapper(this); - result.__dir__ = -1; - result.__filtered__ = true; - } else { - result = this.clone(); - result.__dir__ *= -1; - } - return result; - } - - /** - * Extracts the unwrapped value from its lazy wrapper. - * - * @private - * @name value - * @memberOf LazyWrapper - * @returns {*} Returns the unwrapped value. - */ - function lazyValue() { - var array = this.__wrapped__.value(), - dir = this.__dir__, - isArr = isArray(array), - isRight = dir < 0, - arrLength = isArr ? array.length : 0, - view = getView(0, arrLength, this.__views__), - start = view.start, - end = view.end, - length = end - start, - index = isRight ? end : (start - 1), - iteratees = this.__iteratees__, - iterLength = iteratees.length, - resIndex = 0, - takeCount = nativeMin(length, this.__takeCount__); - - if (!isArr || arrLength < LARGE_ARRAY_SIZE || (arrLength == length && takeCount == length)) { - return baseWrapperValue(array, this.__actions__); - } - var result = []; - - outer: - while (length-- && resIndex < takeCount) { - index += dir; - - var iterIndex = -1, - value = array[index]; - - while (++iterIndex < iterLength) { - var data = iteratees[iterIndex], - iteratee = data.iteratee, - type = data.type, - computed = iteratee(value); - - if (type == LAZY_MAP_FLAG) { - value = computed; - } else if (!computed) { - if (type == LAZY_FILTER_FLAG) { - continue outer; - } else { - break outer; - } - } - } - result[resIndex++] = value; - } - return result; - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates an hash object. - * - * @private - * @returns {Object} Returns the new hash object. - */ - function Hash() {} - - /** - * Removes `key` and its value from the hash. - * - * @private - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function hashDelete(hash, key) { - return hashHas(hash, key) && delete hash[key]; - } - - /** - * Gets the hash value for `key`. - * - * @private - * @param {Object} hash The hash to query. - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function hashGet(hash, key) { - if (nativeCreate) { - var result = hash[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(hash, key) ? hash[key] : undefined; - } - - /** - * Checks if a hash value for `key` exists. - * - * @private - * @param {Object} hash The hash to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function hashHas(hash, key) { - return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key); - } - - /** - * Sets the hash `key` to `value`. - * - * @private - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - */ - function hashSet(hash, key, value) { - hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates a map cache object to store key-value pairs. - * - * @private - * @param {Array} [values] The values to cache. - */ - function MapCache(values) { - var index = -1, - length = values ? values.length : 0; - - this.clear(); - while (++index < length) { - var entry = values[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ - function mapClear() { - this.__data__ = { 'hash': new Hash, 'map': Map ? new Map : [], 'string': new Hash }; - } - - /** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function mapDelete(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashDelete(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map['delete'](key) : assocDelete(data.map, key); - } - - /** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function mapGet(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashGet(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map.get(key) : assocGet(data.map, key); - } - - /** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function mapHas(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashHas(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map.has(key) : assocHas(data.map, key); - } - - /** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache object. - */ - function mapSet(key, value) { - var data = this.__data__; - if (isKeyable(key)) { - hashSet(typeof key == 'string' ? data.string : data.hash, key, value); - } else if (Map) { - data.map.set(key, value); - } else { - assocSet(data.map, key, value); - } - return this; - } - - /*------------------------------------------------------------------------*/ - - /** - * - * Creates a set cache object to store unique values. - * - * @private - * @param {Array} [values] The values to cache. - */ - function SetCache(values) { - var index = -1, - length = values ? values.length : 0; - - this.__data__ = new MapCache; - while (++index < length) { - this.push(values[index]); - } - } - - /** - * Checks if `value` is in `cache`. - * - * @private - * @param {Object} cache The set cache to search. - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. - */ - function cacheHas(cache, value) { - var map = cache.__data__; - if (isKeyable(value)) { - var data = map.__data__, - hash = typeof value == 'string' ? data.string : data.hash; - - return hash[value] === HASH_UNDEFINED; - } - return map.has(value); - } - - /** - * Adds `value` to the set cache. - * - * @private - * @name push - * @memberOf SetCache - * @param {*} value The value to cache. - */ - function cachePush(value) { - var map = this.__data__; - if (isKeyable(value)) { - var data = map.__data__, - hash = typeof value == 'string' ? data.string : data.hash; - - hash[value] = HASH_UNDEFINED; - } - else { - map.set(value, HASH_UNDEFINED); - } - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @param {Array} [values] The values to cache. - */ - function Stack(values) { - var index = -1, - length = values ? values.length : 0; - - this.clear(); - while (++index < length) { - var entry = values[index]; - this.set(entry[0], entry[1]); - } - } - - /** - * Removes all key-value entries from the stack. - * - * @private - * @name clear - * @memberOf Stack - */ - function stackClear() { - this.__data__ = { 'array': [], 'map': null }; - } - - /** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function stackDelete(key) { - var data = this.__data__, - array = data.array; - - return array ? assocDelete(array, key) : data.map['delete'](key); - } - - /** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function stackGet(key) { - var data = this.__data__, - array = data.array; - - return array ? assocGet(array, key) : data.map.get(key); - } - - /** - * Checks if a stack value for `key` exists. - * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function stackHas(key) { - var data = this.__data__, - array = data.array; - - return array ? assocHas(array, key) : data.map.has(key); - } - - /** - * Sets the stack `key` to `value`. - * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache object. - */ - function stackSet(key, value) { - var data = this.__data__, - array = data.array; - - if (array) { - if (array.length < (LARGE_ARRAY_SIZE - 1)) { - assocSet(array, key, value); - } else { - data.array = null; - data.map = new MapCache(array); - } - } - var map = data.map; - if (map) { - map.set(key, value); - } - return this; - } - - /*------------------------------------------------------------------------*/ - - /** - * Removes `key` and its value from the associative array. - * - * @private - * @param {Array} array The array to query. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ - function assocDelete(array, key) { - var index = assocIndexOf(array, key); - if (index < 0) { - return false; - } - var lastIndex = array.length - 1; - if (index == lastIndex) { - array.pop(); - } else { - splice.call(array, index, 1); - } - return true; - } - - /** - * Gets the associative array value for `key`. - * - * @private - * @param {Array} array The array to query. - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ - function assocGet(array, key) { - var index = assocIndexOf(array, key); - return index < 0 ? undefined : array[index][1]; - } - - /** - * Checks if an associative array value for `key` exists. - * - * @private - * @param {Array} array The array to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function assocHas(array, key) { - return assocIndexOf(array, key) > -1; - } - - /** - * Gets the index at which the first occurrence of `key` is found in `array` - * of key-value pairs. - * - * @private - * @param {Array} array The array to search. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; - } - - /** - * Sets the associative array `key` to `value`. - * - * @private - * @param {Array} array The array to modify. - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - */ - function assocSet(array, key, value) { - var index = assocIndexOf(array, key); - if (index < 0) { - array.push([key, value]); - } else { - array[index][1] = value; - } - } - - /*------------------------------------------------------------------------*/ - - /** - * Used by `_.defaults` to customize its `_.assignIn` use. - * - * @private - * @param {*} objValue The destination value. - * @param {*} srcValue The source value. - * @param {string} key The key of the property to assign. - * @param {Object} object The parent object of `objValue`. - * @returns {*} Returns the value to assign. - */ - function assignInDefaults(objValue, srcValue, key, object) { - if (objValue === undefined || - (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { - return srcValue; - } - return objValue; - } - - /** - * This function is like `assignValue` except that it doesn't assign `undefined` values. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function assignMergeValue(object, key, value) { - if ((value !== undefined && !eq(object[key], value)) || - (typeof key == 'number' && value === undefined && !(key in object))) { - object[key] = value; - } - } - - /** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ - function assignValue(object, key, value) { - var objValue = object[key]; - if ((!eq(objValue, value) || - (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) || - (value === undefined && !(key in object))) { - object[key] = value; - } - } - - /** - * Aggregates elements of `collection` on `accumulator` with keys transformed - * by `iteratee` and values set by `setter`. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform keys. - * @param {Object} accumulator The initial aggregated object. - * @returns {Function} Returns `accumulator`. - */ - function baseAggregator(collection, setter, iteratee, accumulator) { - baseEach(collection, function(value, key, collection) { - setter(accumulator, value, iteratee(value), collection); - }); - return accumulator; - } - - /** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ - function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); - } - - /** - * The base implementation of `_.at` without support for individual paths. - * - * @private - * @param {Object} object The object to iterate over. - * @param {string[]} paths The property paths of elements to pick. - * @returns {Array} Returns the new array of picked elements. - */ - function baseAt(object, paths) { - var index = -1, - isNil = object == null, - length = paths.length, - result = Array(length); - - while (++index < length) { - result[index] = isNil ? undefined : get(object, paths[index]); - } - return result; - } - - /** - * The base implementation of `_.clamp` which doesn't coerce arguments to numbers. - * - * @private - * @param {number} number The number to clamp. - * @param {number} [lower] The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the clamped number. - */ - function baseClamp(number, lower, upper) { - if (number === number) { - if (upper !== undefined) { - number = number <= upper ? number : upper; - } - if (lower !== undefined) { - number = number >= lower ? number : lower; - } - } - return number; - } - - /** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ - function baseClone(value, isDeep, customizer, key, object, stack) { - var result; - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; - - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - if (isHostObject(value)) { - return object ? value : {}; - } - result = initCloneObject(isFunc ? {} : value); - if (!isDeep) { - return copySymbols(value, baseAssign(result, value)); - } - } else { - return cloneableTags[tag] - ? initCloneByTag(value, tag, isDeep) - : (object ? value : {}); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); - - // Recursively populate clone (susceptible to call stack limits). - (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) { - assignValue(result, key, baseClone(subValue, isDeep, customizer, key, value, stack)); - }); - return isArr ? result : copySymbols(value, result); - } - - /** - * The base implementation of `_.conforms` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property predicates to conform to. - * @returns {Function} Returns the new function. - */ - function baseConforms(source) { - var props = keys(source), - length = props.length; - - return function(object) { - if (object == null) { - return !length; - } - var index = length; - while (index--) { - var key = props[index], - predicate = source[key], - value = object[key]; - - if ((value === undefined && !(key in Object(object))) || !predicate(value)) { - return false; - } - } - return true; - }; - } - - /** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} prototype The object to inherit from. - * @returns {Object} Returns the new object. - */ - var baseCreate = (function() { - function object() {} - return function(prototype) { - if (isObject(prototype)) { - object.prototype = prototype; - var result = new object; - object.prototype = undefined; - } - return result || {}; - }; - }()); - - /** - * The base implementation of `_.delay` and `_.defer` which accepts an array - * of `func` arguments. - * - * @private - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {Object} args The arguments provide to `func`. - * @returns {number} Returns the timer id. - */ - function baseDelay(func, wait, args) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return setTimeout(function() { func.apply(undefined, args); }, wait); - } - - /** - * The base implementation of methods like `_.difference` without support for - * excluding multiple arrays or iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Array} values The values to exclude. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - */ - function baseDifference(array, values, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - isCommon = true, - length = array.length, - result = [], - valuesLength = values.length; - - if (!length) { - return result; - } - if (iteratee) { - values = arrayMap(values, baseUnary(iteratee)); - } - if (comparator) { - includes = arrayIncludesWith; - isCommon = false; - } - else if (values.length >= LARGE_ARRAY_SIZE) { - includes = cacheHas; - isCommon = false; - values = new SetCache(values); - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - if (isCommon && computed === computed) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values[valuesIndex] === computed) { - continue outer; - } - } - result.push(value); - } - else if (!includes(values, computed, comparator)) { - result.push(value); - } - } - return result; - } - - /** - * The base implementation of `_.forEach` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ - var baseEach = createBaseEach(baseForOwn); - - /** - * The base implementation of `_.forEachRight` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ - var baseEachRight = createBaseEach(baseForOwnRight, true); - - /** - * The base implementation of `_.every` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, else `false` - */ - function baseEvery(collection, predicate) { - var result = true; - baseEach(collection, function(value, index, collection) { - result = !!predicate(value, index, collection); - return result; - }); - return result; - } - - /** - * The base implementation of `_.fill` without an iteratee call guard. - * - * @private - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - */ - function baseFill(array, value, start, end) { - var length = array.length; - - start = toInteger(start); - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = (end === undefined || end > length) ? length : toInteger(end); - if (end < 0) { - end += length; - } - end = start > end ? 0 : toLength(end); - while (start < end) { - array[start++] = value; - } - return array; - } - - /** - * The base implementation of `_.filter` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function baseFilter(collection, predicate) { - var result = []; - baseEach(collection, function(value, index, collection) { - if (predicate(value, index, collection)) { - result.push(value); - } - }); - return result; - } - - /** - * The base implementation of `_.flatten` with support for restricting flattening. - * - * @private - * @param {Array} array The array to flatten. - * @param {boolean} [isDeep] Specify a deep flatten. - * @param {boolean} [isStrict] Restrict flattening to arrays-like objects. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. - */ - function baseFlatten(array, isDeep, isStrict, result) { - result || (result = []); - - var index = -1, - length = array.length; - - while (++index < length) { - var value = array[index]; - if (isArrayLikeObject(value) && - (isStrict || isArray(value) || isArguments(value))) { - if (isDeep) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, isDeep, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; - } - - /** - * The base implementation of `baseForIn` and `baseForOwn` which iterates - * over `object` properties returned by `keysFunc` invoking `iteratee` for - * each property. Iteratee functions may exit iteration early by explicitly - * returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - var baseFor = createBaseFor(); - - /** - * This function is like `baseFor` except that it iterates over properties - * in the opposite order. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - var baseForRight = createBaseFor(true); - - /** - * The base implementation of `_.forIn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForIn(object, iteratee) { - return object == null ? object : baseFor(object, iteratee, keysIn); - } - - /** - * The base implementation of `_.forOwn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); - } - - /** - * The base implementation of `_.forOwnRight` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwnRight(object, iteratee) { - return object && baseForRight(object, iteratee, keys); - } - - /** - * The base implementation of `_.functions` which creates an array of - * `object` function property names filtered from those provided. - * - * @private - * @param {Object} object The object to inspect. - * @param {Array} props The property names to filter. - * @returns {Array} Returns the new array of filtered property names. - */ - function baseFunctions(object, props) { - return arrayFilter(props, function(key) { - return isFunction(object[key]); - }); - } - - /** - * The base implementation of `_.get` without support for default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @returns {*} Returns the resolved value. - */ - function baseGet(object, path) { - path = isKey(path, object) ? [path + ''] : baseToPath(path); - - var index = 0, - length = path.length; - - while (object != null && index < length) { - object = object[path[index++]]; - } - return (index && index == length) ? object : undefined; - } - - /** - * The base implementation of `_.has` without support for deep paths. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHas(object, key) { - // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`, - // that are composed entirely of index properties, return `false` for - // `hasOwnProperty` checks of them. - return hasOwnProperty.call(object, key) || - (typeof object == 'object' && key in object && getPrototypeOf(object) === null); - } - - /** - * The base implementation of `_.hasIn` without support for deep paths. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHasIn(object, key) { - return key in Object(object); - } - - /** - * The base implementation of `_.inRange` which doesn't coerce arguments to numbers. - * - * @private - * @param {number} number The number to check. - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `number` is in the range, else `false`. - */ - function baseInRange(number, start, end) { - return number >= nativeMin(start, end) && number < nativeMax(start, end); - } - - /** - * The base implementation of methods like `_.intersection`, without support - * for iteratee shorthands, that accepts an array of arrays to inspect. - * - * @private - * @param {Array} arrays The arrays to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of shared values. - */ - function baseIntersection(arrays, iteratee, comparator) { - var includes = comparator ? arrayIncludesWith : arrayIncludes, - othLength = arrays.length, - othIndex = othLength, - caches = Array(othLength), - result = []; - - while (othIndex--) { - var array = arrays[othIndex]; - if (othIndex && iteratee) { - array = arrayMap(array, baseUnary(iteratee)); - } - caches[othIndex] = !comparator && (iteratee || array.length >= 120) - ? new SetCache(othIndex && array) - : undefined; - } - array = arrays[0]; - - var index = -1, - length = array.length, - seen = caches[0]; - - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - if (!(seen ? cacheHas(seen, computed) : includes(result, computed, comparator))) { - var othIndex = othLength; - while (--othIndex) { - var cache = caches[othIndex]; - if (!(cache ? cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator))) { - continue outer; - } - } - if (seen) { - seen.push(computed); - } - result.push(value); - } - } - return result; - } - - /** - * The base implementation of `_.invert` and `_.invertBy` which inverts - * `object` with values transformed by `iteratee` and set by `setter`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} setter The function to set `accumulator` values. - * @param {Function} iteratee The iteratee to transform values. - * @param {Object} accumulator The initial inverted object. - * @returns {Function} Returns `accumulator`. - */ - function baseInverter(object, setter, iteratee, accumulator) { - baseForOwn(object, function(value, key, object) { - setter(accumulator, iteratee(value), key, object); - }); - return accumulator; - } - - /** - * The base implementation of `_.invoke` without support for individual - * method arguments. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {Array} args The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. - */ - function baseInvoke(object, path, args) { - if (!isKey(path, object)) { - path = baseToPath(path); - object = parent(object, path); - path = last(path); - } - var func = object == null ? object : object[path]; - return func == null ? undefined : apply(func, object, args); - } - - /** - * The base implementation of `_.isEqual` which supports partial comparisons - * and tracks traversed objects. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparisons. - * @param {boolean} [bitmask] The bitmask of comparison flags. - * The bitmask may be composed of the following flags: - * 1 - Unordered comparison - * 2 - Partial comparison - * @param {Object} [stack] Tracks traversed `value` and `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - */ - function baseIsEqual(value, other, customizer, bitmask, stack) { - if (value === other) { - return true; - } - if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { - return value !== value && other !== other; - } - return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); - } - - /** - * A specialized version of `baseIsEqual` for arrays and objects which performs - * deep comparisons and tracks traversed objects enabling objects with circular - * references to be compared. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { - var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = arrayTag, - othTag = arrayTag; - - if (!objIsArr) { - objTag = getTag(object); - if (objTag == argsTag) { - objTag = objectTag; - } else if (objTag != objectTag) { - objIsArr = isTypedArray(object); - } - } - if (!othIsArr) { - othTag = getTag(other); - if (othTag == argsTag) { - othTag = objectTag; - } else if (othTag != objectTag) { - othIsArr = isTypedArray(other); - } - } - var objIsObj = objTag == objectTag && !isHostObject(object), - othIsObj = othTag == objectTag && !isHostObject(other), - isSameTag = objTag == othTag; - - if (isSameTag && !(objIsArr || objIsObj)) { - return equalByTag(object, other, objTag, equalFunc, customizer, bitmask); - } - var isPartial = bitmask & PARTIAL_COMPARE_FLAG; - if (!isPartial) { - var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), - othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - - if (objIsWrapped || othIsWrapped) { - return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, bitmask, stack); - } - } - if (!isSameTag) { - return false; - } - stack || (stack = new Stack); - return (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, bitmask, stack); - } - - /** - * The base implementation of `_.isMatch` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Array} matchData The property names, values, and compare flags to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - */ - function baseIsMatch(object, source, matchData, customizer) { - var index = matchData.length, - length = index, - noCustomizer = !customizer; - - if (object == null) { - return !length; - } - object = Object(object); - while (index--) { - var data = matchData[index]; - if ((noCustomizer && data[2]) - ? data[1] !== object[data[0]] - : !(data[0] in object) - ) { - return false; - } - } - while (++index < length) { - data = matchData[index]; - var key = data[0], - objValue = object[key], - srcValue = data[1]; - - if (noCustomizer && data[2]) { - if (objValue === undefined && !(key in object)) { - return false; - } - } else { - var stack = new Stack, - result = customizer ? customizer(objValue, srcValue, key, object, source, stack) : undefined; - - if (!(result === undefined - ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) - : result - )) { - return false; - } - } - } - return true; - } - - /** - * The base implementation of `_.iteratee`. - * - * @private - * @param {*} [value=_.identity] The value to convert to an iteratee. - * @returns {Function} Returns the iteratee. - */ - function baseIteratee(value) { - var type = typeof value; - if (type == 'function') { - return value; - } - if (value == null) { - return identity; - } - if (type == 'object') { - return isArray(value) - ? baseMatchesProperty(value[0], value[1]) - : baseMatches(value); - } - return property(value); - } - - /** - * The base implementation of `_.keys` which doesn't skip the constructor - * property of prototypes or treat sparse arrays as dense. - * - * @private - * @type Function - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function baseKeys(object) { - return nativeKeys(Object(object)); - } - - /** - * The base implementation of `_.keysIn` which doesn't skip the constructor - * property of prototypes or treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function baseKeysIn(object) { - object = object == null ? object : Object(object); - - var result = []; - for (var key in object) { - result.push(key); - } - return result; - } - - // Fallback for IE < 9 with es6-shim. - if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) { - baseKeysIn = function(object) { - return iteratorToArray(enumerate(object)); - }; - } - - /** - * The base implementation of `_.map` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function baseMap(collection, iteratee) { - var index = -1, - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value, key, collection) { - result[++index] = iteratee(value, key, collection); - }); - return result; - } - - /** - * The base implementation of `_.matches` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new function. - */ - function baseMatches(source) { - var matchData = getMatchData(source); - if (matchData.length == 1 && matchData[0][2]) { - var key = matchData[0][0], - value = matchData[0][1]; - - return function(object) { - if (object == null) { - return false; - } - return object[key] === value && - (value !== undefined || (key in Object(object))); - }; - } - return function(object) { - return object === source || baseIsMatch(object, source, matchData); - }; - } - - /** - * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. - * - * @private - * @param {string} path The path of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new function. - */ - function baseMatchesProperty(path, srcValue) { - return function(object) { - var objValue = get(object, path); - return (objValue === undefined && objValue === srcValue) - ? hasIn(object, path) - : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); - }; - } - - /** - * The base implementation of `_.merge` without support for multiple sources. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {number} srcIndex The index of `source`. - * @param {Function} [customizer] The function to customize merged values. - * @param {Object} [stack] Tracks traversed source values and their merged counterparts. - */ - function baseMerge(object, source, srcIndex, customizer, stack) { - if (object === source) { - return; - } - var props = (isArray(source) || isTypedArray(source)) ? undefined : keysIn(source); - arrayEach(props || source, function(srcValue, key) { - if (props) { - key = srcValue; - srcValue = source[key]; - } - if (isObject(srcValue)) { - stack || (stack = new Stack); - baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); - } - else { - var newValue = customizer ? customizer(object[key], srcValue, (key + ''), object, source, stack) : undefined; - if (newValue === undefined) { - newValue = srcValue; - } - assignMergeValue(object, key, newValue); - } - }); - } - - /** - * A specialized version of `baseMerge` for arrays and objects which performs - * deep merges and tracks traversed objects enabling objects with circular - * references to be merged. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {string} key The key of the value to merge. - * @param {number} srcIndex The index of `source`. - * @param {Function} mergeFunc The function to merge values. - * @param {Function} [customizer] The function to customize assigned values. - * @param {Object} [stack] Tracks traversed source values and their merged counterparts. - */ - function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { - var objValue = object[key], - srcValue = source[key], - stacked = stack.get(srcValue); - - if (stacked) { - assignMergeValue(object, key, stacked); - return; - } - var newValue = customizer ? customizer(objValue, srcValue, (key + ''), object, source, stack) : undefined, - isCommon = newValue === undefined; - - if (isCommon) { - newValue = srcValue; - if (isArray(srcValue) || isTypedArray(srcValue)) { - if (isArray(objValue)) { - newValue = srcIndex ? copyArray(objValue) : objValue; - } - else if (isArrayLikeObject(objValue)) { - newValue = copyArray(objValue); - } - else { - isCommon = false; - newValue = baseClone(srcValue); - } - } - else if (isPlainObject(srcValue) || isArguments(srcValue)) { - if (isArguments(objValue)) { - newValue = toPlainObject(objValue); - } - else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { - isCommon = false; - newValue = baseClone(srcValue); - } - else { - newValue = srcIndex ? baseClone(objValue) : objValue; - } - } - else { - isCommon = false; - } - } - stack.set(srcValue, newValue); - - if (isCommon) { - // Recursively merge objects and arrays (susceptible to call stack limits). - mergeFunc(newValue, srcValue, srcIndex, customizer, stack); - } - assignMergeValue(object, key, newValue); - } - - /** - * The base implementation of `_.orderBy` without param guards. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. - * @param {string[]} orders The sort orders of `iteratees`. - * @returns {Array} Returns the new sorted array. - */ - function baseOrderBy(collection, iteratees, orders) { - var index = -1, - toIteratee = getIteratee(); - - iteratees = arrayMap(iteratees.length ? iteratees : Array(1), function(iteratee) { - return toIteratee(iteratee); - }); - - var result = baseMap(collection, function(value, key, collection) { - var criteria = arrayMap(iteratees, function(iteratee) { - return iteratee(value); - }); - return { 'criteria': criteria, 'index': ++index, 'value': value }; - }); - - return baseSortBy(result, function(object, other) { - return compareMultiple(object, other, orders); - }); - } - - /** - * The base implementation of `_.pick` without support for individual - * property names. - * - * @private - * @param {Object} object The source object. - * @param {string[]} props The property names to pick. - * @returns {Object} Returns the new object. - */ - function basePick(object, props) { - object = Object(object); - return arrayReduce(props, function(result, key) { - if (key in object) { - result[key] = object[key]; - } - return result; - }, {}); - } - - /** - * The base implementation of `_.pickBy` without support for iteratee shorthands. - * - * @private - * @param {Object} object The source object. - * @param {Function} predicate The function invoked per property. - * @returns {Object} Returns the new object. - */ - function basePickBy(object, predicate) { - var result = {}; - baseForIn(object, function(value, key) { - if (predicate(value, key)) { - result[key] = value; - } - }); - return result; - } - - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ - function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; - } - - /** - * A specialized version of `baseProperty` which supports deep paths. - * - * @private - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new function. - */ - function basePropertyDeep(path) { - return function(object) { - return baseGet(object, path); - }; - } - - /** - * The base implementation of `_.pullAll`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @returns {Array} Returns `array`. - */ - function basePullAll(array, values) { - return basePullAllBy(array, values); - } - - /** - * The base implementation of `_.pullAllBy` without support for iteratee - * shorthands. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function} [iteratee] The iteratee invoked per element. - * @returns {Array} Returns `array`. - */ - function basePullAllBy(array, values, iteratee) { - var index = -1, - length = values.length, - seen = array; - - if (iteratee) { - seen = arrayMap(array, function(value) { return iteratee(value); }); - } - while (++index < length) { - var fromIndex = 0, - value = values[index], - computed = iteratee ? iteratee(value) : value; - - while ((fromIndex = baseIndexOf(seen, computed, fromIndex)) > -1) { - if (seen !== array) { - splice.call(seen, fromIndex, 1); - } - splice.call(array, fromIndex, 1); - } - } - return array; - } - - /** - * The base implementation of `_.pullAt` without support for individual - * indexes or capturing the removed elements. - * - * @private - * @param {Array} array The array to modify. - * @param {number[]} indexes The indexes of elements to remove. - * @returns {Array} Returns `array`. - */ - function basePullAt(array, indexes) { - var length = array ? indexes.length : 0, - lastIndex = length - 1; - - while (length--) { - var index = indexes[length]; - if (lastIndex == length || index != previous) { - var previous = index; - if (isIndex(index)) { - splice.call(array, index, 1); - } - else if (!isKey(index, array)) { - var path = baseToPath(index), - object = parent(array, path); - - if (object != null) { - delete object[last(path)]; - } - } - else { - delete array[index]; - } - } - } - return array; - } - - /** - * The base implementation of `_.random` without support for returning - * floating-point numbers. - * - * @private - * @param {number} lower The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the random number. - */ - function baseRandom(lower, upper) { - return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); - } - - /** - * The base implementation of `_.range` and `_.rangeRight` which doesn't - * coerce arguments to numbers. - * - * @private - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @param {number} step The value to increment or decrement by. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the new array of numbers. - */ - function baseRange(start, end, step, fromRight) { - var index = -1, - length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), - result = Array(length); - - while (length--) { - result[fromRight ? length : ++index] = start; - start += step; - } - return result; - } - - /** - * The base implementation of `_.set`. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @param {Function} [customizer] The function to customize path creation. - * @returns {Object} Returns `object`. - */ - function baseSet(object, path, value, customizer) { - path = isKey(path, object) ? [path + ''] : baseToPath(path); - - var index = -1, - length = path.length, - lastIndex = length - 1, - nested = object; - - while (nested != null && ++index < length) { - var key = path[index]; - if (isObject(nested)) { - var newValue = value; - if (index != lastIndex) { - var objValue = nested[key]; - newValue = customizer ? customizer(objValue, key, nested) : undefined; - if (newValue === undefined) { - newValue = objValue == null ? (isIndex(path[index + 1]) ? [] : {}) : objValue; - } - } - assignValue(nested, key, newValue); - } - nested = nested[key]; - } - return object; - } - - /** - * The base implementation of `setData` without support for hot loop detection. - * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. - */ - var baseSetData = !metaMap ? identity : function(func, data) { - metaMap.set(func, data); - return func; - }; - - /** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; - } - - /** - * The base implementation of `_.some` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`. - */ - function baseSome(collection, predicate) { - var result; - - baseEach(collection, function(value, index, collection) { - result = predicate(value, index, collection); - return !result; - }); - return !!result; - } - - /** - * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which - * performs a binary search of `array` to determine the index at which `value` - * should be inserted into `array` in order to maintain its sort order. - * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - */ - function baseSortedIndex(array, value, retHighest) { - var low = 0, - high = array ? array.length : low; - - if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { - while (low < high) { - var mid = (low + high) >>> 1, - computed = array[mid]; - - if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) { - low = mid + 1; - } else { - high = mid; - } - } - return high; - } - return baseSortedIndexBy(array, value, identity, retHighest); - } - - /** - * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` - * which invokes `iteratee` for `value` and each element of `array` to compute - * their sort ranking. The iteratee is invoked with one argument; (value). - * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} iteratee The iteratee invoked per element. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted into `array`. - */ - function baseSortedIndexBy(array, value, iteratee, retHighest) { - value = iteratee(value); - - var low = 0, - high = array ? array.length : 0, - valIsNaN = value !== value, - valIsNull = value === null, - valIsUndef = value === undefined; - - while (low < high) { - var mid = nativeFloor((low + high) / 2), - computed = iteratee(array[mid]), - isDef = computed !== undefined, - isReflexive = computed === computed; - - if (valIsNaN) { - var setLow = isReflexive || retHighest; - } else if (valIsNull) { - setLow = isReflexive && isDef && (retHighest || computed != null); - } else if (valIsUndef) { - setLow = isReflexive && (retHighest || isDef); - } else if (computed == null) { - setLow = false; - } else { - setLow = retHighest ? (computed <= value) : (computed < value); - } - if (setLow) { - low = mid + 1; - } else { - high = mid; - } - } - return nativeMin(high, MAX_ARRAY_INDEX); - } - - /** - * The base implementation of `_.sortedUniq`. - * - * @private - * @param {Array} array The array to inspect. - * @returns {Array} Returns the new duplicate free array. - */ - function baseSortedUniq(array) { - return baseSortedUniqBy(array); - } - - /** - * The base implementation of `_.sortedUniqBy` without support for iteratee - * shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - */ - function baseSortedUniqBy(array, iteratee) { - var index = 0, - length = array.length, - value = array[0], - computed = iteratee ? iteratee(value) : value, - seen = computed, - resIndex = 0, - result = [value]; - - while (++index < length) { - value = array[index], - computed = iteratee ? iteratee(value) : value; - - if (!eq(computed, seen)) { - seen = computed; - result[++resIndex] = value; - } - } - return result; - } - - /** - * The base implementation of `_.toPath` which only converts `value` to a - * path if it's not one. - * - * @private - * @param {*} value The value to process. - * @returns {Array} Returns the property path array. - */ - function baseToPath(value) { - return isArray(value) ? value : stringToPath(value); - } - - /** - * The base implementation of `_.uniqBy` without support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. - */ - function baseUniq(array, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - length = array.length, - isCommon = true, - result = [], - seen = result; - - if (comparator) { - isCommon = false; - includes = arrayIncludesWith; - } - else if (length >= LARGE_ARRAY_SIZE) { - var set = iteratee ? null : createSet(array); - if (set) { - return setToArray(set); - } - isCommon = false; - includes = cacheHas; - seen = new SetCache; - } - else { - seen = iteratee ? [] : result; - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - if (isCommon && computed === computed) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee) { - seen.push(computed); - } - result.push(value); - } - else if (!includes(seen, computed, comparator)) { - if (seen !== result) { - seen.push(computed); - } - result.push(value); - } - } - return result; - } - - /** - * The base implementation of `_.unset`. - * - * @private - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to unset. - * @returns {boolean} Returns `true` if the property is deleted, else `false`. - */ - function baseUnset(object, path) { - path = isKey(path, object) ? [path + ''] : baseToPath(path); - object = parent(object, path); - var key = last(path); - return (object != null && has(object, key)) ? delete object[key] : true; - } - - /** - * The base implementation of methods like `_.dropWhile` and `_.takeWhile` - * without support for iteratee shorthands. - * - * @private - * @param {Array} array The array to query. - * @param {Function} predicate The function invoked per iteration. - * @param {boolean} [isDrop] Specify dropping elements instead of taking them. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the slice of `array`. - */ - function baseWhile(array, predicate, isDrop, fromRight) { - var length = array.length, - index = fromRight ? length : -1; - - while ((fromRight ? index-- : ++index < length) && - predicate(array[index], index, array)) {} - - return isDrop - ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) - : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); - } - - /** - * The base implementation of `wrapperValue` which returns the result of - * performing a sequence of actions on the unwrapped `value`, where each - * successive action is supplied the return value of the previous. - * - * @private - * @param {*} value The unwrapped value. - * @param {Array} actions Actions to perform to resolve the unwrapped value. - * @returns {*} Returns the resolved value. - */ - function baseWrapperValue(value, actions) { - var result = value; - if (result instanceof LazyWrapper) { - result = result.value(); - } - return arrayReduce(actions, function(result, action) { - return action.func.apply(action.thisArg, arrayPush([result], action.args)); - }, result); - } - - /** - * The base implementation of methods like `_.xor`, without support for - * iteratee shorthands, that accepts an array of arrays to inspect. - * - * @private - * @param {Array} arrays The arrays to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of values. - */ - function baseXor(arrays, iteratee, comparator) { - var index = -1, - length = arrays.length; - - while (++index < length) { - var result = result - ? arrayPush( - baseDifference(result, arrays[index], iteratee, comparator), - baseDifference(arrays[index], result, iteratee, comparator) - ) - : arrays[index]; - } - return (result && result.length) ? baseUniq(result, iteratee, comparator) : []; - } - - /** - * This base implementation of `_.zipObject` which assigns values using `assignFunc`. - * - * @private - * @param {Array} props The property names. - * @param {Array} values The property values. - * @param {Function} assignFunc The function to assign values. - * @returns {Object} Returns the new object. - */ - function baseZipObject(props, values, assignFunc) { - var index = -1, - length = props.length, - valsLength = values.length, - result = {}; - - while (++index < length) { - assignFunc(result, props[index], index < valsLength ? values[index] : undefined); - } - return result; - } - - /** - * Creates a clone of `buffer`. - * - * @private - * @param {ArrayBuffer} buffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ - function cloneBuffer(buffer) { - var Ctor = buffer.constructor, - result = new Ctor(buffer.byteLength), - view = new Uint8Array(result); - - view.set(new Uint8Array(buffer)); - return result; - } - - /** - * Creates a clone of `map`. - * - * @private - * @param {Object} map The map to clone. - * @returns {Object} Returns the cloned map. - */ - function cloneMap(map) { - var Ctor = map.constructor; - return arrayReduce(mapToArray(map), addMapEntry, new Ctor); - } - - /** - * Creates a clone of `regexp`. - * - * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. - */ - function cloneRegExp(regexp) { - var Ctor = regexp.constructor, - result = new Ctor(regexp.source, reFlags.exec(regexp)); - - result.lastIndex = regexp.lastIndex; - return result; - } - - /** - * Creates a clone of `set`. - * - * @private - * @param {Object} set The set to clone. - * @returns {Object} Returns the cloned set. - */ - function cloneSet(set) { - var Ctor = set.constructor; - return arrayReduce(setToArray(set), addSetEntry, new Ctor); - } - - /** - * Creates a clone of the `symbol` object. - * - * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. - */ - function cloneSymbol(symbol) { - return Symbol ? Object(symbolValueOf.call(symbol)) : {}; - } - - /** - * Creates a clone of `typedArray`. - * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ - function cloneTypedArray(typedArray, isDeep) { - var buffer = typedArray.buffer, - Ctor = typedArray.constructor; - - return new Ctor(isDeep ? cloneBuffer(buffer) : buffer, typedArray.byteOffset, typedArray.length); - } - - /** - * Creates an array that is the composition of partially applied arguments, - * placeholders, and provided arguments into a single array of arguments. - * - * @private - * @param {Array|Object} args The provided arguments. - * @param {Array} partials The arguments to prepend to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @returns {Array} Returns the new array of composed arguments. - */ - function composeArgs(args, partials, holders) { - var holdersLength = holders.length, - argsIndex = -1, - argsLength = nativeMax(args.length - holdersLength, 0), - leftIndex = -1, - leftLength = partials.length, - result = Array(leftLength + argsLength); - - while (++leftIndex < leftLength) { - result[leftIndex] = partials[leftIndex]; - } - while (++argsIndex < holdersLength) { - result[holders[argsIndex]] = args[argsIndex]; - } - while (argsLength--) { - result[leftIndex++] = args[argsIndex++]; - } - return result; - } - - /** - * This function is like `composeArgs` except that the arguments composition - * is tailored for `_.partialRight`. - * - * @private - * @param {Array|Object} args The provided arguments. - * @param {Array} partials The arguments to append to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @returns {Array} Returns the new array of composed arguments. - */ - function composeArgsRight(args, partials, holders) { - var holdersIndex = -1, - holdersLength = holders.length, - argsIndex = -1, - argsLength = nativeMax(args.length - holdersLength, 0), - rightIndex = -1, - rightLength = partials.length, - result = Array(argsLength + rightLength); - - while (++argsIndex < argsLength) { - result[argsIndex] = args[argsIndex]; - } - var offset = argsIndex; - while (++rightIndex < rightLength) { - result[offset + rightIndex] = partials[rightIndex]; - } - while (++holdersIndex < holdersLength) { - result[offset + holders[holdersIndex]] = args[argsIndex++]; - } - return result; - } - - /** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ - function copyArray(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; - } - - /** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. - * @param {Object} [object={}] The object to copy properties to. - * @returns {Object} Returns `object`. - */ - function copyObject(source, props, object) { - return copyObjectWith(source, props, object); - } - - /** - * This function is like `copyObject` except that it accepts a function to - * customize copied values. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ - function copyObjectWith(source, props, object, customizer) { - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index], - newValue = customizer ? customizer(object[key], source[key], key, object, source) : source[key]; - - assignValue(object, key, newValue); - } - return object; - } - - /** - * Copies own symbol properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ - function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); - } - - /** - * Creates a function like `_.groupBy`. - * - * @private - * @param {Function} setter The function to set accumulator values. - * @param {Function} [initializer] The accumulator object initializer. - * @returns {Function} Returns the new aggregator function. - */ - function createAggregator(setter, initializer) { - return function(collection, iteratee) { - var func = isArray(collection) ? arrayAggregator : baseAggregator, - accumulator = initializer ? initializer() : {}; - - return func(collection, setter, getIteratee(iteratee), accumulator); - }; - } - - /** - * Creates a function like `_.assign`. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ - function createAssigner(assigner) { - return rest(function(object, sources) { - var index = -1, - length = sources.length, - customizer = length > 1 ? sources[length - 1] : undefined, - guard = length > 2 ? sources[2] : undefined; - - customizer = typeof customizer == 'function' ? (length--, customizer) : undefined; - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; - }); - } - - /** - * Creates a `baseEach` or `baseEachRight` function. - * - * @private - * @param {Function} eachFunc The function to iterate over a collection. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee) { - if (collection == null) { - return collection; - } - if (!isArrayLike(collection)) { - return eachFunc(collection, iteratee); - } - var length = collection.length, - index = fromRight ? length : -1, - iterable = Object(collection); - - while ((fromRight ? index-- : ++index < length)) { - if (iteratee(iterable[index], index, iterable) === false) { - break; - } - } - return collection; - }; - } - - /** - * Creates a base function for methods like `_.forIn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; - } - - /** - * Creates a function that wraps `func` to invoke it with the optional `this` - * binding of `thisArg`. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. - * @param {*} [thisArg] The `this` binding of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createBaseWrapper(func, bitmask, thisArg) { - var isBind = bitmask & BIND_FLAG, - Ctor = createCtorWrapper(func); - - function wrapper() { - var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - return fn.apply(isBind ? thisArg : this, arguments); - } - return wrapper; - } - - /** - * Creates a function like `_.lowerFirst`. - * - * @private - * @param {string} methodName The name of the `String` case method to use. - * @returns {Function} Returns the new function. - */ - function createCaseFirst(methodName) { - return function(string) { - string = toString(string); - - var strSymbols = reHasComplexSymbol.test(string) ? stringToArray(string) : undefined, - chr = strSymbols ? strSymbols[0] : string.charAt(0), - trailing = strSymbols ? strSymbols.slice(1).join('') : string.slice(1); - - return chr[methodName]() + trailing; - }; - } - - /** - * Creates a function like `_.camelCase`. - * - * @private - * @param {Function} callback The function to combine each word. - * @returns {Function} Returns the new compounder function. - */ - function createCompounder(callback) { - return function(string) { - return arrayReduce(words(deburr(string)), callback, ''); - }; - } - - /** - * Creates a function that produces an instance of `Ctor` regardless of - * whether it was invoked as part of a `new` expression or by `call` or `apply`. - * - * @private - * @param {Function} Ctor The constructor to wrap. - * @returns {Function} Returns the new wrapped function. - */ - function createCtorWrapper(Ctor) { - return function() { - // Use a `switch` statement to work with class constructors. - // See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist - // for more details. - var args = arguments; - switch (args.length) { - case 0: return new Ctor; - case 1: return new Ctor(args[0]); - case 2: return new Ctor(args[0], args[1]); - case 3: return new Ctor(args[0], args[1], args[2]); - case 4: return new Ctor(args[0], args[1], args[2], args[3]); - case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); - case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); - case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); - } - var thisBinding = baseCreate(Ctor.prototype), - result = Ctor.apply(thisBinding, args); - - // Mimic the constructor's `return` behavior. - // See https://es5.github.io/#x13.2.2 for more details. - return isObject(result) ? result : thisBinding; - }; - } - - /** - * Creates a function that wraps `func` to enable currying. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. - * @param {number} arity The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createCurryWrapper(func, bitmask, arity) { - var Ctor = createCtorWrapper(func); - - function wrapper() { - var length = arguments.length, - index = length, - args = Array(length), - fn = (this && this !== root && this instanceof wrapper) ? Ctor : func, - placeholder = lodash.placeholder || wrapper.placeholder; - - while (index--) { - args[index] = arguments[index]; - } - var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) - ? [] - : replaceHolders(args, placeholder); - - length -= holders.length; - return length < arity - ? createRecurryWrapper(func, bitmask, createHybridWrapper, placeholder, undefined, args, holders, undefined, undefined, arity - length) - : apply(fn, this, args); - } - return wrapper; - } - - /** - * Creates a `_.flow` or `_.flowRight` function. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new flow function. - */ - function createFlow(fromRight) { - return rest(function(funcs) { - funcs = baseFlatten(funcs); - - var length = funcs.length, - index = length, - prereq = LodashWrapper.prototype.thru; - - if (fromRight) { - funcs.reverse(); - } - while (index--) { - var func = funcs[index]; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (prereq && !wrapper && getFuncName(func) == 'wrapper') { - var wrapper = new LodashWrapper([], true); - } - } - index = wrapper ? index : length; - while (++index < length) { - func = funcs[index]; - - var funcName = getFuncName(func), - data = funcName == 'wrapper' ? getData(func) : undefined; - - if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) { - wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); - } else { - wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func); - } - } - return function() { - var args = arguments, - value = args[0]; - - if (wrapper && args.length == 1 && isArray(value) && value.length >= LARGE_ARRAY_SIZE) { - return wrapper.plant(value).value(); - } - var index = 0, - result = length ? funcs[index].apply(this, args) : value; - - while (++index < length) { - result = funcs[index].call(this, result); - } - return result; - }; - }); - } - - /** - * Creates a function that wraps `func` to invoke it with optional `this` - * binding of `thisArg`, partial application, and currying. - * - * @private - * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to the new function. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [partialsRight] The arguments to append to those provided to the new function. - * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { - var isAry = bitmask & ARY_FLAG, - isBind = bitmask & BIND_FLAG, - isBindKey = bitmask & BIND_KEY_FLAG, - isCurry = bitmask & CURRY_FLAG, - isCurryRight = bitmask & CURRY_RIGHT_FLAG, - isFlip = bitmask & FLIP_FLAG, - Ctor = isBindKey ? undefined : createCtorWrapper(func); - - function wrapper() { - var length = arguments.length, - index = length, - args = Array(length); - - while (index--) { - args[index] = arguments[index]; - } - if (partials) { - args = composeArgs(args, partials, holders); - } - if (partialsRight) { - args = composeArgsRight(args, partialsRight, holdersRight); - } - if (isCurry || isCurryRight) { - var placeholder = lodash.placeholder || wrapper.placeholder, - argsHolders = replaceHolders(args, placeholder); - - length -= argsHolders.length; - if (length < arity) { - return createRecurryWrapper(func, bitmask, createHybridWrapper, placeholder, thisArg, args, argsHolders, argPos, ary, arity - length); - } - } - var thisBinding = isBind ? thisArg : this, - fn = isBindKey ? thisBinding[func] : func; - - if (argPos) { - args = reorder(args, argPos); - } else if (isFlip && args.length > 1) { - args.reverse(); - } - if (isAry && ary < args.length) { - args.length = ary; - } - if (this && this !== root && this instanceof wrapper) { - fn = Ctor || createCtorWrapper(fn); - } - return fn.apply(thisBinding, args); - } - return wrapper; - } - - /** - * Creates a function like `_.invertBy`. - * - * @private - * @param {Function} setter The function to set accumulator values. - * @param {Function} toIteratee The function to resolve iteratees. - * @returns {Function} Returns the new inverter function. - */ - function createInverter(setter, toIteratee) { - return function(object, iteratee) { - return baseInverter(object, setter, toIteratee(iteratee), {}); - }; - } - - /** - * Creates a function like `_.over`. - * - * @private - * @param {Function} arrayFunc The function to iterate over iteratees. - * @returns {Function} Returns the new invoker function. - */ - function createOver(arrayFunc) { - return rest(function(iteratees) { - iteratees = arrayMap(baseFlatten(iteratees), getIteratee()); - return rest(function(args) { - var thisArg = this; - return arrayFunc(iteratees, function(iteratee) { - return apply(iteratee, thisArg, args); - }); - }); - }); - } - - /** - * Creates the padding for `string` based on `length`. The `chars` string - * is truncated if the number of characters exceeds `length`. - * - * @private - * @param {string} string The string to create padding for. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padding for `string`. - */ - function createPadding(string, length, chars) { - length = toInteger(length); - - var strLength = stringSize(string); - if (!length || strLength >= length) { - return ''; - } - var padLength = length - strLength; - chars = chars === undefined ? ' ' : (chars + ''); - - var result = repeat(chars, nativeCeil(padLength / stringSize(chars))); - return reHasComplexSymbol.test(chars) - ? stringToArray(result).slice(0, padLength).join('') - : result.slice(0, padLength); - } - - /** - * Creates a function that wraps `func` to invoke it with the optional `this` - * binding of `thisArg` and the `partials` prepended to those provided to - * the wrapper. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} partials The arguments to prepend to those provided to the new function. - * @returns {Function} Returns the new wrapped function. - */ - function createPartialWrapper(func, bitmask, thisArg, partials) { - var isBind = bitmask & BIND_FLAG, - Ctor = createCtorWrapper(func); - - function wrapper() { - var argsIndex = -1, - argsLength = arguments.length, - leftIndex = -1, - leftLength = partials.length, - args = Array(leftLength + argsLength), - fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - - while (++leftIndex < leftLength) { - args[leftIndex] = partials[leftIndex]; - } - while (argsLength--) { - args[leftIndex++] = arguments[++argsIndex]; - } - return apply(fn, isBind ? thisArg : this, args); - } - return wrapper; - } - - /** - * Creates a `_.range` or `_.rangeRight` function. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new range function. - */ - function createRange(fromRight) { - return function(start, end, step) { - if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { - end = step = undefined; - } - // Ensure the sign of `-0` is preserved. - start = toNumber(start); - start = start === start ? start : 0; - if (end === undefined) { - end = start; - start = 0; - } else { - end = toNumber(end) || 0; - } - step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0); - return baseRange(start, end, step, fromRight); - }; - } - - /** - * Creates a function that wraps `func` to continue currying. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` for more details. - * @param {Function} wrapFunc The function to create the `func` wrapper. - * @param {*} placeholder The placeholder to replace. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to the new function. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { - var isCurry = bitmask & CURRY_FLAG, - newArgPos = argPos ? copyArray(argPos) : undefined, - newsHolders = isCurry ? holders : undefined, - newHoldersRight = isCurry ? undefined : holders, - newPartials = isCurry ? partials : undefined, - newPartialsRight = isCurry ? undefined : partials; - - bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG); - bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG); - - if (!(bitmask & CURRY_BOUND_FLAG)) { - bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); - } - var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, arity], - result = wrapFunc.apply(undefined, newData); - - if (isLaziable(func)) { - setData(result, newData); - } - result.placeholder = placeholder; - return result; - } - - /** - * Creates a function like `_.round`. - * - * @private - * @param {string} methodName The name of the `Math` method to use when rounding. - * @returns {Function} Returns the new round function. - */ - function createRound(methodName) { - var func = Math[methodName]; - return function(number, precision) { - number = toNumber(number); - precision = toInteger(precision); - if (precision) { - // Shift with exponential notation to avoid floating-point issues. - // See [MDN](https://mdn.io/round#Examples) for more details. - var pair = (toString(number) + 'e').split('e'), - value = func(pair[0] + 'e' + (+pair[1] + precision)); - - pair = (toString(value) + 'e').split('e'); - return +(pair[0] + 'e' + (+pair[1] - precision)); - } - return func(number); - }; - } - - /** - * Creates a set of `values`. - * - * @private - * @param {Array} values The values to add to the set. - * @returns {Object} Returns the new set. - */ - var createSet = !(Set && new Set([1, 2]).size === 2) ? noop : function(values) { - return new Set(values); - }; - - /** - * Creates a function that either curries or invokes `func` with optional - * `this` binding and partially applied arguments. - * - * @private - * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask of wrapper flags. - * The bitmask may be composed of the following flags: - * 1 - `_.bind` - * 2 - `_.bindKey` - * 4 - `_.curry` or `_.curryRight` of a bound function - * 8 - `_.curry` - * 16 - `_.curryRight` - * 32 - `_.partial` - * 64 - `_.partialRight` - * 128 - `_.rearg` - * 256 - `_.ary` - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to be partially applied. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { - var isBindKey = bitmask & BIND_KEY_FLAG; - if (!isBindKey && typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - var length = partials ? partials.length : 0; - if (!length) { - bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG); - partials = holders = undefined; - } - ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); - arity = arity === undefined ? arity : toInteger(arity); - length -= holders ? holders.length : 0; - - if (bitmask & PARTIAL_RIGHT_FLAG) { - var partialsRight = partials, - holdersRight = holders; - - partials = holders = undefined; - } - var data = isBindKey ? undefined : getData(func), - newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity]; - - if (data) { - mergeData(newData, data); - } - func = newData[0]; - bitmask = newData[1]; - thisArg = newData[2]; - partials = newData[3]; - holders = newData[4]; - arity = newData[9] = newData[9] == null - ? (isBindKey ? 0 : func.length) - : nativeMax(newData[9] - length, 0); - - if (!arity && bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG)) { - bitmask &= ~(CURRY_FLAG | CURRY_RIGHT_FLAG); - } - if (!bitmask || bitmask == BIND_FLAG) { - var result = createBaseWrapper(func, bitmask, thisArg); - } else if (bitmask == CURRY_FLAG || bitmask == CURRY_RIGHT_FLAG) { - result = createCurryWrapper(func, bitmask, arity); - } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !holders.length) { - result = createPartialWrapper(func, bitmask, thisArg, partials); - } else { - result = createHybridWrapper.apply(undefined, newData); - } - var setter = data ? baseSetData : setData; - return setter(result, newData); - } - - /** - * A specialized version of `baseIsEqualDeep` for arrays with support for - * partial deep comparisons. - * - * @private - * @param {Array} array The array to compare. - * @param {Array} other The other array to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. - * @param {Object} [stack] Tracks traversed `array` and `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. - */ - function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { - var index = -1, - isPartial = bitmask & PARTIAL_COMPARE_FLAG, - isUnordered = bitmask & UNORDERED_COMPARE_FLAG, - arrLength = array.length, - othLength = other.length; - - if (arrLength != othLength && !(isPartial && othLength > arrLength)) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(array); - if (stacked) { - return stacked == other; - } - var result = true; - stack.set(array, other); - - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, arrValue, index, other, array, stack) - : customizer(arrValue, othValue, index, array, other, stack); - } - if (compared !== undefined) { - if (compared) { - continue; - } - result = false; - break; - } - // Recursively compare arrays (susceptible to call stack limits). - if (isUnordered) { - if (!arraySome(other, function(othValue) { - return arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack); - })) { - result = false; - break; - } - } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { - result = false; - break; - } - } - stack['delete'](array); - return result; - } - - /** - * A specialized version of `baseIsEqualDeep` for comparing objects of - * the same `toStringTag`. - * - * **Note:** This function only supports comparing values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {string} tag The `toStringTag` of the objects to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalByTag(object, other, tag, equalFunc, customizer, bitmask) { - switch (tag) { - case arrayBufferTag: - if ((object.byteLength != other.byteLength) || - !equalFunc(new Uint8Array(object), new Uint8Array(other))) { - return false; - } - return true; - - case boolTag: - case dateTag: - // Coerce dates and booleans to numbers, dates to milliseconds and booleans - // to `1` or `0` treating invalid dates coerced to `NaN` as not equal. - return +object == +other; - - case errorTag: - return object.name == other.name && object.message == other.message; - - case numberTag: - // Treat `NaN` vs. `NaN` as equal. - return (object != +object) ? other != +other : object == +other; - - case regexpTag: - case stringTag: - // Coerce regexes to strings and treat strings primitives and string - // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details. - return object == (other + ''); - - case mapTag: - var convert = mapToArray; - - case setTag: - var isPartial = bitmask & PARTIAL_COMPARE_FLAG; - convert || (convert = setToArray); - - // Recursively compare objects (susceptible to call stack limits). - return (isPartial || object.size == other.size) && - equalFunc(convert(object), convert(other), customizer, bitmask | UNORDERED_COMPARE_FLAG); - - case symbolTag: - return !!Symbol && (symbolValueOf.call(object) == symbolValueOf.call(other)); - } - return false; - } - - /** - * A specialized version of `baseIsEqualDeep` for objects with support for - * partial deep comparisons. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparisons. - * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { - var isPartial = bitmask & PARTIAL_COMPARE_FLAG, - objProps = keys(object), - objLength = objProps.length, - othProps = keys(other), - othLength = othProps.length; - - if (objLength != othLength && !isPartial) { - return false; - } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isPartial ? key in other : baseHas(other, key))) { - return false; - } - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked) { - return stacked == other; - } - var result = true; - stack.set(object, other); - - var skipCtor = isPartial; - while (++index < objLength) { - key = objProps[index]; - var objValue = object[key], - othValue = other[key]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, objValue, key, other, object, stack) - : customizer(objValue, othValue, key, object, other, stack); - } - // Recursively compare objects (susceptible to call stack limits). - if (!(compared === undefined - ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack)) - : compared - )) { - result = false; - break; - } - skipCtor || (skipCtor = key == 'constructor'); - } - if (result && !skipCtor) { - var objCtor = object.constructor, - othCtor = other.constructor; - - // Non `Object` object instances with different constructors are not equal. - if (objCtor != othCtor && - ('constructor' in object && 'constructor' in other) && - !(typeof objCtor == 'function' && objCtor instanceof objCtor && - typeof othCtor == 'function' && othCtor instanceof othCtor)) { - result = false; - } - } - stack['delete'](object); - return result; - } - - /** - * Gets metadata for `func`. - * - * @private - * @param {Function} func The function to query. - * @returns {*} Returns the metadata for `func`. - */ - var getData = !metaMap ? noop : function(func) { - return metaMap.get(func); - }; - - /** - * Gets the name of `func`. - * - * @private - * @param {Function} func The function to query. - * @returns {string} Returns the function name. - */ - function getFuncName(func) { - var result = (func.name + ''), - array = realNames[result], - length = hasOwnProperty.call(realNames, result) ? array.length : 0; - - while (length--) { - var data = array[length], - otherFunc = data.func; - if (otherFunc == null || otherFunc == func) { - return data.name; - } - } - return result; - } - - /** - * Gets the appropriate "iteratee" function. If the `_.iteratee` method is - * customized this function returns the custom method, otherwise it returns - * `baseIteratee`. If arguments are provided the chosen function is invoked - * with them and its result is returned. - * - * @private - * @param {*} [value] The value to convert to an iteratee. - * @param {number} [arity] The arity of the created iteratee. - * @returns {Function} Returns the chosen function or its result. - */ - function getIteratee() { - var result = lodash.iteratee || iteratee; - result = result === iteratee ? baseIteratee : result; - return arguments.length ? result(arguments[0], arguments[1]) : result; - } - - /** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ - var getLength = baseProperty('length'); - - /** - * Gets the property names, values, and compare flags of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the match data of `object`. - */ - function getMatchData(object) { - var result = toPairs(object), - length = result.length; - - while (length--) { - result[length][2] = isStrictComparable(result[length][1]); - } - return result; - } - - /** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ - function getNative(object, key) { - var value = object == null ? undefined : object[key]; - return isNative(value) ? value : undefined; - } - - /** - * Creates an array of the own symbol properties of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ - var getSymbols = getOwnPropertySymbols || function() { - return []; - }; - - /** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ - function getTag(value) { - return objectToString.call(value); - } - - // Fallback for IE 11 providing `toStringTag` values for maps and sets. - if ((Map && getTag(new Map) != mapTag) || (Set && getTag(new Set) != setTag)) { - getTag = function(value) { - var result = objectToString.call(value), - Ctor = result == objectTag ? value.constructor : null, - ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : ''; - - if (ctorString) { - if (ctorString == mapCtorString) { - return mapTag; - } - if (ctorString == setCtorString) { - return setTag; - } - } - return result; - }; - } - - /** - * Gets the view, applying any `transforms` to the `start` and `end` positions. - * - * @private - * @param {number} start The start of the view. - * @param {number} end The end of the view. - * @param {Array} transforms The transformations to apply to the view. - * @returns {Object} Returns an object containing the `start` and `end` - * positions of the view. - */ - function getView(start, end, transforms) { - var index = -1, - length = transforms.length; - - while (++index < length) { - var data = transforms[index], - size = data.size; - - switch (data.type) { - case 'drop': start += size; break; - case 'dropRight': end -= size; break; - case 'take': end = nativeMin(end, start + size); break; - case 'takeRight': start = nativeMax(start, end - size); break; - } - } - return { 'start': start, 'end': end }; - } - - /** - * Checks if `path` exists on `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @param {Function} hasFunc The function to check properties. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - */ - function hasPath(object, path, hasFunc) { - if (object == null) { - return false; - } - var result = hasFunc(object, path); - if (!result && !isKey(path)) { - path = baseToPath(path); - object = parent(object, path); - if (object != null) { - path = last(path); - result = hasFunc(object, path); - } - } - var length = object ? object.length : undefined; - return result || ( - !!length && isLength(length) && isIndex(path, length) && - (isArray(object) || isString(object) || isArguments(object)) - ); - } - - /** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ - function initCloneArray(array) { - var length = array.length, - result = array.constructor(length); - - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; - } - return result; - } - - /** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneObject(object) { - if (isPrototype(object)) { - return {}; - } - var Ctor = object.constructor; - return baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined); - } - - /** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneByTag(object, tag, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneBuffer(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); - - case mapTag: - return cloneMap(object); - - case numberTag: - case stringTag: - return new Ctor(object); - - case regexpTag: - return cloneRegExp(object); - - case setTag: - return cloneSet(object); - - case symbolTag: - return cloneSymbol(object); - } - } - - /** - * Creates an array of index keys for `object` values of arrays, - * `arguments` objects, and strings, otherwise `null` is returned. - * - * @private - * @param {Object} object The object to query. - * @returns {Array|null} Returns index keys, else `null`. - */ - function indexKeys(object) { - var length = object ? object.length : undefined; - if (isLength(length) && - (isArray(object) || isString(object) || isArguments(object))) { - return baseTimes(length, String); - } - return null; - } - - /** - * Checks if the provided arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. - */ - function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object)) { - return eq(object[index], value); - } - return false; - } - - /** - * Checks if `value` is a property name and not a property path. - * - * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. - */ - function isKey(value, object) { - if (typeof value == 'number') { - return true; - } - return !isArray(value) && - (reIsPlainProp.test(value) || !reIsDeepProp.test(value) || - (object != null && value in Object(object))); - } - - /** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ - function isKeyable(value) { - var type = typeof value; - return type == 'number' || type == 'boolean' || - (type == 'string' && value !== '__proto__') || value == null; - } - - /** - * Checks if `func` has a lazy counterpart. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`. - */ - function isLaziable(func) { - var funcName = getFuncName(func), - other = lodash[funcName]; - - if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { - return false; - } - if (func === other) { - return true; - } - var data = getData(other); - return !!data && func === data[0]; - } - - /** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ - function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; - } - - /** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. - */ - function isStrictComparable(value) { - return value === value && !isObject(value); - } - - /** - * Merges the function metadata of `source` into `data`. - * - * Merging metadata reduces the number of wrappers used to invoke a function. - * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` - * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg` - * modify function arguments, making the order in which they are executed important, - * preventing the merging of metadata. However, we make an exception for a safe - * combined case where curried functions have `_.ary` and or `_.rearg` applied. - * - * @private - * @param {Array} data The destination metadata. - * @param {Array} source The source metadata. - * @returns {Array} Returns `data`. - */ - function mergeData(data, source) { - var bitmask = data[1], - srcBitmask = source[1], - newBitmask = bitmask | srcBitmask, - isCommon = newBitmask < (BIND_FLAG | BIND_KEY_FLAG | ARY_FLAG); - - var isCombo = - (srcBitmask == ARY_FLAG && (bitmask == CURRY_FLAG)) || - (srcBitmask == ARY_FLAG && (bitmask == REARG_FLAG) && (data[7].length <= source[8])) || - (srcBitmask == (ARY_FLAG | REARG_FLAG) && (source[7].length <= source[8]) && (bitmask == CURRY_FLAG)); - - // Exit early if metadata can't be merged. - if (!(isCommon || isCombo)) { - return data; - } - // Use source `thisArg` if available. - if (srcBitmask & BIND_FLAG) { - data[2] = source[2]; - // Set when currying a bound function. - newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG; - } - // Compose partial arguments. - var value = source[3]; - if (value) { - var partials = data[3]; - data[3] = partials ? composeArgs(partials, value, source[4]) : copyArray(value); - data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : copyArray(source[4]); - } - // Compose partial right arguments. - value = source[5]; - if (value) { - partials = data[5]; - data[5] = partials ? composeArgsRight(partials, value, source[6]) : copyArray(value); - data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : copyArray(source[6]); - } - // Use source `argPos` if available. - value = source[7]; - if (value) { - data[7] = copyArray(value); - } - // Use source `ary` if it's smaller. - if (srcBitmask & ARY_FLAG) { - data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); - } - // Use source `arity` if one is not provided. - if (data[9] == null) { - data[9] = source[9]; - } - // Use source `func` and merge bitmasks. - data[0] = source[0]; - data[1] = newBitmask; - - return data; - } - - /** - * Used by `_.defaultsDeep` to customize its `_.merge` use. - * - * @private - * @param {*} objValue The destination value. - * @param {*} srcValue The source value. - * @param {string} key The key of the property to merge. - * @param {Object} object The parent object of `objValue`. - * @param {Object} source The parent object of `srcValue`. - * @param {Object} [stack] Tracks traversed source values and their merged counterparts. - * @returns {*} Returns the value to assign. - */ - function mergeDefaults(objValue, srcValue, key, object, source, stack) { - if (isObject(objValue) && isObject(srcValue)) { - stack.set(srcValue, objValue); - baseMerge(objValue, srcValue, undefined, mergeDefaults, stack); - } - return objValue; - } - - /** - * Gets the parent value at `path` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} path The path to get the parent value of. - * @returns {*} Returns the parent value. - */ - function parent(object, path) { - return path.length == 1 ? object : get(object, baseSlice(path, 0, -1)); - } - - /** - * Reorder `array` according to the specified indexes where the element at - * the first index is assigned as the first element, the element at - * the second index is assigned as the second element, and so on. - * - * @private - * @param {Array} array The array to reorder. - * @param {Array} indexes The arranged array indexes. - * @returns {Array} Returns `array`. - */ - function reorder(array, indexes) { - var arrLength = array.length, - length = nativeMin(indexes.length, arrLength), - oldArray = copyArray(array); - - while (length--) { - var index = indexes[length]; - array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; - } - return array; - } - - /** - * Sets metadata for `func`. - * - * **Note:** If this function becomes hot, i.e. is invoked a lot in a short - * period of time, it will trip its breaker and transition to an identity function - * to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070) - * for more details. - * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. - */ - var setData = (function() { - var count = 0, - lastCalled = 0; - - return function(key, value) { - var stamp = now(), - remaining = HOT_SPAN - (stamp - lastCalled); - - lastCalled = stamp; - if (remaining > 0) { - if (++count >= HOT_COUNT) { - return key; - } - } else { - count = 0; - } - return baseSetData(key, value); - }; - }()); - - /** - * Converts `string` to a property path array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the property path array. - */ - function stringToPath(string) { - var result = []; - toString(string).replace(rePropName, function(match, number, quote, string) { - result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; - } - - /** - * Converts `value` to an array-like object if it's not one. - * - * @private - * @param {*} value The value to process. - * @returns {Array} Returns the array-like object. - */ - function toArrayLikeObject(value) { - return isArrayLikeObject(value) ? value : []; - } - - /** - * Converts `value` to a function if it's not one. - * - * @private - * @param {*} value The value to process. - * @returns {Function} Returns the function. - */ - function toFunction(value) { - return typeof value == 'function' ? value : identity; - } - - /** - * Creates a clone of `wrapper`. - * - * @private - * @param {Object} wrapper The wrapper to clone. - * @returns {Object} Returns the cloned wrapper. - */ - function wrapperClone(wrapper) { - if (wrapper instanceof LazyWrapper) { - return wrapper.clone(); - } - var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); - result.__actions__ = copyArray(wrapper.__actions__); - result.__index__ = wrapper.__index__; - result.__values__ = wrapper.__values__; - return result; - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates an array of elements split into groups the length of `size`. - * If `array` can't be split evenly, the final chunk will be the remaining - * elements. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to process. - * @param {number} [size=0] The length of each chunk. - * @returns {Array} Returns the new array containing chunks. - * @example - * - * _.chunk(['a', 'b', 'c', 'd'], 2); - * // => [['a', 'b'], ['c', 'd']] - * - * _.chunk(['a', 'b', 'c', 'd'], 3); - * // => [['a', 'b', 'c'], ['d']] - */ - function chunk(array, size) { - size = nativeMax(toInteger(size), 0); - - var length = array ? array.length : 0; - if (!length || size < 1) { - return []; - } - var index = 0, - resIndex = -1, - result = Array(nativeCeil(length / size)); - - while (index < length) { - result[++resIndex] = baseSlice(array, index, (index += size)); - } - return result; - } - - /** - * Creates an array with all falsey values removed. The values `false`, `null`, - * `0`, `""`, `undefined`, and `NaN` are falsey. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to compact. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.compact([0, 1, false, 2, '', 3]); - * // => [1, 2, 3] - */ - function compact(array) { - var index = -1, - length = array ? array.length : 0, - resIndex = -1, - result = []; - - while (++index < length) { - var value = array[index]; - if (value) { - result[++resIndex] = value; - } - } - return result; - } - - /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to concatenate. - * @param {...*} [values] The values to concatenate. - * @returns {Array} Returns the new concatenated array. - * @example - * - * var array = [1]; - * var other = _.concat(array, 2, [3], [[4]]); - * - * console.log(other); - * // => [1, 2, 3, [4]] - * - * console.log(array); - * // => [1] - */ - var concat = rest(function(array, values) { - if (!isArray(array)) { - array = array == null ? [] : [Object(array)]; - } - values = baseFlatten(values); - return arrayConcat(array, values); - }); - - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.difference([3, 2, 1], [4, 2]); - * // => [3, 1] - */ - var difference = rest(function(array, values) { - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, false, true)) - : []; - }); - - /** - * This method is like `_.difference` except that it accepts `iteratee` which - * is invoked for each element of `array` and `values` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.differenceBy([3.1, 2.2, 1.3], [4.4, 2.5], Math.floor); - * // => [3.1, 1.3] - * - * // The `_.property` iteratee shorthand. - * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - var differenceBy = rest(function(array, values) { - var iteratee = last(values); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; - } - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, false, true), getIteratee(iteratee)) - : []; - }); - - /** - * This method is like `_.difference` except that it accepts `comparator` - * which is invoked to compare elements of `array` to `values`. The comparator - * is invoked with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * - * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); - * // => [{ 'x': 2, 'y': 1 }] - */ - var differenceWith = rest(function(array, values) { - var comparator = last(values); - if (isArrayLikeObject(comparator)) { - comparator = undefined; - } - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, false, true), undefined, comparator) - : []; - }); - - /** - * Creates a slice of `array` with `n` elements dropped from the beginning. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.drop([1, 2, 3]); - * // => [2, 3] - * - * _.drop([1, 2, 3], 2); - * // => [3] - * - * _.drop([1, 2, 3], 5); - * // => [] - * - * _.drop([1, 2, 3], 0); - * // => [1, 2, 3] - */ - function drop(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - return baseSlice(array, n < 0 ? 0 : n, length); - } - - /** - * Creates a slice of `array` with `n` elements dropped from the end. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropRight([1, 2, 3]); - * // => [1, 2] - * - * _.dropRight([1, 2, 3], 2); - * // => [1] - * - * _.dropRight([1, 2, 3], 5); - * // => [] - * - * _.dropRight([1, 2, 3], 0); - * // => [1, 2, 3] - */ - function dropRight(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - n = length - n; - return baseSlice(array, 0, n < 0 ? 0 : n); - } - - /** - * Creates a slice of `array` excluding elements dropped from the end. - * Elements are dropped until `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.dropRightWhile(users, function(o) { return !o.active; }); - * // => objects for ['barney'] - * - * // The `_.matches` iteratee shorthand. - * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); - * // => objects for ['barney', 'fred'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.dropRightWhile(users, ['active', false]); - * // => objects for ['barney'] - * - * // The `_.property` iteratee shorthand. - * _.dropRightWhile(users, 'active'); - * // => objects for ['barney', 'fred', 'pebbles'] - */ - function dropRightWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), true, true) - : []; - } - - /** - * Creates a slice of `array` excluding elements dropped from the beginning. - * Elements are dropped until `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.dropWhile(users, function(o) { return !o.active; }); - * // => objects for ['pebbles'] - * - * // The `_.matches` iteratee shorthand. - * _.dropWhile(users, { 'user': 'barney', 'active': false }); - * // => objects for ['fred', 'pebbles'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.dropWhile(users, ['active', false]); - * // => objects for ['pebbles'] - * - * // The `_.property` iteratee shorthand. - * _.dropWhile(users, 'active'); - * // => objects for ['barney', 'fred', 'pebbles'] - */ - function dropWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), true) - : []; - } - - /** - * Fills elements of `array` with `value` from `start` up to, but not - * including, `end`. - * - * **Note:** This method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.fill(array, 'a'); - * console.log(array); - * // => ['a', 'a', 'a'] - * - * _.fill(Array(3), 2); - * // => [2, 2, 2] - * - * _.fill([4, 6, 8, 10], '*', 1, 3); - * // => [4, '*', '*', 10] - */ - function fill(array, value, start, end) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { - start = 0; - end = length; - } - return baseFill(array, value, start, end); - } - - /** - * This method is like `_.find` except that it returns the index of the first - * element `predicate` returns truthy for instead of the element itself. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.findIndex(users, function(o) { return o.user == 'barney'; }); - * // => 0 - * - * // The `_.matches` iteratee shorthand. - * _.findIndex(users, { 'user': 'fred', 'active': false }); - * // => 1 - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findIndex(users, ['active', false]); - * // => 0 - * - * // The `_.property` iteratee shorthand. - * _.findIndex(users, 'active'); - * // => 2 - */ - function findIndex(array, predicate) { - return (array && array.length) - ? baseFindIndex(array, getIteratee(predicate, 3)) - : -1; - } - - /** - * This method is like `_.findIndex` except that it iterates over elements - * of `collection` from right to left. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); - * // => 2 - * - * // The `_.matches` iteratee shorthand. - * _.findLastIndex(users, { 'user': 'barney', 'active': true }); - * // => 0 - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findLastIndex(users, ['active', false]); - * // => 2 - * - * // The `_.property` iteratee shorthand. - * _.findLastIndex(users, 'active'); - * // => 0 - */ - function findLastIndex(array, predicate) { - return (array && array.length) - ? baseFindIndex(array, getIteratee(predicate, 3), true) - : -1; - } - - /** - * Flattens `array` a single level. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flatten([1, [2, 3, [4]]]); - * // => [1, 2, 3, [4]] - */ - function flatten(array) { - var length = array ? array.length : 0; - return length ? baseFlatten(array) : []; - } - - /** - * This method is like `_.flatten` except that it recursively flattens `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to recursively flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flattenDeep([1, [2, 3, [4]]]); - * // => [1, 2, 3, 4] - */ - function flattenDeep(array) { - var length = array ? array.length : 0; - return length ? baseFlatten(array, true) : []; - } - - /** - * The inverse of `_.toPairs`; this method returns an object composed - * from key-value `pairs`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} pairs The key-value pairs. - * @returns {Object} Returns the new object. - * @example - * - * _.fromPairs([['fred', 30], ['barney', 40]]); - * // => { 'fred': 30, 'barney': 40 } - */ - function fromPairs(pairs) { - var index = -1, - length = pairs ? pairs.length : 0, - result = {}; - - while (++index < length) { - var pair = pairs[index]; - result[pair[0]] = pair[1]; - } - return result; - } - - /** - * Gets the first element of `array`. - * - * @static - * @memberOf _ - * @alias first - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the first element of `array`. - * @example - * - * _.head([1, 2, 3]); - * // => 1 - * - * _.head([]); - * // => undefined - */ - function head(array) { - return array ? array[0] : undefined; - } - - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it's used as the offset - * from the end of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // Search from the `fromIndex`. - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - */ - function indexOf(array, value, fromIndex) { - var length = array ? array.length : 0; - if (!length) { - return -1; - } - fromIndex = toInteger(fromIndex); - if (fromIndex < 0) { - fromIndex = nativeMax(length + fromIndex, 0); - } - return baseIndexOf(array, value, fromIndex); - } - - /** - * Gets all but the last element of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.initial([1, 2, 3]); - * // => [1, 2] - */ - function initial(array) { - return dropRight(array, 1); - } - - /** - * Creates an array of unique values that are included in all of the provided - * arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of shared values. - * @example - * - * _.intersection([2, 1], [4, 2], [1, 2]); - * // => [2] - */ - var intersection = rest(function(arrays) { - var mapped = arrayMap(arrays, toArrayLikeObject); - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped) - : []; - }); - - /** - * This method is like `_.intersection` except that it accepts `iteratee` - * which is invoked for each element of each `arrays` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of shared values. - * @example - * - * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1] - * - * // The `_.property` iteratee shorthand. - * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }] - */ - var intersectionBy = rest(function(arrays) { - var iteratee = last(arrays), - mapped = arrayMap(arrays, toArrayLikeObject); - - if (iteratee === last(mapped)) { - iteratee = undefined; - } else { - mapped.pop(); - } - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped, getIteratee(iteratee)) - : []; - }); - - /** - * This method is like `_.intersection` except that it accepts `comparator` - * which is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of shared values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.intersectionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }] - */ - var intersectionWith = rest(function(arrays) { - var comparator = last(arrays), - mapped = arrayMap(arrays, toArrayLikeObject); - - if (comparator === last(mapped)) { - comparator = undefined; - } else { - mapped.pop(); - } - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped, undefined, comparator) - : []; - }); - - /** - * Converts all elements in `array` into a string separated by `separator`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to convert. - * @param {string} [separator=','] The element separator. - * @returns {string} Returns the joined string. - * @example - * - * _.join(['a', 'b', 'c'], '~'); - * // => 'a~b~c' - */ - function join(array, separator) { - return array ? nativeJoin.call(array, separator) : ''; - } - - /** - * Gets the last element of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the last element of `array`. - * @example - * - * _.last([1, 2, 3]); - * // => 3 - */ - function last(array) { - var length = array ? array.length : 0; - return length ? array[length - 1] : undefined; - } - - /** - * This method is like `_.indexOf` except that it iterates over elements of - * `array` from right to left. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {number} [fromIndex=array.length-1] The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.lastIndexOf([1, 2, 1, 2], 2); - * // => 3 - * - * // Search from the `fromIndex`. - * _.lastIndexOf([1, 2, 1, 2], 2, 2); - * // => 1 - */ - function lastIndexOf(array, value, fromIndex) { - var length = array ? array.length : 0; - if (!length) { - return -1; - } - var index = length; - if (fromIndex !== undefined) { - index = toInteger(fromIndex); - index = (index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1)) + 1; - } - if (value !== value) { - return indexOfNaN(array, index, true); - } - while (index--) { - if (array[index] === value) { - return index; - } - } - return -1; - } - - /** - * Removes all provided values from `array` using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * **Note:** Unlike `_.without`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {...*} [values] The values to remove. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, 2, 3); - * console.log(array); - * // => [1, 1] - */ - var pull = rest(pullAll); - - /** - * This method is like `_.pull` except that it accepts an array of values to remove. - * - * **Note:** Unlike `_.difference`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pullAll(array, [2, 3]); - * console.log(array); - * // => [1, 1] - */ - function pullAll(array, values) { - return (array && array.length && values && values.length) - ? basePullAll(array, values) - : array; - } - - /** - * This method is like `_.pullAll` except that it accepts `iteratee` which is - * invoked for each element of `array` and `values` to generate the criterion - * by which uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * **Note:** Unlike `_.differenceBy`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {Array} values The values to remove. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns `array`. - * @example - * - * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; - * - * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); - * console.log(array); - * // => [{ 'x': 2 }] - */ - function pullAllBy(array, values, iteratee) { - return (array && array.length && values && values.length) - ? basePullAllBy(array, values, getIteratee(iteratee)) - : array; - } - - /** - * Removes elements from `array` corresponding to `indexes` and returns an - * array of removed elements. - * - * **Note:** Unlike `_.at`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {...(number|number[])} [indexes] The indexes of elements to remove, - * specified individually or in arrays. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = [5, 10, 15, 20]; - * var evens = _.pullAt(array, 1, 3); - * - * console.log(array); - * // => [5, 15] - * - * console.log(evens); - * // => [10, 20] - */ - var pullAt = rest(function(array, indexes) { - indexes = arrayMap(baseFlatten(indexes), String); - - var result = baseAt(array, indexes); - basePullAt(array, indexes.sort(compareAscending)); - return result; - }); - - /** - * Removes all elements from `array` that `predicate` returns truthy for - * and returns an array of the removed elements. The predicate is invoked with - * three arguments: (value, index, array). - * - * **Note:** Unlike `_.filter`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = [1, 2, 3, 4]; - * var evens = _.remove(array, function(n) { - * return n % 2 == 0; - * }); - * - * console.log(array); - * // => [1, 3] - * - * console.log(evens); - * // => [2, 4] - */ - function remove(array, predicate) { - var result = []; - if (!(array && array.length)) { - return result; - } - var index = -1, - indexes = [], - length = array.length; - - predicate = getIteratee(predicate, 3); - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result.push(value); - indexes.push(index); - } - } - basePullAt(array, indexes); - return result; - } - - /** - * Reverses `array` so that the first element becomes the last, the second - * element becomes the second to last, and so on. - * - * **Note:** This method mutates `array` and is based on - * [`Array#reverse`](https://mdn.io/Array/reverse). - * - * @static - * @memberOf _ - * @category Array - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.reverse(array); - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ - function reverse(array) { - return array ? nativeReverse.call(array) : array; - } - - /** - * Creates a slice of `array` from `start` up to, but not including, `end`. - * - * **Note:** This method is used instead of [`Array#slice`](https://mdn.io/Array/slice) - * to ensure dense arrays are returned. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function slice(array, start, end) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { - start = 0; - end = length; - } - else { - start = start == null ? 0 : toInteger(start); - end = end === undefined ? length : toInteger(end); - } - return baseSlice(array, start, end); - } - - /** - * Uses a binary search to determine the lowest index at which `value` should - * be inserted into `array` in order to maintain its sort order. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @returns {number} Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - * - * _.sortedIndex([4, 5], 4); - * // => 0 - */ - function sortedIndex(array, value) { - return baseSortedIndex(array, value); - } - - /** - * This method is like `_.sortedIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the index at which `value` should be inserted into `array`. - * @example - * - * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; - * - * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); - * // => 1 - * - * // The `_.property` iteratee shorthand. - * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 0 - */ - function sortedIndexBy(array, value, iteratee) { - return baseSortedIndexBy(array, value, getIteratee(iteratee)); - } - - /** - * This method is like `_.indexOf` except that it performs a binary - * search on a sorted `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedIndexOf([1, 1, 2, 2], 2); - * // => 2 - */ - function sortedIndexOf(array, value) { - var length = array ? array.length : 0; - if (length) { - var index = baseSortedIndex(array, value); - if (index < length && eq(array[index], value)) { - return index; - } - } - return -1; - } - - /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @returns {number} Returns the index at which `value` should be inserted into `array`. - * @example - * - * _.sortedLastIndex([4, 5], 4); - * // => 1 - */ - function sortedLastIndex(array, value) { - return baseSortedIndex(array, value, true); - } - - /** - * This method is like `_.sortedLastIndex` except that it accepts `iteratee` - * which is invoked for `value` and each element of `array` to compute their - * sort ranking. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {number} Returns the index at which `value` should be inserted into `array`. - * @example - * - * // The `_.property` iteratee shorthand. - * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); - * // => 1 - */ - function sortedLastIndexBy(array, value, iteratee) { - return baseSortedIndexBy(array, value, getIteratee(iteratee), true); - } - - /** - * This method is like `_.lastIndexOf` except that it performs a binary - * search on a sorted `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.sortedLastIndexOf([1, 1, 2, 2], 2); - * // => 3 - */ - function sortedLastIndexOf(array, value) { - var length = array ? array.length : 0; - if (length) { - var index = baseSortedIndex(array, value, true) - 1; - if (eq(array[index], value)) { - return index; - } - } - return -1; - } - - /** - * This method is like `_.uniq` except that it's designed and optimized - * for sorted arrays. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.sortedUniq([1, 1, 2]); - * // => [1, 2] - */ - function sortedUniq(array) { - return (array && array.length) - ? baseSortedUniq(array) - : []; - } - - /** - * This method is like `_.uniqBy` except that it's designed and optimized - * for sorted arrays. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); - * // => [1.1, 2.3] - */ - function sortedUniqBy(array, iteratee) { - return (array && array.length) - ? baseSortedUniqBy(array, getIteratee(iteratee)) - : []; - } - - /** - * Gets all but the first element of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.tail([1, 2, 3]); - * // => [2, 3] - */ - function tail(array) { - return drop(array, 1); - } - - /** - * Creates a slice of `array` with `n` elements taken from the beginning. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.take([1, 2, 3]); - * // => [1] - * - * _.take([1, 2, 3], 2); - * // => [1, 2] - * - * _.take([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.take([1, 2, 3], 0); - * // => [] - */ - function take(array, n, guard) { - if (!(array && array.length)) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - return baseSlice(array, 0, n < 0 ? 0 : n); - } - - /** - * Creates a slice of `array` with `n` elements taken from the end. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeRight([1, 2, 3]); - * // => [3] - * - * _.takeRight([1, 2, 3], 2); - * // => [2, 3] - * - * _.takeRight([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.takeRight([1, 2, 3], 0); - * // => [] - */ - function takeRight(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - n = (guard || n === undefined) ? 1 : toInteger(n); - n = length - n; - return baseSlice(array, n < 0 ? 0 : n, length); - } - - /** - * Creates a slice of `array` with elements taken from the end. Elements are - * taken until `predicate` returns falsey. The predicate is invoked with three - * arguments: (value, index, array). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.takeRightWhile(users, function(o) { return !o.active; }); - * // => objects for ['fred', 'pebbles'] - * - * // The `_.matches` iteratee shorthand. - * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); - * // => objects for ['pebbles'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.takeRightWhile(users, ['active', false]); - * // => objects for ['fred', 'pebbles'] - * - * // The `_.property` iteratee shorthand. - * _.takeRightWhile(users, 'active'); - * // => [] - */ - function takeRightWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), false, true) - : []; - } - - /** - * Creates a slice of `array` with elements taken from the beginning. Elements - * are taken until `predicate` returns falsey. The predicate is invoked with - * three arguments: (value, index, array). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false}, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.takeWhile(users, function(o) { return !o.active; }); - * // => objects for ['barney', 'fred'] - * - * // The `_.matches` iteratee shorthand. - * _.takeWhile(users, { 'user': 'barney', 'active': false }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.takeWhile(users, ['active', false]); - * // => objects for ['barney', 'fred'] - * - * // The `_.property` iteratee shorthand. - * _.takeWhile(users, 'active'); - * // => [] - */ - function takeWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3)) - : []; - } - - /** - * Creates an array of unique values, in order, from all of the provided arrays - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of combined values. - * @example - * - * _.union([2, 1], [4, 2], [1, 2]); - * // => [2, 1, 4] - */ - var union = rest(function(arrays) { - return baseUniq(baseFlatten(arrays, false, true)); - }); - - /** - * This method is like `_.union` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of combined values. - * @example - * - * _.unionBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [2.1, 1.2, 4.3] - * - * // The `_.property` iteratee shorthand. - * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - var unionBy = rest(function(arrays) { - var iteratee = last(arrays); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; - } - return baseUniq(baseFlatten(arrays, false, true), getIteratee(iteratee)); - }); - - /** - * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked - * with two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of combined values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.unionWith(objects, others, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - var unionWith = rest(function(arrays) { - var comparator = last(arrays); - if (isArrayLikeObject(comparator)) { - comparator = undefined; - } - return baseUniq(baseFlatten(arrays, false, true), undefined, comparator); - }); - - /** - * Creates a duplicate-free version of an array, using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons, in which only the first occurrence of each element - * is kept. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.uniq([2, 1, 2]); - * // => [2, 1] - */ - function uniq(array) { - return (array && array.length) - ? baseUniq(array) - : []; - } - - /** - * This method is like `_.uniq` except that it accepts `iteratee` which is - * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * _.uniqBy([2.1, 1.2, 2.3], Math.floor); - * // => [2.1, 1.2] - * - * // The `_.property` iteratee shorthand. - * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - function uniqBy(array, iteratee) { - return (array && array.length) - ? baseUniq(array, getIteratee(iteratee)) - : []; - } - - /** - * This method is like `_.uniq` except that it accepts `comparator` which - * is invoked to compare elements of `array`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new duplicate free array. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.uniqWith(objects, _.isEqual); - * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] - */ - function uniqWith(array, comparator) { - return (array && array.length) - ? baseUniq(array, undefined, comparator) - : []; - } - - /** - * This method is like `_.zip` except that it accepts an array of grouped - * elements and creates an array regrouping the elements to their pre-zip - * configuration. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array of grouped elements to process. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]); - * // => [['fred', 30, true], ['barney', 40, false]] - * - * _.unzip(zipped); - * // => [['fred', 'barney'], [30, 40], [true, false]] - */ - function unzip(array) { - if (!(array && array.length)) { - return []; - } - var length = 0; - array = arrayFilter(array, function(group) { - if (isArrayLikeObject(group)) { - length = nativeMax(group.length, length); - return true; - } - }); - return baseTimes(length, function(index) { - return arrayMap(array, baseProperty(index)); - }); - } - - /** - * This method is like `_.unzip` except that it accepts `iteratee` to specify - * how regrouped values should be combined. The iteratee is invoked with the - * elements of each group: (...group). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array of grouped elements to process. - * @param {Function} [iteratee=_.identity] The function to combine regrouped values. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip([1, 2], [10, 20], [100, 200]); - * // => [[1, 10, 100], [2, 20, 200]] - * - * _.unzipWith(zipped, _.add); - * // => [3, 30, 300] - */ - function unzipWith(array, iteratee) { - if (!(array && array.length)) { - return []; - } - var result = unzip(array); - if (iteratee == null) { - return result; - } - return arrayMap(result, function(group) { - return apply(iteratee, undefined, group); - }); - } - - /** - * Creates an array excluding all provided values using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to filter. - * @param {...*} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.without([1, 2, 1, 3], 1, 2); - * // => [3] - */ - var without = rest(function(array, values) { - return isArrayLikeObject(array) - ? baseDifference(array, values) - : []; - }); - - /** - * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) - * of the provided arrays. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of values. - * @example - * - * _.xor([2, 1], [4, 2]); - * // => [1, 4] - */ - var xor = rest(function(arrays) { - return baseXor(arrayFilter(arrays, isArrayLikeObject)); - }); - - /** - * This method is like `_.xor` except that it accepts `iteratee` which is - * invoked for each element of each `arrays` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of values. - * @example - * - * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); - * // => [1.2, 4.3] - * - * // The `_.property` iteratee shorthand. - * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 2 }] - */ - var xorBy = rest(function(arrays) { - var iteratee = last(arrays); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined; - } - return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee)); - }); - - /** - * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of values. - * @example - * - * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; - * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; - * - * _.xorWith(objects, others, _.isEqual); - * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - var xorWith = rest(function(arrays) { - var comparator = last(arrays); - if (isArrayLikeObject(comparator)) { - comparator = undefined; - } - return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); - }); - - /** - * Creates an array of grouped elements, the first of which contains the first - * elements of the given arrays, the second of which contains the second elements - * of the given arrays, and so on. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zip(['fred', 'barney'], [30, 40], [true, false]); - * // => [['fred', 30, true], ['barney', 40, false]] - */ - var zip = rest(unzip); - - /** - * This method is like `_.fromPairs` except that it accepts two arrays, - * one of property names and one of corresponding values. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} [props=[]] The property names. - * @param {Array} [values=[]] The property values. - * @returns {Object} Returns the new object. - * @example - * - * _.zipObject(['a', 'b'], [1, 2]); - * // => { 'a': 1, 'b': 2 } - */ - function zipObject(props, values) { - return baseZipObject(props || [], values || [], assignValue); - } - - /** - * This method is like `_.zipObject` except that it supports property paths. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} [props=[]] The property names. - * @param {Array} [values=[]] The property values. - * @returns {Object} Returns the new object. - * @example - * - * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); - * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } - */ - function zipObjectDeep(props, values) { - return baseZipObject(props || [], values || [], baseSet); - } - - /** - * This method is like `_.zip` except that it accepts `iteratee` to specify - * how grouped values should be combined. The iteratee is invoked with the - * elements of each group: (...group). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @param {Function} [iteratee=_.identity] The function to combine grouped values. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { - * return a + b + c; - * }); - * // => [111, 222] - */ - var zipWith = rest(function(arrays) { - var length = arrays.length, - iteratee = length > 1 ? arrays[length - 1] : undefined; - - iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; - return unzipWith(arrays, iteratee); - }); - - /*------------------------------------------------------------------------*/ - - /** - * Creates a `lodash` object that wraps `value` with explicit method chaining enabled. - * The result of such method chaining must be unwrapped with `_#value`. - * - * @static - * @memberOf _ - * @category Seq - * @param {*} value The value to wrap. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'pebbles', 'age': 1 } - * ]; - * - * var youngest = _ - * .chain(users) - * .sortBy('age') - * .map(function(o) { - * return o.user + ' is ' + o.age; - * }) - * .head() - * .value(); - * // => 'pebbles is 1' - */ - function chain(value) { - var result = lodash(value); - result.__chain__ = true; - return result; - } - - /** - * This method invokes `interceptor` and returns `value`. The interceptor - * is invoked with one argument; (value). The purpose of this method is to - * "tap into" a method chain in order to modify intermediate results. - * - * @static - * @memberOf _ - * @category Seq - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @returns {*} Returns `value`. - * @example - * - * _([1, 2, 3]) - * .tap(function(array) { - * // Mutate input array. - * array.pop(); - * }) - * .reverse() - * .value(); - * // => [2, 1] - */ - function tap(value, interceptor) { - interceptor(value); - return value; - } - - /** - * This method is like `_.tap` except that it returns the result of `interceptor`. - * The purpose of this method is to "pass thru" values replacing intermediate - * results in a method chain. - * - * @static - * @memberOf _ - * @category Seq - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @returns {*} Returns the result of `interceptor`. - * @example - * - * _(' abc ') - * .chain() - * .trim() - * .thru(function(value) { - * return [value]; - * }) - * .value(); - * // => ['abc'] - */ - function thru(value, interceptor) { - return interceptor(value); - } - - /** - * This method is the wrapper version of `_.at`. - * - * @name at - * @memberOf _ - * @category Seq - * @param {...(string|string[])} [paths] The property paths of elements to pick, - * specified individually or in arrays. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; - * - * _(object).at(['a[0].b.c', 'a[1]']).value(); - * // => [3, 4] - * - * _(['a', 'b', 'c']).at(0, 2).value(); - * // => ['a', 'c'] - */ - var wrapperAt = rest(function(paths) { - paths = baseFlatten(paths); - var length = paths.length, - start = length ? paths[0] : 0, - value = this.__wrapped__, - interceptor = function(object) { return baseAt(object, paths); }; - - if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) { - return this.thru(interceptor); - } - value = value.slice(start, +start + (length ? 1 : 0)); - value.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined }); - return new LodashWrapper(value, this.__chain__).thru(function(array) { - if (length && !array.length) { - array.push(undefined); - } - return array; - }); - }); - - /** - * Enables explicit method chaining on the wrapper object. - * - * @name chain - * @memberOf _ - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // A sequence without explicit chaining. - * _(users).head(); - * // => { 'user': 'barney', 'age': 36 } - * - * // A sequence with explicit chaining. - * _(users) - * .chain() - * .head() - * .pick('user') - * .value(); - * // => { 'user': 'barney' } - */ - function wrapperChain() { - return chain(this); - } - - /** - * Executes the chained sequence and returns the wrapped result. - * - * @name commit - * @memberOf _ - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2]; - * var wrapped = _(array).push(3); - * - * console.log(array); - * // => [1, 2] - * - * wrapped = wrapped.commit(); - * console.log(array); - * // => [1, 2, 3] - * - * wrapped.last(); - * // => 3 - * - * console.log(array); - * // => [1, 2, 3] - */ - function wrapperCommit() { - return new LodashWrapper(this.value(), this.__chain__); - } - - /** - * This method is the wrapper version of `_.flatMap`. - * - * @name flatMap - * @memberOf _ - * @category Seq - * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * function duplicate(n) { - * return [n, n]; - * } - * - * _([1, 2]).flatMap(duplicate).value(); - * // => [1, 1, 2, 2] - */ - function wrapperFlatMap(iteratee) { - return this.map(iteratee).flatten(); - } - - /** - * Gets the next value on a wrapped object following the - * [iterator protocol](https://mdn.io/iteration_protocols#iterator). - * - * @name next - * @memberOf _ - * @category Seq - * @returns {Object} Returns the next iterator value. - * @example - * - * var wrapped = _([1, 2]); - * - * wrapped.next(); - * // => { 'done': false, 'value': 1 } - * - * wrapped.next(); - * // => { 'done': false, 'value': 2 } - * - * wrapped.next(); - * // => { 'done': true, 'value': undefined } - */ - function wrapperNext() { - if (this.__values__ === undefined) { - this.__values__ = toArray(this.value()); - } - var done = this.__index__ >= this.__values__.length, - value = done ? undefined : this.__values__[this.__index__++]; - - return { 'done': done, 'value': value }; - } - - /** - * Enables the wrapper to be iterable. - * - * @name Symbol.iterator - * @memberOf _ - * @category Seq - * @returns {Object} Returns the wrapper object. - * @example - * - * var wrapped = _([1, 2]); - * - * wrapped[Symbol.iterator]() === wrapped; - * // => true - * - * Array.from(wrapped); - * // => [1, 2] - */ - function wrapperToIterator() { - return this; - } - - /** - * Creates a clone of the chained sequence planting `value` as the wrapped value. - * - * @name plant - * @memberOf _ - * @category Seq - * @param {*} value The value to plant. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var wrapped = _([1, 2]).map(square); - * var other = wrapped.plant([3, 4]); - * - * other.value(); - * // => [9, 16] - * - * wrapped.value(); - * // => [1, 4] - */ - function wrapperPlant(value) { - var result, - parent = this; - - while (parent instanceof baseLodash) { - var clone = wrapperClone(parent); - clone.__index__ = 0; - clone.__values__ = undefined; - if (result) { - previous.__wrapped__ = clone; - } else { - result = clone; - } - var previous = clone; - parent = parent.__wrapped__; - } - previous.__wrapped__ = value; - return result; - } - - /** - * This method is the wrapper version of `_.reverse`. - * - * **Note:** This method mutates the wrapped array. - * - * @name reverse - * @memberOf _ - * @category Seq - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2, 3]; - * - * _(array).reverse().value() - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ - function wrapperReverse() { - var value = this.__wrapped__; - if (value instanceof LazyWrapper) { - var wrapped = value; - if (this.__actions__.length) { - wrapped = new LazyWrapper(this); - } - wrapped = wrapped.reverse(); - wrapped.__actions__.push({ 'func': thru, 'args': [reverse], 'thisArg': undefined }); - return new LodashWrapper(wrapped, this.__chain__); - } - return this.thru(reverse); - } - - /** - * Executes the chained sequence to extract the unwrapped value. - * - * @name value - * @memberOf _ - * @alias toJSON, valueOf - * @category Seq - * @returns {*} Returns the resolved unwrapped value. - * @example - * - * _([1, 2, 3]).value(); - * // => [1, 2, 3] - */ - function wrapperValue() { - return baseWrapperValue(this.__wrapped__, this.__actions__); - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is the number of times the key was returned by `iteratee`. - * The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.countBy([6.1, 4.2, 6.3], Math.floor); - * // => { '4': 1, '6': 2 } - * - * _.countBy(['one', 'two', 'three'], 'length'); - * // => { '3': 2, '5': 1 } - */ - var countBy = createAggregator(function(result, value, key) { - hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1); - }); - - /** - * Checks if `predicate` returns truthy for **all** elements of `collection`. - * Iteration is stopped once `predicate` returns falsey. The predicate is - * invoked with three arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {boolean} Returns `true` if all elements pass the predicate check, else `false`. - * @example - * - * _.every([true, 1, null, 'yes'], Boolean); - * // => false - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.every(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.every(users, ['active', false]); - * // => true - * - * // The `_.property` iteratee shorthand. - * _.every(users, 'active'); - * // => false - */ - function every(collection, predicate, guard) { - var func = isArray(collection) ? arrayEvery : baseEvery; - if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined; - } - return func(collection, getIteratee(predicate, 3)); - } - - /** - * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is invoked with three arguments: - * (value, index|key, collection). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * _.filter(users, function(o) { return !o.active; }); - * // => objects for ['fred'] - * - * // The `_.matches` iteratee shorthand. - * _.filter(users, { 'age': 36, 'active': true }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.filter(users, ['active', false]); - * // => objects for ['fred'] - * - * // The `_.property` iteratee shorthand. - * _.filter(users, 'active'); - * // => objects for ['barney'] - */ - function filter(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, getIteratee(predicate, 3)); - } - - /** - * Iterates over elements of `collection`, returning the first element - * `predicate` returns truthy for. The predicate is invoked with three arguments: - * (value, index|key, collection). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false }, - * { 'user': 'pebbles', 'age': 1, 'active': true } - * ]; - * - * _.find(users, function(o) { return o.age < 40; }); - * // => object for 'barney' - * - * // The `_.matches` iteratee shorthand. - * _.find(users, { 'age': 1, 'active': true }); - * // => object for 'pebbles' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.find(users, ['active', false]); - * // => object for 'fred' - * - * // The `_.property` iteratee shorthand. - * _.find(users, 'active'); - * // => object for 'barney' - */ - function find(collection, predicate) { - predicate = getIteratee(predicate, 3); - if (isArray(collection)) { - var index = baseFindIndex(collection, predicate); - return index > -1 ? collection[index] : undefined; - } - return baseFind(collection, predicate, baseEach); - } - - /** - * This method is like `_.find` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * _.findLast([1, 2, 3, 4], function(n) { - * return n % 2 == 1; - * }); - * // => 3 - */ - function findLast(collection, predicate) { - predicate = getIteratee(predicate, 3); - if (isArray(collection)) { - var index = baseFindIndex(collection, predicate, true); - return index > -1 ? collection[index] : undefined; - } - return baseFind(collection, predicate, baseEachRight); - } - - /** - * Creates an array of flattened values by running each element in `collection` - * through `iteratee` and concating its result to the other mapped values. - * The iteratee is invoked with three arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new flattened array. - * @example - * - * function duplicate(n) { - * return [n, n]; - * } - * - * _.flatMap([1, 2], duplicate); - * // => [1, 1, 2, 2] - */ - function flatMap(collection, iteratee) { - return baseFlatten(map(collection, iteratee)); - } - - /** - * Iterates over elements of `collection` invoking `iteratee` for each element. - * The iteratee is invoked with three arguments: (value, index|key, collection). - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * **Note:** As with other "Collections" methods, objects with a "length" property - * are iterated like arrays. To avoid this behavior use `_.forIn` or `_.forOwn` - * for object iteration. - * - * @static - * @memberOf _ - * @alias each - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - * @example - * - * _([1, 2]).forEach(function(value) { - * console.log(value); - * }); - * // => logs `1` then `2` - * - * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { - * console.log(key); - * }); - * // => logs 'a' then 'b' (iteration order is not guaranteed) - */ - function forEach(collection, iteratee) { - return (typeof iteratee == 'function' && isArray(collection)) - ? arrayEach(collection, iteratee) - : baseEach(collection, toFunction(iteratee)); - } - - /** - * This method is like `_.forEach` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @alias eachRight - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - * @example - * - * _.forEachRight([1, 2], function(value) { - * console.log(value); - * }); - * // => logs `2` then `1` - */ - function forEachRight(collection, iteratee) { - return (typeof iteratee == 'function' && isArray(collection)) - ? arrayEachRight(collection, iteratee) - : baseEachRight(collection, toFunction(iteratee)); - } - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is an array of elements responsible for generating the key. - * The iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.groupBy([6.1, 4.2, 6.3], Math.floor); - * // => { '4': [4.2], '6': [6.1, 6.3] } - * - * // The `_.property` iteratee shorthand. - * _.groupBy(['one', 'two', 'three'], 'length'); - * // => { '3': ['one', 'two'], '5': ['three'] } - */ - var groupBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - result[key].push(value); - } else { - result[key] = [value]; - } - }); - - /** - * Checks if `value` is in `collection`. If `collection` is a string it's checked - * for a substring of `value`, otherwise [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * is used for equality comparisons. If `fromIndex` is negative, it's used as - * the offset from the end of `collection`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {*} value The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns {boolean} Returns `true` if `value` is found, else `false`. - * @example - * - * _.includes([1, 2, 3], 1); - * // => true - * - * _.includes([1, 2, 3], 1, 2); - * // => false - * - * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); - * // => true - * - * _.includes('pebbles', 'eb'); - * // => true - */ - function includes(collection, value, fromIndex, guard) { - collection = isArrayLike(collection) ? collection : values(collection); - fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; - - var length = collection.length; - if (fromIndex < 0) { - fromIndex = nativeMax(length + fromIndex, 0); - } - return isString(collection) - ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) - : (!!length && baseIndexOf(collection, value, fromIndex) > -1); - } - - /** - * Invokes the method at `path` of each element in `collection`, returning - * an array of the results of each invoked method. Any additional arguments - * are provided to each invoked method. If `methodName` is a function it's - * invoked for, and `this` bound to, each element in `collection`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|string} path The path of the method to invoke or - * the function invoked per iteration. - * @param {...*} [args] The arguments to invoke each method with. - * @returns {Array} Returns the array of results. - * @example - * - * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); - * // => [[1, 5, 7], [1, 2, 3]] - * - * _.invokeMap([123, 456], String.prototype.split, ''); - * // => [['1', '2', '3'], ['4', '5', '6']] - */ - var invokeMap = rest(function(collection, path, args) { - var index = -1, - isFunc = typeof path == 'function', - isProp = isKey(path), - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value) { - var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined); - result[++index] = func ? apply(func, value, args) : baseInvoke(value, path, args); - }); - return result; - }); - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is the last element responsible for generating the key. The - * iteratee is invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee to transform keys. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * var array = [ - * { 'dir': 'left', 'code': 97 }, - * { 'dir': 'right', 'code': 100 } - * ]; - * - * _.keyBy(array, function(o) { - * return String.fromCharCode(o.code); - * }); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } - * - * _.keyBy(array, 'dir'); - * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } - */ - var keyBy = createAggregator(function(result, value, key) { - result[key] = value; - }); - - /** - * Creates an array of values by running each element in `collection` through - * `iteratee`. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. - * - * The guarded methods are: - * `ary`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`, - * `invert`, `parseInt`, `random`, `range`, `rangeRight`, `slice`, `some`, - * `sortBy`, `take`, `takeRight`, `template`, `trim`, `trimEnd`, `trimStart`, - * and `words` - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - * @example - * - * function square(n) { - * return n * n; - * } - * - * _.map([4, 8], square); - * // => [16, 64] - * - * _.map({ 'a': 4, 'b': 8 }, square); - * // => [16, 64] (iteration order is not guaranteed) - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * // The `_.property` iteratee shorthand. - * _.map(users, 'user'); - * // => ['barney', 'fred'] - */ - function map(collection, iteratee) { - var func = isArray(collection) ? arrayMap : baseMap; - return func(collection, getIteratee(iteratee, 3)); - } - - /** - * This method is like `_.sortBy` except that it allows specifying the sort - * orders of the iteratees to sort by. If `orders` is unspecified, all values - * are sorted in ascending order. Otherwise, specify an order of "desc" for - * descending or "asc" for ascending sort order of corresponding values. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} [iteratees=[_.identity]] The iteratees to sort by. - * @param {string[]} [orders] The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.reduce`. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // Sort by `user` in ascending order and by `age` in descending order. - * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - function orderBy(collection, iteratees, orders, guard) { - if (collection == null) { - return []; - } - if (!isArray(iteratees)) { - iteratees = iteratees == null ? [] : [iteratees]; - } - orders = guard ? undefined : orders; - if (!isArray(orders)) { - orders = orders == null ? [] : [orders]; - } - return baseOrderBy(collection, iteratees, orders); - } - - /** - * Creates an array of elements split into two groups, the first of which - * contains elements `predicate` returns truthy for, the second of which - * contains elements `predicate` returns falsey for. The predicate is - * invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the array of grouped elements. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true }, - * { 'user': 'pebbles', 'age': 1, 'active': false } - * ]; - * - * _.partition(users, function(o) { return o.active; }); - * // => objects for [['fred'], ['barney', 'pebbles']] - * - * // The `_.matches` iteratee shorthand. - * _.partition(users, { 'age': 1, 'active': false }); - * // => objects for [['pebbles'], ['barney', 'fred']] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.partition(users, ['active', false]); - * // => objects for [['barney', 'pebbles'], ['fred']] - * - * // The `_.property` iteratee shorthand. - * _.partition(users, 'active'); - * // => objects for [['fred'], ['barney', 'pebbles']] - */ - var partition = createAggregator(function(result, value, key) { - result[key ? 0 : 1].push(value); - }, function() { return [[], []]; }); - - /** - * Reduces `collection` to a value which is the accumulated result of running - * each element in `collection` through `iteratee`, where each successive - * invocation is supplied the return value of the previous. If `accumulator` - * is not provided the first element of `collection` is used as the initial - * value. The iteratee is invoked with four arguments: - * (accumulator, value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.reduce`, `_.reduceRight`, and `_.transform`. - * - * The guarded methods are: - * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, - * and `sortBy` - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @returns {*} Returns the accumulated value. - * @example - * - * _.reduce([1, 2], function(sum, n) { - * return sum + n; - * }, 0); - * // => 3 - * - * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { - * (result[value] || (result[value] = [])).push(key); - * return result; - * }, {}); - * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) - */ - function reduce(collection, iteratee, accumulator) { - var func = isArray(collection) ? arrayReduce : baseReduce, - initAccum = arguments.length < 3; - - return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); - } - - /** - * This method is like `_.reduce` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @returns {*} Returns the accumulated value. - * @example - * - * var array = [[0, 1], [2, 3], [4, 5]]; - * - * _.reduceRight(array, function(flattened, other) { - * return flattened.concat(other); - * }, []); - * // => [4, 5, 2, 3, 0, 1] - */ - function reduceRight(collection, iteratee, accumulator) { - var func = isArray(collection) ? arrayReduceRight : baseReduce, - initAccum = arguments.length < 3; - - return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); - } - - /** - * The opposite of `_.filter`; this method returns the elements of `collection` - * that `predicate` does **not** return truthy for. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true } - * ]; - * - * _.reject(users, function(o) { return !o.active; }); - * // => objects for ['fred'] - * - * // The `_.matches` iteratee shorthand. - * _.reject(users, { 'age': 40, 'active': true }); - * // => objects for ['barney'] - * - * // The `_.matchesProperty` iteratee shorthand. - * _.reject(users, ['active', false]); - * // => objects for ['fred'] - * - * // The `_.property` iteratee shorthand. - * _.reject(users, 'active'); - * // => objects for ['barney'] - */ - function reject(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - predicate = getIteratee(predicate, 3); - return func(collection, function(value, index, collection) { - return !predicate(value, index, collection); - }); - } - - /** - * Gets a random element from `collection`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to sample. - * @returns {*} Returns the random element. - * @example - * - * _.sample([1, 2, 3, 4]); - * // => 2 - */ - function sample(collection) { - var array = isArrayLike(collection) ? collection : values(collection), - length = array.length; - - return length > 0 ? array[baseRandom(0, length - 1)] : undefined; - } - - /** - * Gets `n` random elements at unique keys from `collection` up to the - * size of `collection`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to sample. - * @param {number} [n=0] The number of elements to sample. - * @returns {Array} Returns the random elements. - * @example - * - * _.sampleSize([1, 2, 3], 2); - * // => [3, 1] - * - * _.sampleSize([1, 2, 3], 4); - * // => [2, 3, 1] - */ - function sampleSize(collection, n) { - var index = -1, - result = toArray(collection), - length = result.length, - lastIndex = length - 1; - - n = baseClamp(toInteger(n), 0, length); - while (++index < n) { - var rand = baseRandom(index, lastIndex), - value = result[rand]; - - result[rand] = result[index]; - result[index] = value; - } - result.length = n; - return result; - } - - /** - * Creates an array of shuffled values, using a version of the - * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to shuffle. - * @returns {Array} Returns the new shuffled array. - * @example - * - * _.shuffle([1, 2, 3, 4]); - * // => [4, 1, 3, 2] - */ - function shuffle(collection) { - return sampleSize(collection, MAX_ARRAY_LENGTH); - } - - /** - * Gets the size of `collection` by returning its length for array-like - * values or the number of own enumerable properties for objects. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to inspect. - * @returns {number} Returns the collection size. - * @example - * - * _.size([1, 2, 3]); - * // => 3 - * - * _.size({ 'a': 1, 'b': 2 }); - * // => 2 - * - * _.size('pebbles'); - * // => 7 - */ - function size(collection) { - if (collection == null) { - return 0; - } - if (isArrayLike(collection)) { - var result = collection.length; - return (result && isString(collection)) ? stringSize(collection) : result; - } - return keys(collection).length; - } - - /** - * Checks if `predicate` returns truthy for **any** element of `collection`. - * Iteration is stopped once `predicate` returns truthy. The predicate is - * invoked with three arguments: (value, index|key, collection). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`. - * @example - * - * _.some([null, 0, 'yes', false], Boolean); - * // => true - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // The `_.matches` iteratee shorthand. - * _.some(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // The `_.matchesProperty` iteratee shorthand. - * _.some(users, ['active', false]); - * // => true - * - * // The `_.property` iteratee shorthand. - * _.some(users, 'active'); - * // => true - */ - function some(collection, predicate, guard) { - var func = isArray(collection) ? arraySome : baseSome; - if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined; - } - return func(collection, getIteratee(predicate, 3)); - } - - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through each iteratee. This method - * performs a stable sort, that is, it preserves the original sort order of - * equal elements. The iteratees are invoked with one argument: (value). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {...(Function|Function[]|Object|Object[]|string|string[])} [iteratees=[_.identity]] - * The iteratees to sort by, specified individually or in arrays. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.sortBy(users, function(o) { return o.user; }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - * - * _.sortBy(users, ['user', 'age']); - * // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.sortBy(users, 'user', function(o) { - * return Math.floor(o.age / 10); - * }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - var sortBy = rest(function(collection, iteratees) { - if (collection == null) { - return []; - } - var length = iteratees.length; - if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { - iteratees = []; - } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { - iteratees.length = 1; - } - return baseOrderBy(collection, baseFlatten(iteratees), []); - }); - - /*------------------------------------------------------------------------*/ - - /** - * Gets the timestamp of the number of milliseconds that have elapsed since - * the Unix epoch (1 January 1970 00:00:00 UTC). - * - * @static - * @memberOf _ - * @type Function - * @category Date - * @returns {number} Returns the timestamp. - * @example - * - * _.defer(function(stamp) { - * console.log(_.now() - stamp); - * }, _.now()); - * // => logs the number of milliseconds it took for the deferred function to be invoked - */ - var now = Date.now; - - /*------------------------------------------------------------------------*/ - - /** - * The opposite of `_.before`; this method creates a function that invokes - * `func` once it's called `n` or more times. - * - * @static - * @memberOf _ - * @category Function - * @param {number} n The number of calls before `func` is invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var saves = ['profile', 'settings']; - * - * var done = _.after(saves.length, function() { - * console.log('done saving!'); - * }); - * - * _.forEach(saves, function(type) { - * asyncSave({ 'type': type, 'complete': done }); - * }); - * // => logs 'done saving!' after the two async saves have completed - */ - function after(n, func) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - n = toInteger(n); - return function() { - if (--n < 1) { - return func.apply(this, arguments); - } - }; - } - - /** - * Creates a function that accepts up to `n` arguments, ignoring any - * additional arguments. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to cap arguments for. - * @param {number} [n=func.length] The arity cap. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {Function} Returns the new function. - * @example - * - * _.map(['6', '8', '10'], _.ary(parseInt, 1)); - * // => [6, 8, 10] - */ - function ary(func, n, guard) { - n = guard ? undefined : n; - n = (func && n == null) ? func.length : n; - return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n); - } - - /** - * Creates a function that invokes `func`, with the `this` binding and arguments - * of the created function, while it's called less than `n` times. Subsequent - * calls to the created function return the result of the last `func` invocation. - * - * @static - * @memberOf _ - * @category Function - * @param {number} n The number of calls at which `func` is no longer invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * jQuery(element).on('click', _.before(5, addContactToList)); - * // => allows adding up to 4 contacts to the list - */ - function before(n, func) { - var result; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - n = toInteger(n); - return function() { - if (--n > 0) { - result = func.apply(this, arguments); - } - if (n <= 1) { - func = undefined; - } - return result; - }; - } - - /** - * Creates a function that invokes `func` with the `this` binding of `thisArg` - * and prepends any additional `_.bind` arguments to those provided to the - * bound function. - * - * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for partially applied arguments. - * - * **Note:** Unlike native `Function#bind` this method doesn't set the "length" - * property of bound functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var greet = function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * }; - * - * var object = { 'user': 'fred' }; - * - * var bound = _.bind(greet, object, 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * // Bound with placeholders. - * var bound = _.bind(greet, object, _, '!'); - * bound('hi'); - * // => 'hi fred!' - */ - var bind = rest(function(func, thisArg, partials) { - var bitmask = BIND_FLAG; - if (partials.length) { - var placeholder = lodash.placeholder || bind.placeholder, - holders = replaceHolders(partials, placeholder); - - bitmask |= PARTIAL_FLAG; - } - return createWrapper(func, bitmask, thisArg, partials, holders); - }); - - /** - * Creates a function that invokes the method at `object[key]` and prepends - * any additional `_.bindKey` arguments to those provided to the bound function. - * - * This method differs from `_.bind` by allowing bound functions to reference - * methods that may be redefined or don't yet exist. - * See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) - * for more details. - * - * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * @static - * @memberOf _ - * @category Function - * @param {Object} object The object to invoke the method on. - * @param {string} key The key of the method. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var object = { - * 'user': 'fred', - * 'greet': function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * }; - * - * var bound = _.bindKey(object, 'greet', 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * object.greet = function(greeting, punctuation) { - * return greeting + 'ya ' + this.user + punctuation; - * }; - * - * bound('!'); - * // => 'hiya fred!' - * - * // Bound with placeholders. - * var bound = _.bindKey(object, 'greet', _, '!'); - * bound('hi'); - * // => 'hiya fred!' - */ - var bindKey = rest(function(object, key, partials) { - var bitmask = BIND_FLAG | BIND_KEY_FLAG; - if (partials.length) { - var placeholder = lodash.placeholder || bindKey.placeholder, - holders = replaceHolders(partials, placeholder); - - bitmask |= PARTIAL_FLAG; - } - return createWrapper(key, bitmask, object, partials, holders); - }); - - /** - * Creates a function that accepts arguments of `func` and either invokes - * `func` returning its result, if at least `arity` number of arguments have - * been provided, or returns a function that accepts the remaining `func` - * arguments, and so on. The arity of `func` may be specified if `func.length` - * is not sufficient. - * - * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for provided arguments. - * - * **Note:** This method doesn't set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curry(abc); - * - * curried(1)(2)(3); - * // => [1, 2, 3] - * - * curried(1, 2)(3); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // Curried with placeholders. - * curried(1)(_, 3)(2); - * // => [1, 2, 3] - */ - function curry(func, arity, guard) { - arity = guard ? undefined : arity; - var result = createWrapper(func, CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = lodash.placeholder || curry.placeholder; - return result; - } - - /** - * This method is like `_.curry` except that arguments are applied to `func` - * in the manner of `_.partialRight` instead of `_.partial`. - * - * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for provided arguments. - * - * **Note:** This method doesn't set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curryRight(abc); - * - * curried(3)(2)(1); - * // => [1, 2, 3] - * - * curried(2, 3)(1); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // Curried with placeholders. - * curried(3)(1, _)(2); - * // => [1, 2, 3] - */ - function curryRight(func, arity, guard) { - arity = guard ? undefined : arity; - var result = createWrapper(func, CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); - result.placeholder = lodash.placeholder || curryRight.placeholder; - return result; - } - - /** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked. The debounced function comes with a `cancel` method to cancel - * delayed `func` invocations and a `flush` method to immediately invoke them. - * Provide an options object to indicate whether `func` should be invoked on - * the leading and/or trailing edge of the `wait` timeout. The `func` is invoked - * with the last arguments provided to the debounced function. Subsequent calls - * to the debounced function return the result of the last `func` invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked - * on the trailing edge of the timeout only if the debounced function is - * invoked more than once during the `wait` timeout. - * - * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) - * for details over the differences between `_.debounce` and `_.throttle`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options] The options object. - * @param {boolean} [options.leading=false] Specify invoking on the leading - * edge of the timeout. - * @param {number} [options.maxWait] The maximum time `func` is allowed to be - * delayed before it's invoked. - * @param {boolean} [options.trailing=true] Specify invoking on the trailing - * edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // Avoid costly calculations while the window size is in flux. - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // Invoke `sendMail` when clicked, debouncing subsequent calls. - * jQuery(element).on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // Ensure `batchLog` is invoked once after 1 second of debounced calls. - * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); - * var source = new EventSource('/stream'); - * jQuery(source).on('message', debounced); - * - * // Cancel the trailing debounced invocation. - * jQuery(window).on('popstate', debounced.cancel); - */ - function debounce(func, wait, options) { - var args, - maxTimeoutId, - result, - stamp, - thisArg, - timeoutId, - trailingCall, - lastCalled = 0, - leading = false, - maxWait = false, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = toNumber(wait) || 0; - if (isObject(options)) { - leading = !!options.leading; - maxWait = 'maxWait' in options && nativeMax(toNumber(options.maxWait) || 0, wait); - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - - function cancel() { - if (timeoutId) { - clearTimeout(timeoutId); - } - if (maxTimeoutId) { - clearTimeout(maxTimeoutId); - } - lastCalled = 0; - args = maxTimeoutId = thisArg = timeoutId = trailingCall = undefined; - } - - function complete(isCalled, id) { - if (id) { - clearTimeout(id); - } - maxTimeoutId = timeoutId = trailingCall = undefined; - if (isCalled) { - lastCalled = now(); - result = func.apply(thisArg, args); - if (!timeoutId && !maxTimeoutId) { - args = thisArg = undefined; - } - } - } - - function delayed() { - var remaining = wait - (now() - stamp); - if (remaining <= 0 || remaining > wait) { - complete(trailingCall, maxTimeoutId); - } else { - timeoutId = setTimeout(delayed, remaining); - } - } - - function flush() { - if ((timeoutId && trailingCall) || (maxTimeoutId && trailing)) { - result = func.apply(thisArg, args); - } - cancel(); - return result; - } - - function maxDelayed() { - complete(trailing, timeoutId); - } - - function debounced() { - args = arguments; - stamp = now(); - thisArg = this; - trailingCall = trailing && (timeoutId || !leading); - - if (maxWait === false) { - var leadingCall = leading && !timeoutId; - } else { - if (!maxTimeoutId && !leading) { - lastCalled = stamp; - } - var remaining = maxWait - (stamp - lastCalled), - isCalled = remaining <= 0 || remaining > maxWait; - - if (isCalled) { - if (maxTimeoutId) { - maxTimeoutId = clearTimeout(maxTimeoutId); - } - lastCalled = stamp; - result = func.apply(thisArg, args); - } - else if (!maxTimeoutId) { - maxTimeoutId = setTimeout(maxDelayed, remaining); - } - } - if (isCalled && timeoutId) { - timeoutId = clearTimeout(timeoutId); - } - else if (!timeoutId && wait !== maxWait) { - timeoutId = setTimeout(delayed, wait); - } - if (leadingCall) { - isCalled = true; - result = func.apply(thisArg, args); - } - if (isCalled && !timeoutId && !maxTimeoutId) { - args = thisArg = undefined; - } - return result; - } - debounced.cancel = cancel; - debounced.flush = flush; - return debounced; - } - - /** - * Defers invoking the `func` until the current call stack has cleared. Any - * additional arguments are provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to defer. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. - * @example - * - * _.defer(function(text) { - * console.log(text); - * }, 'deferred'); - * // => logs 'deferred' after one or more milliseconds - */ - var defer = rest(function(func, args) { - return baseDelay(func, 1, args); - }); - - /** - * Invokes `func` after `wait` milliseconds. Any additional arguments are - * provided to `func` when it's invoked. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {...*} [args] The arguments to invoke `func` with. - * @returns {number} Returns the timer id. - * @example - * - * _.delay(function(text) { - * console.log(text); - * }, 1000, 'later'); - * // => logs 'later' after one second - */ - var delay = rest(function(func, wait, args) { - return baseDelay(func, toNumber(wait) || 0, args); - }); - - /** - * Creates a function that invokes `func` with arguments reversed. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to flip arguments for. - * @returns {Function} Returns the new function. - * @example - * - * var flipped = _.flip(function() { - * return _.toArray(arguments); - * }); - * - * flipped('a', 'b', 'c', 'd'); - * // => ['d', 'c', 'b', 'a'] - */ - function flip(func) { - return createWrapper(func, FLIP_FLAG); - } - - /** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is used as the map cache key. The `func` - * is invoked with the `this` binding of the memoized function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) - * method interface of `delete`, `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoizing function. - * @example - * - * var object = { 'a': 1, 'b': 2 }; - * var other = { 'c': 3, 'd': 4 }; - * - * var values = _.memoize(_.values); - * values(object); - * // => [1, 2] - * - * values(other); - * // => [3, 4] - * - * object.a = 2; - * values(object); - * // => [1, 2] - * - * // Modify the result cache. - * values.cache.set(object, ['a', 'b']); - * values(object); - * // => ['a', 'b'] - * - * // Replace `_.memoize.Cache`. - * _.memoize.Cache = WeakMap; - */ - function memoize(func, resolver) { - if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result); - return result; - }; - memoized.cache = new memoize.Cache; - return memoized; - } - - /** - * Creates a function that negates the result of the predicate `func`. The - * `func` predicate is invoked with the `this` binding and arguments of the - * created function. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} predicate The predicate to negate. - * @returns {Function} Returns the new function. - * @example - * - * function isEven(n) { - * return n % 2 == 0; - * } - * - * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); - * // => [1, 3, 5] - */ - function negate(predicate) { - if (typeof predicate != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function() { - return !predicate.apply(this, arguments); - }; - } - - /** - * Creates a function that is restricted to invoking `func` once. Repeat calls - * to the function return the value of the first invocation. The `func` is - * invoked with the `this` binding and arguments of the created function. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var initialize = _.once(createApplication); - * initialize(); - * initialize(); - * // `initialize` invokes `createApplication` once - */ - function once(func) { - return before(2, func); - } - - /** - * Creates a function that invokes `func` with arguments transformed by - * corresponding `transforms`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to wrap. - * @param {...(Function|Function[])} [transforms] The functions to transform - * arguments, specified individually or in arrays. - * @returns {Function} Returns the new function. - * @example - * - * function doubled(n) { - * return n * 2; - * } - * - * function square(n) { - * return n * n; - * } - * - * var func = _.overArgs(function(x, y) { - * return [x, y]; - * }, square, doubled); - * - * func(9, 3); - * // => [81, 6] - * - * func(10, 5); - * // => [100, 10] - */ - var overArgs = rest(function(func, transforms) { - transforms = arrayMap(baseFlatten(transforms), getIteratee()); - - var funcsLength = transforms.length; - return rest(function(args) { - var index = -1, - length = nativeMin(args.length, funcsLength); - - while (++index < length) { - args[index] = transforms[index].call(this, args[index]); - } - return apply(func, this, args); - }); - }); - - /** - * Creates a function that invokes `func` with `partial` arguments prepended - * to those provided to the new function. This method is like `_.bind` except - * it does **not** alter the `this` binding. - * - * The `_.partial.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method doesn't set the "length" property of partially - * applied functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * var greet = function(greeting, name) { - * return greeting + ' ' + name; - * }; - * - * var sayHelloTo = _.partial(greet, 'hello'); - * sayHelloTo('fred'); - * // => 'hello fred' - * - * // Partially applied with placeholders. - * var greetFred = _.partial(greet, _, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - */ - var partial = rest(function(func, partials) { - var placeholder = lodash.placeholder || partial.placeholder, - holders = replaceHolders(partials, placeholder); - - return createWrapper(func, PARTIAL_FLAG, undefined, partials, holders); - }); - - /** - * This method is like `_.partial` except that partially applied arguments - * are appended to those provided to the new function. - * - * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method doesn't set the "length" property of partially - * applied functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * var greet = function(greeting, name) { - * return greeting + ' ' + name; - * }; - * - * var greetFred = _.partialRight(greet, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - * - * // Partially applied with placeholders. - * var sayHelloTo = _.partialRight(greet, 'hello', _); - * sayHelloTo('fred'); - * // => 'hello fred' - */ - var partialRight = rest(function(func, partials) { - var placeholder = lodash.placeholder || partialRight.placeholder, - holders = replaceHolders(partials, placeholder); - - return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders); - }); - - /** - * Creates a function that invokes `func` with arguments arranged according - * to the specified indexes where the argument value at the first index is - * provided as the first argument, the argument value at the second index is - * provided as the second argument, and so on. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to rearrange arguments for. - * @param {...(number|number[])} indexes The arranged argument indexes, - * specified individually or in arrays. - * @returns {Function} Returns the new function. - * @example - * - * var rearged = _.rearg(function(a, b, c) { - * return [a, b, c]; - * }, 2, 0, 1); - * - * rearged('b', 'c', 'a') - * // => ['a', 'b', 'c'] - */ - var rearg = rest(function(func, indexes) { - return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes)); - }); - - /** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as an array. - * - * **Note:** This method is based on the [rest parameter](https://mdn.io/rest_parameters). - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.rest(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' - */ - function rest(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - switch (start) { - case 0: return func.call(this, array); - case 1: return func.call(this, args[0], array); - case 2: return func.call(this, args[0], args[1], array); - } - var otherArgs = Array(start + 1); - index = -1; - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = array; - return apply(func, this, otherArgs); - }; - } - - /** - * Creates a function that invokes `func` with the `this` binding of the created - * function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3). - * - * **Note:** This method is based on the [spread operator](https://mdn.io/spread_operator). - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to spread arguments over. - * @param {number} [start=0] The start position of the spread. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.spread(function(who, what) { - * return who + ' says ' + what; - * }); - * - * say(['fred', 'hello']); - * // => 'fred says hello' - * - * var numbers = Promise.all([ - * Promise.resolve(40), - * Promise.resolve(36) - * ]); - * - * numbers.then(_.spread(function(x, y) { - * return x + y; - * })); - * // => a Promise of 76 - */ - function spread(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = start === undefined ? 0 : nativeMax(toInteger(start), 0); - return rest(function(args) { - var array = args[start], - otherArgs = args.slice(0, start); - - if (array) { - arrayPush(otherArgs, array); - } - return apply(func, this, otherArgs); - }); - } - - /** - * Creates a throttled function that only invokes `func` at most once per - * every `wait` milliseconds. The throttled function comes with a `cancel` - * method to cancel delayed `func` invocations and a `flush` method to - * immediately invoke them. Provide an options object to indicate whether - * `func` should be invoked on the leading and/or trailing edge of the `wait` - * timeout. The `func` is invoked with the last arguments provided to the - * throttled function. Subsequent calls to the throttled function return the - * result of the last `func` invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked - * on the trailing edge of the timeout only if the throttled function is - * invoked more than once during the `wait` timeout. - * - * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) - * for details over the differences between `_.throttle` and `_.debounce`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to throttle. - * @param {number} [wait=0] The number of milliseconds to throttle invocations to. - * @param {Object} [options] The options object. - * @param {boolean} [options.leading=true] Specify invoking on the leading - * edge of the timeout. - * @param {boolean} [options.trailing=true] Specify invoking on the trailing - * edge of the timeout. - * @returns {Function} Returns the new throttled function. - * @example - * - * // Avoid excessively updating the position while scrolling. - * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); - * - * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. - * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); - * jQuery(element).on('click', throttled); - * - * // Cancel the trailing throttled invocation. - * jQuery(window).on('popstate', throttled.cancel); - */ - function throttle(func, wait, options) { - var leading = true, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (isObject(options)) { - leading = 'leading' in options ? !!options.leading : leading; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - return debounce(func, wait, { 'leading': leading, 'maxWait': wait, 'trailing': trailing }); - } - - /** - * Creates a function that accepts up to one argument, ignoring any - * additional arguments. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new function. - * @example - * - * _.map(['6', '8', '10'], _.unary(parseInt)); - * // => [6, 8, 10] - */ - function unary(func) { - return ary(func, 1); - } - - /** - * Creates a function that provides `value` to the wrapper function as its - * first argument. Any additional arguments provided to the function are - * appended to those provided to the wrapper function. The wrapper is invoked - * with the `this` binding of the created function. - * - * @static - * @memberOf _ - * @category Function - * @param {*} value The value to wrap. - * @param {Function} wrapper The wrapper function. - * @returns {Function} Returns the new function. - * @example - * - * var p = _.wrap(_.escape, function(func, text) { - * return '

' + func(text) + '

'; - * }); - * - * p('fred, barney, & pebbles'); - * // => '

fred, barney, & pebbles

' - */ - function wrap(value, wrapper) { - wrapper = wrapper == null ? identity : wrapper; - return partial(wrapper, value); - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates a shallow clone of `value`. - * - * **Note:** This method is loosely based on the - * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) - * and supports cloning arrays, array buffers, booleans, date objects, maps, - * numbers, `Object` objects, regexes, sets, strings, symbols, and typed - * arrays. The own enumerable properties of `arguments` objects are cloned - * as plain objects. An empty object is returned for uncloneable values such - * as error objects, functions, DOM nodes, and WeakMaps. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to clone. - * @returns {*} Returns the cloned value. - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var shallow = _.clone(objects); - * console.log(shallow[0] === objects[0]); - * // => true - */ - function clone(value) { - return baseClone(value); - } - - /** - * This method is like `_.clone` except that it accepts `customizer` which - * is invoked to produce the cloned value. If `customizer` returns `undefined` - * cloning is handled by the method instead. The `customizer` is invoked with - * up to four arguments; (value [, index|key, object, stack]). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to clone. - * @param {Function} [customizer] The function to customize cloning. - * @returns {*} Returns the cloned value. - * @example - * - * function customizer(value) { - * if (_.isElement(value)) { - * return value.cloneNode(false); - * } - * } - * - * var el = _.cloneWith(document.body, customizer); - * - * console.log(el === document.body); - * // => false - * console.log(el.nodeName); - * // => 'BODY' - * console.log(el.childNodes.length); - * // => 0 - */ - function cloneWith(value, customizer) { - return baseClone(value, false, customizer); - } - - /** - * This method is like `_.clone` except that it recursively clones `value`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to recursively clone. - * @returns {*} Returns the deep cloned value. - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var deep = _.cloneDeep(objects); - * console.log(deep[0] === objects[0]); - * // => false - */ - function cloneDeep(value) { - return baseClone(value, true); - } - - /** - * This method is like `_.cloneWith` except that it recursively clones `value`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to recursively clone. - * @param {Function} [customizer] The function to customize cloning. - * @returns {*} Returns the deep cloned value. - * @example - * - * function customizer(value) { - * if (_.isElement(value)) { - * return value.cloneNode(true); - * } - * } - * - * var el = _.cloneDeepWith(document.body, customizer); - * - * console.log(el === document.body); - * // => false - * console.log(el.nodeName); - * // => 'BODY' - * console.log(el.childNodes.length); - * // => 20 - */ - function cloneDeepWith(value, customizer) { - return baseClone(value, true, customizer); - } - - /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ - function eq(value, other) { - return value === other || (value !== value && other !== other); - } - - /** - * Checks if `value` is greater than `other`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`. - * @example - * - * _.gt(3, 1); - * // => true - * - * _.gt(3, 3); - * // => false - * - * _.gt(1, 3); - * // => false - */ - function gt(value, other) { - return value > other; - } - - /** - * Checks if `value` is greater than or equal to `other`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than or equal to `other`, else `false`. - * @example - * - * _.gte(3, 1); - * // => true - * - * _.gte(3, 3); - * // => true - * - * _.gte(1, 3); - * // => false - */ - function gte(value, other) { - return value >= other; - } - - /** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - function isArguments(value) { - // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); - } - - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @type Function - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ - var isArray = Array.isArray; - - /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @type Function - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ - function isArrayLike(value) { - return value != null && - !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value)); - } - - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @type Function - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } - - /** - * Checks if `value` is classified as a boolean primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isBoolean(false); - * // => true - * - * _.isBoolean(null); - * // => false - */ - function isBoolean(value) { - return value === true || value === false || - (isObjectLike(value) && objectToString.call(value) == boolTag); - } - - /** - * Checks if `value` is classified as a `Date` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isDate(new Date); - * // => true - * - * _.isDate('Mon April 23 2012'); - * // => false - */ - function isDate(value) { - return isObjectLike(value) && objectToString.call(value) == dateTag; - } - - /** - * Checks if `value` is likely a DOM element. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. - * @example - * - * _.isElement(document.body); - * // => true - * - * _.isElement(''); - * // => false - */ - function isElement(value) { - return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value); - } - - /** - * Checks if `value` is empty. A value is considered empty unless it's an - * `arguments` object, array, string, or jQuery-like collection with a length - * greater than `0` or an object with own enumerable properties. - * - * @static - * @memberOf _ - * @category Lang - * @param {Array|Object|string} value The value to inspect. - * @returns {boolean} Returns `true` if `value` is empty, else `false`. - * @example - * - * _.isEmpty(null); - * // => true - * - * _.isEmpty(true); - * // => true - * - * _.isEmpty(1); - * // => true - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({ 'a': 1 }); - * // => false - */ - function isEmpty(value) { - if (isArrayLike(value) && - (isArray(value) || isString(value) || isFunction(value.splice) || isArguments(value))) { - return !value.length; - } - for (var key in value) { - if (hasOwnProperty.call(value, key)) { - return false; - } - } - return true; - } - - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. - * - * **Note:** This method supports comparing arrays, array buffers, booleans, - * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.isEqual(object, other); - * // => true - * - * object === other; - * // => false - */ - function isEqual(value, other) { - return baseIsEqual(value, other); - } - - /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to six arguments: - * (objValue, othValue [, index|key, object, other, stack]). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, othValue) { - * if (isGreeting(objValue) && isGreeting(othValue)) { - * return true; - * } - * } - * - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqualWith(array, other, customizer); - * // => true - */ - function isEqualWith(value, other, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - var result = customizer ? customizer(value, other) : undefined; - return result === undefined ? baseIsEqual(value, other, customizer) : !!result; - } - - /** - * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, - * `SyntaxError`, `TypeError`, or `URIError` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an error object, else `false`. - * @example - * - * _.isError(new Error); - * // => true - * - * _.isError(Error); - * // => false - */ - function isError(value) { - return isObjectLike(value) && - typeof value.message == 'string' && objectToString.call(value) == errorTag; - } - - /** - * Checks if `value` is a finite primitive number. - * - * **Note:** This method is based on [`Number.isFinite`](https://mdn.io/Number/isFinite). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. - * @example - * - * _.isFinite(3); - * // => true - * - * _.isFinite(Number.MAX_VALUE); - * // => true - * - * _.isFinite(3.14); - * // => true - * - * _.isFinite(Infinity); - * // => false - */ - function isFinite(value) { - return typeof value == 'number' && nativeIsFinite(value); - } - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array constructors, and - // PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; - } - - /** - * Checks if `value` is an integer. - * - * **Note:** This method is based on [`Number.isInteger`](https://mdn.io/Number/isInteger). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an integer, else `false`. - * @example - * - * _.isInteger(3); - * // => true - * - * _.isInteger(Number.MIN_VALUE); - * // => false - * - * _.isInteger(Infinity); - * // => false - * - * _.isInteger('3'); - * // => false - */ - function isInteger(value) { - return typeof value == 'number' && value == toInteger(value); - } - - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ - function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - - /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ - function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } - - /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ - function isObjectLike(value) { - return !!value && typeof value == 'object'; - } - - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. - * - * **Note:** This method supports comparing the same values as `_.isEqual`. - * - * @static - * @memberOf _ - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - */ - function isMatch(object, source) { - return object === source || baseIsMatch(object, source, getMatchData(source)); - } - - /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with five - * arguments: (objValue, srcValue, index|key, object, source). - * - * @static - * @memberOf _ - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * function isGreeting(value) { - * return /^h(?:i|ello)$/.test(value); - * } - * - * function customizer(objValue, srcValue) { - * if (isGreeting(objValue) && isGreeting(srcValue)) { - * return true; - * } - * } - * - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatchWith(object, source, customizer); - * // => true - */ - function isMatchWith(object, source, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return baseIsMatch(object, source, getMatchData(source), customizer); - } - - /** - * Checks if `value` is `NaN`. - * - * **Note:** This method is not the same as [`isNaN`](https://es5.github.io/#x15.1.2.4) - * which returns `true` for `undefined` and other non-numeric values. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - * @example - * - * _.isNaN(NaN); - * // => true - * - * _.isNaN(new Number(NaN)); - * // => true - * - * isNaN(undefined); - * // => true - * - * _.isNaN(undefined); - * // => false - */ - function isNaN(value) { - // An `NaN` primitive is the only value that is not equal to itself. - // Perform the `toStringTag` check first to avoid errors with some ActiveX objects in IE. - return isNumber(value) && value != +value; - } - - /** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ - function isNative(value) { - if (value == null) { - return false; - } - if (isFunction(value)) { - return reIsNative.test(funcToString.call(value)); - } - return isObjectLike(value) && - (isHostObject(value) ? reIsNative : reIsHostCtor).test(value); - } - - /** - * Checks if `value` is `null`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `null`, else `false`. - * @example - * - * _.isNull(null); - * // => true - * - * _.isNull(void 0); - * // => false - */ - function isNull(value) { - return value === null; - } - - /** - * Checks if `value` is `null` or `undefined`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is nullish, else `false`. - * @example - * - * _.isNil(null); - * // => true - * - * _.isNil(void 0); - * // => true - * - * _.isNil(NaN); - * // => false - */ - function isNil(value) { - return value == null; - } - - /** - * Checks if `value` is classified as a `Number` primitive or object. - * - * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified - * as numbers, use the `_.isFinite` method. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isNumber(3); - * // => true - * - * _.isNumber(Number.MIN_VALUE); - * // => true - * - * _.isNumber(Infinity); - * // => true - * - * _.isNumber('3'); - * // => false - */ - function isNumber(value) { - return typeof value == 'number' || - (isObjectLike(value) && objectToString.call(value) == numberTag); - } - - /** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ - function isPlainObject(value) { - if (!isObjectLike(value) || objectToString.call(value) != objectTag || isHostObject(value)) { - return false; - } - var proto = objectProto; - if (typeof value.constructor == 'function') { - proto = getPrototypeOf(value); - } - if (proto === null) { - return true; - } - var Ctor = proto.constructor; - return (typeof Ctor == 'function' && - Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); - } - - /** - * Checks if `value` is classified as a `RegExp` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isRegExp(/abc/); - * // => true - * - * _.isRegExp('/abc/'); - * // => false - */ - function isRegExp(value) { - return isObject(value) && objectToString.call(value) == regexpTag; - } - - /** - * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 - * double precision number which isn't the result of a rounded unsafe integer. - * - * **Note:** This method is based on [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. - * @example - * - * _.isSafeInteger(3); - * // => true - * - * _.isSafeInteger(Number.MIN_VALUE); - * // => false - * - * _.isSafeInteger(Infinity); - * // => false - * - * _.isSafeInteger('3'); - * // => false - */ - function isSafeInteger(value) { - return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; - } - - /** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ - function isString(value) { - return typeof value == 'string' || - (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag); - } - - /** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ - function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); - } - - /** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ - function isTypedArray(value) { - return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; - } - - /** - * Checks if `value` is `undefined`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. - * @example - * - * _.isUndefined(void 0); - * // => true - * - * _.isUndefined(null); - * // => false - */ - function isUndefined(value) { - return value === undefined; - } - - /** - * Checks if `value` is less than `other`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`. - * @example - * - * _.lt(1, 3); - * // => true - * - * _.lt(3, 3); - * // => false - * - * _.lt(3, 1); - * // => false - */ - function lt(value, other) { - return value < other; - } - - /** - * Checks if `value` is less than or equal to `other`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than or equal to `other`, else `false`. - * @example - * - * _.lte(1, 3); - * // => true - * - * _.lte(3, 3); - * // => true - * - * _.lte(3, 1); - * // => false - */ - function lte(value, other) { - return value <= other; - } - - /** - * Converts `value` to an array. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {Array} Returns the converted array. - * @example - * - * _.toArray({ 'a': 1, 'b': 2 }); - * // => [1, 2] - * - * _.toArray('abc'); - * // => ['a', 'b', 'c'] - * - * _.toArray(1); - * // => [] - * - * _.toArray(null); - * // => [] - */ - function toArray(value) { - if (!value) { - return []; - } - if (isArrayLike(value)) { - return isString(value) ? stringToArray(value) : copyArray(value); - } - if (iteratorSymbol && value[iteratorSymbol]) { - return iteratorToArray(value[iteratorSymbol]()); - } - var tag = getTag(value), - func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); - - return func(value); - } - - /** - * Converts `value` to an integer. - * - * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3'); - * // => 3 - */ - function toInteger(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - var remainder = value % 1; - return value === value ? (remainder ? value - remainder : value) : 0; - } - - /** - * Converts `value` to an integer suitable for use as the length of an - * array-like object. - * - * **Note:** This method is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toLength(3); - * // => 3 - * - * _.toLength(Number.MIN_VALUE); - * // => 0 - * - * _.toLength(Infinity); - * // => 4294967295 - * - * _.toLength('3'); - * // => 3 - */ - function toLength(value) { - return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; - } - - /** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3); - * // => 3 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3'); - * // => 3 - */ - function toNumber(value) { - if (isObject(value)) { - var other = isFunction(value.valueOf) ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); - } - - /** - * Converts `value` to a plain object flattening inherited enumerable - * properties of `value` to own properties of the plain object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {Object} Returns the converted plain object. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.assign({ 'a': 1 }, new Foo); - * // => { 'a': 1, 'b': 2 } - * - * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); - * // => { 'a': 1, 'b': 2, 'c': 3 } - */ - function toPlainObject(value) { - return copyObject(value, keysIn(value)); - } - - /** - * Converts `value` to a safe integer. A safe integer can be compared and - * represented correctly. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toSafeInteger(3); - * // => 3 - * - * _.toSafeInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toSafeInteger(Infinity); - * // => 9007199254740991 - * - * _.toSafeInteger('3'); - * // => 3 - */ - function toSafeInteger(value) { - return baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER); - } - - /** - * Converts `value` to a string if it's not one. An empty string is returned - * for `null` and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ - function toString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (value == null) { - return ''; - } - if (isSymbol(value)) { - return Symbol ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; - } - - /*------------------------------------------------------------------------*/ - - /** - * Assigns own enumerable properties of source objects to the destination - * object. Source objects are applied from left to right. Subsequent sources - * overwrite property assignments of previous sources. - * - * **Note:** This method mutates `object` and is loosely based on - * [`Object.assign`](https://mdn.io/Object/assign). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.c = 3; - * } - * - * function Bar() { - * this.e = 5; - * } - * - * Foo.prototype.d = 4; - * Bar.prototype.f = 6; - * - * _.assign({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3, 'e': 5 } - */ - var assign = createAssigner(function(object, source) { - copyObject(source, keys(source), object); - }); - - /** - * This method is like `_.assign` except that it iterates over own and - * inherited source properties. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @alias extend - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * function Bar() { - * this.d = 4; - * } - * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; - * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } - */ - var assignIn = createAssigner(function(object, source) { - copyObject(source, keysIn(source), object); - }); - - /** - * This method is like `_.assignIn` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @alias extendWith - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignInWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObjectWith(source, keysIn(source), object, customizer); - }); - - /** - * This method is like `_.assign` except that it accepts `customizer` which - * is invoked to produce the assigned values. If `customizer` returns `undefined` - * assignment is handled by the method instead. The `customizer` is invoked - * with five arguments: (objValue, srcValue, key, object, source). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * return _.isUndefined(objValue) ? srcValue : objValue; - * } - * - * var defaults = _.partialRight(_.assignWith, customizer); - * - * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); - * // => { 'a': 1, 'b': 2 } - */ - var assignWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObjectWith(source, keys(source), object, customizer); - }); - - /** - * Creates an array of values corresponding to `paths` of `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {...(string|string[])} [paths] The property paths of elements to pick, - * specified individually or in arrays. - * @returns {Array} Returns the new array of picked elements. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; - * - * _.at(object, ['a[0].b.c', 'a[1]']); - * // => [3, 4] - * - * _.at(['a', 'b', 'c'], 0, 2); - * // => ['a', 'c'] - */ - var at = rest(function(object, paths) { - return baseAt(object, baseFlatten(paths)); - }); - - /** - * Creates an object that inherits from the `prototype` object. If a `properties` - * object is provided its own enumerable properties are assigned to the created object. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} prototype The object to inherit from. - * @param {Object} [properties] The properties to assign to the object. - * @returns {Object} Returns the new object. - * @example - * - * function Shape() { - * this.x = 0; - * this.y = 0; - * } - * - * function Circle() { - * Shape.call(this); - * } - * - * Circle.prototype = _.create(Shape.prototype, { - * 'constructor': Circle - * }); - * - * var circle = new Circle; - * circle instanceof Circle; - * // => true - * - * circle instanceof Shape; - * // => true - */ - function create(prototype, properties) { - var result = baseCreate(prototype); - return properties ? baseAssign(result, properties) : result; - } - - /** - * Assigns own and inherited enumerable properties of source objects to the - * destination object for all destination properties that resolve to `undefined`. - * Source objects are applied from left to right. Once a property is set, - * additional values of the same property are ignored. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); - * // => { 'user': 'barney', 'age': 36 } - */ - var defaults = rest(function(args) { - args.push(undefined, assignInDefaults); - return apply(assignInWith, undefined, args); - }); - - /** - * This method is like `_.defaults` except that it recursively assigns - * default properties. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } }); - * // => { 'user': { 'name': 'barney', 'age': 36 } } - * - */ - var defaultsDeep = rest(function(args) { - args.push(undefined, mergeDefaults); - return apply(mergeWith, undefined, args); - }); - - /** - * This method is like `_.find` except that it returns the key of the first - * element `predicate` returns truthy for instead of the element itself. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {string|undefined} Returns the key of the matched element, else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findKey(users, function(o) { return o.age < 40; }); - * // => 'barney' (iteration order is not guaranteed) - * - * // The `_.matches` iteratee shorthand. - * _.findKey(users, { 'age': 1, 'active': true }); - * // => 'pebbles' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findKey(users, ['active', false]); - * // => 'fred' - * - * // The `_.property` iteratee shorthand. - * _.findKey(users, 'active'); - * // => 'barney' - */ - function findKey(object, predicate) { - return baseFind(object, getIteratee(predicate, 3), baseForOwn, true); - } - - /** - * This method is like `_.findKey` except that it iterates over elements of - * a collection in the opposite order. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {string|undefined} Returns the key of the matched element, else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findLastKey(users, function(o) { return o.age < 40; }); - * // => returns 'pebbles' assuming `_.findKey` returns 'barney' - * - * // The `_.matches` iteratee shorthand. - * _.findLastKey(users, { 'age': 36, 'active': true }); - * // => 'barney' - * - * // The `_.matchesProperty` iteratee shorthand. - * _.findLastKey(users, ['active', false]); - * // => 'fred' - * - * // The `_.property` iteratee shorthand. - * _.findLastKey(users, 'active'); - * // => 'pebbles' - */ - function findLastKey(object, predicate) { - return baseFind(object, getIteratee(predicate, 3), baseForOwnRight, true); - } - - /** - * Iterates over own and inherited enumerable properties of an object invoking - * `iteratee` for each property. The iteratee is invoked with three arguments: - * (value, key, object). Iteratee functions may exit iteration early by explicitly - * returning `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forIn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'a', 'b', then 'c' (iteration order is not guaranteed) - */ - function forIn(object, iteratee) { - return object == null ? object : baseFor(object, toFunction(iteratee), keysIn); - } - - /** - * This method is like `_.forIn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forInRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c' - */ - function forInRight(object, iteratee) { - return object == null ? object : baseForRight(object, toFunction(iteratee), keysIn); - } - - /** - * Iterates over own enumerable properties of an object invoking `iteratee` - * for each property. The iteratee is invoked with three arguments: - * (value, key, object). Iteratee functions may exit iteration early by - * explicitly returning `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'a' then 'b' (iteration order is not guaranteed) - */ - function forOwn(object, iteratee) { - return object && baseForOwn(object, toFunction(iteratee)); - } - - /** - * This method is like `_.forOwn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwnRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b' - */ - function forOwnRight(object, iteratee) { - return object && baseForOwnRight(object, toFunction(iteratee)); - } - - /** - * Creates an array of function property names from own enumerable properties - * of `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the new array of property names. - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functions(new Foo); - * // => ['a', 'b'] - */ - function functions(object) { - return object == null ? [] : baseFunctions(object, keys(object)); - } - - /** - * Creates an array of function property names from own and inherited - * enumerable properties of `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the new array of property names. - * @example - * - * function Foo() { - * this.a = _.constant('a'); - * this.b = _.constant('b'); - * } - * - * Foo.prototype.c = _.constant('c'); - * - * _.functionsIn(new Foo); - * // => ['a', 'b', 'c'] - */ - function functionsIn(object) { - return object == null ? [] : baseFunctions(object, keysIn(object)); - } - - /** - * Gets the value at `path` of `object`. If the resolved value is - * `undefined` the `defaultValue` is used in its place. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 - * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 - * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' - */ - function get(object, path, defaultValue) { - var result = object == null ? undefined : baseGet(object, path); - return result === undefined ? defaultValue : result; - } - - /** - * Checks if `path` is a direct property of `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b.c'); - * // => true - * - * _.has(object, ['a', 'b', 'c']); - * // => true - * - * _.has(other, 'a'); - * // => false - */ - function has(object, path) { - return hasPath(object, path, baseHas); - } - - /** - * Checks if `path` is a direct or inherited property of `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. - * @example - * - * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b.c'); - * // => true - * - * _.hasIn(object, ['a', 'b', 'c']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ - function hasIn(object, path) { - return hasPath(object, path, baseHasIn); - } - - /** - * Creates an object composed of the inverted keys and values of `object`. - * If `object` contains duplicate values, subsequent values overwrite property - * assignments of previous values. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to invert. - * @returns {Object} Returns the new inverted object. - * @example - * - * var object = { 'a': 1, 'b': 2, 'c': 1 }; - * - * _.invert(object); - * // => { '1': 'c', '2': 'b' } - */ - var invert = createInverter(function(result, value, key) { - result[value] = key; - }, constant(identity)); - - /** - * This method is like `_.invert` except that the inverted object is generated - * from the results of running each element of `object` through `iteratee`. - * The corresponding inverted value of each inverted key is an array of keys - * responsible for generating the inverted value. The iteratee is invoked - * with one argument: (value). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to invert. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Object} Returns the new inverted object. - * @example - * - * var object = { 'a': 1, 'b': 2, 'c': 1 }; - * - * _.invertBy(object); - * // => { '1': ['a', 'c'], '2': ['b'] } - * - * _.invertBy(object, function(value) { - * return 'group' + value; - * }); - * // => { 'group1': ['a', 'c'], 'group2': ['b'] } - */ - var invertBy = createInverter(function(result, value, key) { - if (hasOwnProperty.call(result, value)) { - result[value].push(key); - } else { - result[value] = [key]; - } - }, getIteratee); - - /** - * Invokes the method at `path` of `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {...*} [args] The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. - * @example - * - * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; - * - * _.invoke(object, 'a[0].b.c.slice', 1, 3); - * // => [2, 3] - */ - var invoke = rest(baseInvoke); - - /** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) - * for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ - function keys(object) { - var isProto = isPrototype(object); - if (!(isProto || isArrayLike(object))) { - return baseKeys(object); - } - var indexes = indexKeys(object), - skipIndexes = !!indexes, - result = indexes || [], - length = result.length; - - for (var key in object) { - if (baseHas(object, key) && - !(skipIndexes && (key == 'length' || isIndex(key, length))) && - !(isProto && key == 'constructor')) { - result.push(key); - } - } - return result; - } - - /** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ - function keysIn(object) { - var index = -1, - isProto = isPrototype(object), - props = baseKeysIn(object), - propsLength = props.length, - indexes = indexKeys(object), - skipIndexes = !!indexes, - result = indexes || [], - length = result.length; - - while (++index < propsLength) { - var key = props[index]; - if (!(skipIndexes && (key == 'length' || isIndex(key, length))) && - !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; - } - - /** - * The opposite of `_.mapValues`; this method creates an object with the - * same values as `object` and keys generated by running each own enumerable - * property of `object` through `iteratee`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns the new mapped object. - * @example - * - * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { - * return key + value; - * }); - * // => { 'a1': 1, 'b2': 2 } - */ - function mapKeys(object, iteratee) { - var result = {}; - iteratee = getIteratee(iteratee, 3); - - baseForOwn(object, function(value, key, object) { - result[iteratee(value, key, object)] = value; - }); - return result; - } - - /** - * Creates an object with the same keys as `object` and values generated by - * running each own enumerable property of `object` through `iteratee`. The - * iteratee function is invoked with three arguments: (value, key, object). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns the new mapped object. - * @example - * - * var users = { - * 'fred': { 'user': 'fred', 'age': 40 }, - * 'pebbles': { 'user': 'pebbles', 'age': 1 } - * }; - * - * _.mapValues(users, function(o) { return o.age; }); - * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) - * - * // The `_.property` iteratee shorthand. - * _.mapValues(users, 'age'); - * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) - */ - function mapValues(object, iteratee) { - var result = {}; - iteratee = getIteratee(iteratee, 3); - - baseForOwn(object, function(value, key, object) { - result[key] = iteratee(value, key, object); - }); - return result; - } - - /** - * Recursively merges own and inherited enumerable properties of source - * objects into the destination object, skipping source properties that resolve - * to `undefined`. Array and plain object properties are merged recursively. - * Other objects and value types are overridden by assignment. Source objects - * are applied from left to right. Subsequent sources overwrite property - * assignments of previous sources. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] - * }; - * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] - * }; - * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } - */ - var merge = createAssigner(function(object, source, srcIndex) { - baseMerge(object, source, srcIndex); - }); - - /** - * This method is like `_.merge` except that it accepts `customizer` which - * is invoked to produce the merged values of the destination and source - * properties. If `customizer` returns `undefined` merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: - * (objValue, srcValue, key, object, source, stack). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} sources The source objects. - * @param {Function} customizer The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * function customizer(objValue, srcValue) { - * if (_.isArray(objValue)) { - * return objValue.concat(srcValue); - * } - * } - * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.mergeWith(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { - baseMerge(object, source, srcIndex, customizer); - }); - - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [props] The property names to omit, specified - * individually or in arrays.. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omit(object, ['a', 'c']); - * // => { 'b': '2' } - */ - var omit = rest(function(object, props) { - if (object == null) { - return {}; - } - props = arrayMap(baseFlatten(props), String); - return basePick(object, baseDifference(keysIn(object), props)); - }); - - /** - * The opposite of `_.pickBy`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that `predicate` - * doesn't return truthy for. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per property. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.omitBy(object, _.isNumber); - * // => { 'b': '2' } - */ - function omitBy(object, predicate) { - predicate = getIteratee(predicate, 2); - return basePickBy(object, function(value, key) { - return !predicate(value, key); - }); - } - - /** - * Creates an object composed of the picked `object` properties. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {...(string|string[])} [props] The property names to pick, specified - * individually or in arrays. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pick(object, ['a', 'c']); - * // => { 'a': 1, 'c': 3 } - */ - var pick = rest(function(object, props) { - return object == null ? {} : basePick(object, baseFlatten(props)); - }); - - /** - * Creates an object composed of the `object` properties `predicate` returns - * truthy for. The predicate is invoked with two arguments: (value, key). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per property. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'a': 1, 'b': '2', 'c': 3 }; - * - * _.pickBy(object, _.isNumber); - * // => { 'a': 1, 'c': 3 } - */ - function pickBy(object, predicate) { - return object == null ? {} : basePickBy(object, getIteratee(predicate, 2)); - } - - /** - * This method is like `_.get` except that if the resolved value is a function - * it's invoked with the `this` binding of its parent object and its result - * is returned. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to resolve. - * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; - * - * _.result(object, 'a[0].b.c1'); - * // => 3 - * - * _.result(object, 'a[0].b.c2'); - * // => 4 - * - * _.result(object, 'a[0].b.c3', 'default'); - * // => 'default' - * - * _.result(object, 'a[0].b.c3', _.constant('default')); - * // => 'default' - */ - function result(object, path, defaultValue) { - if (!isKey(path, object)) { - path = baseToPath(path); - var result = get(object, path); - object = parent(object, path); - } else { - result = object == null ? undefined : object[path]; - } - if (result === undefined) { - result = defaultValue; - } - return isFunction(result) ? result.call(object) : result; - } - - /** - * Sets the value at `path` of `object`. If a portion of `path` doesn't exist - * it's created. Arrays are created for missing index properties while objects - * are created for all other missing properties. Use `_.setWith` to customize - * `path` creation. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @returns {Object} Returns `object`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.set(object, 'a[0].b.c', 4); - * console.log(object.a[0].b.c); - * // => 4 - * - * _.set(object, 'x[0].y.z', 5); - * console.log(object.x[0].y.z); - * // => 5 - */ - function set(object, path, value) { - return object == null ? object : baseSet(object, path, value); - } - - /** - * This method is like `_.set` except that it accepts `customizer` which is - * invoked to produce the objects of `path`. If `customizer` returns `undefined` - * path creation is handled by the method instead. The `customizer` is invoked - * with three arguments: (nsValue, key, nsObject). - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @param {Function} [customizer] The function to customize assigned values. - * @returns {Object} Returns `object`. - * @example - * - * _.setWith({ '0': { 'length': 2 } }, '[0][1][2]', 3, Object); - * // => { '0': { '1': { '2': 3 }, 'length': 2 } } - */ - function setWith(object, path, value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined; - return object == null ? object : baseSet(object, path, value, customizer); - } - - /** - * Creates an array of own enumerable key-value pairs for `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the new array of key-value pairs. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.toPairs(new Foo); - * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) - */ - function toPairs(object) { - return baseToPairs(object, keys(object)); - } - - /** - * Creates an array of own and inherited enumerable key-value pairs for `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the new array of key-value pairs. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.toPairsIn(new Foo); - * // => [['a', 1], ['b', 2], ['c', 1]] (iteration order is not guaranteed) - */ - function toPairsIn(object) { - return baseToPairs(object, keysIn(object)); - } - - /** - * An alternative to `_.reduce`; this method transforms `object` to a new - * `accumulator` object which is the result of running each of its own enumerable - * properties through `iteratee`, with each invocation potentially mutating - * the `accumulator` object. The iteratee is invoked with four arguments: - * (accumulator, value, key, object). Iteratee functions may exit iteration - * early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Array|Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The custom accumulator value. - * @returns {*} Returns the accumulated value. - * @example - * - * _.transform([2, 3, 4], function(result, n) { - * result.push(n *= n); - * return n % 2 == 0; - * }, []); - * // => [4, 9] - * - * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { - * (result[value] || (result[value] = [])).push(key); - * }, {}); - * // => { '1': ['a', 'c'], '2': ['b'] } - */ - function transform(object, iteratee, accumulator) { - var isArr = isArray(object) || isTypedArray(object); - iteratee = getIteratee(iteratee, 4); - - if (accumulator == null) { - if (isArr || isObject(object)) { - var Ctor = object.constructor; - if (isArr) { - accumulator = isArray(object) ? new Ctor : []; - } else { - accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined); - } - } else { - accumulator = {}; - } - } - (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) { - return iteratee(accumulator, value, index, object); - }); - return accumulator; - } - - /** - * Removes the property at `path` of `object`. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to modify. - * @param {Array|string} path The path of the property to unset. - * @returns {boolean} Returns `true` if the property is deleted, else `false`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 7 } }] }; - * _.unset(object, 'a[0].b.c'); - * // => true - * - * console.log(object); - * // => { 'a': [{ 'b': {} }] }; - * - * _.unset(object, 'a[0].b.c'); - * // => true - * - * console.log(object); - * // => { 'a': [{ 'b': {} }] }; - */ - function unset(object, path) { - return object == null ? true : baseUnset(object, path); - } - - /** - * Creates an array of the own enumerable property values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.values(new Foo); - * // => [1, 2] (iteration order is not guaranteed) - * - * _.values('hi'); - * // => ['h', 'i'] - */ - function values(object) { - return object ? baseValues(object, keys(object)) : []; - } - - /** - * Creates an array of the own and inherited enumerable property values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.valuesIn(new Foo); - * // => [1, 2, 3] (iteration order is not guaranteed) - */ - function valuesIn(object) { - return object == null ? baseValues(object, keysIn(object)) : []; - } - - /*------------------------------------------------------------------------*/ - - /** - * Clamps `number` within the inclusive `lower` and `upper` bounds. - * - * @static - * @memberOf _ - * @category Number - * @param {number} number The number to clamp. - * @param {number} [lower] The lower bound. - * @param {number} upper The upper bound. - * @returns {number} Returns the clamped number. - * @example - * - * _.clamp(-10, -5, 5); - * // => -5 - * - * _.clamp(10, -5, 5); - * // => 5 - */ - function clamp(number, lower, upper) { - if (upper === undefined) { - upper = lower; - lower = undefined; - } - if (upper !== undefined) { - upper = toNumber(upper); - upper = upper === upper ? upper : 0; - } - if (lower !== undefined) { - lower = toNumber(lower); - lower = lower === lower ? lower : 0; - } - return baseClamp(toNumber(number), lower, upper); - } - - /** - * Checks if `n` is between `start` and up to but not including, `end`. If - * `end` is not specified it's set to `start` with `start` then set to `0`. - * If `start` is greater than `end` the params are swapped to support - * negative ranges. - * - * @static - * @memberOf _ - * @category Number - * @param {number} number The number to check. - * @param {number} [start=0] The start of the range. - * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `number` is in the range, else `false`. - * @example - * - * _.inRange(3, 2, 4); - * // => true - * - * _.inRange(4, 8); - * // => true - * - * _.inRange(4, 2); - * // => false - * - * _.inRange(2, 2); - * // => false - * - * _.inRange(1.2, 2); - * // => true - * - * _.inRange(5.2, 4); - * // => false - * - * _.inRange(-3, -2, -6); - * // => true - */ - function inRange(number, start, end) { - start = toNumber(start) || 0; - if (end === undefined) { - end = start; - start = 0; - } else { - end = toNumber(end) || 0; - } - number = toNumber(number); - return baseInRange(number, start, end); - } - - /** - * Produces a random number between the inclusive `lower` and `upper` bounds. - * If only one argument is provided a number between `0` and the given number - * is returned. If `floating` is `true`, or either `lower` or `upper` are floats, - * a floating-point number is returned instead of an integer. - * - * **Note:** JavaScript follows the IEEE-754 standard for resolving - * floating-point values which can produce unexpected results. - * - * @static - * @memberOf _ - * @category Number - * @param {number} [lower=0] The lower bound. - * @param {number} [upper=1] The upper bound. - * @param {boolean} [floating] Specify returning a floating-point number. - * @returns {number} Returns the random number. - * @example - * - * _.random(0, 5); - * // => an integer between 0 and 5 - * - * _.random(5); - * // => also an integer between 0 and 5 - * - * _.random(5, true); - * // => a floating-point number between 0 and 5 - * - * _.random(1.2, 5.2); - * // => a floating-point number between 1.2 and 5.2 - */ - function random(lower, upper, floating) { - if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { - upper = floating = undefined; - } - if (floating === undefined) { - if (typeof upper == 'boolean') { - floating = upper; - upper = undefined; - } - else if (typeof lower == 'boolean') { - floating = lower; - lower = undefined; - } - } - if (lower === undefined && upper === undefined) { - lower = 0; - upper = 1; - } - else { - lower = toNumber(lower) || 0; - if (upper === undefined) { - upper = lower; - lower = 0; - } else { - upper = toNumber(upper) || 0; - } - } - if (lower > upper) { - var temp = lower; - lower = upper; - upper = temp; - } - if (floating || lower % 1 || upper % 1) { - var rand = nativeRandom(); - return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); - } - return baseRandom(lower, upper); - } - - /*------------------------------------------------------------------------*/ - - /** - * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the camel cased string. - * @example - * - * _.camelCase('Foo Bar'); - * // => 'fooBar' - * - * _.camelCase('--foo-bar'); - * // => 'fooBar' - * - * _.camelCase('__foo_bar__'); - * // => 'fooBar' - */ - var camelCase = createCompounder(function(result, word, index) { - word = word.toLowerCase(); - return result + (index ? capitalize(word) : word); - }); - - /** - * Converts the first character of `string` to upper case and the remaining - * to lower case. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to capitalize. - * @returns {string} Returns the capitalized string. - * @example - * - * _.capitalize('FRED'); - * // => 'Fred' - */ - function capitalize(string) { - return upperFirst(toString(string).toLowerCase()); - } - - /** - * Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) - * to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to deburr. - * @returns {string} Returns the deburred string. - * @example - * - * _.deburr('déjà vu'); - * // => 'deja vu' - */ - function deburr(string) { - string = toString(string); - return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, ''); - } - - /** - * Checks if `string` ends with the given target string. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to search. - * @param {string} [target] The string to search for. - * @param {number} [position=string.length] The position to search from. - * @returns {boolean} Returns `true` if `string` ends with `target`, else `false`. - * @example - * - * _.endsWith('abc', 'c'); - * // => true - * - * _.endsWith('abc', 'b'); - * // => false - * - * _.endsWith('abc', 'b', 2); - * // => true - */ - function endsWith(string, target, position) { - string = toString(string); - target = typeof target == 'string' ? target : (target + ''); - - var length = string.length; - position = position === undefined - ? length - : baseClamp(toInteger(position), 0, length); - - position -= target.length; - return position >= 0 && string.indexOf(target, position) == position; - } - - /** - * Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to - * their corresponding HTML entities. - * - * **Note:** No other characters are escaped. To escape additional - * characters use a third-party library like [_he_](https://mths.be/he). - * - * Though the ">" character is escaped for symmetry, characters like - * ">" and "/" don't need escaping in HTML and have no special meaning - * unless they're part of a tag or unquoted attribute value. - * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) - * (under "semi-related fun fact") for more details. - * - * Backticks are escaped because in IE < 9, they can break out of - * attribute values or HTML comments. See [#59](https://html5sec.org/#59), - * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and - * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/) - * for more details. - * - * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping) - * to reduce XSS vectors. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escape('fred, barney, & pebbles'); - * // => 'fred, barney, & pebbles' - */ - function escape(string) { - string = toString(string); - return (string && reHasUnescapedHtml.test(string)) - ? string.replace(reUnescapedHtml, escapeHtmlChar) - : string; - } - - /** - * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", - * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escapeRegExp('[lodash](https://lodash.com/)'); - * // => '\[lodash\]\(https://lodash\.com/\)' - */ - function escapeRegExp(string) { - string = toString(string); - return (string && reHasRegExpChar.test(string)) - ? string.replace(reRegExpChar, '\\$&') - : string; - } - - /** - * Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the kebab cased string. - * @example - * - * _.kebabCase('Foo Bar'); - * // => 'foo-bar' - * - * _.kebabCase('fooBar'); - * // => 'foo-bar' - * - * _.kebabCase('__foo_bar__'); - * // => 'foo-bar' - */ - var kebabCase = createCompounder(function(result, word, index) { - return result + (index ? '-' : '') + word.toLowerCase(); - }); - - /** - * Converts `string`, as space separated words, to lower case. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the lower cased string. - * @example - * - * _.lowerCase('--Foo-Bar'); - * // => 'foo bar' - * - * _.lowerCase('fooBar'); - * // => 'foo bar' - * - * _.lowerCase('__FOO_BAR__'); - * // => 'foo bar' - */ - var lowerCase = createCompounder(function(result, word, index) { - return result + (index ? ' ' : '') + word.toLowerCase(); - }); - - /** - * Converts the first character of `string` to lower case. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.lowerFirst('Fred'); - * // => 'fred' - * - * _.lowerFirst('FRED'); - * // => 'fRED' - */ - var lowerFirst = createCaseFirst('toLowerCase'); - - /** - * Converts the first character of `string` to upper case. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.upperFirst('fred'); - * // => 'Fred' - * - * _.upperFirst('FRED'); - * // => 'FRED' - */ - var upperFirst = createCaseFirst('toUpperCase'); - - /** - * Pads `string` on the left and right sides if it's shorter than `length`. - * Padding characters are truncated if they can't be evenly divided by `length`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.pad('abc', 8); - * // => ' abc ' - * - * _.pad('abc', 8, '_-'); - * // => '_-abc_-_' - * - * _.pad('abc', 3); - * // => 'abc' - */ - function pad(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = stringSize(string); - if (!length || strLength >= length) { - return string; - } - var mid = (length - strLength) / 2, - leftLength = nativeFloor(mid), - rightLength = nativeCeil(mid); - - return createPadding('', leftLength, chars) + string + createPadding('', rightLength, chars); - } - - /** - * Pads `string` on the right side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padEnd('abc', 6); - * // => 'abc ' - * - * _.padEnd('abc', 6, '_-'); - * // => 'abc_-_' - * - * _.padEnd('abc', 3); - * // => 'abc' - */ - function padEnd(string, length, chars) { - string = toString(string); - return string + createPadding(string, length, chars); - } - - /** - * Pads `string` on the left side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padStart('abc', 6); - * // => ' abc' - * - * _.padStart('abc', 6, '_-'); - * // => '_-_abc' - * - * _.padStart('abc', 3); - * // => 'abc' - */ - function padStart(string, length, chars) { - string = toString(string); - return createPadding(string, length, chars) + string; - } - - /** - * Converts `string` to an integer of the specified radix. If `radix` is - * `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal, - * in which case a `radix` of `16` is used. - * - * **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#x15.1.2.2) - * of `parseInt`. - * - * @static - * @memberOf _ - * @category String - * @param {string} string The string to convert. - * @param {number} [radix] The radix to interpret `value` by. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {number} Returns the converted integer. - * @example - * - * _.parseInt('08'); - * // => 8 - * - * _.map(['6', '08', '10'], _.parseInt); - * // => [6, 8, 10] - */ - function parseInt(string, radix, guard) { - // Chrome fails to trim leading whitespace characters. - // See https://code.google.com/p/v8/issues/detail?id=3109 for more details. - if (guard || radix == null) { - radix = 0; - } else if (radix) { - radix = +radix; - } - string = toString(string).replace(reTrim, ''); - return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10)); - } - - /** - * Repeats the given string `n` times. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to repeat. - * @param {number} [n=0] The number of times to repeat the string. - * @returns {string} Returns the repeated string. - * @example - * - * _.repeat('*', 3); - * // => '***' - * - * _.repeat('abc', 2); - * // => 'abcabc' - * - * _.repeat('abc', 0); - * // => '' - */ - function repeat(string, n) { - string = toString(string); - n = toInteger(n); - - var result = ''; - if (!string || n < 1 || n > MAX_SAFE_INTEGER) { - return result; - } - // Leverage the exponentiation by squaring algorithm for a faster repeat. - // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. - do { - if (n % 2) { - result += string; - } - n = nativeFloor(n / 2); - string += string; - } while (n); - - return result; - } - - /** - * Replaces matches for `pattern` in `string` with `replacement`. - * - * **Note:** This method is based on [`String#replace`](https://mdn.io/String/replace). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to modify. - * @param {RegExp|string} pattern The pattern to replace. - * @param {Function|string} replacement The match replacement. - * @returns {string} Returns the modified string. - * @example - * - * _.replace('Hi Fred', 'Fred', 'Barney'); - * // => 'Hi Barney' - */ - function replace() { - var args = arguments, - string = toString(args[0]); - - return args.length < 3 ? string : string.replace(args[1], args[2]); - } - - /** - * Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the snake cased string. - * @example - * - * _.snakeCase('Foo Bar'); - * // => 'foo_bar' - * - * _.snakeCase('fooBar'); - * // => 'foo_bar' - * - * _.snakeCase('--foo-bar'); - * // => 'foo_bar' - */ - var snakeCase = createCompounder(function(result, word, index) { - return result + (index ? '_' : '') + word.toLowerCase(); - }); - - /** - * Splits `string` by `separator`. - * - * **Note:** This method is based on [`String#split`](https://mdn.io/String/split). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to split. - * @param {RegExp|string} separator The separator pattern to split by. - * @param {number} [limit] The length to truncate results to. - * @returns {Array} Returns the new array of string segments. - * @example - * - * _.split('a-b-c', '-', 2); - * // => ['a', 'b'] - */ - function split(string, separator, limit) { - return toString(string).split(separator, limit); - } - - /** - * Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the start cased string. - * @example - * - * _.startCase('--foo-bar'); - * // => 'Foo Bar' - * - * _.startCase('fooBar'); - * // => 'Foo Bar' - * - * _.startCase('__foo_bar__'); - * // => 'Foo Bar' - */ - var startCase = createCompounder(function(result, word, index) { - return result + (index ? ' ' : '') + capitalize(word); - }); - - /** - * Checks if `string` starts with the given target string. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to search. - * @param {string} [target] The string to search for. - * @param {number} [position=0] The position to search from. - * @returns {boolean} Returns `true` if `string` starts with `target`, else `false`. - * @example - * - * _.startsWith('abc', 'a'); - * // => true - * - * _.startsWith('abc', 'b'); - * // => false - * - * _.startsWith('abc', 'b', 1); - * // => true - */ - function startsWith(string, target, position) { - string = toString(string); - position = baseClamp(toInteger(position), 0, string.length); - return string.lastIndexOf(target, position) == position; - } - - /** - * Creates a compiled template function that can interpolate data properties - * in "interpolate" delimiters, HTML-escape interpolated data properties in - * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data - * properties may be accessed as free variables in the template. If a setting - * object is provided it takes precedence over `_.templateSettings` values. - * - * **Note:** In the development build `_.template` utilizes - * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) - * for easier debugging. - * - * For more information on precompiling templates see - * [lodash's custom builds documentation](https://lodash.com/custom-builds). - * - * For more information on Chrome extension sandboxes see - * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The template string. - * @param {Object} [options] The options object. - * @param {RegExp} [options.escape] The HTML "escape" delimiter. - * @param {RegExp} [options.evaluate] The "evaluate" delimiter. - * @param {Object} [options.imports] An object to import into the template as free variables. - * @param {RegExp} [options.interpolate] The "interpolate" delimiter. - * @param {string} [options.sourceURL] The sourceURL of the template's compiled source. - * @param {string} [options.variable] The data object variable name. - * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {Function} Returns the compiled template function. - * @example - * - * // Use the "interpolate" delimiter to create a compiled template. - * var compiled = _.template('hello <%= user %>!'); - * compiled({ 'user': 'fred' }); - * // => 'hello fred!' - * - * // Use the HTML "escape" delimiter to escape data property values. - * var compiled = _.template('<%- value %>'); - * compiled({ 'value': ' - - - - -
{{ "%+010d"|sprintf:-123 }}
-
{{ "%+010d"|vsprintf:[-123] }}
-
{{ "%+010d"|fmt:-123 }}
-
{{ "%+010d"|vfmt:[-123] }}
-
{{ "I've got %2$d apples and %1$d oranges."|fmt:4:2 }}
-
{{ "I've got %(apples)d apples and %(oranges)d oranges."|fmt:{apples: 2, oranges: 4} }}
- - - - diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.js deleted file mode 100644 index dbaf744..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! sprintf-js | Alexandru Marasteanu (http://alexei.ro/) | BSD-3-Clause */ - -angular.module("sprintf",[]).filter("sprintf",function(){return function(){return sprintf.apply(null,arguments)}}).filter("fmt",["$filter",function(a){return a("sprintf")}]).filter("vsprintf",function(){return function(a,b){return vsprintf(a,b)}}).filter("vfmt",["$filter",function(a){return a("vsprintf")}]); -//# sourceMappingURL=angular-sprintf.min.map \ No newline at end of file diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.js.map b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.js.map deleted file mode 100644 index 055964c..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"angular-sprintf.min.js","sources":["../src/angular-sprintf.js"],"names":["angular","module","filter","sprintf","apply","arguments","$filter","format","argv","vsprintf"],"mappings":";;AAAAA,QACIC,OAAO,cACPC,OAAO,UAAW,WACd,MAAO,YACH,MAAOC,SAAQC,MAAM,KAAMC,cAGnCH,OAAO,OAAQ,UAAW,SAASI,GAC/B,MAAOA,GAAQ,cAEnBJ,OAAO,WAAY,WACf,MAAO,UAASK,EAAQC,GACpB,MAAOC,UAASF,EAAQC,MAGhCN,OAAO,QAAS,UAAW,SAASI,GAChC,MAAOA,GAAQ"} \ No newline at end of file diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.map b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.map deleted file mode 100644 index 055964c..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"angular-sprintf.min.js","sources":["../src/angular-sprintf.js"],"names":["angular","module","filter","sprintf","apply","arguments","$filter","format","argv","vsprintf"],"mappings":";;AAAAA,QACIC,OAAO,cACPC,OAAO,UAAW,WACd,MAAO,YACH,MAAOC,SAAQC,MAAM,KAAMC,cAGnCH,OAAO,OAAQ,UAAW,SAASI,GAC/B,MAAOA,GAAQ,cAEnBJ,OAAO,WAAY,WACf,MAAO,UAASK,EAAQC,GACpB,MAAOC,UAASF,EAAQC,MAGhCN,OAAO,QAAS,UAAW,SAASI,GAChC,MAAOA,GAAQ"} \ No newline at end of file diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.js deleted file mode 100644 index dc61e51..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! sprintf-js | Alexandru Marasteanu (http://alexei.ro/) | BSD-3-Clause */ - -!function(a){function b(){var a=arguments[0],c=b.cache;return c[a]&&c.hasOwnProperty(a)||(c[a]=b.parse(a)),b.format.call(null,c[a],arguments)}function c(a){return Object.prototype.toString.call(a).slice(8,-1).toLowerCase()}function d(a,b){return Array(b+1).join(a)}var e={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};b.format=function(a,f){var g,h,i,j,k,l,m,n=1,o=a.length,p="",q=[],r=!0,s="";for(h=0;o>h;h++)if(p=c(a[h]),"string"===p)q[q.length]=a[h];else if("array"===p){if(j=a[h],j[2])for(g=f[n],i=0;i=0),j[8]){case"b":g=g.toString(2);break;case"c":g=String.fromCharCode(g);break;case"d":case"i":g=parseInt(g,10);break;case"j":g=JSON.stringify(g,null,j[6]?parseInt(j[6]):0);break;case"e":g=j[7]?g.toExponential(j[7]):g.toExponential();break;case"f":g=j[7]?parseFloat(g).toFixed(j[7]):parseFloat(g);break;case"g":g=j[7]?parseFloat(g).toPrecision(j[7]):parseFloat(g);break;case"o":g=g.toString(8);break;case"s":g=(g=String(g))&&j[7]?g.substring(0,j[7]):g;break;case"u":g>>>=0;break;case"x":g=g.toString(16);break;case"X":g=g.toString(16).toUpperCase()}e.json.test(j[8])?q[q.length]=g:(!e.number.test(j[8])||r&&!j[3]?s="":(s=r?"+":"-",g=g.toString().replace(e.sign,"")),l=j[4]?"0"===j[4]?"0":j[4].charAt(1):" ",m=j[6]-(s+g).length,k=j[6]&&m>0?d(l,m):"",q[q.length]=j[5]?s+g+k:"0"===l?s+k+g:k+s+g)}return q.join("")},b.cache={},b.parse=function(a){for(var b=a,c=[],d=[],f=0;b;){if(null!==(c=e.text.exec(b)))d[d.length]=c[0];else if(null!==(c=e.modulo.exec(b)))d[d.length]="%";else{if(null===(c=e.placeholder.exec(b)))throw new SyntaxError("[sprintf] unexpected placeholder");if(c[2]){f|=1;var g=[],h=c[2],i=[];if(null===(i=e.key.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(g[g.length]=i[1];""!==(h=h.substring(i[0].length));)if(null!==(i=e.key_access.exec(h)))g[g.length]=i[1];else{if(null===(i=e.index_access.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");g[g.length]=i[1]}c[2]=g}else f|=2;if(3===f)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");d[d.length]=c}b=b.substring(c[0].length)}return d};var f=function(a,c,d){return d=(c||[]).slice(0),d.splice(0,0,a),b.apply(null,d)};"undefined"!=typeof exports?(exports.sprintf=b,exports.vsprintf=f):(a.sprintf=b,a.vsprintf=f,"function"==typeof define&&define.amd&&define(function(){return{sprintf:b,vsprintf:f}}))}("undefined"==typeof window?this:window); -//# sourceMappingURL=sprintf.min.map \ No newline at end of file diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.js.map b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.js.map deleted file mode 100644 index 369dbaf..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sprintf.min.js","sources":["../src/sprintf.js"],"names":["window","sprintf","key","arguments","cache","hasOwnProperty","parse","format","call","get_type","variable","Object","prototype","toString","slice","toLowerCase","str_repeat","input","multiplier","Array","join","re","not_string","number","json","not_json","text","modulo","placeholder","key_access","index_access","sign","parse_tree","argv","arg","i","k","match","pad","pad_character","pad_length","cursor","tree_length","length","node_type","output","is_positive","Error","test","isNaN","TypeError","String","fromCharCode","parseInt","JSON","stringify","toExponential","parseFloat","toFixed","substring","toUpperCase","replace","charAt","fmt","_fmt","arg_names","exec","SyntaxError","field_list","replacement_field","field_match","vsprintf","_argv","splice","apply","exports","define","amd","this"],"mappings":";;CAAA,SAAUA,GAeN,QAASC,KACL,GAAIC,GAAMC,UAAU,GAAIC,EAAQH,EAAQG,KAIxC,OAHMA,GAAMF,IAAQE,EAAMC,eAAeH,KACrCE,EAAMF,GAAOD,EAAQK,MAAMJ,IAExBD,EAAQM,OAAOC,KAAK,KAAMJ,EAAMF,GAAMC,WA4JjD,QAASM,GAASC,GACd,MAAOC,QAAOC,UAAUC,SAASL,KAAKE,GAAUI,MAAM,EAAG,IAAIC,cAGjE,QAASC,GAAWC,EAAOC,GACvB,MAAOC,OAAMD,EAAa,GAAGE,KAAKH,GApLtC,GAAII,IACAC,WAAY,OACZC,OAAQ,SACRC,KAAM,MACNC,SAAU,OACVC,KAAM,YACNC,OAAQ,WACRC,YAAa,yFACb1B,IAAK,sBACL2B,WAAY,wBACZC,aAAc,aACdC,KAAM,UAWV9B,GAAQM,OAAS,SAASyB,EAAYC,GAClC,GAAiEC,GAAkBC,EAAGC,EAAGC,EAAOC,EAAKC,EAAeC,EAAhHC,EAAS,EAAGC,EAAcV,EAAWW,OAAQC,EAAY,GAASC,KAA0DC,GAAc,EAAMf,EAAO,EAC3J,KAAKI,EAAI,EAAOO,EAAJP,EAAiBA,IAEzB,GADAS,EAAYnC,EAASuB,EAAWG,IACd,WAAdS,EACAC,EAAOA,EAAOF,QAAUX,EAAWG,OAElC,IAAkB,UAAdS,EAAuB,CAE5B,GADAP,EAAQL,EAAWG,GACfE,EAAM,GAEN,IADAH,EAAMD,EAAKQ,GACNL,EAAI,EAAGA,EAAIC,EAAM,GAAGM,OAAQP,IAAK,CAClC,IAAKF,EAAI7B,eAAegC,EAAM,GAAGD,IAC7B,KAAM,IAAIW,OAAM9C,EAAQ,yCAA0CoC,EAAM,GAAGD,IAE/EF,GAAMA,EAAIG,EAAM,GAAGD,QAIvBF,GADKG,EAAM,GACLJ,EAAKI,EAAM,IAGXJ,EAAKQ,IAOf,IAJqB,YAAjBhC,EAASyB,KACTA,EAAMA,KAGNb,EAAGC,WAAW0B,KAAKX,EAAM,KAAOhB,EAAGI,SAASuB,KAAKX,EAAM,KAAyB,UAAjB5B,EAASyB,IAAoBe,MAAMf,GAClG,KAAM,IAAIgB,WAAUjD,EAAQ,0CAA2CQ,EAASyB,IAOpF,QAJIb,EAAGE,OAAOyB,KAAKX,EAAM,MACrBS,EAAcZ,GAAO,GAGjBG,EAAM,IACV,IAAK,IACDH,EAAMA,EAAIrB,SAAS,EACvB,MACA,KAAK,IACDqB,EAAMiB,OAAOC,aAAalB,EAC9B,MACA,KAAK,IACL,IAAK,IACDA,EAAMmB,SAASnB,EAAK,GACxB,MACA,KAAK,IACDA,EAAMoB,KAAKC,UAAUrB,EAAK,KAAMG,EAAM,GAAKgB,SAAShB,EAAM,IAAM,EACpE,MACA,KAAK,IACDH,EAAMG,EAAM,GAAKH,EAAIsB,cAAcnB,EAAM,IAAMH,EAAIsB,eACvD,MACA,KAAK,IACDtB,EAAMG,EAAM,GAAKoB,WAAWvB,GAAKwB,QAAQrB,EAAM,IAAMoB,WAAWvB,EACpE,MACA,KAAK,IACDA,EAAMA,EAAIrB,SAAS,EACvB,MACA,KAAK,IACDqB,GAAQA,EAAMiB,OAAOjB,KAASG,EAAM,GAAKH,EAAIyB,UAAU,EAAGtB,EAAM,IAAMH,CAC1E,MACA,KAAK,IACDA,KAAc,CAClB,MACA,KAAK,IACDA,EAAMA,EAAIrB,SAAS,GACvB,MACA,KAAK,IACDqB,EAAMA,EAAIrB,SAAS,IAAI+C,cAG3BvC,EAAGG,KAAKwB,KAAKX,EAAM,IACnBQ,EAAOA,EAAOF,QAAUT,IAGpBb,EAAGE,OAAOyB,KAAKX,EAAM,KAASS,IAAeT,EAAM,GAKnDN,EAAO,IAJPA,EAAOe,EAAc,IAAM,IAC3BZ,EAAMA,EAAIrB,WAAWgD,QAAQxC,EAAGU,KAAM,KAK1CQ,EAAgBF,EAAM,GAAkB,MAAbA,EAAM,GAAa,IAAMA,EAAM,GAAGyB,OAAO,GAAK,IACzEtB,EAAaH,EAAM,IAAMN,EAAOG,GAAKS,OACrCL,EAAMD,EAAM,IAAMG,EAAa,EAAIxB,EAAWuB,EAAeC,GAAoB,GACjFK,EAAOA,EAAOF,QAAUN,EAAM,GAAKN,EAAOG,EAAMI,EAAyB,MAAlBC,EAAwBR,EAAOO,EAAMJ,EAAMI,EAAMP,EAAOG,GAI3H,MAAOW,GAAOzB,KAAK,KAGvBnB,EAAQG,SAERH,EAAQK,MAAQ,SAASyD,GAErB,IADA,GAAIC,GAAOD,EAAK1B,KAAYL,KAAiBiC,EAAY,EAClDD,GAAM,CACT,GAAqC,QAAhC3B,EAAQhB,EAAGK,KAAKwC,KAAKF,IACtBhC,EAAWA,EAAWW,QAAUN,EAAM,OAErC,IAAuC,QAAlCA,EAAQhB,EAAGM,OAAOuC,KAAKF,IAC7BhC,EAAWA,EAAWW,QAAU,QAE/B,CAAA,GAA4C,QAAvCN,EAAQhB,EAAGO,YAAYsC,KAAKF,IAgClC,KAAM,IAAIG,aAAY,mCA/BtB,IAAI9B,EAAM,GAAI,CACV4B,GAAa,CACb,IAAIG,MAAiBC,EAAoBhC,EAAM,GAAIiC,IACnD,IAAuD,QAAlDA,EAAcjD,EAAGnB,IAAIgE,KAAKG,IAe3B,KAAM,IAAIF,aAAY,+CAbtB,KADAC,EAAWA,EAAWzB,QAAU2B,EAAY,GACwC,MAA5ED,EAAoBA,EAAkBV,UAAUW,EAAY,GAAG3B,UACnE,GAA8D,QAAzD2B,EAAcjD,EAAGQ,WAAWqC,KAAKG,IAClCD,EAAWA,EAAWzB,QAAU2B,EAAY,OAE3C,CAAA,GAAgE,QAA3DA,EAAcjD,EAAGS,aAAaoC,KAAKG,IAIzC,KAAM,IAAIF,aAAY,+CAHtBC,GAAWA,EAAWzB,QAAU2B,EAAY,GAUxDjC,EAAM,GAAK+B,MAGXH,IAAa,CAEjB,IAAkB,IAAdA,EACA,KAAM,IAAIlB,OAAM,4EAEpBf,GAAWA,EAAWW,QAAUN,EAKpC2B,EAAOA,EAAKL,UAAUtB,EAAM,GAAGM,QAEnC,MAAOX,GAGX,IAAIuC,GAAW,SAASR,EAAK9B,EAAMuC,GAG/B,MAFAA,IAASvC,OAAYnB,MAAM,GAC3B0D,EAAMC,OAAO,EAAG,EAAGV,GACZ9D,EAAQyE,MAAM,KAAMF,GAiBR,oBAAZG,UACPA,QAAQ1E,QAAUA,EAClB0E,QAAQJ,SAAWA,IAGnBvE,EAAOC,QAAUA,EACjBD,EAAOuE,SAAWA,EAEI,kBAAXK,SAAyBA,OAAOC,KACvCD,OAAO,WACH,OACI3E,QAASA,EACTsE,SAAUA,OAKT,mBAAXvE,QAAyB8E,KAAO9E"} \ No newline at end of file diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.map b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.map deleted file mode 100644 index ee011aa..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sprintf.min.js","sources":["../src/sprintf.js"],"names":["window","sprintf","key","arguments","cache","hasOwnProperty","parse","format","call","get_type","variable","Object","prototype","toString","slice","toLowerCase","str_repeat","input","multiplier","Array","join","re","not_string","number","json","not_json","text","modulo","placeholder","key_access","index_access","sign","parse_tree","argv","arg","i","k","match","pad","pad_character","pad_length","cursor","tree_length","length","node_type","output","is_positive","Error","test","isNaN","TypeError","String","fromCharCode","parseInt","JSON","stringify","toExponential","parseFloat","toFixed","toPrecision","substring","toUpperCase","replace","charAt","fmt","_fmt","arg_names","exec","SyntaxError","field_list","replacement_field","field_match","vsprintf","_argv","splice","apply","exports","define","amd","this"],"mappings":";;CAAA,SAAUA,GAeN,QAASC,KACL,GAAIC,GAAMC,UAAU,GAAIC,EAAQH,EAAQG,KAIxC,OAHMA,GAAMF,IAAQE,EAAMC,eAAeH,KACrCE,EAAMF,GAAOD,EAAQK,MAAMJ,IAExBD,EAAQM,OAAOC,KAAK,KAAMJ,EAAMF,GAAMC,WA+JjD,QAASM,GAASC,GACd,MAAOC,QAAOC,UAAUC,SAASL,KAAKE,GAAUI,MAAM,EAAG,IAAIC,cAGjE,QAASC,GAAWC,EAAOC,GACvB,MAAOC,OAAMD,EAAa,GAAGE,KAAKH,GAvLtC,GAAII,IACAC,WAAY,OACZC,OAAQ,UACRC,KAAM,MACNC,SAAU,OACVC,KAAM,YACNC,OAAQ,WACRC,YAAa,yFACb1B,IAAK,sBACL2B,WAAY,wBACZC,aAAc,aACdC,KAAM,UAWV9B,GAAQM,OAAS,SAASyB,EAAYC,GAClC,GAAiEC,GAAkBC,EAAGC,EAAGC,EAAOC,EAAKC,EAAeC,EAAhHC,EAAS,EAAGC,EAAcV,EAAWW,OAAQC,EAAY,GAASC,KAA0DC,GAAc,EAAMf,EAAO,EAC3J,KAAKI,EAAI,EAAOO,EAAJP,EAAiBA,IAEzB,GADAS,EAAYnC,EAASuB,EAAWG,IACd,WAAdS,EACAC,EAAOA,EAAOF,QAAUX,EAAWG,OAElC,IAAkB,UAAdS,EAAuB,CAE5B,GADAP,EAAQL,EAAWG,GACfE,EAAM,GAEN,IADAH,EAAMD,EAAKQ,GACNL,EAAI,EAAGA,EAAIC,EAAM,GAAGM,OAAQP,IAAK,CAClC,IAAKF,EAAI7B,eAAegC,EAAM,GAAGD,IAC7B,KAAM,IAAIW,OAAM9C,EAAQ,yCAA0CoC,EAAM,GAAGD,IAE/EF,GAAMA,EAAIG,EAAM,GAAGD,QAIvBF,GADKG,EAAM,GACLJ,EAAKI,EAAM,IAGXJ,EAAKQ,IAOf,IAJqB,YAAjBhC,EAASyB,KACTA,EAAMA,KAGNb,EAAGC,WAAW0B,KAAKX,EAAM,KAAOhB,EAAGI,SAASuB,KAAKX,EAAM,KAAyB,UAAjB5B,EAASyB,IAAoBe,MAAMf,GAClG,KAAM,IAAIgB,WAAUjD,EAAQ,0CAA2CQ,EAASyB,IAOpF,QAJIb,EAAGE,OAAOyB,KAAKX,EAAM,MACrBS,EAAcZ,GAAO,GAGjBG,EAAM,IACV,IAAK,IACDH,EAAMA,EAAIrB,SAAS,EACvB,MACA,KAAK,IACDqB,EAAMiB,OAAOC,aAAalB,EAC9B,MACA,KAAK,IACL,IAAK,IACDA,EAAMmB,SAASnB,EAAK,GACxB,MACA,KAAK,IACDA,EAAMoB,KAAKC,UAAUrB,EAAK,KAAMG,EAAM,GAAKgB,SAAShB,EAAM,IAAM,EACpE,MACA,KAAK,IACDH,EAAMG,EAAM,GAAKH,EAAIsB,cAAcnB,EAAM,IAAMH,EAAIsB,eACvD,MACA,KAAK,IACDtB,EAAMG,EAAM,GAAKoB,WAAWvB,GAAKwB,QAAQrB,EAAM,IAAMoB,WAAWvB,EACpE,MACA,KAAK,IACDA,EAAMG,EAAM,GAAKoB,WAAWvB,GAAKyB,YAAYtB,EAAM,IAAMoB,WAAWvB,EACxE,MACA,KAAK,IACDA,EAAMA,EAAIrB,SAAS,EACvB,MACA,KAAK,IACDqB,GAAQA,EAAMiB,OAAOjB,KAASG,EAAM,GAAKH,EAAI0B,UAAU,EAAGvB,EAAM,IAAMH,CAC1E,MACA,KAAK,IACDA,KAAc,CAClB,MACA,KAAK,IACDA,EAAMA,EAAIrB,SAAS,GACvB,MACA,KAAK,IACDqB,EAAMA,EAAIrB,SAAS,IAAIgD,cAG3BxC,EAAGG,KAAKwB,KAAKX,EAAM,IACnBQ,EAAOA,EAAOF,QAAUT,IAGpBb,EAAGE,OAAOyB,KAAKX,EAAM,KAASS,IAAeT,EAAM,GAKnDN,EAAO,IAJPA,EAAOe,EAAc,IAAM,IAC3BZ,EAAMA,EAAIrB,WAAWiD,QAAQzC,EAAGU,KAAM,KAK1CQ,EAAgBF,EAAM,GAAkB,MAAbA,EAAM,GAAa,IAAMA,EAAM,GAAG0B,OAAO,GAAK,IACzEvB,EAAaH,EAAM,IAAMN,EAAOG,GAAKS,OACrCL,EAAMD,EAAM,IAAMG,EAAa,EAAIxB,EAAWuB,EAAeC,GAAoB,GACjFK,EAAOA,EAAOF,QAAUN,EAAM,GAAKN,EAAOG,EAAMI,EAAyB,MAAlBC,EAAwBR,EAAOO,EAAMJ,EAAMI,EAAMP,EAAOG,GAI3H,MAAOW,GAAOzB,KAAK,KAGvBnB,EAAQG,SAERH,EAAQK,MAAQ,SAAS0D,GAErB,IADA,GAAIC,GAAOD,EAAK3B,KAAYL,KAAiBkC,EAAY,EAClDD,GAAM,CACT,GAAqC,QAAhC5B,EAAQhB,EAAGK,KAAKyC,KAAKF,IACtBjC,EAAWA,EAAWW,QAAUN,EAAM,OAErC,IAAuC,QAAlCA,EAAQhB,EAAGM,OAAOwC,KAAKF,IAC7BjC,EAAWA,EAAWW,QAAU,QAE/B,CAAA,GAA4C,QAAvCN,EAAQhB,EAAGO,YAAYuC,KAAKF,IAgClC,KAAM,IAAIG,aAAY,mCA/BtB,IAAI/B,EAAM,GAAI,CACV6B,GAAa,CACb,IAAIG,MAAiBC,EAAoBjC,EAAM,GAAIkC,IACnD,IAAuD,QAAlDA,EAAclD,EAAGnB,IAAIiE,KAAKG,IAe3B,KAAM,IAAIF,aAAY,+CAbtB,KADAC,EAAWA,EAAW1B,QAAU4B,EAAY,GACwC,MAA5ED,EAAoBA,EAAkBV,UAAUW,EAAY,GAAG5B,UACnE,GAA8D,QAAzD4B,EAAclD,EAAGQ,WAAWsC,KAAKG,IAClCD,EAAWA,EAAW1B,QAAU4B,EAAY,OAE3C,CAAA,GAAgE,QAA3DA,EAAclD,EAAGS,aAAaqC,KAAKG,IAIzC,KAAM,IAAIF,aAAY,+CAHtBC,GAAWA,EAAW1B,QAAU4B,EAAY,GAUxDlC,EAAM,GAAKgC,MAGXH,IAAa,CAEjB,IAAkB,IAAdA,EACA,KAAM,IAAInB,OAAM,4EAEpBf,GAAWA,EAAWW,QAAUN,EAKpC4B,EAAOA,EAAKL,UAAUvB,EAAM,GAAGM,QAEnC,MAAOX,GAGX,IAAIwC,GAAW,SAASR,EAAK/B,EAAMwC,GAG/B,MAFAA,IAASxC,OAAYnB,MAAM,GAC3B2D,EAAMC,OAAO,EAAG,EAAGV,GACZ/D,EAAQ0E,MAAM,KAAMF,GAiBR,oBAAZG,UACPA,QAAQ3E,QAAUA,EAClB2E,QAAQJ,SAAWA,IAGnBxE,EAAOC,QAAUA,EACjBD,EAAOwE,SAAWA,EAEI,kBAAXK,SAAyBA,OAAOC,KACvCD,OAAO,WACH,OACI5E,QAASA,EACTuE,SAAUA,OAKT,mBAAXxE,QAAyB+E,KAAO/E"} \ No newline at end of file diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/gruntfile.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/gruntfile.js deleted file mode 100644 index 246e1c3..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/gruntfile.js +++ /dev/null @@ -1,36 +0,0 @@ -module.exports = function(grunt) { - grunt.initConfig({ - pkg: grunt.file.readJSON("package.json"), - - uglify: { - options: { - banner: "/*! <%= pkg.name %> | <%= pkg.author %> | <%= pkg.license %> */\n", - sourceMap: true - }, - build: { - files: [ - { - src: "src/sprintf.js", - dest: "dist/sprintf.min.js" - }, - { - src: "src/angular-sprintf.js", - dest: "dist/angular-sprintf.min.js" - } - ] - } - }, - - watch: { - js: { - files: "src/*.js", - tasks: ["uglify"] - } - } - }) - - grunt.loadNpmTasks("grunt-contrib-uglify") - grunt.loadNpmTasks("grunt-contrib-watch") - - grunt.registerTask("default", ["uglify", "watch"]) -} diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/package.json b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/package.json deleted file mode 100644 index 6e9f1d7..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "sprintf-js", - "version": "1.0.3", - "description": "JavaScript sprintf implementation", - "author": { - "name": "Alexandru Marasteanu", - "email": "hello@alexei.ro", - "url": "http://alexei.ro/" - }, - "main": "src/sprintf.js", - "scripts": { - "test": "mocha test/test.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/alexei/sprintf.js.git" - }, - "license": "BSD-3-Clause", - "devDependencies": { - "mocha": "*", - "grunt": "*", - "grunt-contrib-watch": "*", - "grunt-contrib-uglify": "*" - }, - "gitHead": "747b806c2dab5b64d5c9958c42884946a187c3b1", - "bugs": { - "url": "https://github.com/alexei/sprintf.js/issues" - }, - "homepage": "https://github.com/alexei/sprintf.js#readme", - "_id": "sprintf-js@1.0.3", - "_shasum": "04e6926f662895354f3dd015203633b857297e2c", - "_from": "sprintf-js@>=1.0.2 <1.1.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "0.12.4", - "_npmUser": { - "name": "alexei", - "email": "hello@alexei.ro" - }, - "dist": { - "shasum": "04e6926f662895354f3dd015203633b857297e2c", - "tarball": "http://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" - }, - "maintainers": [ - { - "name": "alexei", - "email": "hello@alexei.ro" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/src/angular-sprintf.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/src/angular-sprintf.js deleted file mode 100644 index 9c69123..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/src/angular-sprintf.js +++ /dev/null @@ -1,18 +0,0 @@ -angular. - module("sprintf", []). - filter("sprintf", function() { - return function() { - return sprintf.apply(null, arguments) - } - }). - filter("fmt", ["$filter", function($filter) { - return $filter("sprintf") - }]). - filter("vsprintf", function() { - return function(format, argv) { - return vsprintf(format, argv) - } - }). - filter("vfmt", ["$filter", function($filter) { - return $filter("vsprintf") - }]) diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/src/sprintf.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/src/sprintf.js deleted file mode 100644 index c0fc7c0..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/src/sprintf.js +++ /dev/null @@ -1,208 +0,0 @@ -(function(window) { - var re = { - not_string: /[^s]/, - number: /[diefg]/, - json: /[j]/, - not_json: /[^j]/, - text: /^[^\x25]+/, - modulo: /^\x25{2}/, - placeholder: /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/, - key: /^([a-z_][a-z_\d]*)/i, - key_access: /^\.([a-z_][a-z_\d]*)/i, - index_access: /^\[(\d+)\]/, - sign: /^[\+\-]/ - } - - function sprintf() { - var key = arguments[0], cache = sprintf.cache - if (!(cache[key] && cache.hasOwnProperty(key))) { - cache[key] = sprintf.parse(key) - } - return sprintf.format.call(null, cache[key], arguments) - } - - sprintf.format = function(parse_tree, argv) { - var cursor = 1, tree_length = parse_tree.length, node_type = "", arg, output = [], i, k, match, pad, pad_character, pad_length, is_positive = true, sign = "" - for (i = 0; i < tree_length; i++) { - node_type = get_type(parse_tree[i]) - if (node_type === "string") { - output[output.length] = parse_tree[i] - } - else if (node_type === "array") { - match = parse_tree[i] // convenience purposes only - if (match[2]) { // keyword argument - arg = argv[cursor] - for (k = 0; k < match[2].length; k++) { - if (!arg.hasOwnProperty(match[2][k])) { - throw new Error(sprintf("[sprintf] property '%s' does not exist", match[2][k])) - } - arg = arg[match[2][k]] - } - } - else if (match[1]) { // positional argument (explicit) - arg = argv[match[1]] - } - else { // positional argument (implicit) - arg = argv[cursor++] - } - - if (get_type(arg) == "function") { - arg = arg() - } - - if (re.not_string.test(match[8]) && re.not_json.test(match[8]) && (get_type(arg) != "number" && isNaN(arg))) { - throw new TypeError(sprintf("[sprintf] expecting number but found %s", get_type(arg))) - } - - if (re.number.test(match[8])) { - is_positive = arg >= 0 - } - - switch (match[8]) { - case "b": - arg = arg.toString(2) - break - case "c": - arg = String.fromCharCode(arg) - break - case "d": - case "i": - arg = parseInt(arg, 10) - break - case "j": - arg = JSON.stringify(arg, null, match[6] ? parseInt(match[6]) : 0) - break - case "e": - arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential() - break - case "f": - arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg) - break - case "g": - arg = match[7] ? parseFloat(arg).toPrecision(match[7]) : parseFloat(arg) - break - case "o": - arg = arg.toString(8) - break - case "s": - arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg) - break - case "u": - arg = arg >>> 0 - break - case "x": - arg = arg.toString(16) - break - case "X": - arg = arg.toString(16).toUpperCase() - break - } - if (re.json.test(match[8])) { - output[output.length] = arg - } - else { - if (re.number.test(match[8]) && (!is_positive || match[3])) { - sign = is_positive ? "+" : "-" - arg = arg.toString().replace(re.sign, "") - } - else { - sign = "" - } - pad_character = match[4] ? match[4] === "0" ? "0" : match[4].charAt(1) : " " - pad_length = match[6] - (sign + arg).length - pad = match[6] ? (pad_length > 0 ? str_repeat(pad_character, pad_length) : "") : "" - output[output.length] = match[5] ? sign + arg + pad : (pad_character === "0" ? sign + pad + arg : pad + sign + arg) - } - } - } - return output.join("") - } - - sprintf.cache = {} - - sprintf.parse = function(fmt) { - var _fmt = fmt, match = [], parse_tree = [], arg_names = 0 - while (_fmt) { - if ((match = re.text.exec(_fmt)) !== null) { - parse_tree[parse_tree.length] = match[0] - } - else if ((match = re.modulo.exec(_fmt)) !== null) { - parse_tree[parse_tree.length] = "%" - } - else if ((match = re.placeholder.exec(_fmt)) !== null) { - if (match[2]) { - arg_names |= 1 - var field_list = [], replacement_field = match[2], field_match = [] - if ((field_match = re.key.exec(replacement_field)) !== null) { - field_list[field_list.length] = field_match[1] - while ((replacement_field = replacement_field.substring(field_match[0].length)) !== "") { - if ((field_match = re.key_access.exec(replacement_field)) !== null) { - field_list[field_list.length] = field_match[1] - } - else if ((field_match = re.index_access.exec(replacement_field)) !== null) { - field_list[field_list.length] = field_match[1] - } - else { - throw new SyntaxError("[sprintf] failed to parse named argument key") - } - } - } - else { - throw new SyntaxError("[sprintf] failed to parse named argument key") - } - match[2] = field_list - } - else { - arg_names |= 2 - } - if (arg_names === 3) { - throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported") - } - parse_tree[parse_tree.length] = match - } - else { - throw new SyntaxError("[sprintf] unexpected placeholder") - } - _fmt = _fmt.substring(match[0].length) - } - return parse_tree - } - - var vsprintf = function(fmt, argv, _argv) { - _argv = (argv || []).slice(0) - _argv.splice(0, 0, fmt) - return sprintf.apply(null, _argv) - } - - /** - * helpers - */ - function get_type(variable) { - return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase() - } - - function str_repeat(input, multiplier) { - return Array(multiplier + 1).join(input) - } - - /** - * export to either browser or node.js - */ - if (typeof exports !== "undefined") { - exports.sprintf = sprintf - exports.vsprintf = vsprintf - } - else { - window.sprintf = sprintf - window.vsprintf = vsprintf - - if (typeof define === "function" && define.amd) { - define(function() { - return { - sprintf: sprintf, - vsprintf: vsprintf - } - }) - } - } -})(typeof window === "undefined" ? this : window); diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/test/test.js b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/test/test.js deleted file mode 100644 index 6f57b25..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/test/test.js +++ /dev/null @@ -1,82 +0,0 @@ -var assert = require("assert"), - sprintfjs = require("../src/sprintf.js"), - sprintf = sprintfjs.sprintf, - vsprintf = sprintfjs.vsprintf - -describe("sprintfjs", function() { - var pi = 3.141592653589793 - - it("should return formated strings for simple placeholders", function() { - assert.equal("%", sprintf("%%")) - assert.equal("10", sprintf("%b", 2)) - assert.equal("A", sprintf("%c", 65)) - assert.equal("2", sprintf("%d", 2)) - assert.equal("2", sprintf("%i", 2)) - assert.equal("2", sprintf("%d", "2")) - assert.equal("2", sprintf("%i", "2")) - assert.equal('{"foo":"bar"}', sprintf("%j", {foo: "bar"})) - assert.equal('["foo","bar"]', sprintf("%j", ["foo", "bar"])) - assert.equal("2e+0", sprintf("%e", 2)) - assert.equal("2", sprintf("%u", 2)) - assert.equal("4294967294", sprintf("%u", -2)) - assert.equal("2.2", sprintf("%f", 2.2)) - assert.equal("3.141592653589793", sprintf("%g", pi)) - assert.equal("10", sprintf("%o", 8)) - assert.equal("%s", sprintf("%s", "%s")) - assert.equal("ff", sprintf("%x", 255)) - assert.equal("FF", sprintf("%X", 255)) - assert.equal("Polly wants a cracker", sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants")) - assert.equal("Hello world!", sprintf("Hello %(who)s!", {"who": "world"})) - }) - - it("should return formated strings for complex placeholders", function() { - // sign - assert.equal("2", sprintf("%d", 2)) - assert.equal("-2", sprintf("%d", -2)) - assert.equal("+2", sprintf("%+d", 2)) - assert.equal("-2", sprintf("%+d", -2)) - assert.equal("2", sprintf("%i", 2)) - assert.equal("-2", sprintf("%i", -2)) - assert.equal("+2", sprintf("%+i", 2)) - assert.equal("-2", sprintf("%+i", -2)) - assert.equal("2.2", sprintf("%f", 2.2)) - assert.equal("-2.2", sprintf("%f", -2.2)) - assert.equal("+2.2", sprintf("%+f", 2.2)) - assert.equal("-2.2", sprintf("%+f", -2.2)) - assert.equal("-2.3", sprintf("%+.1f", -2.34)) - assert.equal("-0.0", sprintf("%+.1f", -0.01)) - assert.equal("3.14159", sprintf("%.6g", pi)) - assert.equal("3.14", sprintf("%.3g", pi)) - assert.equal("3", sprintf("%.1g", pi)) - assert.equal("-000000123", sprintf("%+010d", -123)) - assert.equal("______-123", sprintf("%+'_10d", -123)) - assert.equal("-234.34 123.2", sprintf("%f %f", -234.34, 123.2)) - - // padding - assert.equal("-0002", sprintf("%05d", -2)) - assert.equal("-0002", sprintf("%05i", -2)) - assert.equal(" <", sprintf("%5s", "<")) - assert.equal("0000<", sprintf("%05s", "<")) - assert.equal("____<", sprintf("%'_5s", "<")) - assert.equal("> ", sprintf("%-5s", ">")) - assert.equal(">0000", sprintf("%0-5s", ">")) - assert.equal(">____", sprintf("%'_-5s", ">")) - assert.equal("xxxxxx", sprintf("%5s", "xxxxxx")) - assert.equal("1234", sprintf("%02u", 1234)) - assert.equal(" -10.235", sprintf("%8.3f", -10.23456)) - assert.equal("-12.34 xxx", sprintf("%f %s", -12.34, "xxx")) - assert.equal('{\n "foo": "bar"\n}', sprintf("%2j", {foo: "bar"})) - assert.equal('[\n "foo",\n "bar"\n]', sprintf("%2j", ["foo", "bar"])) - - // precision - assert.equal("2.3", sprintf("%.1f", 2.345)) - assert.equal("xxxxx", sprintf("%5.5s", "xxxxxx")) - assert.equal(" x", sprintf("%5.1s", "xxxxxx")) - - }) - - it("should return formated strings for callbacks", function() { - assert.equal("foobar", sprintf("%s", function() { return "foobar" })) - assert.equal(Date.now(), sprintf("%s", Date.now)) // should pass... - }) -}) diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/package.json b/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/package.json deleted file mode 100644 index 081bdcb..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/argparse/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "argparse", - "description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library", - "version": "1.0.4", - "keywords": [ - "cli", - "parser", - "argparse", - "option", - "args" - ], - "homepage": "https://github.com/nodeca/argparse", - "contributors": [ - { - "name": "Eugene Shkuropat" - }, - { - "name": "Paul Jacobson" - } - ], - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/nodeca/argparse.git" - }, - "scripts": { - "test": "make test" - }, - "dependencies": { - "lodash": ">= 4.0.0 < 5.0.0", - "sprintf-js": "~1.0.2" - }, - "devDependencies": { - "mocha": "*" - }, - "gitHead": "26e177bd9c164cbe4906bafb32b968eeebd2f2f2", - "bugs": { - "url": "https://github.com/nodeca/argparse/issues" - }, - "_id": "argparse@1.0.4", - "_shasum": "2b12247b933001971addcbfe4e67d20fd395bbf4", - "_from": "argparse@>=1.0.2 <2.0.0", - "_npmVersion": "2.14.12", - "_nodeVersion": "4.2.4", - "_npmUser": { - "name": "vitaly", - "email": "vitaly@rcdesign.ru" - }, - "maintainers": [ - { - "name": "vitaly", - "email": "vitaly@rcdesign.ru" - } - ], - "dist": { - "shasum": "2b12247b933001971addcbfe4e67d20fd395bbf4", - "tarball": "http://registry.npmjs.org/argparse/-/argparse-1.0.4.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.4.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/esprima/ChangeLog b/node_modules/eslint/node_modules/js-yaml/node_modules/esprima/ChangeLog deleted file mode 100644 index 864ab69..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/esprima/ChangeLog +++ /dev/null @@ -1,170 +0,0 @@ -2016-02-02: Version 2.7.2 - - * Fix out-of-bound error location in an invalid string literal (issue 1457) - * Fix shorthand object destructuring defaults in variable declarations (issue 1459) - -2015-12-10: Version 2.7.1 - - * Do not allow trailing comma in a variable declaration (issue 1360) - * Fix assignment to `let` in non-strict mode (issue 1376) - * Fix missing delegate property in YieldExpression (issue 1407) - -2015-10-22: Version 2.7.0 - - * Fix the handling of semicolon in a break statement (issue 1044) - * Run the test suite with major web browsers (issue 1259, 1317) - * Allow `let` as an identifier in non-strict mode (issue 1289) - * Attach orphaned comments as `innerComments` (issue 1328) - * Add the support for token delegator (issue 1332) - -2015-09-01: Version 2.6.0 - - * Properly allow or prohibit `let` in a binding identifier/pattern (issue 1048, 1098) - * Add sourceType field for Program node (issue 1159) - * Ensure that strict mode reserved word binding throw an error (issue 1171) - * Run the test suite with Node.js and IE 11 on Windows (issue 1294) - * Allow binding pattern with no initializer in a for statement (issue 1301) - -2015-07-31: Version 2.5.0 - - * Run the test suite in a browser environment (issue 1004) - * Ensure a comma between imported default binding and named imports (issue 1046) - * Distinguish `yield` as a keyword vs an identifier (issue 1186) - * Support ES6 meta property `new.target` (issue 1203) - * Fix the syntax node for yield with expression (issue 1223) - * Fix the check of duplicated proto in property names (issue 1225) - * Fix ES6 Unicode escape in identifier name (issue 1229) - * Support ES6 IdentifierStart and IdentifierPart (issue 1232) - * Treat await as a reserved word when parsing as a module (issue 1234) - * Recognize identifier characters from Unicode SMP (issue 1244) - * Ensure that export and import can be followed by a comma (issue 1250) - * Fix yield operator precedence (issue 1262) - -2015-07-01: Version 2.4.1 - - * Fix some cases of comment attachment (issue 1071, 1175) - * Fix the handling of destructuring in function arguments (issue 1193) - * Fix invalid ranges in assignment expression (issue 1201) - -2015-06-26: Version 2.4.0 - - * Support ES6 for-of iteration (issue 1047) - * Support ES6 spread arguments (issue 1169) - * Minimize npm payload (issue 1191) - -2015-06-16: Version 2.3.0 - - * Support ES6 generator (issue 1033) - * Improve parsing of regular expressions with `u` flag (issue 1179) - -2015-04-17: Version 2.2.0 - - * Support ES6 import and export declarations (issue 1000) - * Fix line terminator before arrow not recognized as error (issue 1009) - * Support ES6 destructuring (issue 1045) - * Support ES6 template literal (issue 1074) - * Fix the handling of invalid/incomplete string escape sequences (issue 1106) - * Fix ES3 static member access restriction (issue 1120) - * Support for `super` in ES6 class (issue 1147) - -2015-03-09: Version 2.1.0 - - * Support ES6 class (issue 1001) - * Support ES6 rest parameter (issue 1011) - * Expand the location of property getter, setter, and methods (issue 1029) - * Enable TryStatement transition to a single handler (issue 1031) - * Support ES6 computed property name (issue 1037) - * Tolerate unclosed block comment (issue 1041) - * Support ES6 lexical declaration (issue 1065) - -2015-02-06: Version 2.0.0 - - * Support ES6 arrow function (issue 517) - * Support ES6 Unicode code point escape (issue 521) - * Improve the speed and accuracy of comment attachment (issue 522) - * Support ES6 default parameter (issue 519) - * Support ES6 regular expression flags (issue 557) - * Fix scanning of implicit octal literals (issue 565) - * Fix the handling of automatic semicolon insertion (issue 574) - * Support ES6 method definition (issue 620) - * Support ES6 octal integer literal (issue 621) - * Support ES6 binary integer literal (issue 622) - * Support ES6 object literal property value shorthand (issue 624) - -2015-03-03: Version 1.2.5 - - * Fix scanning of implicit octal literals (issue 565) - -2015-02-05: Version 1.2.4 - - * Fix parsing of LeftHandSideExpression in ForInStatement (issue 560) - * Fix the handling of automatic semicolon insertion (issue 574) - -2015-01-18: Version 1.2.3 - - * Fix division by this (issue 616) - -2014-05-18: Version 1.2.2 - - * Fix duplicated tokens when collecting comments (issue 537) - -2014-05-04: Version 1.2.1 - - * Ensure that Program node may still have leading comments (issue 536) - -2014-04-29: Version 1.2.0 - - * Fix semicolon handling for expression statement (issue 462, 533) - * Disallow escaped characters in regular expression flags (issue 503) - * Performance improvement for location tracking (issue 520) - * Improve the speed of comment attachment (issue 522) - -2014-03-26: Version 1.1.1 - - * Fix token handling of forward slash after an array literal (issue 512) - -2014-03-23: Version 1.1.0 - - * Optionally attach comments to the owning syntax nodes (issue 197) - * Simplify binary parsing with stack-based shift reduce (issue 352) - * Always include the raw source of literals (issue 376) - * Add optional input source information (issue 386) - * Tokenizer API for pure lexical scanning (issue 398) - * Improve the web site and its online demos (issue 337, 400, 404) - * Performance improvement for location tracking (issue 417, 424) - * Support HTML comment syntax (issue 451) - * Drop support for legacy browsers (issue 474) - -2013-08-27: Version 1.0.4 - - * Minimize the payload for packages (issue 362) - * Fix missing cases on an empty switch statement (issue 436) - * Support escaped ] in regexp literal character classes (issue 442) - * Tolerate invalid left-hand side expression (issue 130) - -2013-05-17: Version 1.0.3 - - * Variable declaration needs at least one declarator (issue 391) - * Fix benchmark's variance unit conversion (issue 397) - * IE < 9: \v should be treated as vertical tab (issue 405) - * Unary expressions should always have prefix: true (issue 418) - * Catch clause should only accept an identifier (issue 423) - * Tolerate setters without parameter (issue 426) - -2012-11-02: Version 1.0.2 - - Improvement: - - * Fix esvalidate JUnit output upon a syntax error (issue 374) - -2012-10-28: Version 1.0.1 - - Improvements: - - * esvalidate understands shebang in a Unix shell script (issue 361) - * esvalidate treats fatal parsing failure as an error (issue 361) - * Reduce Node.js package via .npmignore (issue 362) - -2012-10-22: Version 1.0.0 - - Initial release. diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/esprima/LICENSE.BSD b/node_modules/eslint/node_modules/js-yaml/node_modules/esprima/LICENSE.BSD deleted file mode 100644 index 17557ec..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/esprima/LICENSE.BSD +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/esprima/README.md b/node_modules/eslint/node_modules/js-yaml/node_modules/esprima/README.md deleted file mode 100644 index 749454f..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/esprima/README.md +++ /dev/null @@ -1,27 +0,0 @@ -[![NPM version](https://img.shields.io/npm/v/esprima.svg)](https://www.npmjs.com/package/esprima) -[![npm download](https://img.shields.io/npm/dm/esprima.svg)](https://www.npmjs.com/package/esprima) -[![Build Status](https://img.shields.io/travis/jquery/esprima/master.svg)](https://travis-ci.org/jquery/esprima) -[![Coverage Status](https://img.shields.io/codecov/c/github/jquery/esprima/master.svg)](https://codecov.io/github/jquery/esprima) - -**Esprima** ([esprima.org](http://esprima.org), BSD license) is a high performance, -standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) -parser written in ECMAScript (also popularly known as -[JavaScript](https://en.wikipedia.org/wiki/JavaScript)). -Esprima is created and maintained by [Ariya Hidayat](https://twitter.com/ariyahidayat), -with the help of [many contributors](https://github.com/jquery/esprima/contributors). - -### Features - -- Full support for ECMAScript 6 ([ECMA-262](http://www.ecma-international.org/publications/standards/Ecma-262.htm)) -- Sensible [syntax tree format](https://github.com/estree/estree/blob/master/spec.md) as standardized by [ESTree project](https://github.com/estree/estree) -- Optional tracking of syntax node location (index-based and line-column) -- [Heavily tested](http://esprima.org/test/ci.html) (~1250 [unit tests](https://github.com/jquery/esprima/tree/master/test/fixtures) with [full code coverage](https://codecov.io/github/jquery/esprima)) - -Esprima serves as a **building block** for some JavaScript -language tools, from [code instrumentation](http://esprima.org/demo/functiontrace.html) -to [editor autocompletion](http://esprima.org/demo/autocomplete.html). - -Esprima runs on many popular web browsers, as well as other ECMAScript platforms such as -[Rhino](http://www.mozilla.org/rhino), [Nashorn](http://openjdk.java.net/projects/nashorn/), and [Node.js](https://npmjs.org/package/esprima). - -For more information, check the web site [esprima.org](http://esprima.org). diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/esprima/bin/esparse.js b/node_modules/eslint/node_modules/js-yaml/node_modules/esprima/bin/esparse.js deleted file mode 100755 index 98bdbf4..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/esprima/bin/esparse.js +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/env node -/* - Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/*jslint sloppy:true node:true rhino:true */ - -var fs, esprima, fname, content, options, syntax; - -if (typeof require === 'function') { - fs = require('fs'); - esprima = require('esprima'); -} else if (typeof load === 'function') { - try { - load('esprima.js'); - } catch (e) { - load('../esprima.js'); - } -} - -// Shims to Node.js objects when running under Rhino. -if (typeof console === 'undefined' && typeof process === 'undefined') { - console = { log: print }; - fs = { readFileSync: readFile }; - process = { argv: arguments, exit: quit }; - process.argv.unshift('esparse.js'); - process.argv.unshift('rhino'); -} - -function showUsage() { - console.log('Usage:'); - console.log(' esparse [options] file.js'); - console.log(); - console.log('Available options:'); - console.log(); - console.log(' --comment Gather all line and block comments in an array'); - console.log(' --loc Include line-column location info for each syntax node'); - console.log(' --range Include index-based range for each syntax node'); - console.log(' --raw Display the raw value of literals'); - console.log(' --tokens List all tokens in an array'); - console.log(' --tolerant Tolerate errors on a best-effort basis (experimental)'); - console.log(' -v, --version Shows program version'); - console.log(); - process.exit(1); -} - -if (process.argv.length <= 2) { - showUsage(); -} - -options = {}; - -process.argv.splice(2).forEach(function (entry) { - - if (entry === '-h' || entry === '--help') { - showUsage(); - } else if (entry === '-v' || entry === '--version') { - console.log('ECMAScript Parser (using Esprima version', esprima.version, ')'); - console.log(); - process.exit(0); - } else if (entry === '--comment') { - options.comment = true; - } else if (entry === '--loc') { - options.loc = true; - } else if (entry === '--range') { - options.range = true; - } else if (entry === '--raw') { - options.raw = true; - } else if (entry === '--tokens') { - options.tokens = true; - } else if (entry === '--tolerant') { - options.tolerant = true; - } else if (entry.slice(0, 2) === '--') { - console.log('Error: unknown option ' + entry + '.'); - process.exit(1); - } else if (typeof fname === 'string') { - console.log('Error: more than one input file.'); - process.exit(1); - } else { - fname = entry; - } -}); - -if (typeof fname !== 'string') { - console.log('Error: no input file.'); - process.exit(1); -} - -// Special handling for regular expression literal since we need to -// convert it to a string literal, otherwise it will be decoded -// as object "{}" and the regular expression would be lost. -function adjustRegexLiteral(key, value) { - if (key === 'value' && value instanceof RegExp) { - value = value.toString(); - } - return value; -} - -try { - content = fs.readFileSync(fname, 'utf-8'); - syntax = esprima.parse(content, options); - console.log(JSON.stringify(syntax, adjustRegexLiteral, 4)); -} catch (e) { - console.log('Error: ' + e.message); - process.exit(1); -} diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js b/node_modules/eslint/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js deleted file mode 100755 index f522dec..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js +++ /dev/null @@ -1,199 +0,0 @@ -#!/usr/bin/env node -/* - Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/*jslint sloppy:true plusplus:true node:true rhino:true */ -/*global phantom:true */ - -var fs, system, esprima, options, fnames, count; - -if (typeof esprima === 'undefined') { - // PhantomJS can only require() relative files - if (typeof phantom === 'object') { - fs = require('fs'); - system = require('system'); - esprima = require('./esprima'); - } else if (typeof require === 'function') { - fs = require('fs'); - esprima = require('esprima'); - } else if (typeof load === 'function') { - try { - load('esprima.js'); - } catch (e) { - load('../esprima.js'); - } - } -} - -// Shims to Node.js objects when running under PhantomJS 1.7+. -if (typeof phantom === 'object') { - fs.readFileSync = fs.read; - process = { - argv: [].slice.call(system.args), - exit: phantom.exit - }; - process.argv.unshift('phantomjs'); -} - -// Shims to Node.js objects when running under Rhino. -if (typeof console === 'undefined' && typeof process === 'undefined') { - console = { log: print }; - fs = { readFileSync: readFile }; - process = { argv: arguments, exit: quit }; - process.argv.unshift('esvalidate.js'); - process.argv.unshift('rhino'); -} - -function showUsage() { - console.log('Usage:'); - console.log(' esvalidate [options] file.js'); - console.log(); - console.log('Available options:'); - console.log(); - console.log(' --format=type Set the report format, plain (default) or junit'); - console.log(' -v, --version Print program version'); - console.log(); - process.exit(1); -} - -if (process.argv.length <= 2) { - showUsage(); -} - -options = { - format: 'plain' -}; - -fnames = []; - -process.argv.splice(2).forEach(function (entry) { - - if (entry === '-h' || entry === '--help') { - showUsage(); - } else if (entry === '-v' || entry === '--version') { - console.log('ECMAScript Validator (using Esprima version', esprima.version, ')'); - console.log(); - process.exit(0); - } else if (entry.slice(0, 9) === '--format=') { - options.format = entry.slice(9); - if (options.format !== 'plain' && options.format !== 'junit') { - console.log('Error: unknown report format ' + options.format + '.'); - process.exit(1); - } - } else if (entry.slice(0, 2) === '--') { - console.log('Error: unknown option ' + entry + '.'); - process.exit(1); - } else { - fnames.push(entry); - } -}); - -if (fnames.length === 0) { - console.log('Error: no input file.'); - process.exit(1); -} - -if (options.format === 'junit') { - console.log(''); - console.log(''); -} - -count = 0; -fnames.forEach(function (fname) { - var content, timestamp, syntax, name; - try { - content = fs.readFileSync(fname, 'utf-8'); - - if (content[0] === '#' && content[1] === '!') { - content = '//' + content.substr(2, content.length); - } - - timestamp = Date.now(); - syntax = esprima.parse(content, { tolerant: true }); - - if (options.format === 'junit') { - - name = fname; - if (name.lastIndexOf('/') >= 0) { - name = name.slice(name.lastIndexOf('/') + 1); - } - - console.log(''); - - syntax.errors.forEach(function (error) { - var msg = error.message; - msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); - console.log(' '); - console.log(' ' + - error.message + '(' + name + ':' + error.lineNumber + ')' + - ''); - console.log(' '); - }); - - console.log(''); - - } else if (options.format === 'plain') { - - syntax.errors.forEach(function (error) { - var msg = error.message; - msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); - msg = fname + ':' + error.lineNumber + ': ' + msg; - console.log(msg); - ++count; - }); - - } - } catch (e) { - ++count; - if (options.format === 'junit') { - console.log(''); - console.log(' '); - console.log(' ' + - e.message + '(' + fname + ((e.lineNumber) ? ':' + e.lineNumber : '') + - ')'); - console.log(' '); - console.log(''); - } else { - console.log('Error: ' + e.message); - } - } -}); - -if (options.format === 'junit') { - console.log(''); -} - -if (count > 0) { - process.exit(1); -} - -if (count === 0 && typeof phantom === 'object') { - process.exit(0); -} diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/esprima/esprima.js b/node_modules/eslint/node_modules/js-yaml/node_modules/esprima/esprima.js deleted file mode 100644 index 654e5fd..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/esprima/esprima.js +++ /dev/null @@ -1,5739 +0,0 @@ -/* - Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -(function (root, factory) { - 'use strict'; - - // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, - // Rhino, and plain browser loading. - - /* istanbul ignore next */ - if (typeof define === 'function' && define.amd) { - define(['exports'], factory); - } else if (typeof exports !== 'undefined') { - factory(exports); - } else { - factory((root.esprima = {})); - } -}(this, function (exports) { - 'use strict'; - - var Token, - TokenName, - FnExprTokens, - Syntax, - PlaceHolders, - Messages, - Regex, - source, - strict, - index, - lineNumber, - lineStart, - hasLineTerminator, - lastIndex, - lastLineNumber, - lastLineStart, - startIndex, - startLineNumber, - startLineStart, - scanning, - length, - lookahead, - state, - extra, - isBindingElement, - isAssignmentTarget, - firstCoverInitializedNameError; - - Token = { - BooleanLiteral: 1, - EOF: 2, - Identifier: 3, - Keyword: 4, - NullLiteral: 5, - NumericLiteral: 6, - Punctuator: 7, - StringLiteral: 8, - RegularExpression: 9, - Template: 10 - }; - - TokenName = {}; - TokenName[Token.BooleanLiteral] = 'Boolean'; - TokenName[Token.EOF] = ''; - TokenName[Token.Identifier] = 'Identifier'; - TokenName[Token.Keyword] = 'Keyword'; - TokenName[Token.NullLiteral] = 'Null'; - TokenName[Token.NumericLiteral] = 'Numeric'; - TokenName[Token.Punctuator] = 'Punctuator'; - TokenName[Token.StringLiteral] = 'String'; - TokenName[Token.RegularExpression] = 'RegularExpression'; - TokenName[Token.Template] = 'Template'; - - // A function following one of those tokens is an expression. - FnExprTokens = ['(', '{', '[', 'in', 'typeof', 'instanceof', 'new', - 'return', 'case', 'delete', 'throw', 'void', - // assignment operators - '=', '+=', '-=', '*=', '/=', '%=', '<<=', '>>=', '>>>=', - '&=', '|=', '^=', ',', - // binary/unary operators - '+', '-', '*', '/', '%', '++', '--', '<<', '>>', '>>>', '&', - '|', '^', '!', '~', '&&', '||', '?', ':', '===', '==', '>=', - '<=', '<', '>', '!=', '!==']; - - Syntax = { - AssignmentExpression: 'AssignmentExpression', - AssignmentPattern: 'AssignmentPattern', - ArrayExpression: 'ArrayExpression', - ArrayPattern: 'ArrayPattern', - ArrowFunctionExpression: 'ArrowFunctionExpression', - BlockStatement: 'BlockStatement', - BinaryExpression: 'BinaryExpression', - BreakStatement: 'BreakStatement', - CallExpression: 'CallExpression', - CatchClause: 'CatchClause', - ClassBody: 'ClassBody', - ClassDeclaration: 'ClassDeclaration', - ClassExpression: 'ClassExpression', - ConditionalExpression: 'ConditionalExpression', - ContinueStatement: 'ContinueStatement', - DoWhileStatement: 'DoWhileStatement', - DebuggerStatement: 'DebuggerStatement', - EmptyStatement: 'EmptyStatement', - ExportAllDeclaration: 'ExportAllDeclaration', - ExportDefaultDeclaration: 'ExportDefaultDeclaration', - ExportNamedDeclaration: 'ExportNamedDeclaration', - ExportSpecifier: 'ExportSpecifier', - ExpressionStatement: 'ExpressionStatement', - ForStatement: 'ForStatement', - ForOfStatement: 'ForOfStatement', - ForInStatement: 'ForInStatement', - FunctionDeclaration: 'FunctionDeclaration', - FunctionExpression: 'FunctionExpression', - Identifier: 'Identifier', - IfStatement: 'IfStatement', - ImportDeclaration: 'ImportDeclaration', - ImportDefaultSpecifier: 'ImportDefaultSpecifier', - ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', - ImportSpecifier: 'ImportSpecifier', - Literal: 'Literal', - LabeledStatement: 'LabeledStatement', - LogicalExpression: 'LogicalExpression', - MemberExpression: 'MemberExpression', - MetaProperty: 'MetaProperty', - MethodDefinition: 'MethodDefinition', - NewExpression: 'NewExpression', - ObjectExpression: 'ObjectExpression', - ObjectPattern: 'ObjectPattern', - Program: 'Program', - Property: 'Property', - RestElement: 'RestElement', - ReturnStatement: 'ReturnStatement', - SequenceExpression: 'SequenceExpression', - SpreadElement: 'SpreadElement', - Super: 'Super', - SwitchCase: 'SwitchCase', - SwitchStatement: 'SwitchStatement', - TaggedTemplateExpression: 'TaggedTemplateExpression', - TemplateElement: 'TemplateElement', - TemplateLiteral: 'TemplateLiteral', - ThisExpression: 'ThisExpression', - ThrowStatement: 'ThrowStatement', - TryStatement: 'TryStatement', - UnaryExpression: 'UnaryExpression', - UpdateExpression: 'UpdateExpression', - VariableDeclaration: 'VariableDeclaration', - VariableDeclarator: 'VariableDeclarator', - WhileStatement: 'WhileStatement', - WithStatement: 'WithStatement', - YieldExpression: 'YieldExpression' - }; - - PlaceHolders = { - ArrowParameterPlaceHolder: 'ArrowParameterPlaceHolder' - }; - - // Error messages should be identical to V8. - Messages = { - UnexpectedToken: 'Unexpected token %0', - UnexpectedNumber: 'Unexpected number', - UnexpectedString: 'Unexpected string', - UnexpectedIdentifier: 'Unexpected identifier', - UnexpectedReserved: 'Unexpected reserved word', - UnexpectedTemplate: 'Unexpected quasi %0', - UnexpectedEOS: 'Unexpected end of input', - NewlineAfterThrow: 'Illegal newline after throw', - InvalidRegExp: 'Invalid regular expression', - UnterminatedRegExp: 'Invalid regular expression: missing /', - InvalidLHSInAssignment: 'Invalid left-hand side in assignment', - InvalidLHSInForIn: 'Invalid left-hand side in for-in', - InvalidLHSInForLoop: 'Invalid left-hand side in for-loop', - MultipleDefaultsInSwitch: 'More than one default clause in switch statement', - NoCatchOrFinally: 'Missing catch or finally after try', - UnknownLabel: 'Undefined label \'%0\'', - Redeclaration: '%0 \'%1\' has already been declared', - IllegalContinue: 'Illegal continue statement', - IllegalBreak: 'Illegal break statement', - IllegalReturn: 'Illegal return statement', - StrictModeWith: 'Strict mode code may not include a with statement', - StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode', - StrictVarName: 'Variable name may not be eval or arguments in strict mode', - StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode', - StrictParamDupe: 'Strict mode function may not have duplicate parameter names', - StrictFunctionName: 'Function name may not be eval or arguments in strict mode', - StrictOctalLiteral: 'Octal literals are not allowed in strict mode.', - StrictDelete: 'Delete of an unqualified identifier in strict mode.', - StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode', - StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode', - StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode', - StrictReservedWord: 'Use of future reserved word in strict mode', - TemplateOctalLiteral: 'Octal literals are not allowed in template strings.', - ParameterAfterRestParameter: 'Rest parameter must be last formal parameter', - DefaultRestParameter: 'Unexpected token =', - ObjectPatternAsRestParameter: 'Unexpected token {', - DuplicateProtoProperty: 'Duplicate __proto__ fields are not allowed in object literals', - ConstructorSpecialMethod: 'Class constructor may not be an accessor', - DuplicateConstructor: 'A class may only have one constructor', - StaticPrototype: 'Classes may not have static property named prototype', - MissingFromClause: 'Unexpected token', - NoAsAfterImportNamespace: 'Unexpected token', - InvalidModuleSpecifier: 'Unexpected token', - IllegalImportDeclaration: 'Unexpected token', - IllegalExportDeclaration: 'Unexpected token', - DuplicateBinding: 'Duplicate binding %0' - }; - - // See also tools/generate-unicode-regex.js. - Regex = { - // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierStart: - NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/, - - // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierPart: - NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDD0-\uDDDA\uDE00-\uDE11\uDE13-\uDE37\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF01-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ - }; - - // Ensure the condition is true, otherwise throw an error. - // This is only to have a better contract semantic, i.e. another safety net - // to catch a logic error. The condition shall be fulfilled in normal case. - // Do NOT use this to enforce a certain condition on any user input. - - function assert(condition, message) { - /* istanbul ignore if */ - if (!condition) { - throw new Error('ASSERT: ' + message); - } - } - - function isDecimalDigit(ch) { - return (ch >= 0x30 && ch <= 0x39); // 0..9 - } - - function isHexDigit(ch) { - return '0123456789abcdefABCDEF'.indexOf(ch) >= 0; - } - - function isOctalDigit(ch) { - return '01234567'.indexOf(ch) >= 0; - } - - function octalToDecimal(ch) { - // \0 is not octal escape sequence - var octal = (ch !== '0'), code = '01234567'.indexOf(ch); - - if (index < length && isOctalDigit(source[index])) { - octal = true; - code = code * 8 + '01234567'.indexOf(source[index++]); - - // 3 digits are only allowed when string starts - // with 0, 1, 2, 3 - if ('0123'.indexOf(ch) >= 0 && - index < length && - isOctalDigit(source[index])) { - code = code * 8 + '01234567'.indexOf(source[index++]); - } - } - - return { - code: code, - octal: octal - }; - } - - // ECMA-262 11.2 White Space - - function isWhiteSpace(ch) { - return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) || - (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0); - } - - // ECMA-262 11.3 Line Terminators - - function isLineTerminator(ch) { - return (ch === 0x0A) || (ch === 0x0D) || (ch === 0x2028) || (ch === 0x2029); - } - - // ECMA-262 11.6 Identifier Names and Identifiers - - function fromCodePoint(cp) { - return (cp < 0x10000) ? String.fromCharCode(cp) : - String.fromCharCode(0xD800 + ((cp - 0x10000) >> 10)) + - String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023)); - } - - function isIdentifierStart(ch) { - return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore) - (ch >= 0x41 && ch <= 0x5A) || // A..Z - (ch >= 0x61 && ch <= 0x7A) || // a..z - (ch === 0x5C) || // \ (backslash) - ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch))); - } - - function isIdentifierPart(ch) { - return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore) - (ch >= 0x41 && ch <= 0x5A) || // A..Z - (ch >= 0x61 && ch <= 0x7A) || // a..z - (ch >= 0x30 && ch <= 0x39) || // 0..9 - (ch === 0x5C) || // \ (backslash) - ((ch >= 0x80) && Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch))); - } - - // ECMA-262 11.6.2.2 Future Reserved Words - - function isFutureReservedWord(id) { - switch (id) { - case 'enum': - case 'export': - case 'import': - case 'super': - return true; - default: - return false; - } - } - - function isStrictModeReservedWord(id) { - switch (id) { - case 'implements': - case 'interface': - case 'package': - case 'private': - case 'protected': - case 'public': - case 'static': - case 'yield': - case 'let': - return true; - default: - return false; - } - } - - function isRestrictedWord(id) { - return id === 'eval' || id === 'arguments'; - } - - // ECMA-262 11.6.2.1 Keywords - - function isKeyword(id) { - switch (id.length) { - case 2: - return (id === 'if') || (id === 'in') || (id === 'do'); - case 3: - return (id === 'var') || (id === 'for') || (id === 'new') || - (id === 'try') || (id === 'let'); - case 4: - return (id === 'this') || (id === 'else') || (id === 'case') || - (id === 'void') || (id === 'with') || (id === 'enum'); - case 5: - return (id === 'while') || (id === 'break') || (id === 'catch') || - (id === 'throw') || (id === 'const') || (id === 'yield') || - (id === 'class') || (id === 'super'); - case 6: - return (id === 'return') || (id === 'typeof') || (id === 'delete') || - (id === 'switch') || (id === 'export') || (id === 'import'); - case 7: - return (id === 'default') || (id === 'finally') || (id === 'extends'); - case 8: - return (id === 'function') || (id === 'continue') || (id === 'debugger'); - case 10: - return (id === 'instanceof'); - default: - return false; - } - } - - // ECMA-262 11.4 Comments - - function addComment(type, value, start, end, loc) { - var comment; - - assert(typeof start === 'number', 'Comment must have valid position'); - - state.lastCommentStart = start; - - comment = { - type: type, - value: value - }; - if (extra.range) { - comment.range = [start, end]; - } - if (extra.loc) { - comment.loc = loc; - } - extra.comments.push(comment); - if (extra.attachComment) { - extra.leadingComments.push(comment); - extra.trailingComments.push(comment); - } - if (extra.tokenize) { - comment.type = comment.type + 'Comment'; - if (extra.delegate) { - comment = extra.delegate(comment); - } - extra.tokens.push(comment); - } - } - - function skipSingleLineComment(offset) { - var start, loc, ch, comment; - - start = index - offset; - loc = { - start: { - line: lineNumber, - column: index - lineStart - offset - } - }; - - while (index < length) { - ch = source.charCodeAt(index); - ++index; - if (isLineTerminator(ch)) { - hasLineTerminator = true; - if (extra.comments) { - comment = source.slice(start + offset, index - 1); - loc.end = { - line: lineNumber, - column: index - lineStart - 1 - }; - addComment('Line', comment, start, index - 1, loc); - } - if (ch === 13 && source.charCodeAt(index) === 10) { - ++index; - } - ++lineNumber; - lineStart = index; - return; - } - } - - if (extra.comments) { - comment = source.slice(start + offset, index); - loc.end = { - line: lineNumber, - column: index - lineStart - }; - addComment('Line', comment, start, index, loc); - } - } - - function skipMultiLineComment() { - var start, loc, ch, comment; - - if (extra.comments) { - start = index - 2; - loc = { - start: { - line: lineNumber, - column: index - lineStart - 2 - } - }; - } - - while (index < length) { - ch = source.charCodeAt(index); - if (isLineTerminator(ch)) { - if (ch === 0x0D && source.charCodeAt(index + 1) === 0x0A) { - ++index; - } - hasLineTerminator = true; - ++lineNumber; - ++index; - lineStart = index; - } else if (ch === 0x2A) { - // Block comment ends with '*/'. - if (source.charCodeAt(index + 1) === 0x2F) { - ++index; - ++index; - if (extra.comments) { - comment = source.slice(start + 2, index - 2); - loc.end = { - line: lineNumber, - column: index - lineStart - }; - addComment('Block', comment, start, index, loc); - } - return; - } - ++index; - } else { - ++index; - } - } - - // Ran off the end of the file - the whole thing is a comment - if (extra.comments) { - loc.end = { - line: lineNumber, - column: index - lineStart - }; - comment = source.slice(start + 2, index); - addComment('Block', comment, start, index, loc); - } - tolerateUnexpectedToken(); - } - - function skipComment() { - var ch, start; - hasLineTerminator = false; - - start = (index === 0); - while (index < length) { - ch = source.charCodeAt(index); - - if (isWhiteSpace(ch)) { - ++index; - } else if (isLineTerminator(ch)) { - hasLineTerminator = true; - ++index; - if (ch === 0x0D && source.charCodeAt(index) === 0x0A) { - ++index; - } - ++lineNumber; - lineStart = index; - start = true; - } else if (ch === 0x2F) { // U+002F is '/' - ch = source.charCodeAt(index + 1); - if (ch === 0x2F) { - ++index; - ++index; - skipSingleLineComment(2); - start = true; - } else if (ch === 0x2A) { // U+002A is '*' - ++index; - ++index; - skipMultiLineComment(); - } else { - break; - } - } else if (start && ch === 0x2D) { // U+002D is '-' - // U+003E is '>' - if ((source.charCodeAt(index + 1) === 0x2D) && (source.charCodeAt(index + 2) === 0x3E)) { - // '-->' is a single-line comment - index += 3; - skipSingleLineComment(3); - } else { - break; - } - } else if (ch === 0x3C) { // U+003C is '<' - if (source.slice(index + 1, index + 4) === '!--') { - ++index; // `<` - ++index; // `!` - ++index; // `-` - ++index; // `-` - skipSingleLineComment(4); - } else { - break; - } - } else { - break; - } - } - } - - function scanHexEscape(prefix) { - var i, len, ch, code = 0; - - len = (prefix === 'u') ? 4 : 2; - for (i = 0; i < len; ++i) { - if (index < length && isHexDigit(source[index])) { - ch = source[index++]; - code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase()); - } else { - return ''; - } - } - return String.fromCharCode(code); - } - - function scanUnicodeCodePointEscape() { - var ch, code; - - ch = source[index]; - code = 0; - - // At least, one hex digit is required. - if (ch === '}') { - throwUnexpectedToken(); - } - - while (index < length) { - ch = source[index++]; - if (!isHexDigit(ch)) { - break; - } - code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase()); - } - - if (code > 0x10FFFF || ch !== '}') { - throwUnexpectedToken(); - } - - return fromCodePoint(code); - } - - function codePointAt(i) { - var cp, first, second; - - cp = source.charCodeAt(i); - if (cp >= 0xD800 && cp <= 0xDBFF) { - second = source.charCodeAt(i + 1); - if (second >= 0xDC00 && second <= 0xDFFF) { - first = cp; - cp = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; - } - } - - return cp; - } - - function getComplexIdentifier() { - var cp, ch, id; - - cp = codePointAt(index); - id = fromCodePoint(cp); - index += id.length; - - // '\u' (U+005C, U+0075) denotes an escaped character. - if (cp === 0x5C) { - if (source.charCodeAt(index) !== 0x75) { - throwUnexpectedToken(); - } - ++index; - if (source[index] === '{') { - ++index; - ch = scanUnicodeCodePointEscape(); - } else { - ch = scanHexEscape('u'); - cp = ch.charCodeAt(0); - if (!ch || ch === '\\' || !isIdentifierStart(cp)) { - throwUnexpectedToken(); - } - } - id = ch; - } - - while (index < length) { - cp = codePointAt(index); - if (!isIdentifierPart(cp)) { - break; - } - ch = fromCodePoint(cp); - id += ch; - index += ch.length; - - // '\u' (U+005C, U+0075) denotes an escaped character. - if (cp === 0x5C) { - id = id.substr(0, id.length - 1); - if (source.charCodeAt(index) !== 0x75) { - throwUnexpectedToken(); - } - ++index; - if (source[index] === '{') { - ++index; - ch = scanUnicodeCodePointEscape(); - } else { - ch = scanHexEscape('u'); - cp = ch.charCodeAt(0); - if (!ch || ch === '\\' || !isIdentifierPart(cp)) { - throwUnexpectedToken(); - } - } - id += ch; - } - } - - return id; - } - - function getIdentifier() { - var start, ch; - - start = index++; - while (index < length) { - ch = source.charCodeAt(index); - if (ch === 0x5C) { - // Blackslash (U+005C) marks Unicode escape sequence. - index = start; - return getComplexIdentifier(); - } else if (ch >= 0xD800 && ch < 0xDFFF) { - // Need to handle surrogate pairs. - index = start; - return getComplexIdentifier(); - } - if (isIdentifierPart(ch)) { - ++index; - } else { - break; - } - } - - return source.slice(start, index); - } - - function scanIdentifier() { - var start, id, type; - - start = index; - - // Backslash (U+005C) starts an escaped character. - id = (source.charCodeAt(index) === 0x5C) ? getComplexIdentifier() : getIdentifier(); - - // There is no keyword or literal with only one character. - // Thus, it must be an identifier. - if (id.length === 1) { - type = Token.Identifier; - } else if (isKeyword(id)) { - type = Token.Keyword; - } else if (id === 'null') { - type = Token.NullLiteral; - } else if (id === 'true' || id === 'false') { - type = Token.BooleanLiteral; - } else { - type = Token.Identifier; - } - - return { - type: type, - value: id, - lineNumber: lineNumber, - lineStart: lineStart, - start: start, - end: index - }; - } - - - // ECMA-262 11.7 Punctuators - - function scanPunctuator() { - var token, str; - - token = { - type: Token.Punctuator, - value: '', - lineNumber: lineNumber, - lineStart: lineStart, - start: index, - end: index - }; - - // Check for most common single-character punctuators. - str = source[index]; - switch (str) { - - case '(': - if (extra.tokenize) { - extra.openParenToken = extra.tokenValues.length; - } - ++index; - break; - - case '{': - if (extra.tokenize) { - extra.openCurlyToken = extra.tokenValues.length; - } - state.curlyStack.push('{'); - ++index; - break; - - case '.': - ++index; - if (source[index] === '.' && source[index + 1] === '.') { - // Spread operator: ... - index += 2; - str = '...'; - } - break; - - case '}': - ++index; - state.curlyStack.pop(); - break; - case ')': - case ';': - case ',': - case '[': - case ']': - case ':': - case '?': - case '~': - ++index; - break; - - default: - // 4-character punctuator. - str = source.substr(index, 4); - if (str === '>>>=') { - index += 4; - } else { - - // 3-character punctuators. - str = str.substr(0, 3); - if (str === '===' || str === '!==' || str === '>>>' || - str === '<<=' || str === '>>=') { - index += 3; - } else { - - // 2-character punctuators. - str = str.substr(0, 2); - if (str === '&&' || str === '||' || str === '==' || str === '!=' || - str === '+=' || str === '-=' || str === '*=' || str === '/=' || - str === '++' || str === '--' || str === '<<' || str === '>>' || - str === '&=' || str === '|=' || str === '^=' || str === '%=' || - str === '<=' || str === '>=' || str === '=>') { - index += 2; - } else { - - // 1-character punctuators. - str = source[index]; - if ('<>=!+-*%&|^/'.indexOf(str) >= 0) { - ++index; - } - } - } - } - } - - if (index === token.start) { - throwUnexpectedToken(); - } - - token.end = index; - token.value = str; - return token; - } - - // ECMA-262 11.8.3 Numeric Literals - - function scanHexLiteral(start) { - var number = ''; - - while (index < length) { - if (!isHexDigit(source[index])) { - break; - } - number += source[index++]; - } - - if (number.length === 0) { - throwUnexpectedToken(); - } - - if (isIdentifierStart(source.charCodeAt(index))) { - throwUnexpectedToken(); - } - - return { - type: Token.NumericLiteral, - value: parseInt('0x' + number, 16), - lineNumber: lineNumber, - lineStart: lineStart, - start: start, - end: index - }; - } - - function scanBinaryLiteral(start) { - var ch, number; - - number = ''; - - while (index < length) { - ch = source[index]; - if (ch !== '0' && ch !== '1') { - break; - } - number += source[index++]; - } - - if (number.length === 0) { - // only 0b or 0B - throwUnexpectedToken(); - } - - if (index < length) { - ch = source.charCodeAt(index); - /* istanbul ignore else */ - if (isIdentifierStart(ch) || isDecimalDigit(ch)) { - throwUnexpectedToken(); - } - } - - return { - type: Token.NumericLiteral, - value: parseInt(number, 2), - lineNumber: lineNumber, - lineStart: lineStart, - start: start, - end: index - }; - } - - function scanOctalLiteral(prefix, start) { - var number, octal; - - if (isOctalDigit(prefix)) { - octal = true; - number = '0' + source[index++]; - } else { - octal = false; - ++index; - number = ''; - } - - while (index < length) { - if (!isOctalDigit(source[index])) { - break; - } - number += source[index++]; - } - - if (!octal && number.length === 0) { - // only 0o or 0O - throwUnexpectedToken(); - } - - if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) { - throwUnexpectedToken(); - } - - return { - type: Token.NumericLiteral, - value: parseInt(number, 8), - octal: octal, - lineNumber: lineNumber, - lineStart: lineStart, - start: start, - end: index - }; - } - - function isImplicitOctalLiteral() { - var i, ch; - - // Implicit octal, unless there is a non-octal digit. - // (Annex B.1.1 on Numeric Literals) - for (i = index + 1; i < length; ++i) { - ch = source[i]; - if (ch === '8' || ch === '9') { - return false; - } - if (!isOctalDigit(ch)) { - return true; - } - } - - return true; - } - - function scanNumericLiteral() { - var number, start, ch; - - ch = source[index]; - assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'), - 'Numeric literal must start with a decimal digit or a decimal point'); - - start = index; - number = ''; - if (ch !== '.') { - number = source[index++]; - ch = source[index]; - - // Hex number starts with '0x'. - // Octal number starts with '0'. - // Octal number in ES6 starts with '0o'. - // Binary number in ES6 starts with '0b'. - if (number === '0') { - if (ch === 'x' || ch === 'X') { - ++index; - return scanHexLiteral(start); - } - if (ch === 'b' || ch === 'B') { - ++index; - return scanBinaryLiteral(start); - } - if (ch === 'o' || ch === 'O') { - return scanOctalLiteral(ch, start); - } - - if (isOctalDigit(ch)) { - if (isImplicitOctalLiteral()) { - return scanOctalLiteral(ch, start); - } - } - } - - while (isDecimalDigit(source.charCodeAt(index))) { - number += source[index++]; - } - ch = source[index]; - } - - if (ch === '.') { - number += source[index++]; - while (isDecimalDigit(source.charCodeAt(index))) { - number += source[index++]; - } - ch = source[index]; - } - - if (ch === 'e' || ch === 'E') { - number += source[index++]; - - ch = source[index]; - if (ch === '+' || ch === '-') { - number += source[index++]; - } - if (isDecimalDigit(source.charCodeAt(index))) { - while (isDecimalDigit(source.charCodeAt(index))) { - number += source[index++]; - } - } else { - throwUnexpectedToken(); - } - } - - if (isIdentifierStart(source.charCodeAt(index))) { - throwUnexpectedToken(); - } - - return { - type: Token.NumericLiteral, - value: parseFloat(number), - lineNumber: lineNumber, - lineStart: lineStart, - start: start, - end: index - }; - } - - // ECMA-262 11.8.4 String Literals - - function scanStringLiteral() { - var str = '', quote, start, ch, unescaped, octToDec, octal = false; - - quote = source[index]; - assert((quote === '\'' || quote === '"'), - 'String literal must starts with a quote'); - - start = index; - ++index; - - while (index < length) { - ch = source[index++]; - - if (ch === quote) { - quote = ''; - break; - } else if (ch === '\\') { - ch = source[index++]; - if (!ch || !isLineTerminator(ch.charCodeAt(0))) { - switch (ch) { - case 'u': - case 'x': - if (source[index] === '{') { - ++index; - str += scanUnicodeCodePointEscape(); - } else { - unescaped = scanHexEscape(ch); - if (!unescaped) { - throw throwUnexpectedToken(); - } - str += unescaped; - } - break; - case 'n': - str += '\n'; - break; - case 'r': - str += '\r'; - break; - case 't': - str += '\t'; - break; - case 'b': - str += '\b'; - break; - case 'f': - str += '\f'; - break; - case 'v': - str += '\x0B'; - break; - case '8': - case '9': - str += ch; - tolerateUnexpectedToken(); - break; - - default: - if (isOctalDigit(ch)) { - octToDec = octalToDecimal(ch); - - octal = octToDec.octal || octal; - str += String.fromCharCode(octToDec.code); - } else { - str += ch; - } - break; - } - } else { - ++lineNumber; - if (ch === '\r' && source[index] === '\n') { - ++index; - } - lineStart = index; - } - } else if (isLineTerminator(ch.charCodeAt(0))) { - break; - } else { - str += ch; - } - } - - if (quote !== '') { - index = start; - throwUnexpectedToken(); - } - - return { - type: Token.StringLiteral, - value: str, - octal: octal, - lineNumber: startLineNumber, - lineStart: startLineStart, - start: start, - end: index - }; - } - - // ECMA-262 11.8.6 Template Literal Lexical Components - - function scanTemplate() { - var cooked = '', ch, start, rawOffset, terminated, head, tail, restore, unescaped; - - terminated = false; - tail = false; - start = index; - head = (source[index] === '`'); - rawOffset = 2; - - ++index; - - while (index < length) { - ch = source[index++]; - if (ch === '`') { - rawOffset = 1; - tail = true; - terminated = true; - break; - } else if (ch === '$') { - if (source[index] === '{') { - state.curlyStack.push('${'); - ++index; - terminated = true; - break; - } - cooked += ch; - } else if (ch === '\\') { - ch = source[index++]; - if (!isLineTerminator(ch.charCodeAt(0))) { - switch (ch) { - case 'n': - cooked += '\n'; - break; - case 'r': - cooked += '\r'; - break; - case 't': - cooked += '\t'; - break; - case 'u': - case 'x': - if (source[index] === '{') { - ++index; - cooked += scanUnicodeCodePointEscape(); - } else { - restore = index; - unescaped = scanHexEscape(ch); - if (unescaped) { - cooked += unescaped; - } else { - index = restore; - cooked += ch; - } - } - break; - case 'b': - cooked += '\b'; - break; - case 'f': - cooked += '\f'; - break; - case 'v': - cooked += '\v'; - break; - - default: - if (ch === '0') { - if (isDecimalDigit(source.charCodeAt(index))) { - // Illegal: \01 \02 and so on - throwError(Messages.TemplateOctalLiteral); - } - cooked += '\0'; - } else if (isOctalDigit(ch)) { - // Illegal: \1 \2 - throwError(Messages.TemplateOctalLiteral); - } else { - cooked += ch; - } - break; - } - } else { - ++lineNumber; - if (ch === '\r' && source[index] === '\n') { - ++index; - } - lineStart = index; - } - } else if (isLineTerminator(ch.charCodeAt(0))) { - ++lineNumber; - if (ch === '\r' && source[index] === '\n') { - ++index; - } - lineStart = index; - cooked += '\n'; - } else { - cooked += ch; - } - } - - if (!terminated) { - throwUnexpectedToken(); - } - - if (!head) { - state.curlyStack.pop(); - } - - return { - type: Token.Template, - value: { - cooked: cooked, - raw: source.slice(start + 1, index - rawOffset) - }, - head: head, - tail: tail, - lineNumber: lineNumber, - lineStart: lineStart, - start: start, - end: index - }; - } - - // ECMA-262 11.8.5 Regular Expression Literals - - function testRegExp(pattern, flags) { - // The BMP character to use as a replacement for astral symbols when - // translating an ES6 "u"-flagged pattern to an ES5-compatible - // approximation. - // Note: replacing with '\uFFFF' enables false positives in unlikely - // scenarios. For example, `[\u{1044f}-\u{10440}]` is an invalid - // pattern that would not be detected by this substitution. - var astralSubstitute = '\uFFFF', - tmp = pattern; - - if (flags.indexOf('u') >= 0) { - tmp = tmp - // Replace every Unicode escape sequence with the equivalent - // BMP character or a constant ASCII code point in the case of - // astral symbols. (See the above note on `astralSubstitute` - // for more information.) - .replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g, function ($0, $1, $2) { - var codePoint = parseInt($1 || $2, 16); - if (codePoint > 0x10FFFF) { - throwUnexpectedToken(null, Messages.InvalidRegExp); - } - if (codePoint <= 0xFFFF) { - return String.fromCharCode(codePoint); - } - return astralSubstitute; - }) - // Replace each paired surrogate with a single ASCII symbol to - // avoid throwing on regular expressions that are only valid in - // combination with the "u" flag. - .replace( - /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, - astralSubstitute - ); - } - - // First, detect invalid regular expressions. - try { - RegExp(tmp); - } catch (e) { - throwUnexpectedToken(null, Messages.InvalidRegExp); - } - - // Return a regular expression object for this pattern-flag pair, or - // `null` in case the current environment doesn't support the flags it - // uses. - try { - return new RegExp(pattern, flags); - } catch (exception) { - return null; - } - } - - function scanRegExpBody() { - var ch, str, classMarker, terminated, body; - - ch = source[index]; - assert(ch === '/', 'Regular expression literal must start with a slash'); - str = source[index++]; - - classMarker = false; - terminated = false; - while (index < length) { - ch = source[index++]; - str += ch; - if (ch === '\\') { - ch = source[index++]; - // ECMA-262 7.8.5 - if (isLineTerminator(ch.charCodeAt(0))) { - throwUnexpectedToken(null, Messages.UnterminatedRegExp); - } - str += ch; - } else if (isLineTerminator(ch.charCodeAt(0))) { - throwUnexpectedToken(null, Messages.UnterminatedRegExp); - } else if (classMarker) { - if (ch === ']') { - classMarker = false; - } - } else { - if (ch === '/') { - terminated = true; - break; - } else if (ch === '[') { - classMarker = true; - } - } - } - - if (!terminated) { - throwUnexpectedToken(null, Messages.UnterminatedRegExp); - } - - // Exclude leading and trailing slash. - body = str.substr(1, str.length - 2); - return { - value: body, - literal: str - }; - } - - function scanRegExpFlags() { - var ch, str, flags, restore; - - str = ''; - flags = ''; - while (index < length) { - ch = source[index]; - if (!isIdentifierPart(ch.charCodeAt(0))) { - break; - } - - ++index; - if (ch === '\\' && index < length) { - ch = source[index]; - if (ch === 'u') { - ++index; - restore = index; - ch = scanHexEscape('u'); - if (ch) { - flags += ch; - for (str += '\\u'; restore < index; ++restore) { - str += source[restore]; - } - } else { - index = restore; - flags += 'u'; - str += '\\u'; - } - tolerateUnexpectedToken(); - } else { - str += '\\'; - tolerateUnexpectedToken(); - } - } else { - flags += ch; - str += ch; - } - } - - return { - value: flags, - literal: str - }; - } - - function scanRegExp() { - var start, body, flags, value; - scanning = true; - - lookahead = null; - skipComment(); - start = index; - - body = scanRegExpBody(); - flags = scanRegExpFlags(); - value = testRegExp(body.value, flags.value); - scanning = false; - if (extra.tokenize) { - return { - type: Token.RegularExpression, - value: value, - regex: { - pattern: body.value, - flags: flags.value - }, - lineNumber: lineNumber, - lineStart: lineStart, - start: start, - end: index - }; - } - - return { - literal: body.literal + flags.literal, - value: value, - regex: { - pattern: body.value, - flags: flags.value - }, - start: start, - end: index - }; - } - - function collectRegex() { - var pos, loc, regex, token; - - skipComment(); - - pos = index; - loc = { - start: { - line: lineNumber, - column: index - lineStart - } - }; - - regex = scanRegExp(); - - loc.end = { - line: lineNumber, - column: index - lineStart - }; - - /* istanbul ignore next */ - if (!extra.tokenize) { - // Pop the previous token, which is likely '/' or '/=' - if (extra.tokens.length > 0) { - token = extra.tokens[extra.tokens.length - 1]; - if (token.range[0] === pos && token.type === 'Punctuator') { - if (token.value === '/' || token.value === '/=') { - extra.tokens.pop(); - } - } - } - - extra.tokens.push({ - type: 'RegularExpression', - value: regex.literal, - regex: regex.regex, - range: [pos, index], - loc: loc - }); - } - - return regex; - } - - function isIdentifierName(token) { - return token.type === Token.Identifier || - token.type === Token.Keyword || - token.type === Token.BooleanLiteral || - token.type === Token.NullLiteral; - } - - // Using the following algorithm: - // https://github.com/mozilla/sweet.js/wiki/design - - function advanceSlash() { - var regex, previous, check; - - function testKeyword(value) { - return value && (value.length > 1) && (value[0] >= 'a') && (value[0] <= 'z'); - } - - previous = extra.tokenValues[extra.tokens.length - 1]; - regex = (previous !== null); - - switch (previous) { - case 'this': - case ']': - regex = false; - break; - - case ')': - check = extra.tokenValues[extra.openParenToken - 1]; - regex = (check === 'if' || check === 'while' || check === 'for' || check === 'with'); - break; - - case '}': - // Dividing a function by anything makes little sense, - // but we have to check for that. - regex = false; - if (testKeyword(extra.tokenValues[extra.openCurlyToken - 3])) { - // Anonymous function, e.g. function(){} /42 - check = extra.tokenValues[extra.openCurlyToken - 4]; - regex = check ? (FnExprTokens.indexOf(check) < 0) : false; - } else if (testKeyword(extra.tokenValues[extra.openCurlyToken - 4])) { - // Named function, e.g. function f(){} /42/ - check = extra.tokenValues[extra.openCurlyToken - 5]; - regex = check ? (FnExprTokens.indexOf(check) < 0) : true; - } - } - - return regex ? collectRegex() : scanPunctuator(); - } - - function advance() { - var cp, token; - - if (index >= length) { - return { - type: Token.EOF, - lineNumber: lineNumber, - lineStart: lineStart, - start: index, - end: index - }; - } - - cp = source.charCodeAt(index); - - if (isIdentifierStart(cp)) { - token = scanIdentifier(); - if (strict && isStrictModeReservedWord(token.value)) { - token.type = Token.Keyword; - } - return token; - } - - // Very common: ( and ) and ; - if (cp === 0x28 || cp === 0x29 || cp === 0x3B) { - return scanPunctuator(); - } - - // String literal starts with single quote (U+0027) or double quote (U+0022). - if (cp === 0x27 || cp === 0x22) { - return scanStringLiteral(); - } - - // Dot (.) U+002E can also start a floating-point number, hence the need - // to check the next character. - if (cp === 0x2E) { - if (isDecimalDigit(source.charCodeAt(index + 1))) { - return scanNumericLiteral(); - } - return scanPunctuator(); - } - - if (isDecimalDigit(cp)) { - return scanNumericLiteral(); - } - - // Slash (/) U+002F can also start a regex. - if (extra.tokenize && cp === 0x2F) { - return advanceSlash(); - } - - // Template literals start with ` (U+0060) for template head - // or } (U+007D) for template middle or template tail. - if (cp === 0x60 || (cp === 0x7D && state.curlyStack[state.curlyStack.length - 1] === '${')) { - return scanTemplate(); - } - - // Possible identifier start in a surrogate pair. - if (cp >= 0xD800 && cp < 0xDFFF) { - cp = codePointAt(index); - if (isIdentifierStart(cp)) { - return scanIdentifier(); - } - } - - return scanPunctuator(); - } - - function collectToken() { - var loc, token, value, entry; - - loc = { - start: { - line: lineNumber, - column: index - lineStart - } - }; - - token = advance(); - loc.end = { - line: lineNumber, - column: index - lineStart - }; - - if (token.type !== Token.EOF) { - value = source.slice(token.start, token.end); - entry = { - type: TokenName[token.type], - value: value, - range: [token.start, token.end], - loc: loc - }; - if (token.regex) { - entry.regex = { - pattern: token.regex.pattern, - flags: token.regex.flags - }; - } - if (extra.tokenValues) { - extra.tokenValues.push((entry.type === 'Punctuator' || entry.type === 'Keyword') ? entry.value : null); - } - if (extra.tokenize) { - if (!extra.range) { - delete entry.range; - } - if (!extra.loc) { - delete entry.loc; - } - if (extra.delegate) { - entry = extra.delegate(entry); - } - } - extra.tokens.push(entry); - } - - return token; - } - - function lex() { - var token; - scanning = true; - - lastIndex = index; - lastLineNumber = lineNumber; - lastLineStart = lineStart; - - skipComment(); - - token = lookahead; - - startIndex = index; - startLineNumber = lineNumber; - startLineStart = lineStart; - - lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance(); - scanning = false; - return token; - } - - function peek() { - scanning = true; - - skipComment(); - - lastIndex = index; - lastLineNumber = lineNumber; - lastLineStart = lineStart; - - startIndex = index; - startLineNumber = lineNumber; - startLineStart = lineStart; - - lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance(); - scanning = false; - } - - function Position() { - this.line = startLineNumber; - this.column = startIndex - startLineStart; - } - - function SourceLocation() { - this.start = new Position(); - this.end = null; - } - - function WrappingSourceLocation(startToken) { - this.start = { - line: startToken.lineNumber, - column: startToken.start - startToken.lineStart - }; - this.end = null; - } - - function Node() { - if (extra.range) { - this.range = [startIndex, 0]; - } - if (extra.loc) { - this.loc = new SourceLocation(); - } - } - - function WrappingNode(startToken) { - if (extra.range) { - this.range = [startToken.start, 0]; - } - if (extra.loc) { - this.loc = new WrappingSourceLocation(startToken); - } - } - - WrappingNode.prototype = Node.prototype = { - - processComment: function () { - var lastChild, - innerComments, - leadingComments, - trailingComments, - bottomRight = extra.bottomRightStack, - i, - comment, - last = bottomRight[bottomRight.length - 1]; - - if (this.type === Syntax.Program) { - if (this.body.length > 0) { - return; - } - } - /** - * patch innnerComments for properties empty block - * `function a() {/** comments **\/}` - */ - - if (this.type === Syntax.BlockStatement && this.body.length === 0) { - innerComments = []; - for (i = extra.leadingComments.length - 1; i >= 0; --i) { - comment = extra.leadingComments[i]; - if (this.range[1] >= comment.range[1]) { - innerComments.unshift(comment); - extra.leadingComments.splice(i, 1); - extra.trailingComments.splice(i, 1); - } - } - if (innerComments.length) { - this.innerComments = innerComments; - //bottomRight.push(this); - return; - } - } - - if (extra.trailingComments.length > 0) { - trailingComments = []; - for (i = extra.trailingComments.length - 1; i >= 0; --i) { - comment = extra.trailingComments[i]; - if (comment.range[0] >= this.range[1]) { - trailingComments.unshift(comment); - extra.trailingComments.splice(i, 1); - } - } - extra.trailingComments = []; - } else { - if (last && last.trailingComments && last.trailingComments[0].range[0] >= this.range[1]) { - trailingComments = last.trailingComments; - delete last.trailingComments; - } - } - - // Eating the stack. - while (last && last.range[0] >= this.range[0]) { - lastChild = bottomRight.pop(); - last = bottomRight[bottomRight.length - 1]; - } - - if (lastChild) { - if (lastChild.leadingComments) { - leadingComments = []; - for (i = lastChild.leadingComments.length - 1; i >= 0; --i) { - comment = lastChild.leadingComments[i]; - if (comment.range[1] <= this.range[0]) { - leadingComments.unshift(comment); - lastChild.leadingComments.splice(i, 1); - } - } - - if (!lastChild.leadingComments.length) { - lastChild.leadingComments = undefined; - } - } - } else if (extra.leadingComments.length > 0) { - leadingComments = []; - for (i = extra.leadingComments.length - 1; i >= 0; --i) { - comment = extra.leadingComments[i]; - if (comment.range[1] <= this.range[0]) { - leadingComments.unshift(comment); - extra.leadingComments.splice(i, 1); - } - } - } - - - if (leadingComments && leadingComments.length > 0) { - this.leadingComments = leadingComments; - } - if (trailingComments && trailingComments.length > 0) { - this.trailingComments = trailingComments; - } - - bottomRight.push(this); - }, - - finish: function () { - if (extra.range) { - this.range[1] = lastIndex; - } - if (extra.loc) { - this.loc.end = { - line: lastLineNumber, - column: lastIndex - lastLineStart - }; - if (extra.source) { - this.loc.source = extra.source; - } - } - - if (extra.attachComment) { - this.processComment(); - } - }, - - finishArrayExpression: function (elements) { - this.type = Syntax.ArrayExpression; - this.elements = elements; - this.finish(); - return this; - }, - - finishArrayPattern: function (elements) { - this.type = Syntax.ArrayPattern; - this.elements = elements; - this.finish(); - return this; - }, - - finishArrowFunctionExpression: function (params, defaults, body, expression) { - this.type = Syntax.ArrowFunctionExpression; - this.id = null; - this.params = params; - this.defaults = defaults; - this.body = body; - this.generator = false; - this.expression = expression; - this.finish(); - return this; - }, - - finishAssignmentExpression: function (operator, left, right) { - this.type = Syntax.AssignmentExpression; - this.operator = operator; - this.left = left; - this.right = right; - this.finish(); - return this; - }, - - finishAssignmentPattern: function (left, right) { - this.type = Syntax.AssignmentPattern; - this.left = left; - this.right = right; - this.finish(); - return this; - }, - - finishBinaryExpression: function (operator, left, right) { - this.type = (operator === '||' || operator === '&&') ? Syntax.LogicalExpression : Syntax.BinaryExpression; - this.operator = operator; - this.left = left; - this.right = right; - this.finish(); - return this; - }, - - finishBlockStatement: function (body) { - this.type = Syntax.BlockStatement; - this.body = body; - this.finish(); - return this; - }, - - finishBreakStatement: function (label) { - this.type = Syntax.BreakStatement; - this.label = label; - this.finish(); - return this; - }, - - finishCallExpression: function (callee, args) { - this.type = Syntax.CallExpression; - this.callee = callee; - this.arguments = args; - this.finish(); - return this; - }, - - finishCatchClause: function (param, body) { - this.type = Syntax.CatchClause; - this.param = param; - this.body = body; - this.finish(); - return this; - }, - - finishClassBody: function (body) { - this.type = Syntax.ClassBody; - this.body = body; - this.finish(); - return this; - }, - - finishClassDeclaration: function (id, superClass, body) { - this.type = Syntax.ClassDeclaration; - this.id = id; - this.superClass = superClass; - this.body = body; - this.finish(); - return this; - }, - - finishClassExpression: function (id, superClass, body) { - this.type = Syntax.ClassExpression; - this.id = id; - this.superClass = superClass; - this.body = body; - this.finish(); - return this; - }, - - finishConditionalExpression: function (test, consequent, alternate) { - this.type = Syntax.ConditionalExpression; - this.test = test; - this.consequent = consequent; - this.alternate = alternate; - this.finish(); - return this; - }, - - finishContinueStatement: function (label) { - this.type = Syntax.ContinueStatement; - this.label = label; - this.finish(); - return this; - }, - - finishDebuggerStatement: function () { - this.type = Syntax.DebuggerStatement; - this.finish(); - return this; - }, - - finishDoWhileStatement: function (body, test) { - this.type = Syntax.DoWhileStatement; - this.body = body; - this.test = test; - this.finish(); - return this; - }, - - finishEmptyStatement: function () { - this.type = Syntax.EmptyStatement; - this.finish(); - return this; - }, - - finishExpressionStatement: function (expression) { - this.type = Syntax.ExpressionStatement; - this.expression = expression; - this.finish(); - return this; - }, - - finishForStatement: function (init, test, update, body) { - this.type = Syntax.ForStatement; - this.init = init; - this.test = test; - this.update = update; - this.body = body; - this.finish(); - return this; - }, - - finishForOfStatement: function (left, right, body) { - this.type = Syntax.ForOfStatement; - this.left = left; - this.right = right; - this.body = body; - this.finish(); - return this; - }, - - finishForInStatement: function (left, right, body) { - this.type = Syntax.ForInStatement; - this.left = left; - this.right = right; - this.body = body; - this.each = false; - this.finish(); - return this; - }, - - finishFunctionDeclaration: function (id, params, defaults, body, generator) { - this.type = Syntax.FunctionDeclaration; - this.id = id; - this.params = params; - this.defaults = defaults; - this.body = body; - this.generator = generator; - this.expression = false; - this.finish(); - return this; - }, - - finishFunctionExpression: function (id, params, defaults, body, generator) { - this.type = Syntax.FunctionExpression; - this.id = id; - this.params = params; - this.defaults = defaults; - this.body = body; - this.generator = generator; - this.expression = false; - this.finish(); - return this; - }, - - finishIdentifier: function (name) { - this.type = Syntax.Identifier; - this.name = name; - this.finish(); - return this; - }, - - finishIfStatement: function (test, consequent, alternate) { - this.type = Syntax.IfStatement; - this.test = test; - this.consequent = consequent; - this.alternate = alternate; - this.finish(); - return this; - }, - - finishLabeledStatement: function (label, body) { - this.type = Syntax.LabeledStatement; - this.label = label; - this.body = body; - this.finish(); - return this; - }, - - finishLiteral: function (token) { - this.type = Syntax.Literal; - this.value = token.value; - this.raw = source.slice(token.start, token.end); - if (token.regex) { - this.regex = token.regex; - } - this.finish(); - return this; - }, - - finishMemberExpression: function (accessor, object, property) { - this.type = Syntax.MemberExpression; - this.computed = accessor === '['; - this.object = object; - this.property = property; - this.finish(); - return this; - }, - - finishMetaProperty: function (meta, property) { - this.type = Syntax.MetaProperty; - this.meta = meta; - this.property = property; - this.finish(); - return this; - }, - - finishNewExpression: function (callee, args) { - this.type = Syntax.NewExpression; - this.callee = callee; - this.arguments = args; - this.finish(); - return this; - }, - - finishObjectExpression: function (properties) { - this.type = Syntax.ObjectExpression; - this.properties = properties; - this.finish(); - return this; - }, - - finishObjectPattern: function (properties) { - this.type = Syntax.ObjectPattern; - this.properties = properties; - this.finish(); - return this; - }, - - finishPostfixExpression: function (operator, argument) { - this.type = Syntax.UpdateExpression; - this.operator = operator; - this.argument = argument; - this.prefix = false; - this.finish(); - return this; - }, - - finishProgram: function (body, sourceType) { - this.type = Syntax.Program; - this.body = body; - this.sourceType = sourceType; - this.finish(); - return this; - }, - - finishProperty: function (kind, key, computed, value, method, shorthand) { - this.type = Syntax.Property; - this.key = key; - this.computed = computed; - this.value = value; - this.kind = kind; - this.method = method; - this.shorthand = shorthand; - this.finish(); - return this; - }, - - finishRestElement: function (argument) { - this.type = Syntax.RestElement; - this.argument = argument; - this.finish(); - return this; - }, - - finishReturnStatement: function (argument) { - this.type = Syntax.ReturnStatement; - this.argument = argument; - this.finish(); - return this; - }, - - finishSequenceExpression: function (expressions) { - this.type = Syntax.SequenceExpression; - this.expressions = expressions; - this.finish(); - return this; - }, - - finishSpreadElement: function (argument) { - this.type = Syntax.SpreadElement; - this.argument = argument; - this.finish(); - return this; - }, - - finishSwitchCase: function (test, consequent) { - this.type = Syntax.SwitchCase; - this.test = test; - this.consequent = consequent; - this.finish(); - return this; - }, - - finishSuper: function () { - this.type = Syntax.Super; - this.finish(); - return this; - }, - - finishSwitchStatement: function (discriminant, cases) { - this.type = Syntax.SwitchStatement; - this.discriminant = discriminant; - this.cases = cases; - this.finish(); - return this; - }, - - finishTaggedTemplateExpression: function (tag, quasi) { - this.type = Syntax.TaggedTemplateExpression; - this.tag = tag; - this.quasi = quasi; - this.finish(); - return this; - }, - - finishTemplateElement: function (value, tail) { - this.type = Syntax.TemplateElement; - this.value = value; - this.tail = tail; - this.finish(); - return this; - }, - - finishTemplateLiteral: function (quasis, expressions) { - this.type = Syntax.TemplateLiteral; - this.quasis = quasis; - this.expressions = expressions; - this.finish(); - return this; - }, - - finishThisExpression: function () { - this.type = Syntax.ThisExpression; - this.finish(); - return this; - }, - - finishThrowStatement: function (argument) { - this.type = Syntax.ThrowStatement; - this.argument = argument; - this.finish(); - return this; - }, - - finishTryStatement: function (block, handler, finalizer) { - this.type = Syntax.TryStatement; - this.block = block; - this.guardedHandlers = []; - this.handlers = handler ? [handler] : []; - this.handler = handler; - this.finalizer = finalizer; - this.finish(); - return this; - }, - - finishUnaryExpression: function (operator, argument) { - this.type = (operator === '++' || operator === '--') ? Syntax.UpdateExpression : Syntax.UnaryExpression; - this.operator = operator; - this.argument = argument; - this.prefix = true; - this.finish(); - return this; - }, - - finishVariableDeclaration: function (declarations) { - this.type = Syntax.VariableDeclaration; - this.declarations = declarations; - this.kind = 'var'; - this.finish(); - return this; - }, - - finishLexicalDeclaration: function (declarations, kind) { - this.type = Syntax.VariableDeclaration; - this.declarations = declarations; - this.kind = kind; - this.finish(); - return this; - }, - - finishVariableDeclarator: function (id, init) { - this.type = Syntax.VariableDeclarator; - this.id = id; - this.init = init; - this.finish(); - return this; - }, - - finishWhileStatement: function (test, body) { - this.type = Syntax.WhileStatement; - this.test = test; - this.body = body; - this.finish(); - return this; - }, - - finishWithStatement: function (object, body) { - this.type = Syntax.WithStatement; - this.object = object; - this.body = body; - this.finish(); - return this; - }, - - finishExportSpecifier: function (local, exported) { - this.type = Syntax.ExportSpecifier; - this.exported = exported || local; - this.local = local; - this.finish(); - return this; - }, - - finishImportDefaultSpecifier: function (local) { - this.type = Syntax.ImportDefaultSpecifier; - this.local = local; - this.finish(); - return this; - }, - - finishImportNamespaceSpecifier: function (local) { - this.type = Syntax.ImportNamespaceSpecifier; - this.local = local; - this.finish(); - return this; - }, - - finishExportNamedDeclaration: function (declaration, specifiers, src) { - this.type = Syntax.ExportNamedDeclaration; - this.declaration = declaration; - this.specifiers = specifiers; - this.source = src; - this.finish(); - return this; - }, - - finishExportDefaultDeclaration: function (declaration) { - this.type = Syntax.ExportDefaultDeclaration; - this.declaration = declaration; - this.finish(); - return this; - }, - - finishExportAllDeclaration: function (src) { - this.type = Syntax.ExportAllDeclaration; - this.source = src; - this.finish(); - return this; - }, - - finishImportSpecifier: function (local, imported) { - this.type = Syntax.ImportSpecifier; - this.local = local || imported; - this.imported = imported; - this.finish(); - return this; - }, - - finishImportDeclaration: function (specifiers, src) { - this.type = Syntax.ImportDeclaration; - this.specifiers = specifiers; - this.source = src; - this.finish(); - return this; - }, - - finishYieldExpression: function (argument, delegate) { - this.type = Syntax.YieldExpression; - this.argument = argument; - this.delegate = delegate; - this.finish(); - return this; - } - }; - - - function recordError(error) { - var e, existing; - - for (e = 0; e < extra.errors.length; e++) { - existing = extra.errors[e]; - // Prevent duplicated error. - /* istanbul ignore next */ - if (existing.index === error.index && existing.message === error.message) { - return; - } - } - - extra.errors.push(error); - } - - function constructError(msg, column) { - var error = new Error(msg); - try { - throw error; - } catch (base) { - /* istanbul ignore else */ - if (Object.create && Object.defineProperty) { - error = Object.create(base); - Object.defineProperty(error, 'column', { value: column }); - } - } finally { - return error; - } - } - - function createError(line, pos, description) { - var msg, column, error; - - msg = 'Line ' + line + ': ' + description; - column = pos - (scanning ? lineStart : lastLineStart) + 1; - error = constructError(msg, column); - error.lineNumber = line; - error.description = description; - error.index = pos; - return error; - } - - // Throw an exception - - function throwError(messageFormat) { - var args, msg; - - args = Array.prototype.slice.call(arguments, 1); - msg = messageFormat.replace(/%(\d)/g, - function (whole, idx) { - assert(idx < args.length, 'Message reference must be in range'); - return args[idx]; - } - ); - - throw createError(lastLineNumber, lastIndex, msg); - } - - function tolerateError(messageFormat) { - var args, msg, error; - - args = Array.prototype.slice.call(arguments, 1); - /* istanbul ignore next */ - msg = messageFormat.replace(/%(\d)/g, - function (whole, idx) { - assert(idx < args.length, 'Message reference must be in range'); - return args[idx]; - } - ); - - error = createError(lineNumber, lastIndex, msg); - if (extra.errors) { - recordError(error); - } else { - throw error; - } - } - - // Throw an exception because of the token. - - function unexpectedTokenError(token, message) { - var value, msg = message || Messages.UnexpectedToken; - - if (token) { - if (!message) { - msg = (token.type === Token.EOF) ? Messages.UnexpectedEOS : - (token.type === Token.Identifier) ? Messages.UnexpectedIdentifier : - (token.type === Token.NumericLiteral) ? Messages.UnexpectedNumber : - (token.type === Token.StringLiteral) ? Messages.UnexpectedString : - (token.type === Token.Template) ? Messages.UnexpectedTemplate : - Messages.UnexpectedToken; - - if (token.type === Token.Keyword) { - if (isFutureReservedWord(token.value)) { - msg = Messages.UnexpectedReserved; - } else if (strict && isStrictModeReservedWord(token.value)) { - msg = Messages.StrictReservedWord; - } - } - } - - value = (token.type === Token.Template) ? token.value.raw : token.value; - } else { - value = 'ILLEGAL'; - } - - msg = msg.replace('%0', value); - - return (token && typeof token.lineNumber === 'number') ? - createError(token.lineNumber, token.start, msg) : - createError(scanning ? lineNumber : lastLineNumber, scanning ? index : lastIndex, msg); - } - - function throwUnexpectedToken(token, message) { - throw unexpectedTokenError(token, message); - } - - function tolerateUnexpectedToken(token, message) { - var error = unexpectedTokenError(token, message); - if (extra.errors) { - recordError(error); - } else { - throw error; - } - } - - // Expect the next token to match the specified punctuator. - // If not, an exception will be thrown. - - function expect(value) { - var token = lex(); - if (token.type !== Token.Punctuator || token.value !== value) { - throwUnexpectedToken(token); - } - } - - /** - * @name expectCommaSeparator - * @description Quietly expect a comma when in tolerant mode, otherwise delegates - * to expect(value) - * @since 2.0 - */ - function expectCommaSeparator() { - var token; - - if (extra.errors) { - token = lookahead; - if (token.type === Token.Punctuator && token.value === ',') { - lex(); - } else if (token.type === Token.Punctuator && token.value === ';') { - lex(); - tolerateUnexpectedToken(token); - } else { - tolerateUnexpectedToken(token, Messages.UnexpectedToken); - } - } else { - expect(','); - } - } - - // Expect the next token to match the specified keyword. - // If not, an exception will be thrown. - - function expectKeyword(keyword) { - var token = lex(); - if (token.type !== Token.Keyword || token.value !== keyword) { - throwUnexpectedToken(token); - } - } - - // Return true if the next token matches the specified punctuator. - - function match(value) { - return lookahead.type === Token.Punctuator && lookahead.value === value; - } - - // Return true if the next token matches the specified keyword - - function matchKeyword(keyword) { - return lookahead.type === Token.Keyword && lookahead.value === keyword; - } - - // Return true if the next token matches the specified contextual keyword - // (where an identifier is sometimes a keyword depending on the context) - - function matchContextualKeyword(keyword) { - return lookahead.type === Token.Identifier && lookahead.value === keyword; - } - - // Return true if the next token is an assignment operator - - function matchAssign() { - var op; - - if (lookahead.type !== Token.Punctuator) { - return false; - } - op = lookahead.value; - return op === '=' || - op === '*=' || - op === '/=' || - op === '%=' || - op === '+=' || - op === '-=' || - op === '<<=' || - op === '>>=' || - op === '>>>=' || - op === '&=' || - op === '^=' || - op === '|='; - } - - function consumeSemicolon() { - // Catch the very common case first: immediately a semicolon (U+003B). - if (source.charCodeAt(startIndex) === 0x3B || match(';')) { - lex(); - return; - } - - if (hasLineTerminator) { - return; - } - - // FIXME(ikarienator): this is seemingly an issue in the previous location info convention. - lastIndex = startIndex; - lastLineNumber = startLineNumber; - lastLineStart = startLineStart; - - if (lookahead.type !== Token.EOF && !match('}')) { - throwUnexpectedToken(lookahead); - } - } - - // Cover grammar support. - // - // When an assignment expression position starts with an left parenthesis, the determination of the type - // of the syntax is to be deferred arbitrarily long until the end of the parentheses pair (plus a lookahead) - // or the first comma. This situation also defers the determination of all the expressions nested in the pair. - // - // There are three productions that can be parsed in a parentheses pair that needs to be determined - // after the outermost pair is closed. They are: - // - // 1. AssignmentExpression - // 2. BindingElements - // 3. AssignmentTargets - // - // In order to avoid exponential backtracking, we use two flags to denote if the production can be - // binding element or assignment target. - // - // The three productions have the relationship: - // - // BindingElements ⊆ AssignmentTargets ⊆ AssignmentExpression - // - // with a single exception that CoverInitializedName when used directly in an Expression, generates - // an early error. Therefore, we need the third state, firstCoverInitializedNameError, to track the - // first usage of CoverInitializedName and report it when we reached the end of the parentheses pair. - // - // isolateCoverGrammar function runs the given parser function with a new cover grammar context, and it does not - // effect the current flags. This means the production the parser parses is only used as an expression. Therefore - // the CoverInitializedName check is conducted. - // - // inheritCoverGrammar function runs the given parse function with a new cover grammar context, and it propagates - // the flags outside of the parser. This means the production the parser parses is used as a part of a potential - // pattern. The CoverInitializedName check is deferred. - function isolateCoverGrammar(parser) { - var oldIsBindingElement = isBindingElement, - oldIsAssignmentTarget = isAssignmentTarget, - oldFirstCoverInitializedNameError = firstCoverInitializedNameError, - result; - isBindingElement = true; - isAssignmentTarget = true; - firstCoverInitializedNameError = null; - result = parser(); - if (firstCoverInitializedNameError !== null) { - throwUnexpectedToken(firstCoverInitializedNameError); - } - isBindingElement = oldIsBindingElement; - isAssignmentTarget = oldIsAssignmentTarget; - firstCoverInitializedNameError = oldFirstCoverInitializedNameError; - return result; - } - - function inheritCoverGrammar(parser) { - var oldIsBindingElement = isBindingElement, - oldIsAssignmentTarget = isAssignmentTarget, - oldFirstCoverInitializedNameError = firstCoverInitializedNameError, - result; - isBindingElement = true; - isAssignmentTarget = true; - firstCoverInitializedNameError = null; - result = parser(); - isBindingElement = isBindingElement && oldIsBindingElement; - isAssignmentTarget = isAssignmentTarget && oldIsAssignmentTarget; - firstCoverInitializedNameError = oldFirstCoverInitializedNameError || firstCoverInitializedNameError; - return result; - } - - // ECMA-262 13.3.3 Destructuring Binding Patterns - - function parseArrayPattern(params, kind) { - var node = new Node(), elements = [], rest, restNode; - expect('['); - - while (!match(']')) { - if (match(',')) { - lex(); - elements.push(null); - } else { - if (match('...')) { - restNode = new Node(); - lex(); - params.push(lookahead); - rest = parseVariableIdentifier(kind); - elements.push(restNode.finishRestElement(rest)); - break; - } else { - elements.push(parsePatternWithDefault(params, kind)); - } - if (!match(']')) { - expect(','); - } - } - - } - - expect(']'); - - return node.finishArrayPattern(elements); - } - - function parsePropertyPattern(params, kind) { - var node = new Node(), key, keyToken, computed = match('['), init; - if (lookahead.type === Token.Identifier) { - keyToken = lookahead; - key = parseVariableIdentifier(); - if (match('=')) { - params.push(keyToken); - lex(); - init = parseAssignmentExpression(); - - return node.finishProperty( - 'init', key, false, - new WrappingNode(keyToken).finishAssignmentPattern(key, init), false, true); - } else if (!match(':')) { - params.push(keyToken); - return node.finishProperty('init', key, false, key, false, true); - } - } else { - key = parseObjectPropertyKey(); - } - expect(':'); - init = parsePatternWithDefault(params, kind); - return node.finishProperty('init', key, computed, init, false, false); - } - - function parseObjectPattern(params, kind) { - var node = new Node(), properties = []; - - expect('{'); - - while (!match('}')) { - properties.push(parsePropertyPattern(params, kind)); - if (!match('}')) { - expect(','); - } - } - - lex(); - - return node.finishObjectPattern(properties); - } - - function parsePattern(params, kind) { - if (match('[')) { - return parseArrayPattern(params, kind); - } else if (match('{')) { - return parseObjectPattern(params, kind); - } else if (matchKeyword('let')) { - if (kind === 'const' || kind === 'let') { - tolerateUnexpectedToken(lookahead, Messages.UnexpectedToken); - } - } - - params.push(lookahead); - return parseVariableIdentifier(kind); - } - - function parsePatternWithDefault(params, kind) { - var startToken = lookahead, pattern, previousAllowYield, right; - pattern = parsePattern(params, kind); - if (match('=')) { - lex(); - previousAllowYield = state.allowYield; - state.allowYield = true; - right = isolateCoverGrammar(parseAssignmentExpression); - state.allowYield = previousAllowYield; - pattern = new WrappingNode(startToken).finishAssignmentPattern(pattern, right); - } - return pattern; - } - - // ECMA-262 12.2.5 Array Initializer - - function parseArrayInitializer() { - var elements = [], node = new Node(), restSpread; - - expect('['); - - while (!match(']')) { - if (match(',')) { - lex(); - elements.push(null); - } else if (match('...')) { - restSpread = new Node(); - lex(); - restSpread.finishSpreadElement(inheritCoverGrammar(parseAssignmentExpression)); - - if (!match(']')) { - isAssignmentTarget = isBindingElement = false; - expect(','); - } - elements.push(restSpread); - } else { - elements.push(inheritCoverGrammar(parseAssignmentExpression)); - - if (!match(']')) { - expect(','); - } - } - } - - lex(); - - return node.finishArrayExpression(elements); - } - - // ECMA-262 12.2.6 Object Initializer - - function parsePropertyFunction(node, paramInfo, isGenerator) { - var previousStrict, body; - - isAssignmentTarget = isBindingElement = false; - - previousStrict = strict; - body = isolateCoverGrammar(parseFunctionSourceElements); - - if (strict && paramInfo.firstRestricted) { - tolerateUnexpectedToken(paramInfo.firstRestricted, paramInfo.message); - } - if (strict && paramInfo.stricted) { - tolerateUnexpectedToken(paramInfo.stricted, paramInfo.message); - } - - strict = previousStrict; - return node.finishFunctionExpression(null, paramInfo.params, paramInfo.defaults, body, isGenerator); - } - - function parsePropertyMethodFunction() { - var params, method, node = new Node(), - previousAllowYield = state.allowYield; - - state.allowYield = false; - params = parseParams(); - state.allowYield = previousAllowYield; - - state.allowYield = false; - method = parsePropertyFunction(node, params, false); - state.allowYield = previousAllowYield; - - return method; - } - - function parseObjectPropertyKey() { - var token, node = new Node(), expr; - - token = lex(); - - // Note: This function is called only from parseObjectProperty(), where - // EOF and Punctuator tokens are already filtered out. - - switch (token.type) { - case Token.StringLiteral: - case Token.NumericLiteral: - if (strict && token.octal) { - tolerateUnexpectedToken(token, Messages.StrictOctalLiteral); - } - return node.finishLiteral(token); - case Token.Identifier: - case Token.BooleanLiteral: - case Token.NullLiteral: - case Token.Keyword: - return node.finishIdentifier(token.value); - case Token.Punctuator: - if (token.value === '[') { - expr = isolateCoverGrammar(parseAssignmentExpression); - expect(']'); - return expr; - } - break; - } - throwUnexpectedToken(token); - } - - function lookaheadPropertyName() { - switch (lookahead.type) { - case Token.Identifier: - case Token.StringLiteral: - case Token.BooleanLiteral: - case Token.NullLiteral: - case Token.NumericLiteral: - case Token.Keyword: - return true; - case Token.Punctuator: - return lookahead.value === '['; - } - return false; - } - - // This function is to try to parse a MethodDefinition as defined in 14.3. But in the case of object literals, - // it might be called at a position where there is in fact a short hand identifier pattern or a data property. - // This can only be determined after we consumed up to the left parentheses. - // - // In order to avoid back tracking, it returns `null` if the position is not a MethodDefinition and the caller - // is responsible to visit other options. - function tryParseMethodDefinition(token, key, computed, node) { - var value, options, methodNode, params, - previousAllowYield = state.allowYield; - - if (token.type === Token.Identifier) { - // check for `get` and `set`; - - if (token.value === 'get' && lookaheadPropertyName()) { - computed = match('['); - key = parseObjectPropertyKey(); - methodNode = new Node(); - expect('('); - expect(')'); - - state.allowYield = false; - value = parsePropertyFunction(methodNode, { - params: [], - defaults: [], - stricted: null, - firstRestricted: null, - message: null - }, false); - state.allowYield = previousAllowYield; - - return node.finishProperty('get', key, computed, value, false, false); - } else if (token.value === 'set' && lookaheadPropertyName()) { - computed = match('['); - key = parseObjectPropertyKey(); - methodNode = new Node(); - expect('('); - - options = { - params: [], - defaultCount: 0, - defaults: [], - firstRestricted: null, - paramSet: {} - }; - if (match(')')) { - tolerateUnexpectedToken(lookahead); - } else { - state.allowYield = false; - parseParam(options); - state.allowYield = previousAllowYield; - if (options.defaultCount === 0) { - options.defaults = []; - } - } - expect(')'); - - state.allowYield = false; - value = parsePropertyFunction(methodNode, options, false); - state.allowYield = previousAllowYield; - - return node.finishProperty('set', key, computed, value, false, false); - } - } else if (token.type === Token.Punctuator && token.value === '*' && lookaheadPropertyName()) { - computed = match('['); - key = parseObjectPropertyKey(); - methodNode = new Node(); - - state.allowYield = true; - params = parseParams(); - state.allowYield = previousAllowYield; - - state.allowYield = false; - value = parsePropertyFunction(methodNode, params, true); - state.allowYield = previousAllowYield; - - return node.finishProperty('init', key, computed, value, true, false); - } - - if (key && match('(')) { - value = parsePropertyMethodFunction(); - return node.finishProperty('init', key, computed, value, true, false); - } - - // Not a MethodDefinition. - return null; - } - - function parseObjectProperty(hasProto) { - var token = lookahead, node = new Node(), computed, key, maybeMethod, proto, value; - - computed = match('['); - if (match('*')) { - lex(); - } else { - key = parseObjectPropertyKey(); - } - maybeMethod = tryParseMethodDefinition(token, key, computed, node); - if (maybeMethod) { - return maybeMethod; - } - - if (!key) { - throwUnexpectedToken(lookahead); - } - - // Check for duplicated __proto__ - if (!computed) { - proto = (key.type === Syntax.Identifier && key.name === '__proto__') || - (key.type === Syntax.Literal && key.value === '__proto__'); - if (hasProto.value && proto) { - tolerateError(Messages.DuplicateProtoProperty); - } - hasProto.value |= proto; - } - - if (match(':')) { - lex(); - value = inheritCoverGrammar(parseAssignmentExpression); - return node.finishProperty('init', key, computed, value, false, false); - } - - if (token.type === Token.Identifier) { - if (match('=')) { - firstCoverInitializedNameError = lookahead; - lex(); - value = isolateCoverGrammar(parseAssignmentExpression); - return node.finishProperty('init', key, computed, - new WrappingNode(token).finishAssignmentPattern(key, value), false, true); - } - return node.finishProperty('init', key, computed, key, false, true); - } - - throwUnexpectedToken(lookahead); - } - - function parseObjectInitializer() { - var properties = [], hasProto = {value: false}, node = new Node(); - - expect('{'); - - while (!match('}')) { - properties.push(parseObjectProperty(hasProto)); - - if (!match('}')) { - expectCommaSeparator(); - } - } - - expect('}'); - - return node.finishObjectExpression(properties); - } - - function reinterpretExpressionAsPattern(expr) { - var i; - switch (expr.type) { - case Syntax.Identifier: - case Syntax.MemberExpression: - case Syntax.RestElement: - case Syntax.AssignmentPattern: - break; - case Syntax.SpreadElement: - expr.type = Syntax.RestElement; - reinterpretExpressionAsPattern(expr.argument); - break; - case Syntax.ArrayExpression: - expr.type = Syntax.ArrayPattern; - for (i = 0; i < expr.elements.length; i++) { - if (expr.elements[i] !== null) { - reinterpretExpressionAsPattern(expr.elements[i]); - } - } - break; - case Syntax.ObjectExpression: - expr.type = Syntax.ObjectPattern; - for (i = 0; i < expr.properties.length; i++) { - reinterpretExpressionAsPattern(expr.properties[i].value); - } - break; - case Syntax.AssignmentExpression: - expr.type = Syntax.AssignmentPattern; - reinterpretExpressionAsPattern(expr.left); - break; - default: - // Allow other node type for tolerant parsing. - break; - } - } - - // ECMA-262 12.2.9 Template Literals - - function parseTemplateElement(option) { - var node, token; - - if (lookahead.type !== Token.Template || (option.head && !lookahead.head)) { - throwUnexpectedToken(); - } - - node = new Node(); - token = lex(); - - return node.finishTemplateElement({ raw: token.value.raw, cooked: token.value.cooked }, token.tail); - } - - function parseTemplateLiteral() { - var quasi, quasis, expressions, node = new Node(); - - quasi = parseTemplateElement({ head: true }); - quasis = [quasi]; - expressions = []; - - while (!quasi.tail) { - expressions.push(parseExpression()); - quasi = parseTemplateElement({ head: false }); - quasis.push(quasi); - } - - return node.finishTemplateLiteral(quasis, expressions); - } - - // ECMA-262 12.2.10 The Grouping Operator - - function parseGroupExpression() { - var expr, expressions, startToken, i, params = []; - - expect('('); - - if (match(')')) { - lex(); - if (!match('=>')) { - expect('=>'); - } - return { - type: PlaceHolders.ArrowParameterPlaceHolder, - params: [], - rawParams: [] - }; - } - - startToken = lookahead; - if (match('...')) { - expr = parseRestElement(params); - expect(')'); - if (!match('=>')) { - expect('=>'); - } - return { - type: PlaceHolders.ArrowParameterPlaceHolder, - params: [expr] - }; - } - - isBindingElement = true; - expr = inheritCoverGrammar(parseAssignmentExpression); - - if (match(',')) { - isAssignmentTarget = false; - expressions = [expr]; - - while (startIndex < length) { - if (!match(',')) { - break; - } - lex(); - - if (match('...')) { - if (!isBindingElement) { - throwUnexpectedToken(lookahead); - } - expressions.push(parseRestElement(params)); - expect(')'); - if (!match('=>')) { - expect('=>'); - } - isBindingElement = false; - for (i = 0; i < expressions.length; i++) { - reinterpretExpressionAsPattern(expressions[i]); - } - return { - type: PlaceHolders.ArrowParameterPlaceHolder, - params: expressions - }; - } - - expressions.push(inheritCoverGrammar(parseAssignmentExpression)); - } - - expr = new WrappingNode(startToken).finishSequenceExpression(expressions); - } - - - expect(')'); - - if (match('=>')) { - if (expr.type === Syntax.Identifier && expr.name === 'yield') { - return { - type: PlaceHolders.ArrowParameterPlaceHolder, - params: [expr] - }; - } - - if (!isBindingElement) { - throwUnexpectedToken(lookahead); - } - - if (expr.type === Syntax.SequenceExpression) { - for (i = 0; i < expr.expressions.length; i++) { - reinterpretExpressionAsPattern(expr.expressions[i]); - } - } else { - reinterpretExpressionAsPattern(expr); - } - - expr = { - type: PlaceHolders.ArrowParameterPlaceHolder, - params: expr.type === Syntax.SequenceExpression ? expr.expressions : [expr] - }; - } - isBindingElement = false; - return expr; - } - - - // ECMA-262 12.2 Primary Expressions - - function parsePrimaryExpression() { - var type, token, expr, node; - - if (match('(')) { - isBindingElement = false; - return inheritCoverGrammar(parseGroupExpression); - } - - if (match('[')) { - return inheritCoverGrammar(parseArrayInitializer); - } - - if (match('{')) { - return inheritCoverGrammar(parseObjectInitializer); - } - - type = lookahead.type; - node = new Node(); - - if (type === Token.Identifier) { - if (state.sourceType === 'module' && lookahead.value === 'await') { - tolerateUnexpectedToken(lookahead); - } - expr = node.finishIdentifier(lex().value); - } else if (type === Token.StringLiteral || type === Token.NumericLiteral) { - isAssignmentTarget = isBindingElement = false; - if (strict && lookahead.octal) { - tolerateUnexpectedToken(lookahead, Messages.StrictOctalLiteral); - } - expr = node.finishLiteral(lex()); - } else if (type === Token.Keyword) { - if (!strict && state.allowYield && matchKeyword('yield')) { - return parseNonComputedProperty(); - } - if (!strict && matchKeyword('let')) { - return node.finishIdentifier(lex().value); - } - isAssignmentTarget = isBindingElement = false; - if (matchKeyword('function')) { - return parseFunctionExpression(); - } - if (matchKeyword('this')) { - lex(); - return node.finishThisExpression(); - } - if (matchKeyword('class')) { - return parseClassExpression(); - } - throwUnexpectedToken(lex()); - } else if (type === Token.BooleanLiteral) { - isAssignmentTarget = isBindingElement = false; - token = lex(); - token.value = (token.value === 'true'); - expr = node.finishLiteral(token); - } else if (type === Token.NullLiteral) { - isAssignmentTarget = isBindingElement = false; - token = lex(); - token.value = null; - expr = node.finishLiteral(token); - } else if (match('/') || match('/=')) { - isAssignmentTarget = isBindingElement = false; - index = startIndex; - - if (typeof extra.tokens !== 'undefined') { - token = collectRegex(); - } else { - token = scanRegExp(); - } - lex(); - expr = node.finishLiteral(token); - } else if (type === Token.Template) { - expr = parseTemplateLiteral(); - } else { - throwUnexpectedToken(lex()); - } - - return expr; - } - - // ECMA-262 12.3 Left-Hand-Side Expressions - - function parseArguments() { - var args = [], expr; - - expect('('); - - if (!match(')')) { - while (startIndex < length) { - if (match('...')) { - expr = new Node(); - lex(); - expr.finishSpreadElement(isolateCoverGrammar(parseAssignmentExpression)); - } else { - expr = isolateCoverGrammar(parseAssignmentExpression); - } - args.push(expr); - if (match(')')) { - break; - } - expectCommaSeparator(); - } - } - - expect(')'); - - return args; - } - - function parseNonComputedProperty() { - var token, node = new Node(); - - token = lex(); - - if (!isIdentifierName(token)) { - throwUnexpectedToken(token); - } - - return node.finishIdentifier(token.value); - } - - function parseNonComputedMember() { - expect('.'); - - return parseNonComputedProperty(); - } - - function parseComputedMember() { - var expr; - - expect('['); - - expr = isolateCoverGrammar(parseExpression); - - expect(']'); - - return expr; - } - - // ECMA-262 12.3.3 The new Operator - - function parseNewExpression() { - var callee, args, node = new Node(); - - expectKeyword('new'); - - if (match('.')) { - lex(); - if (lookahead.type === Token.Identifier && lookahead.value === 'target') { - if (state.inFunctionBody) { - lex(); - return node.finishMetaProperty('new', 'target'); - } - } - throwUnexpectedToken(lookahead); - } - - callee = isolateCoverGrammar(parseLeftHandSideExpression); - args = match('(') ? parseArguments() : []; - - isAssignmentTarget = isBindingElement = false; - - return node.finishNewExpression(callee, args); - } - - // ECMA-262 12.3.4 Function Calls - - function parseLeftHandSideExpressionAllowCall() { - var quasi, expr, args, property, startToken, previousAllowIn = state.allowIn; - - startToken = lookahead; - state.allowIn = true; - - if (matchKeyword('super') && state.inFunctionBody) { - expr = new Node(); - lex(); - expr = expr.finishSuper(); - if (!match('(') && !match('.') && !match('[')) { - throwUnexpectedToken(lookahead); - } - } else { - expr = inheritCoverGrammar(matchKeyword('new') ? parseNewExpression : parsePrimaryExpression); - } - - for (;;) { - if (match('.')) { - isBindingElement = false; - isAssignmentTarget = true; - property = parseNonComputedMember(); - expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property); - } else if (match('(')) { - isBindingElement = false; - isAssignmentTarget = false; - args = parseArguments(); - expr = new WrappingNode(startToken).finishCallExpression(expr, args); - } else if (match('[')) { - isBindingElement = false; - isAssignmentTarget = true; - property = parseComputedMember(); - expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property); - } else if (lookahead.type === Token.Template && lookahead.head) { - quasi = parseTemplateLiteral(); - expr = new WrappingNode(startToken).finishTaggedTemplateExpression(expr, quasi); - } else { - break; - } - } - state.allowIn = previousAllowIn; - - return expr; - } - - // ECMA-262 12.3 Left-Hand-Side Expressions - - function parseLeftHandSideExpression() { - var quasi, expr, property, startToken; - assert(state.allowIn, 'callee of new expression always allow in keyword.'); - - startToken = lookahead; - - if (matchKeyword('super') && state.inFunctionBody) { - expr = new Node(); - lex(); - expr = expr.finishSuper(); - if (!match('[') && !match('.')) { - throwUnexpectedToken(lookahead); - } - } else { - expr = inheritCoverGrammar(matchKeyword('new') ? parseNewExpression : parsePrimaryExpression); - } - - for (;;) { - if (match('[')) { - isBindingElement = false; - isAssignmentTarget = true; - property = parseComputedMember(); - expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property); - } else if (match('.')) { - isBindingElement = false; - isAssignmentTarget = true; - property = parseNonComputedMember(); - expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property); - } else if (lookahead.type === Token.Template && lookahead.head) { - quasi = parseTemplateLiteral(); - expr = new WrappingNode(startToken).finishTaggedTemplateExpression(expr, quasi); - } else { - break; - } - } - return expr; - } - - // ECMA-262 12.4 Postfix Expressions - - function parsePostfixExpression() { - var expr, token, startToken = lookahead; - - expr = inheritCoverGrammar(parseLeftHandSideExpressionAllowCall); - - if (!hasLineTerminator && lookahead.type === Token.Punctuator) { - if (match('++') || match('--')) { - // ECMA-262 11.3.1, 11.3.2 - if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { - tolerateError(Messages.StrictLHSPostfix); - } - - if (!isAssignmentTarget) { - tolerateError(Messages.InvalidLHSInAssignment); - } - - isAssignmentTarget = isBindingElement = false; - - token = lex(); - expr = new WrappingNode(startToken).finishPostfixExpression(token.value, expr); - } - } - - return expr; - } - - // ECMA-262 12.5 Unary Operators - - function parseUnaryExpression() { - var token, expr, startToken; - - if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) { - expr = parsePostfixExpression(); - } else if (match('++') || match('--')) { - startToken = lookahead; - token = lex(); - expr = inheritCoverGrammar(parseUnaryExpression); - // ECMA-262 11.4.4, 11.4.5 - if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { - tolerateError(Messages.StrictLHSPrefix); - } - - if (!isAssignmentTarget) { - tolerateError(Messages.InvalidLHSInAssignment); - } - expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr); - isAssignmentTarget = isBindingElement = false; - } else if (match('+') || match('-') || match('~') || match('!')) { - startToken = lookahead; - token = lex(); - expr = inheritCoverGrammar(parseUnaryExpression); - expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr); - isAssignmentTarget = isBindingElement = false; - } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) { - startToken = lookahead; - token = lex(); - expr = inheritCoverGrammar(parseUnaryExpression); - expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr); - if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) { - tolerateError(Messages.StrictDelete); - } - isAssignmentTarget = isBindingElement = false; - } else { - expr = parsePostfixExpression(); - } - - return expr; - } - - function binaryPrecedence(token, allowIn) { - var prec = 0; - - if (token.type !== Token.Punctuator && token.type !== Token.Keyword) { - return 0; - } - - switch (token.value) { - case '||': - prec = 1; - break; - - case '&&': - prec = 2; - break; - - case '|': - prec = 3; - break; - - case '^': - prec = 4; - break; - - case '&': - prec = 5; - break; - - case '==': - case '!=': - case '===': - case '!==': - prec = 6; - break; - - case '<': - case '>': - case '<=': - case '>=': - case 'instanceof': - prec = 7; - break; - - case 'in': - prec = allowIn ? 7 : 0; - break; - - case '<<': - case '>>': - case '>>>': - prec = 8; - break; - - case '+': - case '-': - prec = 9; - break; - - case '*': - case '/': - case '%': - prec = 11; - break; - - default: - break; - } - - return prec; - } - - // ECMA-262 12.6 Multiplicative Operators - // ECMA-262 12.7 Additive Operators - // ECMA-262 12.8 Bitwise Shift Operators - // ECMA-262 12.9 Relational Operators - // ECMA-262 12.10 Equality Operators - // ECMA-262 12.11 Binary Bitwise Operators - // ECMA-262 12.12 Binary Logical Operators - - function parseBinaryExpression() { - var marker, markers, expr, token, prec, stack, right, operator, left, i; - - marker = lookahead; - left = inheritCoverGrammar(parseUnaryExpression); - - token = lookahead; - prec = binaryPrecedence(token, state.allowIn); - if (prec === 0) { - return left; - } - isAssignmentTarget = isBindingElement = false; - token.prec = prec; - lex(); - - markers = [marker, lookahead]; - right = isolateCoverGrammar(parseUnaryExpression); - - stack = [left, token, right]; - - while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) { - - // Reduce: make a binary expression from the three topmost entries. - while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) { - right = stack.pop(); - operator = stack.pop().value; - left = stack.pop(); - markers.pop(); - expr = new WrappingNode(markers[markers.length - 1]).finishBinaryExpression(operator, left, right); - stack.push(expr); - } - - // Shift. - token = lex(); - token.prec = prec; - stack.push(token); - markers.push(lookahead); - expr = isolateCoverGrammar(parseUnaryExpression); - stack.push(expr); - } - - // Final reduce to clean-up the stack. - i = stack.length - 1; - expr = stack[i]; - markers.pop(); - while (i > 1) { - expr = new WrappingNode(markers.pop()).finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr); - i -= 2; - } - - return expr; - } - - - // ECMA-262 12.13 Conditional Operator - - function parseConditionalExpression() { - var expr, previousAllowIn, consequent, alternate, startToken; - - startToken = lookahead; - - expr = inheritCoverGrammar(parseBinaryExpression); - if (match('?')) { - lex(); - previousAllowIn = state.allowIn; - state.allowIn = true; - consequent = isolateCoverGrammar(parseAssignmentExpression); - state.allowIn = previousAllowIn; - expect(':'); - alternate = isolateCoverGrammar(parseAssignmentExpression); - - expr = new WrappingNode(startToken).finishConditionalExpression(expr, consequent, alternate); - isAssignmentTarget = isBindingElement = false; - } - - return expr; - } - - // ECMA-262 14.2 Arrow Function Definitions - - function parseConciseBody() { - if (match('{')) { - return parseFunctionSourceElements(); - } - return isolateCoverGrammar(parseAssignmentExpression); - } - - function checkPatternParam(options, param) { - var i; - switch (param.type) { - case Syntax.Identifier: - validateParam(options, param, param.name); - break; - case Syntax.RestElement: - checkPatternParam(options, param.argument); - break; - case Syntax.AssignmentPattern: - checkPatternParam(options, param.left); - break; - case Syntax.ArrayPattern: - for (i = 0; i < param.elements.length; i++) { - if (param.elements[i] !== null) { - checkPatternParam(options, param.elements[i]); - } - } - break; - case Syntax.YieldExpression: - break; - default: - assert(param.type === Syntax.ObjectPattern, 'Invalid type'); - for (i = 0; i < param.properties.length; i++) { - checkPatternParam(options, param.properties[i].value); - } - break; - } - } - function reinterpretAsCoverFormalsList(expr) { - var i, len, param, params, defaults, defaultCount, options, token; - - defaults = []; - defaultCount = 0; - params = [expr]; - - switch (expr.type) { - case Syntax.Identifier: - break; - case PlaceHolders.ArrowParameterPlaceHolder: - params = expr.params; - break; - default: - return null; - } - - options = { - paramSet: {} - }; - - for (i = 0, len = params.length; i < len; i += 1) { - param = params[i]; - switch (param.type) { - case Syntax.AssignmentPattern: - params[i] = param.left; - if (param.right.type === Syntax.YieldExpression) { - if (param.right.argument) { - throwUnexpectedToken(lookahead); - } - param.right.type = Syntax.Identifier; - param.right.name = 'yield'; - delete param.right.argument; - delete param.right.delegate; - } - defaults.push(param.right); - ++defaultCount; - checkPatternParam(options, param.left); - break; - default: - checkPatternParam(options, param); - params[i] = param; - defaults.push(null); - break; - } - } - - if (strict || !state.allowYield) { - for (i = 0, len = params.length; i < len; i += 1) { - param = params[i]; - if (param.type === Syntax.YieldExpression) { - throwUnexpectedToken(lookahead); - } - } - } - - if (options.message === Messages.StrictParamDupe) { - token = strict ? options.stricted : options.firstRestricted; - throwUnexpectedToken(token, options.message); - } - - if (defaultCount === 0) { - defaults = []; - } - - return { - params: params, - defaults: defaults, - stricted: options.stricted, - firstRestricted: options.firstRestricted, - message: options.message - }; - } - - function parseArrowFunctionExpression(options, node) { - var previousStrict, previousAllowYield, body; - - if (hasLineTerminator) { - tolerateUnexpectedToken(lookahead); - } - expect('=>'); - - previousStrict = strict; - previousAllowYield = state.allowYield; - state.allowYield = true; - - body = parseConciseBody(); - - if (strict && options.firstRestricted) { - throwUnexpectedToken(options.firstRestricted, options.message); - } - if (strict && options.stricted) { - tolerateUnexpectedToken(options.stricted, options.message); - } - - strict = previousStrict; - state.allowYield = previousAllowYield; - - return node.finishArrowFunctionExpression(options.params, options.defaults, body, body.type !== Syntax.BlockStatement); - } - - // ECMA-262 14.4 Yield expression - - function parseYieldExpression() { - var argument, expr, delegate, previousAllowYield; - - argument = null; - expr = new Node(); - delegate = false; - - expectKeyword('yield'); - - if (!hasLineTerminator) { - previousAllowYield = state.allowYield; - state.allowYield = false; - delegate = match('*'); - if (delegate) { - lex(); - argument = parseAssignmentExpression(); - } else { - if (!match(';') && !match('}') && !match(')') && lookahead.type !== Token.EOF) { - argument = parseAssignmentExpression(); - } - } - state.allowYield = previousAllowYield; - } - - return expr.finishYieldExpression(argument, delegate); - } - - // ECMA-262 12.14 Assignment Operators - - function parseAssignmentExpression() { - var token, expr, right, list, startToken; - - startToken = lookahead; - token = lookahead; - - if (!state.allowYield && matchKeyword('yield')) { - return parseYieldExpression(); - } - - expr = parseConditionalExpression(); - - if (expr.type === PlaceHolders.ArrowParameterPlaceHolder || match('=>')) { - isAssignmentTarget = isBindingElement = false; - list = reinterpretAsCoverFormalsList(expr); - - if (list) { - firstCoverInitializedNameError = null; - return parseArrowFunctionExpression(list, new WrappingNode(startToken)); - } - - return expr; - } - - if (matchAssign()) { - if (!isAssignmentTarget) { - tolerateError(Messages.InvalidLHSInAssignment); - } - - // ECMA-262 12.1.1 - if (strict && expr.type === Syntax.Identifier) { - if (isRestrictedWord(expr.name)) { - tolerateUnexpectedToken(token, Messages.StrictLHSAssignment); - } - if (isStrictModeReservedWord(expr.name)) { - tolerateUnexpectedToken(token, Messages.StrictReservedWord); - } - } - - if (!match('=')) { - isAssignmentTarget = isBindingElement = false; - } else { - reinterpretExpressionAsPattern(expr); - } - - token = lex(); - right = isolateCoverGrammar(parseAssignmentExpression); - expr = new WrappingNode(startToken).finishAssignmentExpression(token.value, expr, right); - firstCoverInitializedNameError = null; - } - - return expr; - } - - // ECMA-262 12.15 Comma Operator - - function parseExpression() { - var expr, startToken = lookahead, expressions; - - expr = isolateCoverGrammar(parseAssignmentExpression); - - if (match(',')) { - expressions = [expr]; - - while (startIndex < length) { - if (!match(',')) { - break; - } - lex(); - expressions.push(isolateCoverGrammar(parseAssignmentExpression)); - } - - expr = new WrappingNode(startToken).finishSequenceExpression(expressions); - } - - return expr; - } - - // ECMA-262 13.2 Block - - function parseStatementListItem() { - if (lookahead.type === Token.Keyword) { - switch (lookahead.value) { - case 'export': - if (state.sourceType !== 'module') { - tolerateUnexpectedToken(lookahead, Messages.IllegalExportDeclaration); - } - return parseExportDeclaration(); - case 'import': - if (state.sourceType !== 'module') { - tolerateUnexpectedToken(lookahead, Messages.IllegalImportDeclaration); - } - return parseImportDeclaration(); - case 'const': - return parseLexicalDeclaration({inFor: false}); - case 'function': - return parseFunctionDeclaration(new Node()); - case 'class': - return parseClassDeclaration(); - } - } - - if (matchKeyword('let') && isLexicalDeclaration()) { - return parseLexicalDeclaration({inFor: false}); - } - - return parseStatement(); - } - - function parseStatementList() { - var list = []; - while (startIndex < length) { - if (match('}')) { - break; - } - list.push(parseStatementListItem()); - } - - return list; - } - - function parseBlock() { - var block, node = new Node(); - - expect('{'); - - block = parseStatementList(); - - expect('}'); - - return node.finishBlockStatement(block); - } - - // ECMA-262 13.3.2 Variable Statement - - function parseVariableIdentifier(kind) { - var token, node = new Node(); - - token = lex(); - - if (token.type === Token.Keyword && token.value === 'yield') { - if (strict) { - tolerateUnexpectedToken(token, Messages.StrictReservedWord); - } if (!state.allowYield) { - throwUnexpectedToken(token); - } - } else if (token.type !== Token.Identifier) { - if (strict && token.type === Token.Keyword && isStrictModeReservedWord(token.value)) { - tolerateUnexpectedToken(token, Messages.StrictReservedWord); - } else { - if (strict || token.value !== 'let' || kind !== 'var') { - throwUnexpectedToken(token); - } - } - } else if (state.sourceType === 'module' && token.type === Token.Identifier && token.value === 'await') { - tolerateUnexpectedToken(token); - } - - return node.finishIdentifier(token.value); - } - - function parseVariableDeclaration(options) { - var init = null, id, node = new Node(), params = []; - - id = parsePattern(params, 'var'); - - // ECMA-262 12.2.1 - if (strict && isRestrictedWord(id.name)) { - tolerateError(Messages.StrictVarName); - } - - if (match('=')) { - lex(); - init = isolateCoverGrammar(parseAssignmentExpression); - } else if (id.type !== Syntax.Identifier && !options.inFor) { - expect('='); - } - - return node.finishVariableDeclarator(id, init); - } - - function parseVariableDeclarationList(options) { - var opt, list; - - opt = { inFor: options.inFor }; - list = [parseVariableDeclaration(opt)]; - - while (match(',')) { - lex(); - list.push(parseVariableDeclaration(opt)); - } - - return list; - } - - function parseVariableStatement(node) { - var declarations; - - expectKeyword('var'); - - declarations = parseVariableDeclarationList({ inFor: false }); - - consumeSemicolon(); - - return node.finishVariableDeclaration(declarations); - } - - // ECMA-262 13.3.1 Let and Const Declarations - - function parseLexicalBinding(kind, options) { - var init = null, id, node = new Node(), params = []; - - id = parsePattern(params, kind); - - // ECMA-262 12.2.1 - if (strict && id.type === Syntax.Identifier && isRestrictedWord(id.name)) { - tolerateError(Messages.StrictVarName); - } - - if (kind === 'const') { - if (!matchKeyword('in') && !matchContextualKeyword('of')) { - expect('='); - init = isolateCoverGrammar(parseAssignmentExpression); - } - } else if ((!options.inFor && id.type !== Syntax.Identifier) || match('=')) { - expect('='); - init = isolateCoverGrammar(parseAssignmentExpression); - } - - return node.finishVariableDeclarator(id, init); - } - - function parseBindingList(kind, options) { - var list = [parseLexicalBinding(kind, options)]; - - while (match(',')) { - lex(); - list.push(parseLexicalBinding(kind, options)); - } - - return list; - } - - - function tokenizerState() { - return { - index: index, - lineNumber: lineNumber, - lineStart: lineStart, - hasLineTerminator: hasLineTerminator, - lastIndex: lastIndex, - lastLineNumber: lastLineNumber, - lastLineStart: lastLineStart, - startIndex: startIndex, - startLineNumber: startLineNumber, - startLineStart: startLineStart, - lookahead: lookahead, - tokenCount: extra.tokens ? extra.tokens.length : 0 - }; - } - - function resetTokenizerState(ts) { - index = ts.index; - lineNumber = ts.lineNumber; - lineStart = ts.lineStart; - hasLineTerminator = ts.hasLineTerminator; - lastIndex = ts.lastIndex; - lastLineNumber = ts.lastLineNumber; - lastLineStart = ts.lastLineStart; - startIndex = ts.startIndex; - startLineNumber = ts.startLineNumber; - startLineStart = ts.startLineStart; - lookahead = ts.lookahead; - if (extra.tokens) { - extra.tokens.splice(ts.tokenCount, extra.tokens.length); - } - } - - function isLexicalDeclaration() { - var lexical, ts; - - ts = tokenizerState(); - - lex(); - lexical = (lookahead.type === Token.Identifier) || match('[') || match('{') || - matchKeyword('let') || matchKeyword('yield'); - - resetTokenizerState(ts); - - return lexical; - } - - function parseLexicalDeclaration(options) { - var kind, declarations, node = new Node(); - - kind = lex().value; - assert(kind === 'let' || kind === 'const', 'Lexical declaration must be either let or const'); - - declarations = parseBindingList(kind, options); - - consumeSemicolon(); - - return node.finishLexicalDeclaration(declarations, kind); - } - - function parseRestElement(params) { - var param, node = new Node(); - - lex(); - - if (match('{')) { - throwError(Messages.ObjectPatternAsRestParameter); - } - - params.push(lookahead); - - param = parseVariableIdentifier(); - - if (match('=')) { - throwError(Messages.DefaultRestParameter); - } - - if (!match(')')) { - throwError(Messages.ParameterAfterRestParameter); - } - - return node.finishRestElement(param); - } - - // ECMA-262 13.4 Empty Statement - - function parseEmptyStatement(node) { - expect(';'); - return node.finishEmptyStatement(); - } - - // ECMA-262 12.4 Expression Statement - - function parseExpressionStatement(node) { - var expr = parseExpression(); - consumeSemicolon(); - return node.finishExpressionStatement(expr); - } - - // ECMA-262 13.6 If statement - - function parseIfStatement(node) { - var test, consequent, alternate; - - expectKeyword('if'); - - expect('('); - - test = parseExpression(); - - expect(')'); - - consequent = parseStatement(); - - if (matchKeyword('else')) { - lex(); - alternate = parseStatement(); - } else { - alternate = null; - } - - return node.finishIfStatement(test, consequent, alternate); - } - - // ECMA-262 13.7 Iteration Statements - - function parseDoWhileStatement(node) { - var body, test, oldInIteration; - - expectKeyword('do'); - - oldInIteration = state.inIteration; - state.inIteration = true; - - body = parseStatement(); - - state.inIteration = oldInIteration; - - expectKeyword('while'); - - expect('('); - - test = parseExpression(); - - expect(')'); - - if (match(';')) { - lex(); - } - - return node.finishDoWhileStatement(body, test); - } - - function parseWhileStatement(node) { - var test, body, oldInIteration; - - expectKeyword('while'); - - expect('('); - - test = parseExpression(); - - expect(')'); - - oldInIteration = state.inIteration; - state.inIteration = true; - - body = parseStatement(); - - state.inIteration = oldInIteration; - - return node.finishWhileStatement(test, body); - } - - function parseForStatement(node) { - var init, forIn, initSeq, initStartToken, test, update, left, right, kind, declarations, - body, oldInIteration, previousAllowIn = state.allowIn; - - init = test = update = null; - forIn = true; - - expectKeyword('for'); - - expect('('); - - if (match(';')) { - lex(); - } else { - if (matchKeyword('var')) { - init = new Node(); - lex(); - - state.allowIn = false; - declarations = parseVariableDeclarationList({ inFor: true }); - state.allowIn = previousAllowIn; - - if (declarations.length === 1 && matchKeyword('in')) { - init = init.finishVariableDeclaration(declarations); - lex(); - left = init; - right = parseExpression(); - init = null; - } else if (declarations.length === 1 && declarations[0].init === null && matchContextualKeyword('of')) { - init = init.finishVariableDeclaration(declarations); - lex(); - left = init; - right = parseAssignmentExpression(); - init = null; - forIn = false; - } else { - init = init.finishVariableDeclaration(declarations); - expect(';'); - } - } else if (matchKeyword('const') || matchKeyword('let')) { - init = new Node(); - kind = lex().value; - - if (!strict && lookahead.value === 'in') { - init = init.finishIdentifier(kind); - lex(); - left = init; - right = parseExpression(); - init = null; - } else { - state.allowIn = false; - declarations = parseBindingList(kind, {inFor: true}); - state.allowIn = previousAllowIn; - - if (declarations.length === 1 && declarations[0].init === null && matchKeyword('in')) { - init = init.finishLexicalDeclaration(declarations, kind); - lex(); - left = init; - right = parseExpression(); - init = null; - } else if (declarations.length === 1 && declarations[0].init === null && matchContextualKeyword('of')) { - init = init.finishLexicalDeclaration(declarations, kind); - lex(); - left = init; - right = parseAssignmentExpression(); - init = null; - forIn = false; - } else { - consumeSemicolon(); - init = init.finishLexicalDeclaration(declarations, kind); - } - } - } else { - initStartToken = lookahead; - state.allowIn = false; - init = inheritCoverGrammar(parseAssignmentExpression); - state.allowIn = previousAllowIn; - - if (matchKeyword('in')) { - if (!isAssignmentTarget) { - tolerateError(Messages.InvalidLHSInForIn); - } - - lex(); - reinterpretExpressionAsPattern(init); - left = init; - right = parseExpression(); - init = null; - } else if (matchContextualKeyword('of')) { - if (!isAssignmentTarget) { - tolerateError(Messages.InvalidLHSInForLoop); - } - - lex(); - reinterpretExpressionAsPattern(init); - left = init; - right = parseAssignmentExpression(); - init = null; - forIn = false; - } else { - if (match(',')) { - initSeq = [init]; - while (match(',')) { - lex(); - initSeq.push(isolateCoverGrammar(parseAssignmentExpression)); - } - init = new WrappingNode(initStartToken).finishSequenceExpression(initSeq); - } - expect(';'); - } - } - } - - if (typeof left === 'undefined') { - - if (!match(';')) { - test = parseExpression(); - } - expect(';'); - - if (!match(')')) { - update = parseExpression(); - } - } - - expect(')'); - - oldInIteration = state.inIteration; - state.inIteration = true; - - body = isolateCoverGrammar(parseStatement); - - state.inIteration = oldInIteration; - - return (typeof left === 'undefined') ? - node.finishForStatement(init, test, update, body) : - forIn ? node.finishForInStatement(left, right, body) : - node.finishForOfStatement(left, right, body); - } - - // ECMA-262 13.8 The continue statement - - function parseContinueStatement(node) { - var label = null, key; - - expectKeyword('continue'); - - // Optimize the most common form: 'continue;'. - if (source.charCodeAt(startIndex) === 0x3B) { - lex(); - - if (!state.inIteration) { - throwError(Messages.IllegalContinue); - } - - return node.finishContinueStatement(null); - } - - if (hasLineTerminator) { - if (!state.inIteration) { - throwError(Messages.IllegalContinue); - } - - return node.finishContinueStatement(null); - } - - if (lookahead.type === Token.Identifier) { - label = parseVariableIdentifier(); - - key = '$' + label.name; - if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) { - throwError(Messages.UnknownLabel, label.name); - } - } - - consumeSemicolon(); - - if (label === null && !state.inIteration) { - throwError(Messages.IllegalContinue); - } - - return node.finishContinueStatement(label); - } - - // ECMA-262 13.9 The break statement - - function parseBreakStatement(node) { - var label = null, key; - - expectKeyword('break'); - - // Catch the very common case first: immediately a semicolon (U+003B). - if (source.charCodeAt(lastIndex) === 0x3B) { - lex(); - - if (!(state.inIteration || state.inSwitch)) { - throwError(Messages.IllegalBreak); - } - - return node.finishBreakStatement(null); - } - - if (hasLineTerminator) { - if (!(state.inIteration || state.inSwitch)) { - throwError(Messages.IllegalBreak); - } - } else if (lookahead.type === Token.Identifier) { - label = parseVariableIdentifier(); - - key = '$' + label.name; - if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) { - throwError(Messages.UnknownLabel, label.name); - } - } - - consumeSemicolon(); - - if (label === null && !(state.inIteration || state.inSwitch)) { - throwError(Messages.IllegalBreak); - } - - return node.finishBreakStatement(label); - } - - // ECMA-262 13.10 The return statement - - function parseReturnStatement(node) { - var argument = null; - - expectKeyword('return'); - - if (!state.inFunctionBody) { - tolerateError(Messages.IllegalReturn); - } - - // 'return' followed by a space and an identifier is very common. - if (source.charCodeAt(lastIndex) === 0x20) { - if (isIdentifierStart(source.charCodeAt(lastIndex + 1))) { - argument = parseExpression(); - consumeSemicolon(); - return node.finishReturnStatement(argument); - } - } - - if (hasLineTerminator) { - // HACK - return node.finishReturnStatement(null); - } - - if (!match(';')) { - if (!match('}') && lookahead.type !== Token.EOF) { - argument = parseExpression(); - } - } - - consumeSemicolon(); - - return node.finishReturnStatement(argument); - } - - // ECMA-262 13.11 The with statement - - function parseWithStatement(node) { - var object, body; - - if (strict) { - tolerateError(Messages.StrictModeWith); - } - - expectKeyword('with'); - - expect('('); - - object = parseExpression(); - - expect(')'); - - body = parseStatement(); - - return node.finishWithStatement(object, body); - } - - // ECMA-262 13.12 The switch statement - - function parseSwitchCase() { - var test, consequent = [], statement, node = new Node(); - - if (matchKeyword('default')) { - lex(); - test = null; - } else { - expectKeyword('case'); - test = parseExpression(); - } - expect(':'); - - while (startIndex < length) { - if (match('}') || matchKeyword('default') || matchKeyword('case')) { - break; - } - statement = parseStatementListItem(); - consequent.push(statement); - } - - return node.finishSwitchCase(test, consequent); - } - - function parseSwitchStatement(node) { - var discriminant, cases, clause, oldInSwitch, defaultFound; - - expectKeyword('switch'); - - expect('('); - - discriminant = parseExpression(); - - expect(')'); - - expect('{'); - - cases = []; - - if (match('}')) { - lex(); - return node.finishSwitchStatement(discriminant, cases); - } - - oldInSwitch = state.inSwitch; - state.inSwitch = true; - defaultFound = false; - - while (startIndex < length) { - if (match('}')) { - break; - } - clause = parseSwitchCase(); - if (clause.test === null) { - if (defaultFound) { - throwError(Messages.MultipleDefaultsInSwitch); - } - defaultFound = true; - } - cases.push(clause); - } - - state.inSwitch = oldInSwitch; - - expect('}'); - - return node.finishSwitchStatement(discriminant, cases); - } - - // ECMA-262 13.14 The throw statement - - function parseThrowStatement(node) { - var argument; - - expectKeyword('throw'); - - if (hasLineTerminator) { - throwError(Messages.NewlineAfterThrow); - } - - argument = parseExpression(); - - consumeSemicolon(); - - return node.finishThrowStatement(argument); - } - - // ECMA-262 13.15 The try statement - - function parseCatchClause() { - var param, params = [], paramMap = {}, key, i, body, node = new Node(); - - expectKeyword('catch'); - - expect('('); - if (match(')')) { - throwUnexpectedToken(lookahead); - } - - param = parsePattern(params); - for (i = 0; i < params.length; i++) { - key = '$' + params[i].value; - if (Object.prototype.hasOwnProperty.call(paramMap, key)) { - tolerateError(Messages.DuplicateBinding, params[i].value); - } - paramMap[key] = true; - } - - // ECMA-262 12.14.1 - if (strict && isRestrictedWord(param.name)) { - tolerateError(Messages.StrictCatchVariable); - } - - expect(')'); - body = parseBlock(); - return node.finishCatchClause(param, body); - } - - function parseTryStatement(node) { - var block, handler = null, finalizer = null; - - expectKeyword('try'); - - block = parseBlock(); - - if (matchKeyword('catch')) { - handler = parseCatchClause(); - } - - if (matchKeyword('finally')) { - lex(); - finalizer = parseBlock(); - } - - if (!handler && !finalizer) { - throwError(Messages.NoCatchOrFinally); - } - - return node.finishTryStatement(block, handler, finalizer); - } - - // ECMA-262 13.16 The debugger statement - - function parseDebuggerStatement(node) { - expectKeyword('debugger'); - - consumeSemicolon(); - - return node.finishDebuggerStatement(); - } - - // 13 Statements - - function parseStatement() { - var type = lookahead.type, - expr, - labeledBody, - key, - node; - - if (type === Token.EOF) { - throwUnexpectedToken(lookahead); - } - - if (type === Token.Punctuator && lookahead.value === '{') { - return parseBlock(); - } - isAssignmentTarget = isBindingElement = true; - node = new Node(); - - if (type === Token.Punctuator) { - switch (lookahead.value) { - case ';': - return parseEmptyStatement(node); - case '(': - return parseExpressionStatement(node); - default: - break; - } - } else if (type === Token.Keyword) { - switch (lookahead.value) { - case 'break': - return parseBreakStatement(node); - case 'continue': - return parseContinueStatement(node); - case 'debugger': - return parseDebuggerStatement(node); - case 'do': - return parseDoWhileStatement(node); - case 'for': - return parseForStatement(node); - case 'function': - return parseFunctionDeclaration(node); - case 'if': - return parseIfStatement(node); - case 'return': - return parseReturnStatement(node); - case 'switch': - return parseSwitchStatement(node); - case 'throw': - return parseThrowStatement(node); - case 'try': - return parseTryStatement(node); - case 'var': - return parseVariableStatement(node); - case 'while': - return parseWhileStatement(node); - case 'with': - return parseWithStatement(node); - default: - break; - } - } - - expr = parseExpression(); - - // ECMA-262 12.12 Labelled Statements - if ((expr.type === Syntax.Identifier) && match(':')) { - lex(); - - key = '$' + expr.name; - if (Object.prototype.hasOwnProperty.call(state.labelSet, key)) { - throwError(Messages.Redeclaration, 'Label', expr.name); - } - - state.labelSet[key] = true; - labeledBody = parseStatement(); - delete state.labelSet[key]; - return node.finishLabeledStatement(expr, labeledBody); - } - - consumeSemicolon(); - - return node.finishExpressionStatement(expr); - } - - // ECMA-262 14.1 Function Definition - - function parseFunctionSourceElements() { - var statement, body = [], token, directive, firstRestricted, - oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, - node = new Node(); - - expect('{'); - - while (startIndex < length) { - if (lookahead.type !== Token.StringLiteral) { - break; - } - token = lookahead; - - statement = parseStatementListItem(); - body.push(statement); - if (statement.expression.type !== Syntax.Literal) { - // this is not directive - break; - } - directive = source.slice(token.start + 1, token.end - 1); - if (directive === 'use strict') { - strict = true; - if (firstRestricted) { - tolerateUnexpectedToken(firstRestricted, Messages.StrictOctalLiteral); - } - } else { - if (!firstRestricted && token.octal) { - firstRestricted = token; - } - } - } - - oldLabelSet = state.labelSet; - oldInIteration = state.inIteration; - oldInSwitch = state.inSwitch; - oldInFunctionBody = state.inFunctionBody; - - state.labelSet = {}; - state.inIteration = false; - state.inSwitch = false; - state.inFunctionBody = true; - - while (startIndex < length) { - if (match('}')) { - break; - } - body.push(parseStatementListItem()); - } - - expect('}'); - - state.labelSet = oldLabelSet; - state.inIteration = oldInIteration; - state.inSwitch = oldInSwitch; - state.inFunctionBody = oldInFunctionBody; - - return node.finishBlockStatement(body); - } - - function validateParam(options, param, name) { - var key = '$' + name; - if (strict) { - if (isRestrictedWord(name)) { - options.stricted = param; - options.message = Messages.StrictParamName; - } - if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { - options.stricted = param; - options.message = Messages.StrictParamDupe; - } - } else if (!options.firstRestricted) { - if (isRestrictedWord(name)) { - options.firstRestricted = param; - options.message = Messages.StrictParamName; - } else if (isStrictModeReservedWord(name)) { - options.firstRestricted = param; - options.message = Messages.StrictReservedWord; - } else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { - options.stricted = param; - options.message = Messages.StrictParamDupe; - } - } - options.paramSet[key] = true; - } - - function parseParam(options) { - var token, param, params = [], i, def; - - token = lookahead; - if (token.value === '...') { - param = parseRestElement(params); - validateParam(options, param.argument, param.argument.name); - options.params.push(param); - options.defaults.push(null); - return false; - } - - param = parsePatternWithDefault(params); - for (i = 0; i < params.length; i++) { - validateParam(options, params[i], params[i].value); - } - - if (param.type === Syntax.AssignmentPattern) { - def = param.right; - param = param.left; - ++options.defaultCount; - } - - options.params.push(param); - options.defaults.push(def); - - return !match(')'); - } - - function parseParams(firstRestricted) { - var options; - - options = { - params: [], - defaultCount: 0, - defaults: [], - firstRestricted: firstRestricted - }; - - expect('('); - - if (!match(')')) { - options.paramSet = {}; - while (startIndex < length) { - if (!parseParam(options)) { - break; - } - expect(','); - } - } - - expect(')'); - - if (options.defaultCount === 0) { - options.defaults = []; - } - - return { - params: options.params, - defaults: options.defaults, - stricted: options.stricted, - firstRestricted: options.firstRestricted, - message: options.message - }; - } - - function parseFunctionDeclaration(node, identifierIsOptional) { - var id = null, params = [], defaults = [], body, token, stricted, tmp, firstRestricted, message, previousStrict, - isGenerator, previousAllowYield; - - previousAllowYield = state.allowYield; - - expectKeyword('function'); - - isGenerator = match('*'); - if (isGenerator) { - lex(); - } - - if (!identifierIsOptional || !match('(')) { - token = lookahead; - id = parseVariableIdentifier(); - if (strict) { - if (isRestrictedWord(token.value)) { - tolerateUnexpectedToken(token, Messages.StrictFunctionName); - } - } else { - if (isRestrictedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictFunctionName; - } else if (isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictReservedWord; - } - } - } - - state.allowYield = !isGenerator; - tmp = parseParams(firstRestricted); - params = tmp.params; - defaults = tmp.defaults; - stricted = tmp.stricted; - firstRestricted = tmp.firstRestricted; - if (tmp.message) { - message = tmp.message; - } - - - previousStrict = strict; - body = parseFunctionSourceElements(); - if (strict && firstRestricted) { - throwUnexpectedToken(firstRestricted, message); - } - if (strict && stricted) { - tolerateUnexpectedToken(stricted, message); - } - - strict = previousStrict; - state.allowYield = previousAllowYield; - - return node.finishFunctionDeclaration(id, params, defaults, body, isGenerator); - } - - function parseFunctionExpression() { - var token, id = null, stricted, firstRestricted, message, tmp, - params = [], defaults = [], body, previousStrict, node = new Node(), - isGenerator, previousAllowYield; - - previousAllowYield = state.allowYield; - - expectKeyword('function'); - - isGenerator = match('*'); - if (isGenerator) { - lex(); - } - - state.allowYield = !isGenerator; - if (!match('(')) { - token = lookahead; - id = (!strict && !isGenerator && matchKeyword('yield')) ? parseNonComputedProperty() : parseVariableIdentifier(); - if (strict) { - if (isRestrictedWord(token.value)) { - tolerateUnexpectedToken(token, Messages.StrictFunctionName); - } - } else { - if (isRestrictedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictFunctionName; - } else if (isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictReservedWord; - } - } - } - - tmp = parseParams(firstRestricted); - params = tmp.params; - defaults = tmp.defaults; - stricted = tmp.stricted; - firstRestricted = tmp.firstRestricted; - if (tmp.message) { - message = tmp.message; - } - - previousStrict = strict; - body = parseFunctionSourceElements(); - if (strict && firstRestricted) { - throwUnexpectedToken(firstRestricted, message); - } - if (strict && stricted) { - tolerateUnexpectedToken(stricted, message); - } - strict = previousStrict; - state.allowYield = previousAllowYield; - - return node.finishFunctionExpression(id, params, defaults, body, isGenerator); - } - - // ECMA-262 14.5 Class Definitions - - function parseClassBody() { - var classBody, token, isStatic, hasConstructor = false, body, method, computed, key; - - classBody = new Node(); - - expect('{'); - body = []; - while (!match('}')) { - if (match(';')) { - lex(); - } else { - method = new Node(); - token = lookahead; - isStatic = false; - computed = match('['); - if (match('*')) { - lex(); - } else { - key = parseObjectPropertyKey(); - if (key.name === 'static' && (lookaheadPropertyName() || match('*'))) { - token = lookahead; - isStatic = true; - computed = match('['); - if (match('*')) { - lex(); - } else { - key = parseObjectPropertyKey(); - } - } - } - method = tryParseMethodDefinition(token, key, computed, method); - if (method) { - method['static'] = isStatic; // jscs:ignore requireDotNotation - if (method.kind === 'init') { - method.kind = 'method'; - } - if (!isStatic) { - if (!method.computed && (method.key.name || method.key.value.toString()) === 'constructor') { - if (method.kind !== 'method' || !method.method || method.value.generator) { - throwUnexpectedToken(token, Messages.ConstructorSpecialMethod); - } - if (hasConstructor) { - throwUnexpectedToken(token, Messages.DuplicateConstructor); - } else { - hasConstructor = true; - } - method.kind = 'constructor'; - } - } else { - if (!method.computed && (method.key.name || method.key.value.toString()) === 'prototype') { - throwUnexpectedToken(token, Messages.StaticPrototype); - } - } - method.type = Syntax.MethodDefinition; - delete method.method; - delete method.shorthand; - body.push(method); - } else { - throwUnexpectedToken(lookahead); - } - } - } - lex(); - return classBody.finishClassBody(body); - } - - function parseClassDeclaration(identifierIsOptional) { - var id = null, superClass = null, classNode = new Node(), classBody, previousStrict = strict; - strict = true; - - expectKeyword('class'); - - if (!identifierIsOptional || lookahead.type === Token.Identifier) { - id = parseVariableIdentifier(); - } - - if (matchKeyword('extends')) { - lex(); - superClass = isolateCoverGrammar(parseLeftHandSideExpressionAllowCall); - } - classBody = parseClassBody(); - strict = previousStrict; - - return classNode.finishClassDeclaration(id, superClass, classBody); - } - - function parseClassExpression() { - var id = null, superClass = null, classNode = new Node(), classBody, previousStrict = strict; - strict = true; - - expectKeyword('class'); - - if (lookahead.type === Token.Identifier) { - id = parseVariableIdentifier(); - } - - if (matchKeyword('extends')) { - lex(); - superClass = isolateCoverGrammar(parseLeftHandSideExpressionAllowCall); - } - classBody = parseClassBody(); - strict = previousStrict; - - return classNode.finishClassExpression(id, superClass, classBody); - } - - // ECMA-262 15.2 Modules - - function parseModuleSpecifier() { - var node = new Node(); - - if (lookahead.type !== Token.StringLiteral) { - throwError(Messages.InvalidModuleSpecifier); - } - return node.finishLiteral(lex()); - } - - // ECMA-262 15.2.3 Exports - - function parseExportSpecifier() { - var exported, local, node = new Node(), def; - if (matchKeyword('default')) { - // export {default} from 'something'; - def = new Node(); - lex(); - local = def.finishIdentifier('default'); - } else { - local = parseVariableIdentifier(); - } - if (matchContextualKeyword('as')) { - lex(); - exported = parseNonComputedProperty(); - } - return node.finishExportSpecifier(local, exported); - } - - function parseExportNamedDeclaration(node) { - var declaration = null, - isExportFromIdentifier, - src = null, specifiers = []; - - // non-default export - if (lookahead.type === Token.Keyword) { - // covers: - // export var f = 1; - switch (lookahead.value) { - case 'let': - case 'const': - declaration = parseLexicalDeclaration({inFor: false}); - return node.finishExportNamedDeclaration(declaration, specifiers, null); - case 'var': - case 'class': - case 'function': - declaration = parseStatementListItem(); - return node.finishExportNamedDeclaration(declaration, specifiers, null); - } - } - - expect('{'); - while (!match('}')) { - isExportFromIdentifier = isExportFromIdentifier || matchKeyword('default'); - specifiers.push(parseExportSpecifier()); - if (!match('}')) { - expect(','); - if (match('}')) { - break; - } - } - } - expect('}'); - - if (matchContextualKeyword('from')) { - // covering: - // export {default} from 'foo'; - // export {foo} from 'foo'; - lex(); - src = parseModuleSpecifier(); - consumeSemicolon(); - } else if (isExportFromIdentifier) { - // covering: - // export {default}; // missing fromClause - throwError(lookahead.value ? - Messages.UnexpectedToken : Messages.MissingFromClause, lookahead.value); - } else { - // cover - // export {foo}; - consumeSemicolon(); - } - return node.finishExportNamedDeclaration(declaration, specifiers, src); - } - - function parseExportDefaultDeclaration(node) { - var declaration = null, - expression = null; - - // covers: - // export default ... - expectKeyword('default'); - - if (matchKeyword('function')) { - // covers: - // export default function foo () {} - // export default function () {} - declaration = parseFunctionDeclaration(new Node(), true); - return node.finishExportDefaultDeclaration(declaration); - } - if (matchKeyword('class')) { - declaration = parseClassDeclaration(true); - return node.finishExportDefaultDeclaration(declaration); - } - - if (matchContextualKeyword('from')) { - throwError(Messages.UnexpectedToken, lookahead.value); - } - - // covers: - // export default {}; - // export default []; - // export default (1 + 2); - if (match('{')) { - expression = parseObjectInitializer(); - } else if (match('[')) { - expression = parseArrayInitializer(); - } else { - expression = parseAssignmentExpression(); - } - consumeSemicolon(); - return node.finishExportDefaultDeclaration(expression); - } - - function parseExportAllDeclaration(node) { - var src; - - // covers: - // export * from 'foo'; - expect('*'); - if (!matchContextualKeyword('from')) { - throwError(lookahead.value ? - Messages.UnexpectedToken : Messages.MissingFromClause, lookahead.value); - } - lex(); - src = parseModuleSpecifier(); - consumeSemicolon(); - - return node.finishExportAllDeclaration(src); - } - - function parseExportDeclaration() { - var node = new Node(); - if (state.inFunctionBody) { - throwError(Messages.IllegalExportDeclaration); - } - - expectKeyword('export'); - - if (matchKeyword('default')) { - return parseExportDefaultDeclaration(node); - } - if (match('*')) { - return parseExportAllDeclaration(node); - } - return parseExportNamedDeclaration(node); - } - - // ECMA-262 15.2.2 Imports - - function parseImportSpecifier() { - // import {} ...; - var local, imported, node = new Node(); - - imported = parseNonComputedProperty(); - if (matchContextualKeyword('as')) { - lex(); - local = parseVariableIdentifier(); - } - - return node.finishImportSpecifier(local, imported); - } - - function parseNamedImports() { - var specifiers = []; - // {foo, bar as bas} - expect('{'); - while (!match('}')) { - specifiers.push(parseImportSpecifier()); - if (!match('}')) { - expect(','); - if (match('}')) { - break; - } - } - } - expect('}'); - return specifiers; - } - - function parseImportDefaultSpecifier() { - // import ...; - var local, node = new Node(); - - local = parseNonComputedProperty(); - - return node.finishImportDefaultSpecifier(local); - } - - function parseImportNamespaceSpecifier() { - // import <* as foo> ...; - var local, node = new Node(); - - expect('*'); - if (!matchContextualKeyword('as')) { - throwError(Messages.NoAsAfterImportNamespace); - } - lex(); - local = parseNonComputedProperty(); - - return node.finishImportNamespaceSpecifier(local); - } - - function parseImportDeclaration() { - var specifiers = [], src, node = new Node(); - - if (state.inFunctionBody) { - throwError(Messages.IllegalImportDeclaration); - } - - expectKeyword('import'); - - if (lookahead.type === Token.StringLiteral) { - // import 'foo'; - src = parseModuleSpecifier(); - } else { - - if (match('{')) { - // import {bar} - specifiers = specifiers.concat(parseNamedImports()); - } else if (match('*')) { - // import * as foo - specifiers.push(parseImportNamespaceSpecifier()); - } else if (isIdentifierName(lookahead) && !matchKeyword('default')) { - // import foo - specifiers.push(parseImportDefaultSpecifier()); - if (match(',')) { - lex(); - if (match('*')) { - // import foo, * as foo - specifiers.push(parseImportNamespaceSpecifier()); - } else if (match('{')) { - // import foo, {bar} - specifiers = specifiers.concat(parseNamedImports()); - } else { - throwUnexpectedToken(lookahead); - } - } - } else { - throwUnexpectedToken(lex()); - } - - if (!matchContextualKeyword('from')) { - throwError(lookahead.value ? - Messages.UnexpectedToken : Messages.MissingFromClause, lookahead.value); - } - lex(); - src = parseModuleSpecifier(); - } - - consumeSemicolon(); - return node.finishImportDeclaration(specifiers, src); - } - - // ECMA-262 15.1 Scripts - - function parseScriptBody() { - var statement, body = [], token, directive, firstRestricted; - - while (startIndex < length) { - token = lookahead; - if (token.type !== Token.StringLiteral) { - break; - } - - statement = parseStatementListItem(); - body.push(statement); - if (statement.expression.type !== Syntax.Literal) { - // this is not directive - break; - } - directive = source.slice(token.start + 1, token.end - 1); - if (directive === 'use strict') { - strict = true; - if (firstRestricted) { - tolerateUnexpectedToken(firstRestricted, Messages.StrictOctalLiteral); - } - } else { - if (!firstRestricted && token.octal) { - firstRestricted = token; - } - } - } - - while (startIndex < length) { - statement = parseStatementListItem(); - /* istanbul ignore if */ - if (typeof statement === 'undefined') { - break; - } - body.push(statement); - } - return body; - } - - function parseProgram() { - var body, node; - - peek(); - node = new Node(); - - body = parseScriptBody(); - return node.finishProgram(body, state.sourceType); - } - - function filterTokenLocation() { - var i, entry, token, tokens = []; - - for (i = 0; i < extra.tokens.length; ++i) { - entry = extra.tokens[i]; - token = { - type: entry.type, - value: entry.value - }; - if (entry.regex) { - token.regex = { - pattern: entry.regex.pattern, - flags: entry.regex.flags - }; - } - if (extra.range) { - token.range = entry.range; - } - if (extra.loc) { - token.loc = entry.loc; - } - tokens.push(token); - } - - extra.tokens = tokens; - } - - function tokenize(code, options, delegate) { - var toString, - tokens; - - toString = String; - if (typeof code !== 'string' && !(code instanceof String)) { - code = toString(code); - } - - source = code; - index = 0; - lineNumber = (source.length > 0) ? 1 : 0; - lineStart = 0; - startIndex = index; - startLineNumber = lineNumber; - startLineStart = lineStart; - length = source.length; - lookahead = null; - state = { - allowIn: true, - allowYield: true, - labelSet: {}, - inFunctionBody: false, - inIteration: false, - inSwitch: false, - lastCommentStart: -1, - curlyStack: [] - }; - - extra = {}; - - // Options matching. - options = options || {}; - - // Of course we collect tokens here. - options.tokens = true; - extra.tokens = []; - extra.tokenValues = []; - extra.tokenize = true; - extra.delegate = delegate; - - // The following two fields are necessary to compute the Regex tokens. - extra.openParenToken = -1; - extra.openCurlyToken = -1; - - extra.range = (typeof options.range === 'boolean') && options.range; - extra.loc = (typeof options.loc === 'boolean') && options.loc; - - if (typeof options.comment === 'boolean' && options.comment) { - extra.comments = []; - } - if (typeof options.tolerant === 'boolean' && options.tolerant) { - extra.errors = []; - } - - try { - peek(); - if (lookahead.type === Token.EOF) { - return extra.tokens; - } - - lex(); - while (lookahead.type !== Token.EOF) { - try { - lex(); - } catch (lexError) { - if (extra.errors) { - recordError(lexError); - // We have to break on the first error - // to avoid infinite loops. - break; - } else { - throw lexError; - } - } - } - - tokens = extra.tokens; - if (typeof extra.errors !== 'undefined') { - tokens.errors = extra.errors; - } - } catch (e) { - throw e; - } finally { - extra = {}; - } - return tokens; - } - - function parse(code, options) { - var program, toString; - - toString = String; - if (typeof code !== 'string' && !(code instanceof String)) { - code = toString(code); - } - - source = code; - index = 0; - lineNumber = (source.length > 0) ? 1 : 0; - lineStart = 0; - startIndex = index; - startLineNumber = lineNumber; - startLineStart = lineStart; - length = source.length; - lookahead = null; - state = { - allowIn: true, - allowYield: true, - labelSet: {}, - inFunctionBody: false, - inIteration: false, - inSwitch: false, - lastCommentStart: -1, - curlyStack: [], - sourceType: 'script' - }; - strict = false; - - extra = {}; - if (typeof options !== 'undefined') { - extra.range = (typeof options.range === 'boolean') && options.range; - extra.loc = (typeof options.loc === 'boolean') && options.loc; - extra.attachComment = (typeof options.attachComment === 'boolean') && options.attachComment; - - if (extra.loc && options.source !== null && options.source !== undefined) { - extra.source = toString(options.source); - } - - if (typeof options.tokens === 'boolean' && options.tokens) { - extra.tokens = []; - } - if (typeof options.comment === 'boolean' && options.comment) { - extra.comments = []; - } - if (typeof options.tolerant === 'boolean' && options.tolerant) { - extra.errors = []; - } - if (extra.attachComment) { - extra.range = true; - extra.comments = []; - extra.bottomRightStack = []; - extra.trailingComments = []; - extra.leadingComments = []; - } - if (options.sourceType === 'module') { - // very restrictive condition for now - state.sourceType = options.sourceType; - strict = true; - } - } - - try { - program = parseProgram(); - if (typeof extra.comments !== 'undefined') { - program.comments = extra.comments; - } - if (typeof extra.tokens !== 'undefined') { - filterTokenLocation(); - program.tokens = extra.tokens; - } - if (typeof extra.errors !== 'undefined') { - program.errors = extra.errors; - } - } catch (e) { - throw e; - } finally { - extra = {}; - } - - return program; - } - - // Sync with *.json manifests. - exports.version = '2.7.2'; - - exports.tokenize = tokenize; - - exports.parse = parse; - - // Deep copy. - /* istanbul ignore next */ - exports.Syntax = (function () { - var name, types = {}; - - if (typeof Object.create === 'function') { - types = Object.create(null); - } - - for (name in Syntax) { - if (Syntax.hasOwnProperty(name)) { - types[name] = Syntax[name]; - } - } - - if (typeof Object.freeze === 'function') { - Object.freeze(types); - } - - return types; - }()); - -})); -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/eslint/node_modules/js-yaml/node_modules/esprima/package.json b/node_modules/eslint/node_modules/js-yaml/node_modules/esprima/package.json deleted file mode 100644 index 8927d26..0000000 --- a/node_modules/eslint/node_modules/js-yaml/node_modules/esprima/package.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "name": "esprima", - "description": "ECMAScript parsing infrastructure for multipurpose analysis", - "homepage": "http://esprima.org", - "main": "esprima.js", - "bin": { - "esparse": "./bin/esparse.js", - "esvalidate": "./bin/esvalidate.js" - }, - "version": "2.7.2", - "files": [ - "bin", - "unit-tests.js", - "esprima.js" - ], - "engines": { - "node": ">=0.10.0" - }, - "author": { - "name": "Ariya Hidayat", - "email": "ariya.hidayat@gmail.com" - }, - "maintainers": [ - { - "name": "ariya", - "email": "ariya.hidayat@gmail.com" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/jquery/esprima.git" - }, - "bugs": { - "url": "https://github.com/jquery/esprima/issues" - }, - "license": "BSD-2-Clause", - "devDependencies": { - "codecov.io": "~0.1.6", - "escomplex-js": "1.2.0", - "eslint": "~1.7.2", - "everything.js": "~1.0.3", - "glob": "^5.0.15", - "istanbul": "~0.4.0", - "jscs": "~2.3.5", - "json-diff": "~0.3.1", - "karma": "^0.13.11", - "karma-chrome-launcher": "^0.2.1", - "karma-detect-browsers": "^2.0.2", - "karma-firefox-launcher": "^0.1.6", - "karma-ie-launcher": "^0.2.0", - "karma-mocha": "^0.2.0", - "karma-safari-launcher": "^0.1.1", - "karma-sauce-launcher": "^0.2.14", - "lodash": "^3.10.0", - "mocha": "^2.3.3", - "node-tick-processor": "~0.0.2", - "regenerate": "~1.2.1", - "temp": "~0.8.3", - "unicode-7.0.0": "~0.1.5" - }, - "keywords": [ - "ast", - "ecmascript", - "javascript", - "parser", - "syntax" - ], - "scripts": { - "check-version": "node test/check-version.js", - "jscs": "jscs -p crockford esprima.js && jscs -p crockford test/*.js", - "eslint": "node node_modules/eslint/bin/eslint.js -c .lintrc esprima.js", - "complexity": "node test/check-complexity.js", - "static-analysis": "npm run check-version && npm run jscs && npm run eslint && npm run complexity", - "unit-tests": "node test/unit-tests.js", - "grammar-tests": "node test/grammar-tests.js", - "regression-tests": "node test/regression-tests.js", - "all-tests": "npm run generate-fixtures && npm run unit-tests && npm run grammar-tests && npm run regression-tests", - "generate-fixtures": "node tools/generate-fixtures.js", - "browser-tests": "npm run generate-fixtures && cd test && karma start --single-run", - "saucelabs-evergreen": "cd test && karma start saucelabs-evergreen.conf.js", - "saucelabs-safari": "cd test && karma start saucelabs-safari.conf.js", - "saucelabs-ie": "cd test && karma start saucelabs-ie.conf.js", - "analyze-coverage": "istanbul cover test/unit-tests.js", - "check-coverage": "istanbul check-coverage --statement 100 --branch 100 --function 100", - "dynamic-analysis": "npm run analyze-coverage && npm run check-coverage", - "test": "npm run all-tests && npm run static-analysis && npm run dynamic-analysis", - "profile": "node --prof test/profile.js && mv isolate*.log v8.log && node-tick-processor", - "benchmark": "node test/benchmarks.js", - "benchmark-quick": "node test/benchmarks.js quick", - "codecov": "istanbul report cobertura && codecov < ./coverage/cobertura-coverage.xml", - "downstream": "node test/downstream.js", - "travis": "npm test", - "circleci": "npm test && npm run codecov && npm run downstream", - "appveyor": "npm run all-tests && npm run browser-tests && npm run dynamic-analysis", - "droneio": "npm test && npm run saucelabs-evergreen && npm run saucelabs-ie && npm run saucelabs-safari", - "generate-regex": "node tools/generate-identifier-regex.js" - }, - "gitHead": "eb05a03b18b8433ab1ebeabea635a949219cd75e", - "_id": "esprima@2.7.2", - "_shasum": "f43be543609984eae44c933ac63352a6af35f339", - "_from": "esprima@>=2.6.0 <3.0.0", - "_npmVersion": "2.14.7", - "_nodeVersion": "4.2.2", - "_npmUser": { - "name": "ariya", - "email": "ariya.hidayat@gmail.com" - }, - "dist": { - "shasum": "f43be543609984eae44c933ac63352a6af35f339", - "tarball": "http://registry.npmjs.org/esprima/-/esprima-2.7.2.tgz" - }, - "_npmOperationalInternal": { - "host": "packages-9-west.internal.npmjs.com", - "tmp": "tmp/esprima-2.7.2.tgz_1454477276067_0.014412595424801111" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.2.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/js-yaml/package.json b/node_modules/eslint/node_modules/js-yaml/package.json deleted file mode 100644 index 757a4d1..0000000 --- a/node_modules/eslint/node_modules/js-yaml/package.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "name": "js-yaml", - "version": "3.4.5", - "description": "YAML 1.2 parser and serializer", - "keywords": [ - "yaml", - "parser", - "serializer", - "pyyaml" - ], - "homepage": "https://github.com/nodeca/js-yaml", - "author": { - "name": "Vladimir Zapparov", - "email": "dervus.grim@gmail.com" - }, - "contributors": [ - { - "name": "Aleksey V Zapparov", - "email": "ixti@member.fsf.org", - "url": "http://www.ixti.net/" - }, - { - "name": "Vitaly Puzrin", - "email": "vitaly@rcdesign.ru", - "url": "https://github.com/puzrin" - }, - { - "name": "Martin Grenfell", - "email": "martin.grenfell@gmail.com", - "url": "http://got-ravings.blogspot.com" - } - ], - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/nodeca/js-yaml.git" - }, - "files": [ - "index.js", - "lib/", - "bin/", - "dist/" - ], - "bin": { - "js-yaml": "bin/js-yaml.js" - }, - "dependencies": { - "argparse": "^1.0.2", - "esprima": "^2.6.0" - }, - "devDependencies": { - "ansi": "*", - "benchmark": "*", - "eslint": "0.24.1", - "eslint-plugin-nodeca": "^1.0.3", - "istanbul": "*", - "mocha": "*" - }, - "browser": { - "buffer": false - }, - "scripts": { - "test": "make test" - }, - "gitHead": "66035322ee0906f0bcb24700bd7332ce66726c32", - "bugs": { - "url": "https://github.com/nodeca/js-yaml/issues" - }, - "_id": "js-yaml@3.4.5", - "_shasum": "c3403797df12b91866574f2de23646fe8cafb44d", - "_from": "js-yaml@3.4.5", - "_npmVersion": "2.14.7", - "_nodeVersion": "4.2.2", - "_npmUser": { - "name": "vitaly", - "email": "vitaly@rcdesign.ru" - }, - "maintainers": [ - { - "name": "vitaly", - "email": "vitaly@rcdesign.ru" - } - ], - "dist": { - "shasum": "c3403797df12b91866574f2de23646fe8cafb44d", - "tarball": "http://registry.npmjs.org/js-yaml/-/js-yaml-3.4.5.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.4.5.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/json-stable-stringify/.npmignore b/node_modules/eslint/node_modules/json-stable-stringify/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/eslint/node_modules/json-stable-stringify/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/eslint/node_modules/json-stable-stringify/.travis.yml b/node_modules/eslint/node_modules/json-stable-stringify/.travis.yml deleted file mode 100644 index cc4dba2..0000000 --- a/node_modules/eslint/node_modules/json-stable-stringify/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" diff --git a/node_modules/eslint/node_modules/json-stable-stringify/LICENSE b/node_modules/eslint/node_modules/json-stable-stringify/LICENSE deleted file mode 100644 index ee27ba4..0000000 --- a/node_modules/eslint/node_modules/json-stable-stringify/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -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. diff --git a/node_modules/eslint/node_modules/json-stable-stringify/example/key_cmp.js b/node_modules/eslint/node_modules/json-stable-stringify/example/key_cmp.js deleted file mode 100644 index d5f6675..0000000 --- a/node_modules/eslint/node_modules/json-stable-stringify/example/key_cmp.js +++ /dev/null @@ -1,7 +0,0 @@ -var stringify = require('../'); - -var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; -var s = stringify(obj, function (a, b) { - return a.key < b.key ? 1 : -1; -}); -console.log(s); diff --git a/node_modules/eslint/node_modules/json-stable-stringify/example/nested.js b/node_modules/eslint/node_modules/json-stable-stringify/example/nested.js deleted file mode 100644 index 9a672fc..0000000 --- a/node_modules/eslint/node_modules/json-stable-stringify/example/nested.js +++ /dev/null @@ -1,3 +0,0 @@ -var stringify = require('../'); -var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; -console.log(stringify(obj)); diff --git a/node_modules/eslint/node_modules/json-stable-stringify/example/str.js b/node_modules/eslint/node_modules/json-stable-stringify/example/str.js deleted file mode 100644 index 9b4b3cd..0000000 --- a/node_modules/eslint/node_modules/json-stable-stringify/example/str.js +++ /dev/null @@ -1,3 +0,0 @@ -var stringify = require('../'); -var obj = { c: 6, b: [4,5], a: 3 }; -console.log(stringify(obj)); diff --git a/node_modules/eslint/node_modules/json-stable-stringify/example/value_cmp.js b/node_modules/eslint/node_modules/json-stable-stringify/example/value_cmp.js deleted file mode 100644 index 09f1c5f..0000000 --- a/node_modules/eslint/node_modules/json-stable-stringify/example/value_cmp.js +++ /dev/null @@ -1,7 +0,0 @@ -var stringify = require('../'); - -var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 }; -var s = stringify(obj, function (a, b) { - return a.value < b.value ? 1 : -1; -}); -console.log(s); diff --git a/node_modules/eslint/node_modules/json-stable-stringify/index.js b/node_modules/eslint/node_modules/json-stable-stringify/index.js deleted file mode 100644 index 6a4131d..0000000 --- a/node_modules/eslint/node_modules/json-stable-stringify/index.js +++ /dev/null @@ -1,84 +0,0 @@ -var json = typeof JSON !== 'undefined' ? JSON : require('jsonify'); - -module.exports = function (obj, opts) { - if (!opts) opts = {}; - if (typeof opts === 'function') opts = { cmp: opts }; - var space = opts.space || ''; - if (typeof space === 'number') space = Array(space+1).join(' '); - var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false; - var replacer = opts.replacer || function(key, value) { return value; }; - - var cmp = opts.cmp && (function (f) { - return function (node) { - return function (a, b) { - var aobj = { key: a, value: node[a] }; - var bobj = { key: b, value: node[b] }; - return f(aobj, bobj); - }; - }; - })(opts.cmp); - - var seen = []; - return (function stringify (parent, key, node, level) { - var indent = space ? ('\n' + new Array(level + 1).join(space)) : ''; - var colonSeparator = space ? ': ' : ':'; - - if (node && node.toJSON && typeof node.toJSON === 'function') { - node = node.toJSON(); - } - - node = replacer.call(parent, key, node); - - if (node === undefined) { - return; - } - if (typeof node !== 'object' || node === null) { - return json.stringify(node); - } - if (isArray(node)) { - var out = []; - for (var i = 0; i < node.length; i++) { - var item = stringify(node, i, node[i], level+1) || json.stringify(null); - out.push(indent + space + item); - } - return '[' + out.join(',') + indent + ']'; - } - else { - if (seen.indexOf(node) !== -1) { - if (cycles) return json.stringify('__cycle__'); - throw new TypeError('Converting circular structure to JSON'); - } - else seen.push(node); - - var keys = objectKeys(node).sort(cmp && cmp(node)); - var out = []; - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var value = stringify(node, key, node[key], level+1); - - if(!value) continue; - - var keyValue = json.stringify(key) - + colonSeparator - + value; - ; - out.push(indent + space + keyValue); - } - seen.splice(seen.indexOf(node), 1); - return '{' + out.join(',') + indent + '}'; - } - })({ '': obj }, '', obj, 0); -}; - -var isArray = Array.isArray || function (x) { - return {}.toString.call(x) === '[object Array]'; -}; - -var objectKeys = Object.keys || function (obj) { - var has = Object.prototype.hasOwnProperty || function () { return true }; - var keys = []; - for (var key in obj) { - if (has.call(obj, key)) keys.push(key); - } - return keys; -}; diff --git a/node_modules/eslint/node_modules/json-stable-stringify/node_modules/jsonify/README.markdown b/node_modules/eslint/node_modules/json-stable-stringify/node_modules/jsonify/README.markdown deleted file mode 100644 index 71d9a93..0000000 --- a/node_modules/eslint/node_modules/json-stable-stringify/node_modules/jsonify/README.markdown +++ /dev/null @@ -1,34 +0,0 @@ -jsonify -======= - -This module provides Douglas Crockford's JSON implementation without modifying -any globals. - -`stringify` and `parse` are merely exported without respect to whether or not a -global `JSON` object exists. - -methods -======= - -var json = require('jsonify'); - -json.parse(source, reviver) ---------------------------- - -Return a new javascript object from a parse of the `source` string. - -If a `reviver` function is specified, walk the structure passing each name/value -pair to `reviver.call(parent, key, value)` to transform the `value` before -parsing it. - -json.stringify(value, replacer, space) --------------------------------------- - -Return a string representation for `value`. - -If `replacer` is specified, walk the structure passing each name/value pair to -`replacer.call(parent, key, value)` to transform the `value` before stringifying -it. - -If `space` is a number, indent the result by that many spaces. -If `space` is a string, use `space` as the indentation. diff --git a/node_modules/eslint/node_modules/json-stable-stringify/node_modules/jsonify/index.js b/node_modules/eslint/node_modules/json-stable-stringify/node_modules/jsonify/index.js deleted file mode 100644 index f728a16..0000000 --- a/node_modules/eslint/node_modules/json-stable-stringify/node_modules/jsonify/index.js +++ /dev/null @@ -1,2 +0,0 @@ -exports.parse = require('./lib/parse'); -exports.stringify = require('./lib/stringify'); diff --git a/node_modules/eslint/node_modules/json-stable-stringify/node_modules/jsonify/lib/parse.js b/node_modules/eslint/node_modules/json-stable-stringify/node_modules/jsonify/lib/parse.js deleted file mode 100644 index 30e2f01..0000000 --- a/node_modules/eslint/node_modules/json-stable-stringify/node_modules/jsonify/lib/parse.js +++ /dev/null @@ -1,273 +0,0 @@ -var at, // The index of the current character - ch, // The current character - escapee = { - '"': '"', - '\\': '\\', - '/': '/', - b: '\b', - f: '\f', - n: '\n', - r: '\r', - t: '\t' - }, - text, - - error = function (m) { - // Call error when something is wrong. - throw { - name: 'SyntaxError', - message: m, - at: at, - text: text - }; - }, - - next = function (c) { - // If a c parameter is provided, verify that it matches the current character. - if (c && c !== ch) { - error("Expected '" + c + "' instead of '" + ch + "'"); - } - - // Get the next character. When there are no more characters, - // return the empty string. - - ch = text.charAt(at); - at += 1; - return ch; - }, - - number = function () { - // Parse a number value. - var number, - string = ''; - - if (ch === '-') { - string = '-'; - next('-'); - } - while (ch >= '0' && ch <= '9') { - string += ch; - next(); - } - if (ch === '.') { - string += '.'; - while (next() && ch >= '0' && ch <= '9') { - string += ch; - } - } - if (ch === 'e' || ch === 'E') { - string += ch; - next(); - if (ch === '-' || ch === '+') { - string += ch; - next(); - } - while (ch >= '0' && ch <= '9') { - string += ch; - next(); - } - } - number = +string; - if (!isFinite(number)) { - error("Bad number"); - } else { - return number; - } - }, - - string = function () { - // Parse a string value. - var hex, - i, - string = '', - uffff; - - // When parsing for string values, we must look for " and \ characters. - if (ch === '"') { - while (next()) { - if (ch === '"') { - next(); - return string; - } else if (ch === '\\') { - next(); - if (ch === 'u') { - uffff = 0; - for (i = 0; i < 4; i += 1) { - hex = parseInt(next(), 16); - if (!isFinite(hex)) { - break; - } - uffff = uffff * 16 + hex; - } - string += String.fromCharCode(uffff); - } else if (typeof escapee[ch] === 'string') { - string += escapee[ch]; - } else { - break; - } - } else { - string += ch; - } - } - } - error("Bad string"); - }, - - white = function () { - -// Skip whitespace. - - while (ch && ch <= ' ') { - next(); - } - }, - - word = function () { - -// true, false, or null. - - switch (ch) { - case 't': - next('t'); - next('r'); - next('u'); - next('e'); - return true; - case 'f': - next('f'); - next('a'); - next('l'); - next('s'); - next('e'); - return false; - case 'n': - next('n'); - next('u'); - next('l'); - next('l'); - return null; - } - error("Unexpected '" + ch + "'"); - }, - - value, // Place holder for the value function. - - array = function () { - -// Parse an array value. - - var array = []; - - if (ch === '[') { - next('['); - white(); - if (ch === ']') { - next(']'); - return array; // empty array - } - while (ch) { - array.push(value()); - white(); - if (ch === ']') { - next(']'); - return array; - } - next(','); - white(); - } - } - error("Bad array"); - }, - - object = function () { - -// Parse an object value. - - var key, - object = {}; - - if (ch === '{') { - next('{'); - white(); - if (ch === '}') { - next('}'); - return object; // empty object - } - while (ch) { - key = string(); - white(); - next(':'); - if (Object.hasOwnProperty.call(object, key)) { - error('Duplicate key "' + key + '"'); - } - object[key] = value(); - white(); - if (ch === '}') { - next('}'); - return object; - } - next(','); - white(); - } - } - error("Bad object"); - }; - -value = function () { - -// Parse a JSON value. It could be an object, an array, a string, a number, -// or a word. - - white(); - switch (ch) { - case '{': - return object(); - case '[': - return array(); - case '"': - return string(); - case '-': - return number(); - default: - return ch >= '0' && ch <= '9' ? number() : word(); - } -}; - -// Return the json_parse function. It will have access to all of the above -// functions and variables. - -module.exports = function (source, reviver) { - var result; - - text = source; - at = 0; - ch = ' '; - result = value(); - white(); - if (ch) { - error("Syntax error"); - } - - // If there is a reviver function, we recursively walk the new structure, - // passing each name/value pair to the reviver function for possible - // transformation, starting with a temporary root object that holds the result - // in an empty key. If there is not a reviver function, we simply return the - // result. - - return typeof reviver === 'function' ? (function walk(holder, key) { - var k, v, value = holder[key]; - if (value && typeof value === 'object') { - for (k in value) { - if (Object.prototype.hasOwnProperty.call(value, k)) { - v = walk(value, k); - if (v !== undefined) { - value[k] = v; - } else { - delete value[k]; - } - } - } - } - return reviver.call(holder, key, value); - }({'': result}, '')) : result; -}; diff --git a/node_modules/eslint/node_modules/json-stable-stringify/node_modules/jsonify/lib/stringify.js b/node_modules/eslint/node_modules/json-stable-stringify/node_modules/jsonify/lib/stringify.js deleted file mode 100644 index 1345870..0000000 --- a/node_modules/eslint/node_modules/json-stable-stringify/node_modules/jsonify/lib/stringify.js +++ /dev/null @@ -1,154 +0,0 @@ -var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - gap, - indent, - meta = { // table of character substitutions - '\b': '\\b', - '\t': '\\t', - '\n': '\\n', - '\f': '\\f', - '\r': '\\r', - '"' : '\\"', - '\\': '\\\\' - }, - rep; - -function quote(string) { - // If the string contains no control characters, no quote characters, and no - // backslash characters, then we can safely slap some quotes around it. - // Otherwise we must also replace the offending characters with safe escape - // sequences. - - escapable.lastIndex = 0; - return escapable.test(string) ? '"' + string.replace(escapable, function (a) { - var c = meta[a]; - return typeof c === 'string' ? c : - '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); - }) + '"' : '"' + string + '"'; -} - -function str(key, holder) { - // Produce a string from holder[key]. - var i, // The loop counter. - k, // The member key. - v, // The member value. - length, - mind = gap, - partial, - value = holder[key]; - - // If the value has a toJSON method, call it to obtain a replacement value. - if (value && typeof value === 'object' && - typeof value.toJSON === 'function') { - value = value.toJSON(key); - } - - // If we were called with a replacer function, then call the replacer to - // obtain a replacement value. - if (typeof rep === 'function') { - value = rep.call(holder, key, value); - } - - // What happens next depends on the value's type. - switch (typeof value) { - case 'string': - return quote(value); - - case 'number': - // JSON numbers must be finite. Encode non-finite numbers as null. - return isFinite(value) ? String(value) : 'null'; - - case 'boolean': - case 'null': - // If the value is a boolean or null, convert it to a string. Note: - // typeof null does not produce 'null'. The case is included here in - // the remote chance that this gets fixed someday. - return String(value); - - case 'object': - if (!value) return 'null'; - gap += indent; - partial = []; - - // Array.isArray - if (Object.prototype.toString.apply(value) === '[object Array]') { - length = value.length; - for (i = 0; i < length; i += 1) { - partial[i] = str(i, value) || 'null'; - } - - // Join all of the elements together, separated with commas, and - // wrap them in brackets. - v = partial.length === 0 ? '[]' : gap ? - '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : - '[' + partial.join(',') + ']'; - gap = mind; - return v; - } - - // If the replacer is an array, use it to select the members to be - // stringified. - if (rep && typeof rep === 'object') { - length = rep.length; - for (i = 0; i < length; i += 1) { - k = rep[i]; - if (typeof k === 'string') { - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } - else { - // Otherwise, iterate through all of the keys in the object. - for (k in value) { - if (Object.prototype.hasOwnProperty.call(value, k)) { - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } - - // Join all of the member texts together, separated with commas, - // and wrap them in braces. - - v = partial.length === 0 ? '{}' : gap ? - '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : - '{' + partial.join(',') + '}'; - gap = mind; - return v; - } -} - -module.exports = function (value, replacer, space) { - var i; - gap = ''; - indent = ''; - - // If the space parameter is a number, make an indent string containing that - // many spaces. - if (typeof space === 'number') { - for (i = 0; i < space; i += 1) { - indent += ' '; - } - } - // If the space parameter is a string, it will be used as the indent string. - else if (typeof space === 'string') { - indent = space; - } - - // If there is a replacer, it must be a function or an array. - // Otherwise, throw an error. - rep = replacer; - if (replacer && typeof replacer !== 'function' - && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) { - throw new Error('JSON.stringify'); - } - - // Make a fake root object containing our value under the key of ''. - // Return the result of stringifying the value. - return str('', {'': value}); -}; diff --git a/node_modules/eslint/node_modules/json-stable-stringify/node_modules/jsonify/package.json b/node_modules/eslint/node_modules/json-stable-stringify/node_modules/jsonify/package.json deleted file mode 100644 index 4cfb721..0000000 --- a/node_modules/eslint/node_modules/json-stable-stringify/node_modules/jsonify/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "jsonify", - "version": "0.0.0", - "description": "JSON without touching any globals", - "main": "index.js", - "directories": { - "lib": ".", - "test": "test" - }, - "devDependencies": { - "tap": "0.0.x", - "garbage": "0.0.x" - }, - "scripts": { - "test": "tap test" - }, - "repository": { - "type": "git", - "url": "git://github.com/substack/jsonify.git" - }, - "keywords": [ - "json", - "browser" - ], - "author": { - "name": "Douglas Crockford", - "url": "http://crockford.com/" - }, - "license": "Public Domain", - "_id": "jsonify@0.0.0", - "dependencies": {}, - "engines": { - "node": "*" - }, - "_engineSupported": true, - "_npmVersion": "1.0.10", - "_nodeVersion": "v0.5.0-pre", - "_defaultsLoaded": true, - "dist": { - "shasum": "2c74b6ee41d93ca51b7b5aaee8f503631d252a73", - "tarball": "http://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "_shasum": "2c74b6ee41d93ca51b7b5aaee8f503631d252a73", - "_resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "_from": "jsonify@>=0.0.0 <0.1.0", - "bugs": { - "url": "https://github.com/substack/jsonify/issues" - }, - "readme": "ERROR: No README data found!", - "homepage": "https://github.com/substack/jsonify#readme" -} diff --git a/node_modules/eslint/node_modules/json-stable-stringify/node_modules/jsonify/test/parse.js b/node_modules/eslint/node_modules/json-stable-stringify/node_modules/jsonify/test/parse.js deleted file mode 100644 index e2313f5..0000000 --- a/node_modules/eslint/node_modules/json-stable-stringify/node_modules/jsonify/test/parse.js +++ /dev/null @@ -1,16 +0,0 @@ -var test = require('tap').test; -var json = require('../'); -var garbage = require('garbage'); - -test('parse', function (t) { - for (var i = 0; i < 50; i++) { - var s = JSON.stringify(garbage(50)); - - t.deepEqual( - json.parse(s), - JSON.parse(s) - ); - } - - t.end(); -}); diff --git a/node_modules/eslint/node_modules/json-stable-stringify/node_modules/jsonify/test/stringify.js b/node_modules/eslint/node_modules/json-stable-stringify/node_modules/jsonify/test/stringify.js deleted file mode 100644 index 89b0b67..0000000 --- a/node_modules/eslint/node_modules/json-stable-stringify/node_modules/jsonify/test/stringify.js +++ /dev/null @@ -1,15 +0,0 @@ -var test = require('tap').test; -var json = require('../'); -var garbage = require('garbage'); - -test('stringify', function (t) { - for (var i = 0; i < 50; i++) { - var obj = garbage(50); - t.equal( - json.stringify(obj), - JSON.stringify(obj) - ); - } - - t.end(); -}); diff --git a/node_modules/eslint/node_modules/json-stable-stringify/package.json b/node_modules/eslint/node_modules/json-stable-stringify/package.json deleted file mode 100644 index e0ab263..0000000 --- a/node_modules/eslint/node_modules/json-stable-stringify/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "name": "json-stable-stringify", - "version": "1.0.1", - "description": "deterministic JSON.stringify() with custom sorting to get deterministic hashes from stringified results", - "main": "index.js", - "dependencies": { - "jsonify": "~0.0.0" - }, - "devDependencies": { - "tape": "~1.0.4" - }, - "scripts": { - "test": "tape test/*.js" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "ff/5", - "ff/latest", - "chrome/15", - "chrome/latest", - "safari/latest", - "opera/latest" - ] - }, - "repository": { - "type": "git", - "url": "git://github.com/substack/json-stable-stringify.git" - }, - "homepage": "https://github.com/substack/json-stable-stringify", - "keywords": [ - "json", - "stringify", - "deterministic", - "hash", - "sort", - "stable" - ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "license": "MIT", - "gitHead": "4a3ac9cc006a91e64901f8ebe78d23bf9fc9fbd0", - "bugs": { - "url": "https://github.com/substack/json-stable-stringify/issues" - }, - "_id": "json-stable-stringify@1.0.1", - "_shasum": "9a759d39c5f2ff503fd5300646ed445f88c4f9af", - "_from": "json-stable-stringify@>=1.0.0 <2.0.0", - "_npmVersion": "3.4.1", - "_nodeVersion": "4.2.1", - "_npmUser": { - "name": "substack", - "email": "substack@gmail.com" - }, - "dist": { - "shasum": "9a759d39c5f2ff503fd5300646ed445f88c4f9af", - "tarball": "http://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "_npmOperationalInternal": { - "host": "packages-5-east.internal.npmjs.com", - "tmp": "tmp/json-stable-stringify-1.0.1.tgz_1454436356521_0.9410459187347442" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/json-stable-stringify/readme.markdown b/node_modules/eslint/node_modules/json-stable-stringify/readme.markdown deleted file mode 100644 index 406c3c7..0000000 --- a/node_modules/eslint/node_modules/json-stable-stringify/readme.markdown +++ /dev/null @@ -1,130 +0,0 @@ -# json-stable-stringify - -deterministic version of `JSON.stringify()` so you can get a consistent hash -from stringified results - -You can also pass in a custom comparison function. - -[![browser support](https://ci.testling.com/substack/json-stable-stringify.png)](https://ci.testling.com/substack/json-stable-stringify) - -[![build status](https://secure.travis-ci.org/substack/json-stable-stringify.png)](http://travis-ci.org/substack/json-stable-stringify) - -# example - -``` js -var stringify = require('json-stable-stringify'); -var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; -console.log(stringify(obj)); -``` - -output: - -``` -{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8} -``` - -# methods - -``` js -var stringify = require('json-stable-stringify') -``` - -## var str = stringify(obj, opts) - -Return a deterministic stringified string `str` from the object `obj`. - -## options - -### cmp - -If `opts` is given, you can supply an `opts.cmp` to have a custom comparison -function for object keys. Your function `opts.cmp` is called with these -parameters: - -``` js -opts.cmp({ key: akey, value: avalue }, { key: bkey, value: bvalue }) -``` - -For example, to sort on the object key names in reverse order you could write: - -``` js -var stringify = require('json-stable-stringify'); - -var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; -var s = stringify(obj, function (a, b) { - return a.key < b.key ? 1 : -1; -}); -console.log(s); -``` - -which results in the output string: - -``` -{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3} -``` - -Or if you wanted to sort on the object values in reverse order, you could write: - -``` -var stringify = require('json-stable-stringify'); - -var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 }; -var s = stringify(obj, function (a, b) { - return a.value < b.value ? 1 : -1; -}); -console.log(s); -``` - -which outputs: - -``` -{"d":6,"c":5,"b":[{"z":3,"y":2,"x":1},9],"a":10} -``` - -### space - -If you specify `opts.space`, it will indent the output for pretty-printing. -Valid values are strings (e.g. `{space: \t}`) or a number of spaces -(`{space: 3}`). - -For example: - -```js -var obj = { b: 1, a: { foo: 'bar', and: [1, 2, 3] } }; -var s = stringify(obj, { space: ' ' }); -console.log(s); -``` - -which outputs: - -``` -{ - "a": { - "and": [ - 1, - 2, - 3 - ], - "foo": "bar" - }, - "b": 1 -} -``` - -### replacer - -The replacer parameter is a function `opts.replacer(key, value)` that behaves -the same as the replacer -[from the core JSON object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_native_JSON#The_replacer_parameter). - -# install - -With [npm](https://npmjs.org) do: - -``` -npm install json-stable-stringify -``` - -# license - -MIT diff --git a/node_modules/eslint/node_modules/json-stable-stringify/test/cmp.js b/node_modules/eslint/node_modules/json-stable-stringify/test/cmp.js deleted file mode 100644 index 2dbb393..0000000 --- a/node_modules/eslint/node_modules/json-stable-stringify/test/cmp.js +++ /dev/null @@ -1,11 +0,0 @@ -var test = require('tape'); -var stringify = require('../'); - -test('custom comparison function', function (t) { - t.plan(1); - var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; - var s = stringify(obj, function (a, b) { - return a.key < b.key ? 1 : -1; - }); - t.equal(s, '{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3}'); -}); diff --git a/node_modules/eslint/node_modules/json-stable-stringify/test/nested.js b/node_modules/eslint/node_modules/json-stable-stringify/test/nested.js deleted file mode 100644 index 026ebd5..0000000 --- a/node_modules/eslint/node_modules/json-stable-stringify/test/nested.js +++ /dev/null @@ -1,35 +0,0 @@ -var test = require('tape'); -var stringify = require('../'); - -test('nested', function (t) { - t.plan(1); - var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; - t.equal(stringify(obj), '{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8}'); -}); - -test('cyclic (default)', function (t) { - t.plan(1); - var one = { a: 1 }; - var two = { a: 2, one: one }; - one.two = two; - try { - stringify(one); - } catch (ex) { - t.equal(ex.toString(), 'TypeError: Converting circular structure to JSON'); - } -}); - -test('cyclic (specifically allowed)', function (t) { - t.plan(1); - var one = { a: 1 }; - var two = { a: 2, one: one }; - one.two = two; - t.equal(stringify(one, {cycles:true}), '{"a":1,"two":{"a":2,"one":"__cycle__"}}'); -}); - -test('repeated non-cyclic value', function(t) { - t.plan(1); - var one = { x: 1 }; - var two = { a: one, b: one }; - t.equal(stringify(two), '{"a":{"x":1},"b":{"x":1}}'); -}); diff --git a/node_modules/eslint/node_modules/json-stable-stringify/test/replacer.js b/node_modules/eslint/node_modules/json-stable-stringify/test/replacer.js deleted file mode 100644 index 98802a7..0000000 --- a/node_modules/eslint/node_modules/json-stable-stringify/test/replacer.js +++ /dev/null @@ -1,74 +0,0 @@ -var test = require('tape'); -var stringify = require('../'); - -test('replace root', function (t) { - t.plan(1); - - var obj = { a: 1, b: 2, c: false }; - var replacer = function(key, value) { return 'one'; }; - - t.equal(stringify(obj, { replacer: replacer }), '"one"'); -}); - -test('replace numbers', function (t) { - t.plan(1); - - var obj = { a: 1, b: 2, c: false }; - var replacer = function(key, value) { - if(value === 1) return 'one'; - if(value === 2) return 'two'; - return value; - }; - - t.equal(stringify(obj, { replacer: replacer }), '{"a":"one","b":"two","c":false}'); -}); - -test('replace with object', function (t) { - t.plan(1); - - var obj = { a: 1, b: 2, c: false }; - var replacer = function(key, value) { - if(key === 'b') return { d: 1 }; - if(value === 1) return 'one'; - return value; - }; - - t.equal(stringify(obj, { replacer: replacer }), '{"a":"one","b":{"d":"one"},"c":false}'); -}); - -test('replace with undefined', function (t) { - t.plan(1); - - var obj = { a: 1, b: 2, c: false }; - var replacer = function(key, value) { - if(value === false) return; - return value; - }; - - t.equal(stringify(obj, { replacer: replacer }), '{"a":1,"b":2}'); -}); - -test('replace with array', function (t) { - t.plan(1); - - var obj = { a: 1, b: 2, c: false }; - var replacer = function(key, value) { - if(key === 'b') return ['one', 'two']; - return value; - }; - - t.equal(stringify(obj, { replacer: replacer }), '{"a":1,"b":["one","two"],"c":false}'); -}); - -test('replace array item', function (t) { - t.plan(1); - - var obj = { a: 1, b: 2, c: [1,2] }; - var replacer = function(key, value) { - if(value === 1) return 'one'; - if(value === 2) return 'two'; - return value; - }; - - t.equal(stringify(obj, { replacer: replacer }), '{"a":"one","b":"two","c":["one","two"]}'); -}); diff --git a/node_modules/eslint/node_modules/json-stable-stringify/test/space.js b/node_modules/eslint/node_modules/json-stable-stringify/test/space.js deleted file mode 100644 index 2621122..0000000 --- a/node_modules/eslint/node_modules/json-stable-stringify/test/space.js +++ /dev/null @@ -1,59 +0,0 @@ -var test = require('tape'); -var stringify = require('../'); - -test('space parameter', function (t) { - t.plan(1); - var obj = { one: 1, two: 2 }; - t.equal(stringify(obj, {space: ' '}), '' - + '{\n' - + ' "one": 1,\n' - + ' "two": 2\n' - + '}' - ); -}); - -test('space parameter (with tabs)', function (t) { - t.plan(1); - var obj = { one: 1, two: 2 }; - t.equal(stringify(obj, {space: '\t'}), '' - + '{\n' - + '\t"one": 1,\n' - + '\t"two": 2\n' - + '}' - ); -}); - -test('space parameter (with a number)', function (t) { - t.plan(1); - var obj = { one: 1, two: 2 }; - t.equal(stringify(obj, {space: 3}), '' - + '{\n' - + ' "one": 1,\n' - + ' "two": 2\n' - + '}' - ); -}); - -test('space parameter (nested objects)', function (t) { - t.plan(1); - var obj = { one: 1, two: { b: 4, a: [2,3] } }; - t.equal(stringify(obj, {space: ' '}), '' - + '{\n' - + ' "one": 1,\n' - + ' "two": {\n' - + ' "a": [\n' - + ' 2,\n' - + ' 3\n' - + ' ],\n' - + ' "b": 4\n' - + ' }\n' - + '}' - ); -}); - -test('space parameter (same as native)', function (t) { - t.plan(1); - // for this test, properties need to be in alphabetical order - var obj = { one: 1, two: { a: [2,3], b: 4 } }; - t.equal(stringify(obj, {space: ' '}), JSON.stringify(obj, null, ' ')); -}); diff --git a/node_modules/eslint/node_modules/json-stable-stringify/test/str.js b/node_modules/eslint/node_modules/json-stable-stringify/test/str.js deleted file mode 100644 index 67426b9..0000000 --- a/node_modules/eslint/node_modules/json-stable-stringify/test/str.js +++ /dev/null @@ -1,32 +0,0 @@ -var test = require('tape'); -var stringify = require('../'); - -test('simple object', function (t) { - t.plan(1); - var obj = { c: 6, b: [4,5], a: 3, z: null }; - t.equal(stringify(obj), '{"a":3,"b":[4,5],"c":6,"z":null}'); -}); - -test('object with undefined', function (t) { - t.plan(1); - var obj = { a: 3, z: undefined }; - t.equal(stringify(obj), '{"a":3}'); -}); - -test('array with undefined', function (t) { - t.plan(1); - var obj = [4, undefined, 6]; - t.equal(stringify(obj), '[4,null,6]'); -}); - -test('object with empty string', function (t) { - t.plan(1); - var obj = { a: 3, z: '' }; - t.equal(stringify(obj), '{"a":3,"z":""}'); -}); - -test('array with empty string', function (t) { - t.plan(1); - var obj = [4, '', 6]; - t.equal(stringify(obj), '[4,"",6]'); -}); diff --git a/node_modules/eslint/node_modules/json-stable-stringify/test/to-json.js b/node_modules/eslint/node_modules/json-stable-stringify/test/to-json.js deleted file mode 100644 index ef9a980..0000000 --- a/node_modules/eslint/node_modules/json-stable-stringify/test/to-json.js +++ /dev/null @@ -1,20 +0,0 @@ -var test = require('tape'); -var stringify = require('../'); - -test('toJSON function', function (t) { - t.plan(1); - var obj = { one: 1, two: 2, toJSON: function() { return { one: 1 }; } }; - t.equal(stringify(obj), '{"one":1}' ); -}); - -test('toJSON returns string', function (t) { - t.plan(1); - var obj = { one: 1, two: 2, toJSON: function() { return 'one'; } }; - t.equal(stringify(obj), '"one"'); -}); - -test('toJSON returns array', function (t) { - t.plan(1); - var obj = { one: 1, two: 2, toJSON: function() { return ['one']; } }; - t.equal(stringify(obj), '["one"]'); -}); diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/LICENSE b/node_modules/eslint/node_modules/lodash.clonedeep/LICENSE deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/README.md b/node_modules/eslint/node_modules/lodash.clonedeep/README.md deleted file mode 100644 index 7be9a82..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash.clonedeep v3.0.2 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.cloneDeep` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.clonedeep -``` - -In Node.js/io.js: - -```js -var cloneDeep = require('lodash.clonedeep'); -``` - -See the [documentation](https://lodash.com/docs#cloneDeep) or [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash.clonedeep) for more details. diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/index.js b/node_modules/eslint/node_modules/lodash.clonedeep/index.js deleted file mode 100644 index f486c22..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/index.js +++ /dev/null @@ -1,63 +0,0 @@ -/** - * lodash 3.0.2 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -var baseClone = require('lodash._baseclone'), - bindCallback = require('lodash._bindcallback'); - -/** - * Creates a deep clone of `value`. If `customizer` is provided it's invoked - * to produce the cloned values. If `customizer` returns `undefined` cloning - * is handled by the method instead. The `customizer` is bound to `thisArg` - * and invoked with up to three argument; (value [, index|key, object]). - * - * **Note:** This method is loosely based on the - * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm). - * The enumerable properties of `arguments` objects and objects created by - * constructors other than `Object` are cloned to plain `Object` objects. An - * empty object is returned for uncloneable values such as functions, DOM nodes, - * Maps, Sets, and WeakMaps. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to deep clone. - * @param {Function} [customizer] The function to customize cloning values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {*} Returns the deep cloned value. - * @example - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * var deep = _.cloneDeep(users); - * deep[0] === users[0]; - * // => false - * - * // using a customizer callback - * var el = _.cloneDeep(document.body, function(value) { - * if (_.isElement(value)) { - * return value.cloneNode(true); - * } - * }); - * - * el === document.body - * // => false - * el.nodeName - * // => BODY - * el.childNodes.length; - * // => 20 - */ -function cloneDeep(value, customizer, thisArg) { - return typeof customizer == 'function' - ? baseClone(value, true, bindCallback(customizer, thisArg, 3)) - : baseClone(value, true); -} - -module.exports = cloneDeep; diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/LICENSE b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/LICENSE deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/README.md b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/README.md deleted file mode 100644 index 883a43c..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._baseclone v3.3.0 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseClone` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._baseclone -``` - -In Node.js/io.js: - -```js -var baseClone = require('lodash._baseclone'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.3.0-npm-packages/lodash._baseclone) for more details. diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/index.js b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/index.js deleted file mode 100644 index 4024d58..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/index.js +++ /dev/null @@ -1,271 +0,0 @@ -/** - * lodash 3.3.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -var arrayCopy = require('lodash._arraycopy'), - arrayEach = require('lodash._arrayeach'), - baseAssign = require('lodash._baseassign'), - baseFor = require('lodash._basefor'), - isArray = require('lodash.isarray'), - keys = require('lodash.keys'); - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - weakMapTag = '[object WeakMap]'; - -var arrayBufferTag = '[object ArrayBuffer]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - -/** Used to match `RegExp` flags from their coerced string values. */ -var reFlags = /\w*$/; - -/** Used to identify `toStringTag` values supported by `_.clone`. */ -var cloneableTags = {}; -cloneableTags[argsTag] = cloneableTags[arrayTag] = -cloneableTags[arrayBufferTag] = cloneableTags[boolTag] = -cloneableTags[dateTag] = cloneableTags[float32Tag] = -cloneableTags[float64Tag] = cloneableTags[int8Tag] = -cloneableTags[int16Tag] = cloneableTags[int32Tag] = -cloneableTags[numberTag] = cloneableTags[objectTag] = -cloneableTags[regexpTag] = cloneableTags[stringTag] = -cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = -cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; -cloneableTags[errorTag] = cloneableTags[funcTag] = -cloneableTags[mapTag] = cloneableTags[setTag] = -cloneableTags[weakMapTag] = false; - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objToString = objectProto.toString; - -/** Native method references. */ -var ArrayBuffer = global.ArrayBuffer, - Uint8Array = global.Uint8Array; - -/** - * The base implementation of `_.clone` without support for argument juggling - * and `this` binding `customizer` functions. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @param {Function} [customizer] The function to customize cloning values. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The object `value` belongs to. - * @param {Array} [stackA=[]] Tracks traversed source objects. - * @param {Array} [stackB=[]] Associates clones with source counterparts. - * @returns {*} Returns the cloned value. - */ -function baseClone(value, isDeep, customizer, key, object, stackA, stackB) { - var result; - if (customizer) { - result = object ? customizer(value, key, object) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return arrayCopy(value, result); - } - } else { - var tag = objToString.call(value), - isFunc = tag == funcTag; - - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - result = initCloneObject(isFunc ? {} : value); - if (!isDeep) { - return baseAssign(result, value); - } - } else { - return cloneableTags[tag] - ? initCloneByTag(value, tag, isDeep) - : (object ? value : {}); - } - } - // Check for circular references and return its corresponding clone. - stackA || (stackA = []); - stackB || (stackB = []); - - var length = stackA.length; - while (length--) { - if (stackA[length] == value) { - return stackB[length]; - } - } - // Add the source value to the stack of traversed objects and associate it with its clone. - stackA.push(value); - stackB.push(result); - - // Recursively populate clone (susceptible to call stack limits). - (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) { - result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB); - }); - return result; -} - -/** - * The base implementation of `_.forOwn` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ -function baseForOwn(object, iteratee) { - return baseFor(object, iteratee, keys); -} - -/** - * Creates a clone of the given array buffer. - * - * @private - * @param {ArrayBuffer} buffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ -function bufferClone(buffer) { - var result = new ArrayBuffer(buffer.byteLength), - view = new Uint8Array(result); - - view.set(new Uint8Array(buffer)); - return result; -} - -/** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ -function initCloneArray(array) { - var length = array.length, - result = new array.constructor(length); - - // Add array properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; - } - return result; -} - -/** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneObject(object) { - var Ctor = object.constructor; - if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) { - Ctor = Object; - } - return new Ctor; -} - -/** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneByTag(object, tag, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return bufferClone(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - var buffer = object.buffer; - return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length); - - case numberTag: - case stringTag: - return new Ctor(object); - - case regexpTag: - var result = new Ctor(object.source, reFlags.exec(object)); - result.lastIndex = object.lastIndex; - } - return result; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -module.exports = baseClone; diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arraycopy/LICENSE.txt b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arraycopy/LICENSE.txt deleted file mode 100644 index 1776432..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arraycopy/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arraycopy/README.md b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arraycopy/README.md deleted file mode 100644 index 16ee6fd..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arraycopy/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._arraycopy v3.0.0 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `arrayCopy` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._arraycopy -``` - -In Node.js/io.js: - -```js -var arrayCopy = require('lodash._arraycopy'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash._arraycopy) for more details. diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arraycopy/index.js b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arraycopy/index.js deleted file mode 100644 index b9abb22..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arraycopy/index.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * lodash 3.0.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ -function arrayCopy(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; -} - -module.exports = arrayCopy; diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arraycopy/package.json b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arraycopy/package.json deleted file mode 100644 index 5f851f5..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arraycopy/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "lodash._arraycopy", - "version": "3.0.0", - "description": "The modern build of lodash’s internal `arrayCopy` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._arraycopy@3.0.0", - "_shasum": "76e7b7c1f1fb92547374878a562ed06a3e50f6e1", - "_from": "lodash._arraycopy@>=3.0.0 <4.0.0", - "_npmVersion": "2.3.0", - "_nodeVersion": "0.10.35", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - } - ], - "dist": { - "shasum": "76e7b7c1f1fb92547374878a562ed06a3e50f6e1", - "tarball": "http://registry.npmjs.org/lodash._arraycopy/-/lodash._arraycopy-3.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._arraycopy/-/lodash._arraycopy-3.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arrayeach/LICENSE.txt b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arrayeach/LICENSE.txt deleted file mode 100644 index 1776432..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arrayeach/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arrayeach/README.md b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arrayeach/README.md deleted file mode 100644 index 1f3236b..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arrayeach/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._arrayeach v3.0.0 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `arrayEach` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._arrayeach -``` - -In Node.js/io.js: - -```js -var arrayEach = require('lodash._arrayeach'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash._arrayeach) for more details. diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arrayeach/index.js b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arrayeach/index.js deleted file mode 100644 index 7b31bcd..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arrayeach/index.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * lodash 3.0.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * A specialized version of `_.forEach` for arrays without support for callback - * shorthands or `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ -function arrayEach(array, iteratee) { - var index = -1, - length = array.length; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; -} - -module.exports = arrayEach; diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arrayeach/package.json b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arrayeach/package.json deleted file mode 100644 index 993a8f3..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arrayeach/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "lodash._arrayeach", - "version": "3.0.0", - "description": "The modern build of lodash’s internal `arrayEach` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._arrayeach@3.0.0", - "_shasum": "bab156b2a90d3f1bbd5c653403349e5e5933ef9e", - "_from": "lodash._arrayeach@>=3.0.0 <4.0.0", - "_npmVersion": "2.3.0", - "_nodeVersion": "0.10.35", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - } - ], - "dist": { - "shasum": "bab156b2a90d3f1bbd5c653403349e5e5933ef9e", - "tarball": "http://registry.npmjs.org/lodash._arrayeach/-/lodash._arrayeach-3.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._arrayeach/-/lodash._arrayeach-3.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/LICENSE.txt b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/LICENSE.txt deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/README.md b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/README.md deleted file mode 100644 index 0aa2309..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._baseassign v3.2.0 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseAssign` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._baseassign -``` - -In Node.js/io.js: - -```js -var baseAssign = require('lodash._baseassign'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.2.0-npm-packages/lodash._baseassign) for more details. diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/index.js b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/index.js deleted file mode 100644 index f5612c8..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/index.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * lodash 3.2.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -var baseCopy = require('lodash._basecopy'), - keys = require('lodash.keys'); - -/** - * The base implementation of `_.assign` without support for argument juggling, - * multiple sources, and `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ -function baseAssign(object, source) { - return source == null - ? object - : baseCopy(source, keys(source), object); -} - -module.exports = baseAssign; diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/LICENSE.txt b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/LICENSE.txt deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/README.md b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/README.md deleted file mode 100644 index acdfa29..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._basecopy v3.0.1 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseCopy` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._basecopy -``` - -In Node.js/io.js: - -```js -var baseCopy = require('lodash._basecopy'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._basecopy) for more details. diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/index.js b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/index.js deleted file mode 100644 index b586d31..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * lodash 3.0.1 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. - * @param {Object} [object={}] The object to copy properties to. - * @returns {Object} Returns `object`. - */ -function baseCopy(source, props, object) { - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - object[key] = source[key]; - } - return object; -} - -module.exports = baseCopy; diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/package.json b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/package.json deleted file mode 100644 index 47db975..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "name": "lodash._basecopy", - "version": "3.0.1", - "description": "The modern build of lodash’s internal `baseCopy` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._basecopy@3.0.1", - "_shasum": "8da0e6a876cf344c0ad8a54882111dd3c5c7ca36", - "_from": "lodash._basecopy@>=3.0.0 <4.0.0", - "_npmVersion": "2.7.6", - "_nodeVersion": "0.12.2", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "dist": { - "shasum": "8da0e6a876cf344c0ad8a54882111dd3c5c7ca36", - "tarball": "http://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/package.json b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/package.json deleted file mode 100644 index e9ec405..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/package.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "name": "lodash._baseassign", - "version": "3.2.0", - "description": "The modern build of lodash’s internal `baseAssign` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "dependencies": { - "lodash._basecopy": "^3.0.0", - "lodash.keys": "^3.0.0" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._baseassign@3.2.0", - "_shasum": "8c38a099500f215ad09e59f1722fd0c52bfe0a4e", - "_from": "lodash._baseassign@>=3.0.0 <4.0.0", - "_npmVersion": "2.10.0", - "_nodeVersion": "0.12.3", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "dist": { - "shasum": "8c38a099500f215ad09e59f1722fd0c52bfe0a4e", - "tarball": "http://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._basefor/LICENSE b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._basefor/LICENSE deleted file mode 100644 index b054ca5..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._basefor/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._basefor/README.md b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._basefor/README.md deleted file mode 100644 index b17e221..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._basefor/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._basefor v3.0.3 - -The internal [lodash](https://lodash.com/) function `baseFor` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._basefor -``` - -In Node.js: -```js -var baseFor = require('lodash._basefor'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.0.3-npm-packages/lodash._basefor) for more details. diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._basefor/index.js b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._basefor/index.js deleted file mode 100644 index 3f1d189..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._basefor/index.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * lodash 3.0.3 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * The base implementation of `baseForIn` and `baseForOwn` which iterates - * over `object` properties returned by `keysFunc` invoking `iteratee` for - * each property. Iteratee functions may exit iteration early by explicitly - * returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ -var baseFor = createBaseFor(); - -/** - * Creates a base function for methods like `_.forIn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ -function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; -} - -module.exports = baseFor; diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._basefor/package.json b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._basefor/package.json deleted file mode 100644 index 7490169..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._basefor/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "lodash._basefor", - "version": "3.0.3", - "description": "The internal lodash function `baseFor` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "https://github.com/phated" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._basefor@3.0.3", - "_shasum": "7550b4e9218ef09fad24343b612021c79b4c20c2", - "_from": "lodash._basefor@>=3.0.0 <4.0.0", - "_npmVersion": "2.14.15", - "_nodeVersion": "5.4.0", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "dist": { - "shasum": "7550b4e9218ef09fad24343b612021c79b4c20c2", - "tarball": "http://registry.npmjs.org/lodash._basefor/-/lodash._basefor-3.0.3.tgz" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._basefor/-/lodash._basefor-3.0.3.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.isarray/LICENSE b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.isarray/LICENSE deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.isarray/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.isarray/README.md b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.isarray/README.md deleted file mode 100644 index ea274aa..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.isarray/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash.isarray v3.0.4 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.isArray` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.isarray -``` - -In Node.js/io.js: - -```js -var isArray = require('lodash.isarray'); -``` - -See the [documentation](https://lodash.com/docs#isArray) or [package source](https://github.com/lodash/lodash/blob/3.0.4-npm-packages/lodash.isarray) for more details. diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.isarray/index.js b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.isarray/index.js deleted file mode 100644 index dd24658..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.isarray/index.js +++ /dev/null @@ -1,180 +0,0 @@ -/** - * lodash 3.0.4 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** `Object#toString` result references. */ -var arrayTag = '[object Array]', - funcTag = '[object Function]'; - -/** Used to detect host constructors (Safari > 5). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** - * Checks if `value` is object-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var fnToString = Function.prototype.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objToString = objectProto.toString; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeIsArray = getNative(Array, 'isArray'); - -/** - * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) - * of an array-like value. - */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = object == null ? undefined : object[key]; - return isNative(value) ? value : undefined; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - */ -function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(function() { return arguments; }()); - * // => false - */ -var isArray = nativeIsArray || function(value) { - return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; -}; - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in older versions of Chrome and Safari which return 'function' for regexes - // and Safari 8 equivalents which return 'object' for typed array constructors. - return isObject(value) && objToString.call(value) == funcTag; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ -function isNative(value) { - if (value == null) { - return false; - } - if (isFunction(value)) { - return reIsNative.test(fnToString.call(value)); - } - return isObjectLike(value) && reIsHostCtor.test(value); -} - -module.exports = isArray; diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.isarray/package.json b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.isarray/package.json deleted file mode 100644 index 54d165c..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.isarray/package.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "name": "lodash.isarray", - "version": "3.0.4", - "description": "The modern build of lodash’s `_.isArray` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": [ - "lodash", - "lodash-modularized", - "stdlib", - "util" - ], - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash.isarray@3.0.4", - "_shasum": "79e4eb88c36a8122af86f844aa9bcd851b5fbb55", - "_from": "lodash.isarray@>=3.0.0 <4.0.0", - "_npmVersion": "2.12.0", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - } - ], - "dist": { - "shasum": "79e4eb88c36a8122af86f844aa9bcd851b5fbb55", - "tarball": "http://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/LICENSE b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/LICENSE deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/README.md b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/README.md deleted file mode 100644 index 5f69a18..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash.keys v3.1.2 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.keys` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.keys -``` - -In Node.js/io.js: - -```js -var keys = require('lodash.keys'); -``` - -See the [documentation](https://lodash.com/docs#keys) or [package source](https://github.com/lodash/lodash/blob/3.1.2-npm-packages/lodash.keys) for more details. diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/index.js b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/index.js deleted file mode 100644 index f4c1774..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/index.js +++ /dev/null @@ -1,236 +0,0 @@ -/** - * lodash 3.1.2 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -var getNative = require('lodash._getnative'), - isArguments = require('lodash.isarguments'), - isArray = require('lodash.isarray'); - -/** Used to detect unsigned integer values. */ -var reIsUint = /^\d+$/; - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeKeys = getNative(Object, 'keys'); - -/** - * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) - * of an array-like value. - */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; -} - -/** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ -var getLength = baseProperty('length'); - -/** - * Checks if `value` is array-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - */ -function isArrayLike(value) { - return value != null && isLength(getLength(value)); -} - -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - */ -function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * A fallback implementation of `Object.keys` which creates an array of the - * own enumerable property names of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function shimKeys(object) { - var props = keysIn(object), - propsLength = props.length, - length = propsLength && object.length; - - var allowIndexes = !!length && isLength(length) && - (isArray(object) || isArguments(object)); - - var index = -1, - result = []; - - while (++index < propsLength) { - var key = props[index]; - if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) { - result.push(key); - } - } - return result; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) - * for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ -var keys = !nativeKeys ? shimKeys : function(object) { - var Ctor = object == null ? undefined : object.constructor; - if ((typeof Ctor == 'function' && Ctor.prototype === object) || - (typeof object != 'function' && isArrayLike(object))) { - return shimKeys(object); - } - return isObject(object) ? nativeKeys(object) : []; -}; - -/** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ -function keysIn(object) { - if (object == null) { - return []; - } - if (!isObject(object)) { - object = Object(object); - } - var length = object.length; - length = (length && isLength(length) && - (isArray(object) || isArguments(object)) && length) || 0; - - var Ctor = object.constructor, - index = -1, - isProto = typeof Ctor == 'function' && Ctor.prototype === object, - result = Array(length), - skipIndexes = length > 0; - - while (++index < length) { - result[index] = (index + ''); - } - for (var key in object) { - if (!(skipIndexes && isIndex(key, length)) && - !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; -} - -module.exports = keys; diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash._getnative/LICENSE b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash._getnative/LICENSE deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash._getnative/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash._getnative/README.md b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash._getnative/README.md deleted file mode 100644 index 7835cec..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash._getnative/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._getnative v3.9.1 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `getNative` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._getnative -``` - -In Node.js/io.js: - -```js -var getNative = require('lodash._getnative'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.9.1-npm-packages/lodash._getnative) for more details. diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash._getnative/index.js b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash._getnative/index.js deleted file mode 100644 index a32063d..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash._getnative/index.js +++ /dev/null @@ -1,137 +0,0 @@ -/** - * lodash 3.9.1 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** `Object#toString` result references. */ -var funcTag = '[object Function]'; - -/** Used to detect host constructors (Safari > 5). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** - * Checks if `value` is object-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var fnToString = Function.prototype.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objToString = objectProto.toString; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = object == null ? undefined : object[key]; - return isNative(value) ? value : undefined; -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in older versions of Chrome and Safari which return 'function' for regexes - // and Safari 8 equivalents which return 'object' for typed array constructors. - return isObject(value) && objToString.call(value) == funcTag; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ -function isNative(value) { - if (value == null) { - return false; - } - if (isFunction(value)) { - return reIsNative.test(fnToString.call(value)); - } - return isObjectLike(value) && reIsHostCtor.test(value); -} - -module.exports = getNative; diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash._getnative/package.json b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash._getnative/package.json deleted file mode 100644 index 41400a9..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash._getnative/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "name": "lodash._getnative", - "version": "3.9.1", - "description": "The modern build of lodash’s internal `getNative` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._getnative@3.9.1", - "_shasum": "570bc7dede46d61cdcde687d65d3eecbaa3aaff5", - "_from": "lodash._getnative@>=3.0.0 <4.0.0", - "_npmVersion": "2.12.0", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "dist": { - "shasum": "570bc7dede46d61cdcde687d65d3eecbaa3aaff5", - "tarball": "http://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash.isarguments/LICENSE b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash.isarguments/LICENSE deleted file mode 100644 index b054ca5..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash.isarguments/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash.isarguments/README.md b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash.isarguments/README.md deleted file mode 100644 index e53688d..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash.isarguments/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.isarguments v3.0.6 - -The [lodash](https://lodash.com/) method `_.isArguments` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.isarguments -``` - -In Node.js: -```js -var isArguments = require('lodash.isarguments'); -``` - -See the [documentation](https://lodash.com/docs#isArguments) or [package source](https://github.com/lodash/lodash/blob/3.0.6-npm-packages/lodash.isarguments) for more details. diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash.isarguments/index.js b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash.isarguments/index.js deleted file mode 100644 index 56ec8ac..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash.isarguments/index.js +++ /dev/null @@ -1,245 +0,0 @@ -/** - * lodash 3.0.6 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var propertyIsEnumerable = objectProto.propertyIsEnumerable; - -/** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; -} - -/** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ -var getLength = baseProperty('length'); - -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -function isArguments(value) { - // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); -} - -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @type Function - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && - !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value)); -} - -/** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @type Function - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array constructors, and - // PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -module.exports = isArguments; diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash.isarguments/package.json b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash.isarguments/package.json deleted file mode 100644 index 5384e10..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/node_modules/lodash.isarguments/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "lodash.isarguments", - "version": "3.0.6", - "description": "The lodash method `_.isArguments` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": [ - "lodash-modularized", - "isarguments" - ], - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "https://github.com/phated" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash.isarguments@3.0.6", - "_shasum": "5dcaf8555b3ccd0afb15812b9819ec68ca098206", - "_from": "lodash.isarguments@>=3.0.0 <4.0.0", - "_npmVersion": "2.14.15", - "_nodeVersion": "5.4.0", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "dist": { - "shasum": "5dcaf8555b3ccd0afb15812b9819ec68ca098206", - "tarball": "http://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.0.6.tgz" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "_npmOperationalInternal": { - "host": "packages-5-east.internal.npmjs.com", - "tmp": "tmp/lodash.isarguments-3.0.6.tgz_1454484489481_0.09009004035033286" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.0.6.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/package.json b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/package.json deleted file mode 100644 index e3aecc5..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash.keys/package.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "name": "lodash.keys", - "version": "3.1.2", - "description": "The modern build of lodash’s `_.keys` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": [ - "lodash", - "lodash-modularized", - "stdlib", - "util" - ], - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "dependencies": { - "lodash._getnative": "^3.0.0", - "lodash.isarguments": "^3.0.0", - "lodash.isarray": "^3.0.0" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash.keys@3.1.2", - "_shasum": "4dbc0472b156be50a0b286855d1bd0b0c656098a", - "_from": "lodash.keys@>=3.0.0 <4.0.0", - "_npmVersion": "2.12.0", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - } - ], - "dist": { - "shasum": "4dbc0472b156be50a0b286855d1bd0b0c656098a", - "tarball": "http://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/package.json b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/package.json deleted file mode 100644 index c312d66..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/package.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "name": "lodash._baseclone", - "version": "3.3.0", - "description": "The modern build of lodash’s internal `baseClone` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "dependencies": { - "lodash._arraycopy": "^3.0.0", - "lodash._arrayeach": "^3.0.0", - "lodash._baseassign": "^3.0.0", - "lodash._basefor": "^3.0.0", - "lodash.isarray": "^3.0.0", - "lodash.keys": "^3.0.0" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._baseclone@3.3.0", - "_shasum": "303519bf6393fe7e42f34d8b630ef7794e3542b7", - "_from": "lodash._baseclone@>=3.0.0 <4.0.0", - "_npmVersion": "2.12.0", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - } - ], - "dist": { - "shasum": "303519bf6393fe7e42f34d8b630ef7794e3542b7", - "tarball": "http://registry.npmjs.org/lodash._baseclone/-/lodash._baseclone-3.3.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._baseclone/-/lodash._baseclone-3.3.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._bindcallback/LICENSE.txt b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._bindcallback/LICENSE.txt deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._bindcallback/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._bindcallback/README.md b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._bindcallback/README.md deleted file mode 100644 index d287f26..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._bindcallback/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._bindcallback v3.0.1 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `bindCallback` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._bindcallback -``` - -In Node.js/io.js: - -```js -var bindCallback = require('lodash._bindcallback'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._bindcallback) for more details. diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._bindcallback/index.js b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._bindcallback/index.js deleted file mode 100644 index ef6811d..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._bindcallback/index.js +++ /dev/null @@ -1,65 +0,0 @@ -/** - * lodash 3.0.1 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * A specialized version of `baseCallback` which only supports `this` binding - * and specifying the number of arguments to provide to `func`. - * - * @private - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {number} [argCount] The number of arguments to provide to `func`. - * @returns {Function} Returns the callback. - */ -function bindCallback(func, thisArg, argCount) { - if (typeof func != 'function') { - return identity; - } - if (thisArg === undefined) { - return func; - } - switch (argCount) { - case 1: return function(value) { - return func.call(thisArg, value); - }; - case 3: return function(value, index, collection) { - return func.call(thisArg, value, index, collection); - }; - case 4: return function(accumulator, value, index, collection) { - return func.call(thisArg, accumulator, value, index, collection); - }; - case 5: return function(value, other, key, object, source) { - return func.call(thisArg, value, other, key, object, source); - }; - } - return function() { - return func.apply(thisArg, arguments); - }; -} - -/** - * This method returns the first argument provided to it. - * - * @static - * @memberOf _ - * @category Utility - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'user': 'fred' }; - * - * _.identity(object) === object; - * // => true - */ -function identity(value) { - return value; -} - -module.exports = bindCallback; diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._bindcallback/package.json b/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._bindcallback/package.json deleted file mode 100644 index 374000d..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/node_modules/lodash._bindcallback/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "name": "lodash._bindcallback", - "version": "3.0.1", - "description": "The modern build of lodash’s internal `bindCallback` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._bindcallback@3.0.1", - "_shasum": "e531c27644cf8b57a99e17ed95b35c748789392e", - "_from": "lodash._bindcallback@>=3.0.0 <4.0.0", - "_npmVersion": "2.7.6", - "_nodeVersion": "0.12.2", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "dist": { - "shasum": "e531c27644cf8b57a99e17ed95b35c748789392e", - "tarball": "http://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.clonedeep/package.json b/node_modules/eslint/node_modules/lodash.clonedeep/package.json deleted file mode 100644 index abed99e..0000000 --- a/node_modules/eslint/node_modules/lodash.clonedeep/package.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "name": "lodash.clonedeep", - "version": "3.0.2", - "description": "The modern build of lodash’s `_.cloneDeep` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": [ - "lodash", - "lodash-modularized", - "stdlib", - "util" - ], - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "dependencies": { - "lodash._baseclone": "^3.0.0", - "lodash._bindcallback": "^3.0.0" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash.clonedeep@3.0.2", - "_shasum": "a0a1e40d82a5ea89ff5b147b8444ed63d92827db", - "_from": "lodash.clonedeep@>=3.0.1 <4.0.0", - "_npmVersion": "2.13.1", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - } - ], - "dist": { - "shasum": "a0a1e40d82a5ea89ff5b147b8444ed63d92827db", - "tarball": "http://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-3.0.2.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-3.0.2.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.merge/LICENSE b/node_modules/eslint/node_modules/lodash.merge/LICENSE deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.merge/README.md b/node_modules/eslint/node_modules/lodash.merge/README.md deleted file mode 100644 index e8acecf..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash.merge v3.3.2 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.merge` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.merge -``` - -In Node.js/io.js: - -```js -var merge = require('lodash.merge'); -``` - -See the [documentation](https://lodash.com/docs#merge) or [package source](https://github.com/lodash/lodash/blob/3.3.2-npm-packages/lodash.merge) for more details. diff --git a/node_modules/eslint/node_modules/lodash.merge/index.js b/node_modules/eslint/node_modules/lodash.merge/index.js deleted file mode 100644 index 42a7bc1..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/index.js +++ /dev/null @@ -1,266 +0,0 @@ -/** - * lodash 3.3.2 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -var arrayCopy = require('lodash._arraycopy'), - arrayEach = require('lodash._arrayeach'), - createAssigner = require('lodash._createassigner'), - isArguments = require('lodash.isarguments'), - isArray = require('lodash.isarray'), - isPlainObject = require('lodash.isplainobject'), - isTypedArray = require('lodash.istypedarray'), - keys = require('lodash.keys'), - toPlainObject = require('lodash.toplainobject'); - -/** - * Checks if `value` is object-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) - * of an array-like value. - */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** - * The base implementation of `_.merge` without support for argument juggling, - * multiple sources, and `this` binding `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {Function} [customizer] The function to customize merged values. - * @param {Array} [stackA=[]] Tracks traversed source objects. - * @param {Array} [stackB=[]] Associates values with source counterparts. - * @returns {Object} Returns `object`. - */ -function baseMerge(object, source, customizer, stackA, stackB) { - if (!isObject(object)) { - return object; - } - var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)), - props = isSrcArr ? undefined : keys(source); - - arrayEach(props || source, function(srcValue, key) { - if (props) { - key = srcValue; - srcValue = source[key]; - } - if (isObjectLike(srcValue)) { - stackA || (stackA = []); - stackB || (stackB = []); - baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB); - } - else { - var value = object[key], - result = customizer ? customizer(value, srcValue, key, object, source) : undefined, - isCommon = result === undefined; - - if (isCommon) { - result = srcValue; - } - if ((result !== undefined || (isSrcArr && !(key in object))) && - (isCommon || (result === result ? (result !== value) : (value === value)))) { - object[key] = result; - } - } - }); - return object; -} - -/** - * A specialized version of `baseMerge` for arrays and objects which performs - * deep merges and tracks traversed objects enabling objects with circular - * references to be merged. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {string} key The key of the value to merge. - * @param {Function} mergeFunc The function to merge values. - * @param {Function} [customizer] The function to customize merged values. - * @param {Array} [stackA=[]] Tracks traversed source objects. - * @param {Array} [stackB=[]] Associates values with source counterparts. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ -function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) { - var length = stackA.length, - srcValue = source[key]; - - while (length--) { - if (stackA[length] == srcValue) { - object[key] = stackB[length]; - return; - } - } - var value = object[key], - result = customizer ? customizer(value, srcValue, key, object, source) : undefined, - isCommon = result === undefined; - - if (isCommon) { - result = srcValue; - if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) { - result = isArray(value) - ? value - : (isArrayLike(value) ? arrayCopy(value) : []); - } - else if (isPlainObject(srcValue) || isArguments(srcValue)) { - result = isArguments(value) - ? toPlainObject(value) - : (isPlainObject(value) ? value : {}); - } - else { - isCommon = false; - } - } - // Add the source value to the stack of traversed objects and associate - // it with its merged value. - stackA.push(srcValue); - stackB.push(result); - - if (isCommon) { - // Recursively merge objects and arrays (susceptible to call stack limits). - object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB); - } else if (result === result ? (result !== value) : (value === value)) { - object[key] = result; - } -} - -/** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; -} - -/** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ -var getLength = baseProperty('length'); - -/** - * Checks if `value` is array-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - */ -function isArrayLike(value) { - return value != null && isLength(getLength(value)); -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - */ -function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Recursively merges own enumerable properties of the source object(s), that - * don't resolve to `undefined` into the destination object. Subsequent sources - * overwrite property assignments of previous sources. If `customizer` is - * provided it is invoked to produce the merged values of the destination and - * source properties. If `customizer` returns `undefined` merging is handled - * by the method instead. The `customizer` is bound to `thisArg` and invoked - * with five arguments: (objectValue, sourceValue, key, object, source). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {Object} Returns `object`. - * @example - * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] - * }; - * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] - * }; - * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } - * - * // using a customizer callback - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, function(a, b) { - * if (_.isArray(a)) { - * return a.concat(b); - * } - * }); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ -var merge = createAssigner(baseMerge); - -module.exports = merge; diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._arraycopy/LICENSE.txt b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._arraycopy/LICENSE.txt deleted file mode 100644 index 1776432..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._arraycopy/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._arraycopy/README.md b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._arraycopy/README.md deleted file mode 100644 index 16ee6fd..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._arraycopy/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._arraycopy v3.0.0 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `arrayCopy` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._arraycopy -``` - -In Node.js/io.js: - -```js -var arrayCopy = require('lodash._arraycopy'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash._arraycopy) for more details. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._arraycopy/index.js b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._arraycopy/index.js deleted file mode 100644 index b9abb22..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._arraycopy/index.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * lodash 3.0.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ -function arrayCopy(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; -} - -module.exports = arrayCopy; diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._arraycopy/package.json b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._arraycopy/package.json deleted file mode 100644 index 5f851f5..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._arraycopy/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "lodash._arraycopy", - "version": "3.0.0", - "description": "The modern build of lodash’s internal `arrayCopy` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._arraycopy@3.0.0", - "_shasum": "76e7b7c1f1fb92547374878a562ed06a3e50f6e1", - "_from": "lodash._arraycopy@>=3.0.0 <4.0.0", - "_npmVersion": "2.3.0", - "_nodeVersion": "0.10.35", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - } - ], - "dist": { - "shasum": "76e7b7c1f1fb92547374878a562ed06a3e50f6e1", - "tarball": "http://registry.npmjs.org/lodash._arraycopy/-/lodash._arraycopy-3.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._arraycopy/-/lodash._arraycopy-3.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._arrayeach/LICENSE.txt b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._arrayeach/LICENSE.txt deleted file mode 100644 index 1776432..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._arrayeach/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._arrayeach/README.md b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._arrayeach/README.md deleted file mode 100644 index 1f3236b..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._arrayeach/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._arrayeach v3.0.0 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `arrayEach` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._arrayeach -``` - -In Node.js/io.js: - -```js -var arrayEach = require('lodash._arrayeach'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash._arrayeach) for more details. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._arrayeach/index.js b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._arrayeach/index.js deleted file mode 100644 index 7b31bcd..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._arrayeach/index.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * lodash 3.0.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * A specialized version of `_.forEach` for arrays without support for callback - * shorthands or `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ -function arrayEach(array, iteratee) { - var index = -1, - length = array.length; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; -} - -module.exports = arrayEach; diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._arrayeach/package.json b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._arrayeach/package.json deleted file mode 100644 index 993a8f3..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._arrayeach/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "lodash._arrayeach", - "version": "3.0.0", - "description": "The modern build of lodash’s internal `arrayEach` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._arrayeach@3.0.0", - "_shasum": "bab156b2a90d3f1bbd5c653403349e5e5933ef9e", - "_from": "lodash._arrayeach@>=3.0.0 <4.0.0", - "_npmVersion": "2.3.0", - "_nodeVersion": "0.10.35", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - } - ], - "dist": { - "shasum": "bab156b2a90d3f1bbd5c653403349e5e5933ef9e", - "tarball": "http://registry.npmjs.org/lodash._arrayeach/-/lodash._arrayeach-3.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._arrayeach/-/lodash._arrayeach-3.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/LICENSE.txt b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/LICENSE.txt deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/README.md b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/README.md deleted file mode 100644 index daeebce..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._createassigner v3.1.1 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `createAssigner` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._createassigner -``` - -In Node.js/io.js: - -```js -var createAssigner = require('lodash._createassigner'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.1.1-npm-packages/lodash._createassigner) for more details. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/index.js b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/index.js deleted file mode 100644 index 2fdfba7..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/index.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * lodash 3.1.1 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -var bindCallback = require('lodash._bindcallback'), - isIterateeCall = require('lodash._isiterateecall'), - restParam = require('lodash.restparam'); - -/** - * Creates a function that assigns properties of source object(s) to a given - * destination object. - * - * **Note:** This function is used to create `_.assign`, `_.defaults`, and `_.merge`. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ -function createAssigner(assigner) { - return restParam(function(object, sources) { - var index = -1, - length = object == null ? 0 : sources.length, - customizer = length > 2 ? sources[length - 2] : undefined, - guard = length > 2 ? sources[2] : undefined, - thisArg = length > 1 ? sources[length - 1] : undefined; - - if (typeof customizer == 'function') { - customizer = bindCallback(customizer, thisArg, 5); - length -= 2; - } else { - customizer = typeof thisArg == 'function' ? thisArg : undefined; - length -= (customizer ? 1 : 0); - } - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, customizer); - } - } - return object; - }); -} - -module.exports = createAssigner; diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash._bindcallback/LICENSE.txt b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash._bindcallback/LICENSE.txt deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash._bindcallback/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash._bindcallback/README.md b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash._bindcallback/README.md deleted file mode 100644 index d287f26..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash._bindcallback/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._bindcallback v3.0.1 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `bindCallback` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._bindcallback -``` - -In Node.js/io.js: - -```js -var bindCallback = require('lodash._bindcallback'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._bindcallback) for more details. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash._bindcallback/index.js b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash._bindcallback/index.js deleted file mode 100644 index ef6811d..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash._bindcallback/index.js +++ /dev/null @@ -1,65 +0,0 @@ -/** - * lodash 3.0.1 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * A specialized version of `baseCallback` which only supports `this` binding - * and specifying the number of arguments to provide to `func`. - * - * @private - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {number} [argCount] The number of arguments to provide to `func`. - * @returns {Function} Returns the callback. - */ -function bindCallback(func, thisArg, argCount) { - if (typeof func != 'function') { - return identity; - } - if (thisArg === undefined) { - return func; - } - switch (argCount) { - case 1: return function(value) { - return func.call(thisArg, value); - }; - case 3: return function(value, index, collection) { - return func.call(thisArg, value, index, collection); - }; - case 4: return function(accumulator, value, index, collection) { - return func.call(thisArg, accumulator, value, index, collection); - }; - case 5: return function(value, other, key, object, source) { - return func.call(thisArg, value, other, key, object, source); - }; - } - return function() { - return func.apply(thisArg, arguments); - }; -} - -/** - * This method returns the first argument provided to it. - * - * @static - * @memberOf _ - * @category Utility - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'user': 'fred' }; - * - * _.identity(object) === object; - * // => true - */ -function identity(value) { - return value; -} - -module.exports = bindCallback; diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash._bindcallback/package.json b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash._bindcallback/package.json deleted file mode 100644 index 374000d..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash._bindcallback/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "name": "lodash._bindcallback", - "version": "3.0.1", - "description": "The modern build of lodash’s internal `bindCallback` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._bindcallback@3.0.1", - "_shasum": "e531c27644cf8b57a99e17ed95b35c748789392e", - "_from": "lodash._bindcallback@>=3.0.0 <4.0.0", - "_npmVersion": "2.7.6", - "_nodeVersion": "0.12.2", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "dist": { - "shasum": "e531c27644cf8b57a99e17ed95b35c748789392e", - "tarball": "http://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash._isiterateecall/LICENSE.txt b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash._isiterateecall/LICENSE.txt deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash._isiterateecall/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash._isiterateecall/README.md b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash._isiterateecall/README.md deleted file mode 100644 index 0c5c701..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash._isiterateecall/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._isiterateecall v3.0.9 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `isIterateeCall` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._isiterateecall -``` - -In Node.js/io.js: - -```js -var isIterateeCall = require('lodash._isiterateecall'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.0.9-npm-packages/lodash._isiterateecall) for more details. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash._isiterateecall/index.js b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash._isiterateecall/index.js deleted file mode 100644 index ea3761b..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash._isiterateecall/index.js +++ /dev/null @@ -1,132 +0,0 @@ -/** - * lodash 3.0.9 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** Used to detect unsigned integer values. */ -var reIsUint = /^\d+$/; - -/** - * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) - * of an array-like value. - */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; -} - -/** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ -var getLength = baseProperty('length'); - -/** - * Checks if `value` is array-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - */ -function isArrayLike(value) { - return value != null && isLength(getLength(value)); -} - -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; -} - -/** - * Checks if the provided arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. - */ -function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object)) { - var other = object[index]; - return value === value ? (value === other) : (other !== other); - } - return false; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - */ -function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -module.exports = isIterateeCall; diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash._isiterateecall/package.json b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash._isiterateecall/package.json deleted file mode 100644 index bfb1e2a..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash._isiterateecall/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "name": "lodash._isiterateecall", - "version": "3.0.9", - "description": "The modern build of lodash’s internal `isIterateeCall` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._isiterateecall@3.0.9", - "_shasum": "5203ad7ba425fae842460e696db9cf3e6aac057c", - "_from": "lodash._isiterateecall@>=3.0.0 <4.0.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "2.0.2", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "dist": { - "shasum": "5203ad7ba425fae842460e696db9cf3e6aac057c", - "tarball": "http://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash.restparam/LICENSE.txt b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash.restparam/LICENSE.txt deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash.restparam/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash.restparam/README.md b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash.restparam/README.md deleted file mode 100644 index 80e47a4..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash.restparam/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash.restparam v3.6.1 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.restParam` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.restparam -``` - -In Node.js/io.js: - -```js -var restParam = require('lodash.restparam'); -``` - -See the [documentation](https://lodash.com/docs#restParam) or [package source](https://github.com/lodash/lodash/blob/3.6.1-npm-packages/lodash.restparam) for more details. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js deleted file mode 100644 index 932f47a..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js +++ /dev/null @@ -1,67 +0,0 @@ -/** - * lodash 3.6.1 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as an array. - * - * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters). - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.restParam(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' - */ -function restParam(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - rest = Array(length); - - while (++index < length) { - rest[index] = args[start + index]; - } - switch (start) { - case 0: return func.call(this, rest); - case 1: return func.call(this, args[0], rest); - case 2: return func.call(this, args[0], args[1], rest); - } - var otherArgs = Array(start + 1); - index = -1; - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = rest; - return func.apply(this, otherArgs); - }; -} - -module.exports = restParam; diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash.restparam/package.json b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash.restparam/package.json deleted file mode 100644 index c00ecad..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/node_modules/lodash.restparam/package.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "name": "lodash.restparam", - "version": "3.6.1", - "description": "The modern build of lodash’s `_.restParam` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": [ - "lodash", - "lodash-modularized", - "stdlib", - "util" - ], - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash.restparam@3.6.1", - "_shasum": "936a4e309ef330a7645ed4145986c85ae5b20805", - "_from": "lodash.restparam@>=3.0.0 <4.0.0", - "_npmVersion": "2.7.6", - "_nodeVersion": "0.12.2", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "dist": { - "shasum": "936a4e309ef330a7645ed4145986c85ae5b20805", - "tarball": "http://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/package.json b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/package.json deleted file mode 100644 index 3d8a948..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._createassigner/package.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "name": "lodash._createassigner", - "version": "3.1.1", - "description": "The modern build of lodash’s internal `createAssigner` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "dependencies": { - "lodash._bindcallback": "^3.0.0", - "lodash._isiterateecall": "^3.0.0", - "lodash.restparam": "^3.0.0" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._createassigner@3.1.1", - "_shasum": "838a5bae2fdaca63ac22dee8e19fa4e6d6970b11", - "_from": "lodash._createassigner@>=3.0.0 <4.0.0", - "_npmVersion": "2.10.0", - "_nodeVersion": "0.12.3", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "dist": { - "shasum": "838a5bae2fdaca63ac22dee8e19fa4e6d6970b11", - "tarball": "http://registry.npmjs.org/lodash._createassigner/-/lodash._createassigner-3.1.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._createassigner/-/lodash._createassigner-3.1.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._getnative/LICENSE b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._getnative/LICENSE deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._getnative/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._getnative/README.md b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._getnative/README.md deleted file mode 100644 index 7835cec..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._getnative/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._getnative v3.9.1 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `getNative` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._getnative -``` - -In Node.js/io.js: - -```js -var getNative = require('lodash._getnative'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.9.1-npm-packages/lodash._getnative) for more details. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._getnative/index.js b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._getnative/index.js deleted file mode 100644 index a32063d..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._getnative/index.js +++ /dev/null @@ -1,137 +0,0 @@ -/** - * lodash 3.9.1 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** `Object#toString` result references. */ -var funcTag = '[object Function]'; - -/** Used to detect host constructors (Safari > 5). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** - * Checks if `value` is object-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var fnToString = Function.prototype.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objToString = objectProto.toString; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = object == null ? undefined : object[key]; - return isNative(value) ? value : undefined; -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in older versions of Chrome and Safari which return 'function' for regexes - // and Safari 8 equivalents which return 'object' for typed array constructors. - return isObject(value) && objToString.call(value) == funcTag; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ -function isNative(value) { - if (value == null) { - return false; - } - if (isFunction(value)) { - return reIsNative.test(fnToString.call(value)); - } - return isObjectLike(value) && reIsHostCtor.test(value); -} - -module.exports = getNative; diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._getnative/package.json b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._getnative/package.json deleted file mode 100644 index 41400a9..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash._getnative/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "name": "lodash._getnative", - "version": "3.9.1", - "description": "The modern build of lodash’s internal `getNative` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._getnative@3.9.1", - "_shasum": "570bc7dede46d61cdcde687d65d3eecbaa3aaff5", - "_from": "lodash._getnative@>=3.0.0 <4.0.0", - "_npmVersion": "2.12.0", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "dist": { - "shasum": "570bc7dede46d61cdcde687d65d3eecbaa3aaff5", - "tarball": "http://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isarguments/LICENSE b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isarguments/LICENSE deleted file mode 100644 index b054ca5..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isarguments/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isarguments/README.md b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isarguments/README.md deleted file mode 100644 index e53688d..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isarguments/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.isarguments v3.0.6 - -The [lodash](https://lodash.com/) method `_.isArguments` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.isarguments -``` - -In Node.js: -```js -var isArguments = require('lodash.isarguments'); -``` - -See the [documentation](https://lodash.com/docs#isArguments) or [package source](https://github.com/lodash/lodash/blob/3.0.6-npm-packages/lodash.isarguments) for more details. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isarguments/index.js b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isarguments/index.js deleted file mode 100644 index 56ec8ac..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isarguments/index.js +++ /dev/null @@ -1,245 +0,0 @@ -/** - * lodash 3.0.6 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var propertyIsEnumerable = objectProto.propertyIsEnumerable; - -/** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; -} - -/** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ -var getLength = baseProperty('length'); - -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -function isArguments(value) { - // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); -} - -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @type Function - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && - !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value)); -} - -/** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @type Function - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array constructors, and - // PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -module.exports = isArguments; diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isarguments/package.json b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isarguments/package.json deleted file mode 100644 index 5384e10..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isarguments/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "lodash.isarguments", - "version": "3.0.6", - "description": "The lodash method `_.isArguments` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": [ - "lodash-modularized", - "isarguments" - ], - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "https://github.com/phated" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash.isarguments@3.0.6", - "_shasum": "5dcaf8555b3ccd0afb15812b9819ec68ca098206", - "_from": "lodash.isarguments@>=3.0.0 <4.0.0", - "_npmVersion": "2.14.15", - "_nodeVersion": "5.4.0", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "dist": { - "shasum": "5dcaf8555b3ccd0afb15812b9819ec68ca098206", - "tarball": "http://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.0.6.tgz" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "_npmOperationalInternal": { - "host": "packages-5-east.internal.npmjs.com", - "tmp": "tmp/lodash.isarguments-3.0.6.tgz_1454484489481_0.09009004035033286" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.0.6.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isarray/LICENSE b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isarray/LICENSE deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isarray/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isarray/README.md b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isarray/README.md deleted file mode 100644 index ea274aa..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isarray/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash.isarray v3.0.4 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.isArray` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.isarray -``` - -In Node.js/io.js: - -```js -var isArray = require('lodash.isarray'); -``` - -See the [documentation](https://lodash.com/docs#isArray) or [package source](https://github.com/lodash/lodash/blob/3.0.4-npm-packages/lodash.isarray) for more details. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isarray/index.js b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isarray/index.js deleted file mode 100644 index dd24658..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isarray/index.js +++ /dev/null @@ -1,180 +0,0 @@ -/** - * lodash 3.0.4 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** `Object#toString` result references. */ -var arrayTag = '[object Array]', - funcTag = '[object Function]'; - -/** Used to detect host constructors (Safari > 5). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** - * Checks if `value` is object-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var fnToString = Function.prototype.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objToString = objectProto.toString; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeIsArray = getNative(Array, 'isArray'); - -/** - * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) - * of an array-like value. - */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = object == null ? undefined : object[key]; - return isNative(value) ? value : undefined; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - */ -function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(function() { return arguments; }()); - * // => false - */ -var isArray = nativeIsArray || function(value) { - return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; -}; - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in older versions of Chrome and Safari which return 'function' for regexes - // and Safari 8 equivalents which return 'object' for typed array constructors. - return isObject(value) && objToString.call(value) == funcTag; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ -function isNative(value) { - if (value == null) { - return false; - } - if (isFunction(value)) { - return reIsNative.test(fnToString.call(value)); - } - return isObjectLike(value) && reIsHostCtor.test(value); -} - -module.exports = isArray; diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isarray/package.json b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isarray/package.json deleted file mode 100644 index 54d165c..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isarray/package.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "name": "lodash.isarray", - "version": "3.0.4", - "description": "The modern build of lodash’s `_.isArray` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": [ - "lodash", - "lodash-modularized", - "stdlib", - "util" - ], - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash.isarray@3.0.4", - "_shasum": "79e4eb88c36a8122af86f844aa9bcd851b5fbb55", - "_from": "lodash.isarray@>=3.0.0 <4.0.0", - "_npmVersion": "2.12.0", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - } - ], - "dist": { - "shasum": "79e4eb88c36a8122af86f844aa9bcd851b5fbb55", - "tarball": "http://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isplainobject/LICENSE b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isplainobject/LICENSE deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isplainobject/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isplainobject/README.md b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isplainobject/README.md deleted file mode 100644 index 49adee1..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isplainobject/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash.isplainobject v3.2.0 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.isPlainObject` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.isplainobject -``` - -In Node.js/io.js: - -```js -var isPlainObject = require('lodash.isplainobject'); -``` - -See the [documentation](https://lodash.com/docs#isPlainObject) or [package source](https://github.com/lodash/lodash/blob/3.2.0-npm-packages/lodash.isplainobject) for more details. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isplainobject/index.js b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isplainobject/index.js deleted file mode 100644 index beadd60..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isplainobject/index.js +++ /dev/null @@ -1,103 +0,0 @@ -/** - * lodash 3.2.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -var baseFor = require('lodash._basefor'), - isArguments = require('lodash.isarguments'), - keysIn = require('lodash.keysin'); - -/** `Object#toString` result references. */ -var objectTag = '[object Object]'; - -/** - * Checks if `value` is object-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objToString = objectProto.toString; - -/** - * The base implementation of `_.forIn` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ -function baseForIn(object, iteratee) { - return baseFor(object, iteratee, keysIn); -} - -/** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * **Note:** This method assumes objects created by the `Object` constructor - * have no inherited enumerable properties. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ -function isPlainObject(value) { - var Ctor; - - // Exit early for non `Object` objects. - if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isArguments(value)) || - (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) { - return false; - } - // IE < 9 iterates inherited properties before own properties. If the first - // iterated property is an object's own property then there are no inherited - // enumerable properties. - var result; - // In most environments an object's own properties are iterated before - // its inherited properties. If the last iterated property is an object's - // own property then there are no inherited enumerable properties. - baseForIn(value, function(subValue, key) { - result = key; - }); - return result === undefined || hasOwnProperty.call(value, result); -} - -module.exports = isPlainObject; diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isplainobject/node_modules/lodash._basefor/LICENSE b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isplainobject/node_modules/lodash._basefor/LICENSE deleted file mode 100644 index b054ca5..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isplainobject/node_modules/lodash._basefor/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isplainobject/node_modules/lodash._basefor/README.md b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isplainobject/node_modules/lodash._basefor/README.md deleted file mode 100644 index b17e221..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isplainobject/node_modules/lodash._basefor/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._basefor v3.0.3 - -The internal [lodash](https://lodash.com/) function `baseFor` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._basefor -``` - -In Node.js: -```js -var baseFor = require('lodash._basefor'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.0.3-npm-packages/lodash._basefor) for more details. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isplainobject/node_modules/lodash._basefor/index.js b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isplainobject/node_modules/lodash._basefor/index.js deleted file mode 100644 index 3f1d189..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isplainobject/node_modules/lodash._basefor/index.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * lodash 3.0.3 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * The base implementation of `baseForIn` and `baseForOwn` which iterates - * over `object` properties returned by `keysFunc` invoking `iteratee` for - * each property. Iteratee functions may exit iteration early by explicitly - * returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ -var baseFor = createBaseFor(); - -/** - * Creates a base function for methods like `_.forIn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ -function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; -} - -module.exports = baseFor; diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isplainobject/node_modules/lodash._basefor/package.json b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isplainobject/node_modules/lodash._basefor/package.json deleted file mode 100644 index 7490169..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isplainobject/node_modules/lodash._basefor/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "lodash._basefor", - "version": "3.0.3", - "description": "The internal lodash function `baseFor` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "https://github.com/phated" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._basefor@3.0.3", - "_shasum": "7550b4e9218ef09fad24343b612021c79b4c20c2", - "_from": "lodash._basefor@>=3.0.0 <4.0.0", - "_npmVersion": "2.14.15", - "_nodeVersion": "5.4.0", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "dist": { - "shasum": "7550b4e9218ef09fad24343b612021c79b4c20c2", - "tarball": "http://registry.npmjs.org/lodash._basefor/-/lodash._basefor-3.0.3.tgz" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._basefor/-/lodash._basefor-3.0.3.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isplainobject/package.json b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isplainobject/package.json deleted file mode 100644 index b43bc29..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.isplainobject/package.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "name": "lodash.isplainobject", - "version": "3.2.0", - "description": "The modern build of lodash’s `_.isPlainObject` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": [ - "lodash", - "lodash-modularized", - "stdlib", - "util" - ], - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "dependencies": { - "lodash._basefor": "^3.0.0", - "lodash.isarguments": "^3.0.0", - "lodash.keysin": "^3.0.0" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash.isplainobject@3.2.0", - "_shasum": "9a8238ae16b200432960cd7346512d0123fbf4c5", - "_from": "lodash.isplainobject@>=3.0.0 <4.0.0", - "_npmVersion": "2.12.0", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - } - ], - "dist": { - "shasum": "9a8238ae16b200432960cd7346512d0123fbf4c5", - "tarball": "http://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-3.2.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-3.2.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.istypedarray/LICENSE b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.istypedarray/LICENSE deleted file mode 100644 index b054ca5..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.istypedarray/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.istypedarray/README.md b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.istypedarray/README.md deleted file mode 100644 index 7d0a6c2..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.istypedarray/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.istypedarray v3.0.4 - -The [lodash](https://lodash.com/) method `_.isTypedArray` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.istypedarray -``` - -In Node.js: -```js -var isTypedArray = require('lodash.istypedarray'); -``` - -See the [documentation](https://lodash.com/docs#isTypedArray) or [package source](https://github.com/lodash/lodash/blob/3.0.4-npm-packages/lodash.istypedarray) for more details. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.istypedarray/index.js b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.istypedarray/index.js deleted file mode 100644 index 544bbb1..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.istypedarray/index.js +++ /dev/null @@ -1,138 +0,0 @@ -/** - * lodash 3.0.4 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - weakMapTag = '[object WeakMap]'; - -var arrayBufferTag = '[object ArrayBuffer]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - -/** Used to identify `toStringTag` values of typed arrays. */ -var typedArrayTags = {}; -typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = -typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = -typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = -typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = -typedArrayTags[uint32Tag] = true; -typedArrayTags[argsTag] = typedArrayTags[arrayTag] = -typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = -typedArrayTags[dateTag] = typedArrayTags[errorTag] = -typedArrayTags[funcTag] = typedArrayTags[mapTag] = -typedArrayTags[numberTag] = typedArrayTags[objectTag] = -typedArrayTags[regexpTag] = typedArrayTags[setTag] = -typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ -function isTypedArray(value) { - return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; -} - -module.exports = isTypedArray; diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.istypedarray/package.json b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.istypedarray/package.json deleted file mode 100644 index a50aa6d..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.istypedarray/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "lodash.istypedarray", - "version": "3.0.4", - "description": "The lodash method `_.isTypedArray` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": [ - "lodash-modularized", - "istypedarray" - ], - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "https://github.com/phated" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash.istypedarray@3.0.4", - "_shasum": "fae5b807fee3cb3f19a3dd379babca5f53cdb6de", - "_from": "lodash.istypedarray@>=3.0.0 <4.0.0", - "_npmVersion": "2.14.15", - "_nodeVersion": "5.4.0", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "dist": { - "shasum": "fae5b807fee3cb3f19a3dd379babca5f53cdb6de", - "tarball": "http://registry.npmjs.org/lodash.istypedarray/-/lodash.istypedarray-3.0.4.tgz" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "_npmOperationalInternal": { - "host": "packages-9-west.internal.npmjs.com", - "tmp": "tmp/lodash.istypedarray-3.0.4.tgz_1454484543797_0.018702789209783077" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.istypedarray/-/lodash.istypedarray-3.0.4.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.keys/LICENSE b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.keys/LICENSE deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.keys/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.keys/README.md b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.keys/README.md deleted file mode 100644 index 5f69a18..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.keys/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash.keys v3.1.2 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.keys` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.keys -``` - -In Node.js/io.js: - -```js -var keys = require('lodash.keys'); -``` - -See the [documentation](https://lodash.com/docs#keys) or [package source](https://github.com/lodash/lodash/blob/3.1.2-npm-packages/lodash.keys) for more details. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.keys/index.js b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.keys/index.js deleted file mode 100644 index f4c1774..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.keys/index.js +++ /dev/null @@ -1,236 +0,0 @@ -/** - * lodash 3.1.2 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -var getNative = require('lodash._getnative'), - isArguments = require('lodash.isarguments'), - isArray = require('lodash.isarray'); - -/** Used to detect unsigned integer values. */ -var reIsUint = /^\d+$/; - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeKeys = getNative(Object, 'keys'); - -/** - * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) - * of an array-like value. - */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; -} - -/** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ -var getLength = baseProperty('length'); - -/** - * Checks if `value` is array-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - */ -function isArrayLike(value) { - return value != null && isLength(getLength(value)); -} - -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - */ -function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * A fallback implementation of `Object.keys` which creates an array of the - * own enumerable property names of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function shimKeys(object) { - var props = keysIn(object), - propsLength = props.length, - length = propsLength && object.length; - - var allowIndexes = !!length && isLength(length) && - (isArray(object) || isArguments(object)); - - var index = -1, - result = []; - - while (++index < propsLength) { - var key = props[index]; - if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) { - result.push(key); - } - } - return result; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) - * for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ -var keys = !nativeKeys ? shimKeys : function(object) { - var Ctor = object == null ? undefined : object.constructor; - if ((typeof Ctor == 'function' && Ctor.prototype === object) || - (typeof object != 'function' && isArrayLike(object))) { - return shimKeys(object); - } - return isObject(object) ? nativeKeys(object) : []; -}; - -/** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ -function keysIn(object) { - if (object == null) { - return []; - } - if (!isObject(object)) { - object = Object(object); - } - var length = object.length; - length = (length && isLength(length) && - (isArray(object) || isArguments(object)) && length) || 0; - - var Ctor = object.constructor, - index = -1, - isProto = typeof Ctor == 'function' && Ctor.prototype === object, - result = Array(length), - skipIndexes = length > 0; - - while (++index < length) { - result[index] = (index + ''); - } - for (var key in object) { - if (!(skipIndexes && isIndex(key, length)) && - !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; -} - -module.exports = keys; diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.keys/package.json b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.keys/package.json deleted file mode 100644 index e3aecc5..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.keys/package.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "name": "lodash.keys", - "version": "3.1.2", - "description": "The modern build of lodash’s `_.keys` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": [ - "lodash", - "lodash-modularized", - "stdlib", - "util" - ], - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "dependencies": { - "lodash._getnative": "^3.0.0", - "lodash.isarguments": "^3.0.0", - "lodash.isarray": "^3.0.0" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash.keys@3.1.2", - "_shasum": "4dbc0472b156be50a0b286855d1bd0b0c656098a", - "_from": "lodash.keys@>=3.0.0 <4.0.0", - "_npmVersion": "2.12.0", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - } - ], - "dist": { - "shasum": "4dbc0472b156be50a0b286855d1bd0b0c656098a", - "tarball": "http://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.keysin/LICENSE.txt b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.keysin/LICENSE.txt deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.keysin/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.keysin/README.md b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.keysin/README.md deleted file mode 100644 index 1ff19c8..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.keysin/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash.keysin v3.0.8 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.keysIn` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.keysin -``` - -In Node.js/io.js: - -```js -var keysIn = require('lodash.keysin'); -``` - -See the [documentation](https://lodash.com/docs#keysIn) or [package source](https://github.com/lodash/lodash/blob/3.0.8-npm-packages/lodash.keysin) for more details. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.keysin/index.js b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.keysin/index.js deleted file mode 100644 index b109299..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.keysin/index.js +++ /dev/null @@ -1,132 +0,0 @@ -/** - * lodash 3.0.8 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -var isArguments = require('lodash.isarguments'), - isArray = require('lodash.isarray'); - -/** Used to detect unsigned integer values. */ -var reIsUint = /^\d+$/; - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) - * of an array-like value. - */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - */ -function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ -function keysIn(object) { - if (object == null) { - return []; - } - if (!isObject(object)) { - object = Object(object); - } - var length = object.length; - length = (length && isLength(length) && - (isArray(object) || isArguments(object)) && length) || 0; - - var Ctor = object.constructor, - index = -1, - isProto = typeof Ctor == 'function' && Ctor.prototype === object, - result = Array(length), - skipIndexes = length > 0; - - while (++index < length) { - result[index] = (index + ''); - } - for (var key in object) { - if (!(skipIndexes && isIndex(key, length)) && - !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; -} - -module.exports = keysIn; diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.keysin/package.json b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.keysin/package.json deleted file mode 100644 index 31c6025..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.keysin/package.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "name": "lodash.keysin", - "version": "3.0.8", - "description": "The modern build of lodash’s `_.keysIn` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": [ - "lodash", - "lodash-modularized", - "stdlib", - "util" - ], - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "dependencies": { - "lodash.isarguments": "^3.0.0", - "lodash.isarray": "^3.0.0" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash.keysin@3.0.8", - "_shasum": "22c4493ebbedb1427962a54b445b2c8a767fb47f", - "_from": "lodash.keysin@>=3.0.0 <4.0.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "2.0.2", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "dist": { - "shasum": "22c4493ebbedb1427962a54b445b2c8a767fb47f", - "tarball": "http://registry.npmjs.org/lodash.keysin/-/lodash.keysin-3.0.8.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.keysin/-/lodash.keysin-3.0.8.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.toplainobject/LICENSE.txt b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.toplainobject/LICENSE.txt deleted file mode 100644 index 1776432..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.toplainobject/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.toplainobject/README.md b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.toplainobject/README.md deleted file mode 100644 index 72b3423..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.toplainobject/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash.toplainobject v3.0.0 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.toPlainObject` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.toplainobject -``` - -In Node.js/io.js: - -```js -var toPlainObject = require('lodash.toplainobject'); -``` - -See the [documentation](https://lodash.com/docs#toPlainObject) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.toplainobject) for more details. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.toplainobject/index.js b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.toplainobject/index.js deleted file mode 100644 index b54640c..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.toplainobject/index.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * lodash 3.0.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -var baseCopy = require('lodash._basecopy'), - keysIn = require('lodash.keysin'); - -/** - * Converts `value` to a plain object flattening inherited enumerable - * properties of `value` to own properties of the plain object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {Object} Returns the converted plain object. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.assign({ 'a': 1 }, new Foo); - * // => { 'a': 1, 'b': 2 } - * - * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); - * // => { 'a': 1, 'b': 2, 'c': 3 } - */ -function toPlainObject(value) { - return baseCopy(value, keysIn(value)); -} - -module.exports = toPlainObject; diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.toplainobject/node_modules/lodash._basecopy/LICENSE.txt b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.toplainobject/node_modules/lodash._basecopy/LICENSE.txt deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.toplainobject/node_modules/lodash._basecopy/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.toplainobject/node_modules/lodash._basecopy/README.md b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.toplainobject/node_modules/lodash._basecopy/README.md deleted file mode 100644 index acdfa29..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.toplainobject/node_modules/lodash._basecopy/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._basecopy v3.0.1 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseCopy` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._basecopy -``` - -In Node.js/io.js: - -```js -var baseCopy = require('lodash._basecopy'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._basecopy) for more details. diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.toplainobject/node_modules/lodash._basecopy/index.js b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.toplainobject/node_modules/lodash._basecopy/index.js deleted file mode 100644 index b586d31..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.toplainobject/node_modules/lodash._basecopy/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * lodash 3.0.1 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. - * @param {Object} [object={}] The object to copy properties to. - * @returns {Object} Returns `object`. - */ -function baseCopy(source, props, object) { - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - object[key] = source[key]; - } - return object; -} - -module.exports = baseCopy; diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.toplainobject/node_modules/lodash._basecopy/package.json b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.toplainobject/node_modules/lodash._basecopy/package.json deleted file mode 100644 index 47db975..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.toplainobject/node_modules/lodash._basecopy/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "name": "lodash._basecopy", - "version": "3.0.1", - "description": "The modern build of lodash’s internal `baseCopy` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._basecopy@3.0.1", - "_shasum": "8da0e6a876cf344c0ad8a54882111dd3c5c7ca36", - "_from": "lodash._basecopy@>=3.0.0 <4.0.0", - "_npmVersion": "2.7.6", - "_nodeVersion": "0.12.2", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "dist": { - "shasum": "8da0e6a876cf344c0ad8a54882111dd3c5c7ca36", - "tarball": "http://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.toplainobject/package.json b/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.toplainobject/package.json deleted file mode 100644 index 8b206c8..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/node_modules/lodash.toplainobject/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "name": "lodash.toplainobject", - "version": "3.0.0", - "description": "The modern build of lodash’s `_.toPlainObject` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": [ - "lodash", - "lodash-modularized", - "stdlib", - "util" - ], - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "dependencies": { - "lodash._basecopy": "^3.0.0", - "lodash.keysin": "^3.0.0" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash.toplainobject@3.0.0", - "_shasum": "28790ad942d293d78aa663a07ecf7f52ca04198d", - "_from": "lodash.toplainobject@>=3.0.0 <4.0.0", - "_npmVersion": "2.3.0", - "_nodeVersion": "0.10.35", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - } - ], - "dist": { - "shasum": "28790ad942d293d78aa663a07ecf7f52ca04198d", - "tarball": "http://registry.npmjs.org/lodash.toplainobject/-/lodash.toplainobject-3.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.toplainobject/-/lodash.toplainobject-3.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.merge/package.json b/node_modules/eslint/node_modules/lodash.merge/package.json deleted file mode 100644 index ba4b3b7..0000000 --- a/node_modules/eslint/node_modules/lodash.merge/package.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "name": "lodash.merge", - "version": "3.3.2", - "description": "The modern build of lodash’s `_.merge` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": [ - "lodash", - "lodash-modularized", - "stdlib", - "util" - ], - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "dependencies": { - "lodash._arraycopy": "^3.0.0", - "lodash._arrayeach": "^3.0.0", - "lodash._createassigner": "^3.0.0", - "lodash._getnative": "^3.0.0", - "lodash.isarguments": "^3.0.0", - "lodash.isarray": "^3.0.0", - "lodash.isplainobject": "^3.0.0", - "lodash.istypedarray": "^3.0.0", - "lodash.keys": "^3.0.0", - "lodash.keysin": "^3.0.0", - "lodash.toplainobject": "^3.0.0" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash.merge@3.3.2", - "_shasum": "0d90d93ed637b1878437bb3e21601260d7afe994", - "_from": "lodash.merge@>=3.3.2 <4.0.0", - "_npmVersion": "2.12.0", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - } - ], - "dist": { - "shasum": "0d90d93ed637b1878437bb3e21601260d7afe994", - "tarball": "http://registry.npmjs.org/lodash.merge/-/lodash.merge-3.3.2.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-3.3.2.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.omit/LICENSE.txt b/node_modules/eslint/node_modules/lodash.omit/LICENSE.txt deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.omit/README.md b/node_modules/eslint/node_modules/lodash.omit/README.md deleted file mode 100644 index 49990fa..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash.omit v3.1.0 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.omit` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.omit -``` - -In Node.js/io.js: - -```js -var omit = require('lodash.omit'); -``` - -See the [documentation](https://lodash.com/docs#omit) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.omit) for more details. diff --git a/node_modules/eslint/node_modules/lodash.omit/index.js b/node_modules/eslint/node_modules/lodash.omit/index.js deleted file mode 100644 index bcf4d22..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/index.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * lodash 3.1.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.2 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -var arrayMap = require('lodash._arraymap'), - baseDifference = require('lodash._basedifference'), - baseFlatten = require('lodash._baseflatten'), - bindCallback = require('lodash._bindcallback'), - pickByArray = require('lodash._pickbyarray'), - pickByCallback = require('lodash._pickbycallback'), - keysIn = require('lodash.keysin'), - restParam = require('lodash.restparam'); - -/** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * Property names may be specified as individual arguments or as arrays of - * property names. If `predicate` is provided it is invoked for each property - * of `object` omitting the properties `predicate` returns truthy for. The - * predicate is bound to `thisArg` and invoked with three arguments: - * (value, key, object). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {Function|...(string|string[])} [predicate] The function invoked per - * iteration or property names to omit, specified as individual property - * names or arrays of property names. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.omit(object, 'age'); - * // => { 'user': 'fred' } - * - * _.omit(object, _.isNumber); - * // => { 'user': 'fred' } - */ -var omit = restParam(function(object, props) { - if (object == null) { - return {}; - } - if (typeof props[0] != 'function') { - var props = arrayMap(baseFlatten(props), String); - return pickByArray(object, baseDifference(keysIn(object), props)); - } - var predicate = bindCallback(props[0], props[1], 3); - return pickByCallback(object, function(value, key, object) { - return !predicate(value, key, object); - }); -}); - -module.exports = omit; diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._arraymap/LICENSE.txt b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._arraymap/LICENSE.txt deleted file mode 100644 index 1776432..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._arraymap/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._arraymap/README.md b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._arraymap/README.md deleted file mode 100644 index 1c86686..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._arraymap/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._arraymap v3.0.0 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `arrayMap` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._arraymap -``` - -In Node.js/io.js: - -```js -var arrayMap = require('lodash._arraymap'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash._arraymap) for more details. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._arraymap/index.js b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._arraymap/index.js deleted file mode 100644 index 4e0c30b..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._arraymap/index.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * lodash 3.0.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * A specialized version of `_.map` for arrays without support for callback - * shorthands or `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ -function arrayMap(array, iteratee) { - var index = -1, - length = array.length, - result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; -} - -module.exports = arrayMap; diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._arraymap/package.json b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._arraymap/package.json deleted file mode 100644 index f087c41..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._arraymap/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "lodash._arraymap", - "version": "3.0.0", - "description": "The modern build of lodash’s internal `arrayMap` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._arraymap@3.0.0", - "_shasum": "1a8fd0f4c0df4b61dea076d717cdc97f0a3c3e66", - "_from": "lodash._arraymap@>=3.0.0 <4.0.0", - "_npmVersion": "2.3.0", - "_nodeVersion": "0.10.35", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - } - ], - "dist": { - "shasum": "1a8fd0f4c0df4b61dea076d717cdc97f0a3c3e66", - "tarball": "http://registry.npmjs.org/lodash._arraymap/-/lodash._arraymap-3.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._arraymap/-/lodash._arraymap-3.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/LICENSE b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/LICENSE deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/README.md b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/README.md deleted file mode 100644 index d9b809c..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._basedifference v3.0.3 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseDifference` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._basedifference -``` - -In Node.js/io.js: - -```js -var baseDifference = require('lodash._basedifference'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.0.3-npm-packages/lodash._basedifference) for more details. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/index.js b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/index.js deleted file mode 100644 index 43c6460..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/index.js +++ /dev/null @@ -1,63 +0,0 @@ -/** - * lodash 3.0.3 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -var baseIndexOf = require('lodash._baseindexof'), - cacheIndexOf = require('lodash._cacheindexof'), - createCache = require('lodash._createcache'); - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** - * The base implementation of `_.difference` which accepts a single array - * of values to exclude. - * - * @private - * @param {Array} array The array to inspect. - * @param {Array} values The values to exclude. - * @returns {Array} Returns the new array of filtered values. - */ -function baseDifference(array, values) { - var length = array ? array.length : 0, - result = []; - - if (!length) { - return result; - } - var index = -1, - indexOf = baseIndexOf, - isCommon = true, - cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : null, - valuesLength = values.length; - - if (cache) { - indexOf = cacheIndexOf; - isCommon = false; - values = cache; - } - outer: - while (++index < length) { - var value = array[index]; - - if (isCommon && value === value) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values[valuesIndex] === value) { - continue outer; - } - } - result.push(value); - } - else if (indexOf(values, value, 0) < 0) { - result.push(value); - } - } - return result; -} - -module.exports = baseDifference; diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._baseindexof/LICENSE.txt b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._baseindexof/LICENSE.txt deleted file mode 100644 index 1776432..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._baseindexof/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._baseindexof/README.md b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._baseindexof/README.md deleted file mode 100644 index ddcc79d..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._baseindexof/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._baseindexof v3.1.0 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseIndexOf` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._baseindexof -``` - -In Node.js/io.js: - -```js -var baseIndexOf = require('lodash._baseindexof'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash._baseindexof) for more details. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._baseindexof/index.js b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._baseindexof/index.js deleted file mode 100644 index e5da791..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._baseindexof/index.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * lodash 3.1.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.2 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * The base implementation of `_.indexOf` without support for binary searches. - * - * @private - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseIndexOf(array, value, fromIndex) { - if (value !== value) { - return indexOfNaN(array, fromIndex); - } - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; -} - -/** - * Gets the index at which the first occurrence of `NaN` is found in `array`. - * If `fromRight` is provided elements of `array` are iterated from right to left. - * - * @private - * @param {Array} array The array to search. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched `NaN`, else `-1`. - */ -function indexOfNaN(array, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 0 : -1); - - while ((fromRight ? index-- : ++index < length)) { - var other = array[index]; - if (other !== other) { - return index; - } - } - return -1; -} - -module.exports = baseIndexOf; diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._baseindexof/package.json b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._baseindexof/package.json deleted file mode 100644 index 9d1d62d..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._baseindexof/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "name": "lodash._baseindexof", - "version": "3.1.0", - "description": "The modern build of lodash’s internal `baseIndexOf` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._baseindexof@3.1.0", - "_shasum": "fe52b53a1c6761e42618d654e4a25789ed61822c", - "_from": "lodash._baseindexof@>=3.0.0 <4.0.0", - "_npmVersion": "2.6.1", - "_nodeVersion": "0.12.0", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - } - ], - "dist": { - "shasum": "fe52b53a1c6761e42618d654e4a25789ed61822c", - "tarball": "http://registry.npmjs.org/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._cacheindexof/LICENSE.txt b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._cacheindexof/LICENSE.txt deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._cacheindexof/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._cacheindexof/README.md b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._cacheindexof/README.md deleted file mode 100644 index 69d2b62..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._cacheindexof/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._cacheindexof v3.0.2 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `cacheIndexOf` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._cacheindexof -``` - -In Node.js/io.js: - -```js -var cacheIndexOf = require('lodash._cacheindexof'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash._cacheindexof) for more details. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._cacheindexof/index.js b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._cacheindexof/index.js deleted file mode 100644 index bc1d5af..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._cacheindexof/index.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * lodash 3.0.2 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * Checks if `value` is in `cache` mimicking the return signature of - * `_.indexOf` by returning `0` if the value is found, else `-1`. - * - * @private - * @param {Object} cache The cache to search. - * @param {*} value The value to search for. - * @returns {number} Returns `0` if `value` is found, else `-1`. - */ -function cacheIndexOf(cache, value) { - var data = cache.data, - result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value]; - - return result ? 0 : -1; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -module.exports = cacheIndexOf; diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._cacheindexof/package.json b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._cacheindexof/package.json deleted file mode 100644 index e628739..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._cacheindexof/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "name": "lodash._cacheindexof", - "version": "3.0.2", - "description": "The modern build of lodash’s internal `cacheIndexOf` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._cacheindexof@3.0.2", - "_shasum": "3dc69ac82498d2ee5e3ce56091bafd2adc7bde92", - "_from": "lodash._cacheindexof@>=3.0.0 <4.0.0", - "_npmVersion": "2.10.0", - "_nodeVersion": "0.12.3", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - } - ], - "dist": { - "shasum": "3dc69ac82498d2ee5e3ce56091bafd2adc7bde92", - "tarball": "http://registry.npmjs.org/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/LICENSE b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/LICENSE deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/README.md b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/README.md deleted file mode 100644 index 0ee4834..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._createcache v3.1.2 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `createCache` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._createcache -``` - -In Node.js/io.js: - -```js -var createCache = require('lodash._createcache'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.1.2-npm-packages/lodash._createcache) for more details. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/index.js b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/index.js deleted file mode 100644 index 6cf391c..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/index.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * lodash 3.1.2 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -var getNative = require('lodash._getnative'); - -/** Native method references. */ -var Set = getNative(global, 'Set'); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeCreate = getNative(Object, 'create'); - -/** - * - * Creates a cache object to store unique values. - * - * @private - * @param {Array} [values] The values to cache. - */ -function SetCache(values) { - var length = values ? values.length : 0; - - this.data = { 'hash': nativeCreate(null), 'set': new Set }; - while (length--) { - this.push(values[length]); - } -} - -/** - * Adds `value` to the cache. - * - * @private - * @name push - * @memberOf SetCache - * @param {*} value The value to cache. - */ -function cachePush(value) { - var data = this.data; - if (typeof value == 'string' || isObject(value)) { - data.set.add(value); - } else { - data.hash[value] = true; - } -} - -/** - * Creates a `Set` cache object to optimize linear searches of large arrays. - * - * @private - * @param {Array} [values] The values to cache. - * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`. - */ -function createCache(values) { - return (nativeCreate && Set) ? new SetCache(values) : null; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -// Add functions to the `Set` cache. -SetCache.prototype.push = cachePush; - -module.exports = createCache; diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/node_modules/lodash._getnative/LICENSE b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/node_modules/lodash._getnative/LICENSE deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/node_modules/lodash._getnative/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/node_modules/lodash._getnative/README.md b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/node_modules/lodash._getnative/README.md deleted file mode 100644 index 7835cec..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/node_modules/lodash._getnative/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._getnative v3.9.1 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `getNative` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._getnative -``` - -In Node.js/io.js: - -```js -var getNative = require('lodash._getnative'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.9.1-npm-packages/lodash._getnative) for more details. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/node_modules/lodash._getnative/index.js b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/node_modules/lodash._getnative/index.js deleted file mode 100644 index a32063d..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/node_modules/lodash._getnative/index.js +++ /dev/null @@ -1,137 +0,0 @@ -/** - * lodash 3.9.1 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** `Object#toString` result references. */ -var funcTag = '[object Function]'; - -/** Used to detect host constructors (Safari > 5). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** - * Checks if `value` is object-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var fnToString = Function.prototype.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objToString = objectProto.toString; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = object == null ? undefined : object[key]; - return isNative(value) ? value : undefined; -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in older versions of Chrome and Safari which return 'function' for regexes - // and Safari 8 equivalents which return 'object' for typed array constructors. - return isObject(value) && objToString.call(value) == funcTag; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ -function isNative(value) { - if (value == null) { - return false; - } - if (isFunction(value)) { - return reIsNative.test(fnToString.call(value)); - } - return isObjectLike(value) && reIsHostCtor.test(value); -} - -module.exports = getNative; diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/node_modules/lodash._getnative/package.json b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/node_modules/lodash._getnative/package.json deleted file mode 100644 index 41400a9..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/node_modules/lodash._getnative/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "name": "lodash._getnative", - "version": "3.9.1", - "description": "The modern build of lodash’s internal `getNative` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._getnative@3.9.1", - "_shasum": "570bc7dede46d61cdcde687d65d3eecbaa3aaff5", - "_from": "lodash._getnative@>=3.0.0 <4.0.0", - "_npmVersion": "2.12.0", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "dist": { - "shasum": "570bc7dede46d61cdcde687d65d3eecbaa3aaff5", - "tarball": "http://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/package.json b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/package.json deleted file mode 100644 index 8213d89..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/package.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "name": "lodash._createcache", - "version": "3.1.2", - "description": "The modern build of lodash’s internal `createCache` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "dependencies": { - "lodash._getnative": "^3.0.0" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._createcache@3.1.2", - "_shasum": "56d6a064017625e79ebca6b8018e17440bdcf093", - "_from": "lodash._createcache@>=3.0.0 <4.0.0", - "_npmVersion": "2.12.0", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - } - ], - "dist": { - "shasum": "56d6a064017625e79ebca6b8018e17440bdcf093", - "tarball": "http://registry.npmjs.org/lodash._createcache/-/lodash._createcache-3.1.2.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._createcache/-/lodash._createcache-3.1.2.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/package.json b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/package.json deleted file mode 100644 index 3b6b2e2..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._basedifference/package.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "name": "lodash._basedifference", - "version": "3.0.3", - "description": "The modern build of lodash’s internal `baseDifference` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "dependencies": { - "lodash._baseindexof": "^3.0.0", - "lodash._cacheindexof": "^3.0.0", - "lodash._createcache": "^3.0.0" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._basedifference@3.0.3", - "_shasum": "f2c204296c2a78e02b389081b6edcac933cf629c", - "_from": "lodash._basedifference@>=3.0.0 <4.0.0", - "_npmVersion": "2.12.0", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - } - ], - "dist": { - "shasum": "f2c204296c2a78e02b389081b6edcac933cf629c", - "tarball": "http://registry.npmjs.org/lodash._basedifference/-/lodash._basedifference-3.0.3.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._basedifference/-/lodash._basedifference-3.0.3.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/LICENSE b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/LICENSE deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/README.md b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/README.md deleted file mode 100644 index f3e2277..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._baseflatten v3.1.4 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseFlatten` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._baseflatten -``` - -In Node.js/io.js: - -```js -var baseFlatten = require('lodash._baseflatten'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.1.4-npm-packages/lodash._baseflatten) for more details. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/index.js b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/index.js deleted file mode 100644 index c43acfa..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/index.js +++ /dev/null @@ -1,131 +0,0 @@ -/** - * lodash 3.1.4 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -var isArguments = require('lodash.isarguments'), - isArray = require('lodash.isarray'); - -/** - * Checks if `value` is object-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) - * of an array-like value. - */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ -function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; -} - -/** - * The base implementation of `_.flatten` with added support for restricting - * flattening and specifying the start index. - * - * @private - * @param {Array} array The array to flatten. - * @param {boolean} [isDeep] Specify a deep flatten. - * @param {boolean} [isStrict] Restrict flattening to arrays-like objects. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. - */ -function baseFlatten(array, isDeep, isStrict, result) { - result || (result = []); - - var index = -1, - length = array.length; - - while (++index < length) { - var value = array[index]; - if (isObjectLike(value) && isArrayLike(value) && - (isStrict || isArray(value) || isArguments(value))) { - if (isDeep) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, isDeep, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; -} - -/** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; -} - -/** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ -var getLength = baseProperty('length'); - -/** - * Checks if `value` is array-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - */ -function isArrayLike(value) { - return value != null && isLength(getLength(value)); -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - */ -function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -module.exports = baseFlatten; diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/node_modules/lodash.isarguments/LICENSE b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/node_modules/lodash.isarguments/LICENSE deleted file mode 100644 index b054ca5..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/node_modules/lodash.isarguments/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/node_modules/lodash.isarguments/README.md b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/node_modules/lodash.isarguments/README.md deleted file mode 100644 index e53688d..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/node_modules/lodash.isarguments/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.isarguments v3.0.6 - -The [lodash](https://lodash.com/) method `_.isArguments` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.isarguments -``` - -In Node.js: -```js -var isArguments = require('lodash.isarguments'); -``` - -See the [documentation](https://lodash.com/docs#isArguments) or [package source](https://github.com/lodash/lodash/blob/3.0.6-npm-packages/lodash.isarguments) for more details. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/node_modules/lodash.isarguments/index.js b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/node_modules/lodash.isarguments/index.js deleted file mode 100644 index 56ec8ac..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/node_modules/lodash.isarguments/index.js +++ /dev/null @@ -1,245 +0,0 @@ -/** - * lodash 3.0.6 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var propertyIsEnumerable = objectProto.propertyIsEnumerable; - -/** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; -} - -/** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ -var getLength = baseProperty('length'); - -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -function isArguments(value) { - // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); -} - -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @type Function - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && - !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value)); -} - -/** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @type Function - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array constructors, and - // PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -module.exports = isArguments; diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/node_modules/lodash.isarguments/package.json b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/node_modules/lodash.isarguments/package.json deleted file mode 100644 index 5384e10..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/node_modules/lodash.isarguments/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "lodash.isarguments", - "version": "3.0.6", - "description": "The lodash method `_.isArguments` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": [ - "lodash-modularized", - "isarguments" - ], - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "https://github.com/phated" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash.isarguments@3.0.6", - "_shasum": "5dcaf8555b3ccd0afb15812b9819ec68ca098206", - "_from": "lodash.isarguments@>=3.0.0 <4.0.0", - "_npmVersion": "2.14.15", - "_nodeVersion": "5.4.0", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "dist": { - "shasum": "5dcaf8555b3ccd0afb15812b9819ec68ca098206", - "tarball": "http://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.0.6.tgz" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "_npmOperationalInternal": { - "host": "packages-5-east.internal.npmjs.com", - "tmp": "tmp/lodash.isarguments-3.0.6.tgz_1454484489481_0.09009004035033286" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.0.6.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/node_modules/lodash.isarray/LICENSE b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/node_modules/lodash.isarray/LICENSE deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/node_modules/lodash.isarray/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/node_modules/lodash.isarray/README.md b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/node_modules/lodash.isarray/README.md deleted file mode 100644 index ea274aa..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/node_modules/lodash.isarray/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash.isarray v3.0.4 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.isArray` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.isarray -``` - -In Node.js/io.js: - -```js -var isArray = require('lodash.isarray'); -``` - -See the [documentation](https://lodash.com/docs#isArray) or [package source](https://github.com/lodash/lodash/blob/3.0.4-npm-packages/lodash.isarray) for more details. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/node_modules/lodash.isarray/index.js b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/node_modules/lodash.isarray/index.js deleted file mode 100644 index dd24658..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/node_modules/lodash.isarray/index.js +++ /dev/null @@ -1,180 +0,0 @@ -/** - * lodash 3.0.4 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** `Object#toString` result references. */ -var arrayTag = '[object Array]', - funcTag = '[object Function]'; - -/** Used to detect host constructors (Safari > 5). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** - * Checks if `value` is object-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var fnToString = Function.prototype.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objToString = objectProto.toString; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeIsArray = getNative(Array, 'isArray'); - -/** - * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) - * of an array-like value. - */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = object == null ? undefined : object[key]; - return isNative(value) ? value : undefined; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - */ -function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(function() { return arguments; }()); - * // => false - */ -var isArray = nativeIsArray || function(value) { - return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; -}; - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in older versions of Chrome and Safari which return 'function' for regexes - // and Safari 8 equivalents which return 'object' for typed array constructors. - return isObject(value) && objToString.call(value) == funcTag; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ -function isNative(value) { - if (value == null) { - return false; - } - if (isFunction(value)) { - return reIsNative.test(fnToString.call(value)); - } - return isObjectLike(value) && reIsHostCtor.test(value); -} - -module.exports = isArray; diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/node_modules/lodash.isarray/package.json b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/node_modules/lodash.isarray/package.json deleted file mode 100644 index 54d165c..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/node_modules/lodash.isarray/package.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "name": "lodash.isarray", - "version": "3.0.4", - "description": "The modern build of lodash’s `_.isArray` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": [ - "lodash", - "lodash-modularized", - "stdlib", - "util" - ], - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash.isarray@3.0.4", - "_shasum": "79e4eb88c36a8122af86f844aa9bcd851b5fbb55", - "_from": "lodash.isarray@>=3.0.0 <4.0.0", - "_npmVersion": "2.12.0", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - } - ], - "dist": { - "shasum": "79e4eb88c36a8122af86f844aa9bcd851b5fbb55", - "tarball": "http://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/package.json b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/package.json deleted file mode 100644 index 0ca9c1e..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._baseflatten/package.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "name": "lodash._baseflatten", - "version": "3.1.4", - "description": "The modern build of lodash’s internal `baseFlatten` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "dependencies": { - "lodash.isarguments": "^3.0.0", - "lodash.isarray": "^3.0.0" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._baseflatten@3.1.4", - "_shasum": "0770ff80131af6e34f3b511796a7ba5214e65ff7", - "_from": "lodash._baseflatten@>=3.0.0 <4.0.0", - "_npmVersion": "2.12.0", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - } - ], - "dist": { - "shasum": "0770ff80131af6e34f3b511796a7ba5214e65ff7", - "tarball": "http://registry.npmjs.org/lodash._baseflatten/-/lodash._baseflatten-3.1.4.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._baseflatten/-/lodash._baseflatten-3.1.4.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._bindcallback/LICENSE.txt b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._bindcallback/LICENSE.txt deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._bindcallback/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._bindcallback/README.md b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._bindcallback/README.md deleted file mode 100644 index d287f26..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._bindcallback/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._bindcallback v3.0.1 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `bindCallback` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._bindcallback -``` - -In Node.js/io.js: - -```js -var bindCallback = require('lodash._bindcallback'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._bindcallback) for more details. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._bindcallback/index.js b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._bindcallback/index.js deleted file mode 100644 index ef6811d..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._bindcallback/index.js +++ /dev/null @@ -1,65 +0,0 @@ -/** - * lodash 3.0.1 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * A specialized version of `baseCallback` which only supports `this` binding - * and specifying the number of arguments to provide to `func`. - * - * @private - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {number} [argCount] The number of arguments to provide to `func`. - * @returns {Function} Returns the callback. - */ -function bindCallback(func, thisArg, argCount) { - if (typeof func != 'function') { - return identity; - } - if (thisArg === undefined) { - return func; - } - switch (argCount) { - case 1: return function(value) { - return func.call(thisArg, value); - }; - case 3: return function(value, index, collection) { - return func.call(thisArg, value, index, collection); - }; - case 4: return function(accumulator, value, index, collection) { - return func.call(thisArg, accumulator, value, index, collection); - }; - case 5: return function(value, other, key, object, source) { - return func.call(thisArg, value, other, key, object, source); - }; - } - return function() { - return func.apply(thisArg, arguments); - }; -} - -/** - * This method returns the first argument provided to it. - * - * @static - * @memberOf _ - * @category Utility - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'user': 'fred' }; - * - * _.identity(object) === object; - * // => true - */ -function identity(value) { - return value; -} - -module.exports = bindCallback; diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._bindcallback/package.json b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._bindcallback/package.json deleted file mode 100644 index 374000d..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._bindcallback/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "name": "lodash._bindcallback", - "version": "3.0.1", - "description": "The modern build of lodash’s internal `bindCallback` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._bindcallback@3.0.1", - "_shasum": "e531c27644cf8b57a99e17ed95b35c748789392e", - "_from": "lodash._bindcallback@>=3.0.0 <4.0.0", - "_npmVersion": "2.7.6", - "_nodeVersion": "0.12.2", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "dist": { - "shasum": "e531c27644cf8b57a99e17ed95b35c748789392e", - "tarball": "http://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbyarray/LICENSE.txt b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbyarray/LICENSE.txt deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbyarray/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbyarray/README.md b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbyarray/README.md deleted file mode 100644 index c824e12..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbyarray/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._pickbyarray v3.0.2 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `pickByArray` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._pickbyarray -``` - -In Node.js/io.js: - -```js -var pickByArray = require('lodash._pickbyarray'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash._pickbyarray) for more details. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbyarray/index.js b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbyarray/index.js deleted file mode 100644 index ffbd391..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbyarray/index.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * lodash 3.0.2 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * A specialized version of `_.pick` which picks `object` properties specified - * by `props`. - * - * @private - * @param {Object} object The source object. - * @param {string[]} props The property names to pick. - * @returns {Object} Returns the new object. - */ -function pickByArray(object, props) { - object = toObject(object); - - var index = -1, - length = props.length, - result = {}; - - while (++index < length) { - var key = props[index]; - if (key in object) { - result[key] = object[key]; - } - } - return result; -} - -/** - * Converts `value` to an object if it's not one. - * - * @private - * @param {*} value The value to process. - * @returns {Object} Returns the object. - */ -function toObject(value) { - return isObject(value) ? value : Object(value); -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -module.exports = pickByArray; diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbyarray/package.json b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbyarray/package.json deleted file mode 100644 index 3032981..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbyarray/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "name": "lodash._pickbyarray", - "version": "3.0.2", - "description": "The modern build of lodash’s internal `pickByArray` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._pickbyarray@3.0.2", - "_shasum": "1f898d9607eb560b0e167384b77c7c6d108aa4c5", - "_from": "lodash._pickbyarray@>=3.0.0 <4.0.0", - "_npmVersion": "2.10.0", - "_nodeVersion": "0.12.3", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "dist": { - "shasum": "1f898d9607eb560b0e167384b77c7c6d108aa4c5", - "tarball": "http://registry.npmjs.org/lodash._pickbyarray/-/lodash._pickbyarray-3.0.2.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._pickbyarray/-/lodash._pickbyarray-3.0.2.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbycallback/LICENSE.txt b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbycallback/LICENSE.txt deleted file mode 100644 index 1776432..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbycallback/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbycallback/README.md b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbycallback/README.md deleted file mode 100644 index a40c836..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbycallback/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._pickbycallback v3.0.0 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `pickByCallback` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._pickbycallback -``` - -In Node.js/io.js: - -```js -var pickByCallback = require('lodash._pickbycallback'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash._pickbycallback) for more details. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbycallback/index.js b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbycallback/index.js deleted file mode 100644 index fdb6484..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbycallback/index.js +++ /dev/null @@ -1,44 +0,0 @@ -/** - * lodash 3.0.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -var baseFor = require('lodash._basefor'), - keysIn = require('lodash.keysin'); - -/** - * The base implementation of `_.forIn` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ -function baseForIn(object, iteratee) { - return baseFor(object, iteratee, keysIn); -} - -/** - * A specialized version of `_.pick` that picks `object` properties `predicate` - * returns truthy for. - * - * @private - * @param {Object} object The source object. - * @param {Function} predicate The function invoked per iteration. - * @returns {Object} Returns the new object. - */ -function pickByCallback(object, predicate) { - var result = {}; - baseForIn(object, function(value, key, object) { - if (predicate(value, key, object)) { - result[key] = value; - } - }); - return result; -} - -module.exports = pickByCallback; diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbycallback/node_modules/lodash._basefor/LICENSE b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbycallback/node_modules/lodash._basefor/LICENSE deleted file mode 100644 index b054ca5..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbycallback/node_modules/lodash._basefor/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbycallback/node_modules/lodash._basefor/README.md b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbycallback/node_modules/lodash._basefor/README.md deleted file mode 100644 index b17e221..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbycallback/node_modules/lodash._basefor/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._basefor v3.0.3 - -The internal [lodash](https://lodash.com/) function `baseFor` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._basefor -``` - -In Node.js: -```js -var baseFor = require('lodash._basefor'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.0.3-npm-packages/lodash._basefor) for more details. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbycallback/node_modules/lodash._basefor/index.js b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbycallback/node_modules/lodash._basefor/index.js deleted file mode 100644 index 3f1d189..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbycallback/node_modules/lodash._basefor/index.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * lodash 3.0.3 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * The base implementation of `baseForIn` and `baseForOwn` which iterates - * over `object` properties returned by `keysFunc` invoking `iteratee` for - * each property. Iteratee functions may exit iteration early by explicitly - * returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ -var baseFor = createBaseFor(); - -/** - * Creates a base function for methods like `_.forIn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ -function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; -} - -module.exports = baseFor; diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbycallback/node_modules/lodash._basefor/package.json b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbycallback/node_modules/lodash._basefor/package.json deleted file mode 100644 index 7490169..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbycallback/node_modules/lodash._basefor/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "lodash._basefor", - "version": "3.0.3", - "description": "The internal lodash function `baseFor` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "https://github.com/phated" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._basefor@3.0.3", - "_shasum": "7550b4e9218ef09fad24343b612021c79b4c20c2", - "_from": "lodash._basefor@>=3.0.0 <4.0.0", - "_npmVersion": "2.14.15", - "_nodeVersion": "5.4.0", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "dist": { - "shasum": "7550b4e9218ef09fad24343b612021c79b4c20c2", - "tarball": "http://registry.npmjs.org/lodash._basefor/-/lodash._basefor-3.0.3.tgz" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._basefor/-/lodash._basefor-3.0.3.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbycallback/package.json b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbycallback/package.json deleted file mode 100644 index ec8d388..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash._pickbycallback/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "name": "lodash._pickbycallback", - "version": "3.0.0", - "description": "The modern build of lodash’s internal `pickByCallback` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "dependencies": { - "lodash._basefor": "^3.0.0", - "lodash.keysin": "^3.0.0" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._pickbycallback@3.0.0", - "_shasum": "ff61b9a017a7b3af7d30e6c53de28afa19b8750a", - "_from": "lodash._pickbycallback@>=3.0.0 <4.0.0", - "_npmVersion": "2.3.0", - "_nodeVersion": "0.10.35", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - } - ], - "dist": { - "shasum": "ff61b9a017a7b3af7d30e6c53de28afa19b8750a", - "tarball": "http://registry.npmjs.org/lodash._pickbycallback/-/lodash._pickbycallback-3.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._pickbycallback/-/lodash._pickbycallback-3.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/LICENSE.txt b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/LICENSE.txt deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/README.md b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/README.md deleted file mode 100644 index 1ff19c8..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash.keysin v3.0.8 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.keysIn` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.keysin -``` - -In Node.js/io.js: - -```js -var keysIn = require('lodash.keysin'); -``` - -See the [documentation](https://lodash.com/docs#keysIn) or [package source](https://github.com/lodash/lodash/blob/3.0.8-npm-packages/lodash.keysin) for more details. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/index.js b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/index.js deleted file mode 100644 index b109299..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/index.js +++ /dev/null @@ -1,132 +0,0 @@ -/** - * lodash 3.0.8 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -var isArguments = require('lodash.isarguments'), - isArray = require('lodash.isarray'); - -/** Used to detect unsigned integer values. */ -var reIsUint = /^\d+$/; - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) - * of an array-like value. - */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - */ -function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ -function keysIn(object) { - if (object == null) { - return []; - } - if (!isObject(object)) { - object = Object(object); - } - var length = object.length; - length = (length && isLength(length) && - (isArray(object) || isArguments(object)) && length) || 0; - - var Ctor = object.constructor, - index = -1, - isProto = typeof Ctor == 'function' && Ctor.prototype === object, - result = Array(length), - skipIndexes = length > 0; - - while (++index < length) { - result[index] = (index + ''); - } - for (var key in object) { - if (!(skipIndexes && isIndex(key, length)) && - !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; -} - -module.exports = keysIn; diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/node_modules/lodash.isarguments/LICENSE b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/node_modules/lodash.isarguments/LICENSE deleted file mode 100644 index b054ca5..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/node_modules/lodash.isarguments/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/node_modules/lodash.isarguments/README.md b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/node_modules/lodash.isarguments/README.md deleted file mode 100644 index e53688d..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/node_modules/lodash.isarguments/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.isarguments v3.0.6 - -The [lodash](https://lodash.com/) method `_.isArguments` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.isarguments -``` - -In Node.js: -```js -var isArguments = require('lodash.isarguments'); -``` - -See the [documentation](https://lodash.com/docs#isArguments) or [package source](https://github.com/lodash/lodash/blob/3.0.6-npm-packages/lodash.isarguments) for more details. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/node_modules/lodash.isarguments/index.js b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/node_modules/lodash.isarguments/index.js deleted file mode 100644 index 56ec8ac..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/node_modules/lodash.isarguments/index.js +++ /dev/null @@ -1,245 +0,0 @@ -/** - * lodash 3.0.6 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var propertyIsEnumerable = objectProto.propertyIsEnumerable; - -/** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; -} - -/** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ -var getLength = baseProperty('length'); - -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -function isArguments(value) { - // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); -} - -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @type Function - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && - !(typeof value == 'function' && isFunction(value)) && isLength(getLength(value)); -} - -/** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @type Function - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array constructors, and - // PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -module.exports = isArguments; diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/node_modules/lodash.isarguments/package.json b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/node_modules/lodash.isarguments/package.json deleted file mode 100644 index 5384e10..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/node_modules/lodash.isarguments/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "lodash.isarguments", - "version": "3.0.6", - "description": "The lodash method `_.isArguments` exported as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": [ - "lodash-modularized", - "isarguments" - ], - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "https://github.com/phated" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash.isarguments@3.0.6", - "_shasum": "5dcaf8555b3ccd0afb15812b9819ec68ca098206", - "_from": "lodash.isarguments@>=3.0.0 <4.0.0", - "_npmVersion": "2.14.15", - "_nodeVersion": "5.4.0", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "dist": { - "shasum": "5dcaf8555b3ccd0afb15812b9819ec68ca098206", - "tarball": "http://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.0.6.tgz" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "_npmOperationalInternal": { - "host": "packages-5-east.internal.npmjs.com", - "tmp": "tmp/lodash.isarguments-3.0.6.tgz_1454484489481_0.09009004035033286" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.0.6.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/node_modules/lodash.isarray/LICENSE b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/node_modules/lodash.isarray/LICENSE deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/node_modules/lodash.isarray/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/node_modules/lodash.isarray/README.md b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/node_modules/lodash.isarray/README.md deleted file mode 100644 index ea274aa..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/node_modules/lodash.isarray/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash.isarray v3.0.4 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.isArray` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.isarray -``` - -In Node.js/io.js: - -```js -var isArray = require('lodash.isarray'); -``` - -See the [documentation](https://lodash.com/docs#isArray) or [package source](https://github.com/lodash/lodash/blob/3.0.4-npm-packages/lodash.isarray) for more details. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/node_modules/lodash.isarray/index.js b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/node_modules/lodash.isarray/index.js deleted file mode 100644 index dd24658..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/node_modules/lodash.isarray/index.js +++ /dev/null @@ -1,180 +0,0 @@ -/** - * lodash 3.0.4 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** `Object#toString` result references. */ -var arrayTag = '[object Array]', - funcTag = '[object Function]'; - -/** Used to detect host constructors (Safari > 5). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** - * Checks if `value` is object-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var fnToString = Function.prototype.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objToString = objectProto.toString; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeIsArray = getNative(Array, 'isArray'); - -/** - * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) - * of an array-like value. - */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = object == null ? undefined : object[key]; - return isNative(value) ? value : undefined; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - */ -function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(function() { return arguments; }()); - * // => false - */ -var isArray = nativeIsArray || function(value) { - return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; -}; - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in older versions of Chrome and Safari which return 'function' for regexes - // and Safari 8 equivalents which return 'object' for typed array constructors. - return isObject(value) && objToString.call(value) == funcTag; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ -function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ -function isNative(value) { - if (value == null) { - return false; - } - if (isFunction(value)) { - return reIsNative.test(fnToString.call(value)); - } - return isObjectLike(value) && reIsHostCtor.test(value); -} - -module.exports = isArray; diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/node_modules/lodash.isarray/package.json b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/node_modules/lodash.isarray/package.json deleted file mode 100644 index 54d165c..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/node_modules/lodash.isarray/package.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "name": "lodash.isarray", - "version": "3.0.4", - "description": "The modern build of lodash’s `_.isArray` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": [ - "lodash", - "lodash-modularized", - "stdlib", - "util" - ], - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash.isarray@3.0.4", - "_shasum": "79e4eb88c36a8122af86f844aa9bcd851b5fbb55", - "_from": "lodash.isarray@>=3.0.0 <4.0.0", - "_npmVersion": "2.12.0", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - } - ], - "dist": { - "shasum": "79e4eb88c36a8122af86f844aa9bcd851b5fbb55", - "tarball": "http://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/package.json b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/package.json deleted file mode 100644 index 31c6025..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.keysin/package.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "name": "lodash.keysin", - "version": "3.0.8", - "description": "The modern build of lodash’s `_.keysIn` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": [ - "lodash", - "lodash-modularized", - "stdlib", - "util" - ], - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "dependencies": { - "lodash.isarguments": "^3.0.0", - "lodash.isarray": "^3.0.0" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash.keysin@3.0.8", - "_shasum": "22c4493ebbedb1427962a54b445b2c8a767fb47f", - "_from": "lodash.keysin@>=3.0.0 <4.0.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "2.0.2", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "dist": { - "shasum": "22c4493ebbedb1427962a54b445b2c8a767fb47f", - "tarball": "http://registry.npmjs.org/lodash.keysin/-/lodash.keysin-3.0.8.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.keysin/-/lodash.keysin-3.0.8.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.restparam/LICENSE.txt b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.restparam/LICENSE.txt deleted file mode 100644 index 9cd87e5..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.restparam/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.restparam/README.md b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.restparam/README.md deleted file mode 100644 index 80e47a4..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.restparam/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash.restparam v3.6.1 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.restParam` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.restparam -``` - -In Node.js/io.js: - -```js -var restParam = require('lodash.restparam'); -``` - -See the [documentation](https://lodash.com/docs#restParam) or [package source](https://github.com/lodash/lodash/blob/3.6.1-npm-packages/lodash.restparam) for more details. diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.restparam/index.js b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.restparam/index.js deleted file mode 100644 index 932f47a..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.restparam/index.js +++ /dev/null @@ -1,67 +0,0 @@ -/** - * lodash 3.6.1 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as an array. - * - * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters). - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.restParam(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' - */ -function restParam(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - rest = Array(length); - - while (++index < length) { - rest[index] = args[start + index]; - } - switch (start) { - case 0: return func.call(this, rest); - case 1: return func.call(this, args[0], rest); - case 2: return func.call(this, args[0], args[1], rest); - } - var otherArgs = Array(start + 1); - index = -1; - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = rest; - return func.apply(this, otherArgs); - }; -} - -module.exports = restParam; diff --git a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.restparam/package.json b/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.restparam/package.json deleted file mode 100644 index c00ecad..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/node_modules/lodash.restparam/package.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "name": "lodash.restparam", - "version": "3.6.1", - "description": "The modern build of lodash’s `_.restParam` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": [ - "lodash", - "lodash-modularized", - "stdlib", - "util" - ], - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash.restparam@3.6.1", - "_shasum": "936a4e309ef330a7645ed4145986c85ae5b20805", - "_from": "lodash.restparam@>=3.0.0 <4.0.0", - "_npmVersion": "2.7.6", - "_nodeVersion": "0.12.2", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "dist": { - "shasum": "936a4e309ef330a7645ed4145986c85ae5b20805", - "tarball": "http://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/lodash.omit/package.json b/node_modules/eslint/node_modules/lodash.omit/package.json deleted file mode 100644 index bdec4c5..0000000 --- a/node_modules/eslint/node_modules/lodash.omit/package.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "name": "lodash.omit", - "version": "3.1.0", - "description": "The modern build of lodash’s `_.omit` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": [ - "lodash", - "lodash-modularized", - "stdlib", - "util" - ], - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "dependencies": { - "lodash._arraymap": "^3.0.0", - "lodash._basedifference": "^3.0.0", - "lodash._baseflatten": "^3.0.0", - "lodash._bindcallback": "^3.0.0", - "lodash._pickbyarray": "^3.0.0", - "lodash._pickbycallback": "^3.0.0", - "lodash.keysin": "^3.0.0", - "lodash.restparam": "^3.0.0" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash.omit@3.1.0", - "_shasum": "897fe382e6413d9ac97c61f78ed1e057a00af9f3", - "_from": "lodash.omit@>=3.1.0 <4.0.0", - "_npmVersion": "2.7.3", - "_nodeVersion": "0.12.0", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - } - ], - "dist": { - "shasum": "897fe382e6413d9ac97c61f78ed1e057a00af9f3", - "tarball": "http://registry.npmjs.org/lodash.omit/-/lodash.omit-3.1.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.omit/-/lodash.omit-3.1.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/minimatch/LICENSE b/node_modules/eslint/node_modules/minimatch/LICENSE deleted file mode 100644 index 19129e3..0000000 --- a/node_modules/eslint/node_modules/minimatch/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -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. diff --git a/node_modules/eslint/node_modules/minimatch/README.md b/node_modules/eslint/node_modules/minimatch/README.md deleted file mode 100644 index d458bc2..0000000 --- a/node_modules/eslint/node_modules/minimatch/README.md +++ /dev/null @@ -1,216 +0,0 @@ -# minimatch - -A minimal matching utility. - -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) - - -This is the matching library used internally by npm. - -It works by converting glob expressions into JavaScript `RegExp` -objects. - -## Usage - -```javascript -var minimatch = require("minimatch") - -minimatch("bar.foo", "*.foo") // true! -minimatch("bar.foo", "*.bar") // false! -minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! -``` - -## Features - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` - -## Minimatch Class - -Create a minimatch object by instanting the `minimatch.Minimatch` class. - -```javascript -var Minimatch = require("minimatch").Minimatch -var mm = new Minimatch(pattern, options) -``` - -### Properties - -* `pattern` The original pattern the minimatch object represents. -* `options` The options supplied to the constructor. -* `set` A 2-dimensional array of regexp or string expressions. - Each row in the - array corresponds to a brace-expanded pattern. Each item in the row - corresponds to a single path-part. For example, the pattern - `{a,b/c}/d` would expand to a set of patterns like: - - [ [ a, d ] - , [ b, c, d ] ] - - If a portion of the pattern doesn't have any "magic" in it - (that is, it's something like `"foo"` rather than `fo*o?`), then it - will be left as a string rather than converted to a regular - expression. - -* `regexp` Created by the `makeRe` method. A single regular expression - expressing the entire pattern. This is useful in cases where you wish - to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. -* `negate` True if the pattern is negated. -* `comment` True if the pattern is a comment. -* `empty` True if the pattern is `""`. - -### Methods - -* `makeRe` Generate the `regexp` member if necessary, and return it. - Will return `false` if the pattern is invalid. -* `match(fname)` Return true if the filename matches the pattern, or - false otherwise. -* `matchOne(fileArray, patternArray, partial)` Take a `/`-split - filename, and match it against a single row in the `regExpSet`. This - method is mainly for internal use, but is exposed so that it can be - used by a glob-walker that needs to avoid excessive filesystem calls. - -All other methods are internal, and will be called as necessary. - -## Functions - -The top-level exported function has a `cache` property, which is an LRU -cache set to store 100 items. So, calling these methods repeatedly -with the same pattern and options will use the same Minimatch object, -saving the cost of parsing it multiple times. - -### minimatch(path, pattern, options) - -Main export. Tests a path against the pattern using the options. - -```javascript -var isJS = minimatch(file, "*.js", { matchBase: true }) -``` - -### minimatch.filter(pattern, options) - -Returns a function that tests its -supplied argument, suitable for use with `Array.filter`. Example: - -```javascript -var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) -``` - -### minimatch.match(list, pattern, options) - -Match against the list of -files, in the style of fnmatch or glob. If nothing is matched, and -options.nonull is set, then return a list containing the pattern itself. - -```javascript -var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) -``` - -### minimatch.makeRe(pattern, options) - -Make a regular expression object from the pattern. - -## Options - -All options are `false` by default. - -### debug - -Dump a ton of stuff to stderr. - -### nobrace - -Do not expand `{a,b}` and `{1..3}` brace sets. - -### noglobstar - -Disable `**` matching against multiple folder names. - -### dot - -Allow patterns to match filenames starting with a period, even if -the pattern does not explicitly have a period in that spot. - -Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` -is set. - -### noext - -Disable "extglob" style patterns like `+(a|b)`. - -### nocase - -Perform a case-insensitive match. - -### nonull - -When a match is not found by `minimatch.match`, return a list containing -the pattern itself if this option is set. When not set, an empty list -is returned if there are no matches. - -### matchBase - -If set, then patterns without slashes will be matched -against the basename of the path if it contains slashes. For example, -`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. - -### nocomment - -Suppress the behavior of treating `#` at the start of a pattern as a -comment. - -### nonegate - -Suppress the behavior of treating a leading `!` character as negation. - -### flipNegate - -Returns from negate expressions the same as if they were not negated. -(Ie, true on a hit, false on a miss.) - - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between minimatch and other -implementations, and are intentional. - -If the pattern starts with a `!` character, then it is negated. Set the -`nonegate` flag to suppress this behavior, and treat leading `!` -characters normally. This is perhaps relevant if you wish to start the -pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` -characters at the start of a pattern will negate the pattern multiple -times. - -If a pattern starts with `#`, then it is treated as a comment, and -will not match anything. Use `\#` to match a literal `#` at the -start of a line, or set the `nocomment` flag to suppress this behavior. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.1, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then minimatch.match returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. diff --git a/node_modules/eslint/node_modules/minimatch/minimatch.js b/node_modules/eslint/node_modules/minimatch/minimatch.js deleted file mode 100644 index ec4c05c..0000000 --- a/node_modules/eslint/node_modules/minimatch/minimatch.js +++ /dev/null @@ -1,912 +0,0 @@ -module.exports = minimatch -minimatch.Minimatch = Minimatch - -var path = { sep: '/' } -try { - path = require('path') -} catch (er) {} - -var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = require('brace-expansion') - -// any single thing other than / -// don't need to escape / when using new RegExp() -var qmark = '[^/]' - -// * => any number of characters -var star = qmark + '*?' - -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - -// characters that need to be escaped in RegExp. -var reSpecials = charSet('().*{}+?[]^$\\!') - -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split('').reduce(function (set, c) { - set[c] = true - return set - }, {}) -} - -// normalizes slashes. -var slashSplit = /\/+/ - -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} - -function ext (a, b) { - a = a || {} - b = b || {} - var t = {} - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - return t -} - -minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return minimatch - - var orig = minimatch - - var m = function minimatch (p, pattern, options) { - return orig.minimatch(p, pattern, ext(def, options)) - } - - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - - return m -} - -Minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return Minimatch - return minimatch.defaults(def).Minimatch -} - -function minimatch (p, pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } - - // "" only matches "" - if (pattern.trim() === '') return p === '' - - return new Minimatch(pattern, options).match(p) -} - -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options) - } - - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - pattern = pattern.trim() - - // windows support: need to use /, not \ - if (path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') - } - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - - // make the set of regexps etc. - this.make() -} - -Minimatch.prototype.debug = function () {} - -Minimatch.prototype.make = make -function make () { - // don't do it more than once. - if (this._made) return - - var pattern = this.pattern - var options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - var set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = console.error - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) - - this.debug(this.pattern, set) - - this.set = set -} - -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 - - if (options.nonegate) return - - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return braceExpand(pattern, options) -} - -Minimatch.prototype.braceExpand = braceExpand - -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} - } - } - - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern - - if (typeof pattern === 'undefined') { - throw new Error('undefined pattern') - } - - if (options.nobrace || - !pattern.match(/\{.*\}/)) { - // shortcut. no need to expand. - return [pattern] - } - - return expand(pattern) -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - var options = this.options - - // shortcuts - if (!options.noglobstar && pattern === '**') return GLOBSTAR - if (pattern === '') return '' - - var re = '' - var hasMagic = !!options.nocase - var escaping = false - // ? => one single character - var patternListStack = [] - var negativeLists = [] - var plType - var stateChar - var inClass = false - var reClassStart = -1 - var classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - var self = this - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for (var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) - - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += '\\' + c - escaping = false - continue - } - - switch (c) { - case '/': - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - - case '\\': - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': - if (inClass) { - re += '(' - continue - } - - if (!stateChar) { - re += '\\(' - continue - } - - plType = stateChar - patternListStack.push({ - type: plType, - start: i - 1, - reStart: re.length - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } - - clearStateChar() - hasMagic = true - re += ')' - var pl = patternListStack.pop() - plType = pl.type - // negation is (?:(?!js)[^/]*) - // The others are (?:) - switch (plType) { - case '!': - negativeLists.push(pl) - re += ')[^/]*?)' - pl.reEnd = re.length - break - case '?': - case '+': - case '*': - re += plType - break - case '@': break // the default anyway - } - continue - - case '|': - if (inClass || !patternListStack.length || escaping) { - re += '\\|' - escaping = false - continue - } - - clearStateChar() - re += '|' - continue - - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += '\\' + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - escaping = false - continue - } - - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - if (inClass) { - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { - re += '\\' - } - - re += c - - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + 3) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case '.': - case '[': - case '(': addPatternStart = true - } - - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n] - - var nlBefore = re.slice(0, nl.reStart) - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) - var nlAfter = re.slice(nl.reEnd) - - nlLast += nlAfter - - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - var openParensBefore = nlBefore.split('(').length - 1 - var cleanAfter = nlAfter - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') - } - nlAfter = cleanAfter - - var dollar = '' - if (nlAfter === '' && isSub !== SUBPARSE) { - dollar = '$' - } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast - re = newRe - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } - - if (addPatternStart) { - re = patternStart + re - } - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - var flags = options.nocase ? 'i' : '' - var regExp = new RegExp('^' + re + '$', flags) - - regExp._glob = pattern - regExp._src = re - - return regExp -} - -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} - -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set - - if (!set.length) { - this.regexp = false - return this.regexp - } - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - var flags = options.nocase ? 'i' : '' - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === 'string') ? regExpEscape(p) - : p._src - }).join('\\\/') - }).join('|') - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' - - try { - this.regexp = new RegExp(re, flags) - } catch (ex) { - this.regexp = false - } - return this.regexp -} - -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -Minimatch.prototype.match = match -function match (f, partial) { - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' - - if (f === '/' && partial) return true - - var options = this.options - - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - var set = this.set - this.debug(this.pattern, 'set', set) - - // Find the basename of the path by looking for the last non-empty segment - var filename - var i - for (i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } - - for (i = 0; i < set.length; i++) { - var pattern = set[i] - var file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} - -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase() - } else { - hit = f === p - } - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') - return emptyFileEnd - } - - // should be unreachable. - throw new Error('wtf?') -} - -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') -} - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') -} diff --git a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/.npmignore b/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/.npmignore deleted file mode 100644 index 353546a..0000000 --- a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -test -.gitignore -.travis.yml diff --git a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/README.md b/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/README.md deleted file mode 100644 index 1793929..0000000 --- a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/README.md +++ /dev/null @@ -1,122 +0,0 @@ -# brace-expansion - -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), -as known from sh/bash, in JavaScript. - -[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) -[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) - -[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) - -## Example - -```js -var expand = require('brace-expansion'); - -expand('file-{a,b,c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('-v{,,}') -// => ['-v', '-v', '-v'] - -expand('file{0..2}.jpg') -// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] - -expand('file-{a..c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('file{2..0}.jpg') -// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] - -expand('file{0..4..2}.jpg') -// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] - -expand('file-{a..e..2}.jpg') -// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] - -expand('file{00..10..5}.jpg') -// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] - -expand('{{A..C},{a..c}}') -// => ['A', 'B', 'C', 'a', 'b', 'c'] - -expand('ppp{,config,oe{,conf}}') -// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] -``` - -## API - -```js -var expand = require('brace-expansion'); -``` - -### var expanded = expand(str) - -Return an array of all possible and valid expansions of `str`. If none are -found, `[str]` is returned. - -Valid expansions are: - -```js -/^(.*,)+(.+)?$/ -// {a,b,...} -``` - -A comma seperated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -A numeric sequence from `x` to `y` inclusive, with optional increment. -If `x` or `y` start with a leading `0`, all the numbers will be padded -to have equal length. Negative numbers and backwards iteration work too. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -An alphabetic sequence from `x` to `y` inclusive, with optional increment. -`x` and `y` must be exactly one character, and if given, `incr` must be a -number. - -For compatibility reasons, the string `${` is not eligible for brace expansion. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install brace-expansion -``` - -## Contributors - -- [Julian Gruber](https://github.com/juliangruber) -- [Isaac Z. Schlueter](https://github.com/isaacs) - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.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. diff --git a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/example.js b/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/example.js deleted file mode 100644 index 60ecfc7..0000000 --- a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/example.js +++ /dev/null @@ -1,8 +0,0 @@ -var expand = require('./'); - -console.log(expand('http://any.org/archive{1996..1999}/vol{1..4}/part{a,b,c}.html')); -console.log(expand('http://www.numericals.com/file{1..100..10}.txt')); -console.log(expand('http://www.letters.com/file{a..z..2}.txt')); -console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}')); -console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}')); - diff --git a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/index.js b/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/index.js deleted file mode 100644 index a23104e..0000000 --- a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/index.js +++ /dev/null @@ -1,191 +0,0 @@ -var concatMap = require('concat-map'); -var balanced = require('balanced-match'); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = /^(.*,)+(.+)?$/.test(m.body); - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - - return expansions; -} - diff --git a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore b/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore deleted file mode 100644 index fd4f2b0..0000000 --- a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -.DS_Store diff --git a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml b/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml deleted file mode 100644 index 6e5919d..0000000 --- a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "0.10" diff --git a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md b/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md deleted file mode 100644 index 2cdc8e4..0000000 --- a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.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. diff --git a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile b/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile deleted file mode 100644 index fa5da71..0000000 --- a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +++ /dev/null @@ -1,6 +0,0 @@ - -test: - @node_modules/.bin/tape test/*.js - -.PHONY: test - diff --git a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md deleted file mode 100644 index 421f3aa..0000000 --- a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +++ /dev/null @@ -1,89 +0,0 @@ -# balanced-match - -Match balanced string pairs, like `{` and `}` or `` and ``. - -[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) -[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) - -[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) - -## Example - -Get the first matching pair of braces: - -```js -var balanced = require('balanced-match'); - -console.log(balanced('{', '}', 'pre{in{nested}}post')); -console.log(balanced('{', '}', 'pre{first}between{second}post')); -``` - -The matches are: - -```bash -$ node example.js -{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } -{ start: 3, - end: 9, - pre: 'pre', - body: 'first', - post: 'between{second}post' } -``` - -## API - -### var m = balanced(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -object with those keys: - -* **start** the index of the first match of `a` -* **end** the index of the matching `b` -* **pre** the preamble, `a` and `b` not included -* **body** the match, `a` and `b` not included -* **post** the postscript, `a` and `b` not included - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`. - -### var r = balanced.range(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -array with indexes: `[ , ]`. - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]`. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install balanced-match -``` - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.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. diff --git a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js b/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js deleted file mode 100644 index c02ad34..0000000 --- a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +++ /dev/null @@ -1,5 +0,0 @@ -var balanced = require('./'); - -console.log(balanced('{', '}', 'pre{in{nested}}post')); -console.log(balanced('{', '}', 'pre{first}between{second}post')); - diff --git a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js deleted file mode 100644 index 75f3d71..0000000 --- a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +++ /dev/null @@ -1,50 +0,0 @@ -module.exports = balanced; -function balanced(a, b, str) { - var r = range(a, b, str); - - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; -} - -balanced.range = range; -function range(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var i = ai; - - if (ai >= 0 && bi > 0) { - begs = []; - left = str.length; - - while (i < str.length && i >= 0 && ! result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [ begs.pop(), bi ]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } - - bi = str.indexOf(b, i + 1); - } - - i = ai < bi && ai >= 0 ? ai : bi; - } - - if (begs.length) { - result = [ left, right ]; - } - } - - return result; -} diff --git a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json deleted file mode 100644 index 7eb3457..0000000 --- a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "balanced-match", - "description": "Match balanced character pairs, like \"{\" and \"}\"", - "version": "0.3.0", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/balanced-match.git" - }, - "homepage": "https://github.com/juliangruber/balanced-match", - "main": "index.js", - "scripts": { - "test": "make test" - }, - "dependencies": {}, - "devDependencies": { - "tape": "~4.2.2" - }, - "keywords": [ - "match", - "regexp", - "test", - "balanced", - "parse" - ], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "gitHead": "a7114b0986554787e90b7ac595a043ca75ea77e5", - "bugs": { - "url": "https://github.com/juliangruber/balanced-match/issues" - }, - "_id": "balanced-match@0.3.0", - "_shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756", - "_from": "balanced-match@>=0.3.0 <0.4.0", - "_npmVersion": "2.14.7", - "_nodeVersion": "4.2.1", - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - "dist": { - "shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756", - "tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz" - }, - "maintainers": [ - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js b/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js deleted file mode 100644 index f5e98e3..0000000 --- a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +++ /dev/null @@ -1,84 +0,0 @@ -var test = require('tape'); -var balanced = require('..'); - -test('balanced', function(t) { - t.deepEqual(balanced('{', '}', 'pre{in{nest}}post'), { - start: 3, - end: 12, - pre: 'pre', - body: 'in{nest}', - post: 'post' - }); - t.deepEqual(balanced('{', '}', '{{{{{{{{{in}post'), { - start: 8, - end: 11, - pre: '{{{{{{{{', - body: 'in', - post: 'post' - }); - t.deepEqual(balanced('{', '}', 'pre{body{in}post'), { - start: 8, - end: 11, - pre: 'pre{body', - body: 'in', - post: 'post' - }); - t.deepEqual(balanced('{', '}', 'pre}{in{nest}}post'), { - start: 4, - end: 13, - pre: 'pre}', - body: 'in{nest}', - post: 'post' - }); - t.deepEqual(balanced('{', '}', 'pre{body}between{body2}post'), { - start: 3, - end: 8, - pre: 'pre', - body: 'body', - post: 'between{body2}post' - }); - t.notOk(balanced('{', '}', 'nope'), 'should be notOk'); - t.deepEqual(balanced('', '', 'preinnestpost'), { - start: 3, - end: 19, - pre: 'pre', - body: 'innest', - post: 'post' - }); - t.deepEqual(balanced('', '', 'preinnestpost'), { - start: 7, - end: 23, - pre: 'pre', - body: 'innest', - post: 'post' - }); - t.deepEqual(balanced('{{', '}}', 'pre{{{in}}}post'), { - start: 3, - end: 9, - pre: 'pre', - body: '{in}', - post: 'post' - }); - t.deepEqual(balanced('{{{', '}}', 'pre{{{in}}}post'), { - start: 3, - end: 8, - pre: 'pre', - body: 'in', - post: '}post' - }); - t.deepEqual(balanced('{', '}', 'pre{{first}in{second}post'), { - start: 4, - end: 10, - pre: 'pre{', - body: 'first', - post: 'in{second}post' - }); - t.deepEqual(balanced('', 'prepost'), { - start: 3, - end: 4, - pre: 'pre', - body: '', - post: 'post' - }); - t.end(); -}); diff --git a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml b/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml deleted file mode 100644 index f1d0f13..0000000 --- a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE b/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE deleted file mode 100644 index ee27ba4..0000000 --- a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -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. diff --git a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown b/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown deleted file mode 100644 index 408f70a..0000000 --- a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown +++ /dev/null @@ -1,62 +0,0 @@ -concat-map -========== - -Concatenative mapdashery. - -[![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map) - -[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map) - -example -======= - -``` js -var concatMap = require('concat-map'); -var xs = [ 1, 2, 3, 4, 5, 6 ]; -var ys = concatMap(xs, function (x) { - return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; -}); -console.dir(ys); -``` - -*** - -``` -[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ] -``` - -methods -======= - -``` js -var concatMap = require('concat-map') -``` - -concatMap(xs, fn) ------------------ - -Return an array of concatenated elements by calling `fn(x, i)` for each element -`x` and each index `i` in the array `xs`. - -When `fn(x, i)` returns an array, its result will be concatenated with the -result array. If `fn(x, i)` returns anything else, that value will be pushed -onto the end of the result array. - -install -======= - -With [npm](http://npmjs.org) do: - -``` -npm install concat-map -``` - -license -======= - -MIT - -notes -===== - -This module was written while sitting high above the ground in a tree. diff --git a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js b/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js deleted file mode 100644 index 3365621..0000000 --- a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js +++ /dev/null @@ -1,6 +0,0 @@ -var concatMap = require('../'); -var xs = [ 1, 2, 3, 4, 5, 6 ]; -var ys = concatMap(xs, function (x) { - return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; -}); -console.dir(ys); diff --git a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js b/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js deleted file mode 100644 index b29a781..0000000 --- a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = function (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - var x = fn(xs[i], i); - if (isArray(x)) res.push.apply(res, x); - else res.push(x); - } - return res; -}; - -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; diff --git a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json b/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json deleted file mode 100644 index b516138..0000000 --- a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "name": "concat-map", - "description": "concatenative mapdashery", - "version": "0.0.1", - "repository": { - "type": "git", - "url": "git://github.com/substack/node-concat-map.git" - }, - "main": "index.js", - "keywords": [ - "concat", - "concatMap", - "map", - "functional", - "higher-order" - ], - "directories": { - "example": "example", - "test": "test" - }, - "scripts": { - "test": "tape test/*.js" - }, - "devDependencies": { - "tape": "~2.4.0" - }, - "license": "MIT", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "testling": { - "files": "test/*.js", - "browsers": { - "ie": [ - 6, - 7, - 8, - 9 - ], - "ff": [ - 3.5, - 10, - 15 - ], - "chrome": [ - 10, - 22 - ], - "safari": [ - 5.1 - ], - "opera": [ - 12 - ] - } - }, - "bugs": { - "url": "https://github.com/substack/node-concat-map/issues" - }, - "homepage": "https://github.com/substack/node-concat-map", - "_id": "concat-map@0.0.1", - "dist": { - "shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", - "tarball": "http://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" - }, - "_from": "concat-map@0.0.1", - "_npmVersion": "1.3.21", - "_npmUser": { - "name": "substack", - "email": "mail@substack.net" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", - "_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js b/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js deleted file mode 100644 index fdbd702..0000000 --- a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js +++ /dev/null @@ -1,39 +0,0 @@ -var concatMap = require('../'); -var test = require('tape'); - -test('empty or not', function (t) { - var xs = [ 1, 2, 3, 4, 5, 6 ]; - var ixes = []; - var ys = concatMap(xs, function (x, ix) { - ixes.push(ix); - return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; - }); - t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]); - t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]); - t.end(); -}); - -test('always something', function (t) { - var xs = [ 'a', 'b', 'c', 'd' ]; - var ys = concatMap(xs, function (x) { - return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ]; - }); - t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); - t.end(); -}); - -test('scalars', function (t) { - var xs = [ 'a', 'b', 'c', 'd' ]; - var ys = concatMap(xs, function (x) { - return x === 'b' ? [ 'B', 'B', 'B' ] : x; - }); - t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); - t.end(); -}); - -test('undefs', function (t) { - var xs = [ 'a', 'b', 'c', 'd' ]; - var ys = concatMap(xs, function () {}); - t.same(ys, [ undefined, undefined, undefined, undefined ]); - t.end(); -}); diff --git a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/package.json b/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/package.json deleted file mode 100644 index fe96726..0000000 --- a/node_modules/eslint/node_modules/minimatch/node_modules/brace-expansion/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "brace-expansion", - "description": "Brace expansion as known from sh/bash", - "version": "1.1.2", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/brace-expansion.git" - }, - "homepage": "https://github.com/juliangruber/brace-expansion", - "main": "index.js", - "scripts": { - "test": "tape test/*.js", - "gentest": "bash test/generate.sh" - }, - "dependencies": { - "balanced-match": "^0.3.0", - "concat-map": "0.0.1" - }, - "devDependencies": { - "tape": "4.2.2" - }, - "keywords": [], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "gitHead": "b03773a30fa516b1374945b68e9acb6253d595fa", - "bugs": { - "url": "https://github.com/juliangruber/brace-expansion/issues" - }, - "_id": "brace-expansion@1.1.2", - "_shasum": "f21445d0488b658e2771efd870eff51df29f04ef", - "_from": "brace-expansion@>=1.0.0 <2.0.0", - "_npmVersion": "2.14.7", - "_nodeVersion": "4.2.1", - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - "dist": { - "shasum": "f21445d0488b658e2771efd870eff51df29f04ef", - "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.2.tgz" - }, - "maintainers": [ - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - { - "name": "isaacs", - "email": "isaacs@npmjs.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.2.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/minimatch/package.json b/node_modules/eslint/node_modules/minimatch/package.json deleted file mode 100644 index 51abf98..0000000 --- a/node_modules/eslint/node_modules/minimatch/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "minimatch", - "description": "a glob matcher in javascript", - "version": "3.0.0", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "posttest": "standard minimatch.js test/*.js", - "test": "tap test/*.js" - }, - "engines": { - "node": "*" - }, - "dependencies": { - "brace-expansion": "^1.0.0" - }, - "devDependencies": { - "standard": "^3.7.2", - "tap": "^1.2.0" - }, - "license": "ISC", - "files": [ - "minimatch.js" - ], - "gitHead": "270dbea567f0af6918cb18103e98c612aa717a20", - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" - }, - "homepage": "https://github.com/isaacs/minimatch#readme", - "_id": "minimatch@3.0.0", - "_shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", - "_from": "minimatch@>=3.0.0 <4.0.0", - "_npmVersion": "3.3.2", - "_nodeVersion": "4.0.0", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/mkdirp/.travis.yml b/node_modules/eslint/node_modules/mkdirp/.travis.yml deleted file mode 100644 index 74c57bf..0000000 --- a/node_modules/eslint/node_modules/mkdirp/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" - - "0.12" - - "iojs" -before_install: - - npm install -g npm@~1.4.6 diff --git a/node_modules/eslint/node_modules/mkdirp/LICENSE b/node_modules/eslint/node_modules/mkdirp/LICENSE deleted file mode 100644 index 432d1ae..0000000 --- a/node_modules/eslint/node_modules/mkdirp/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright 2010 James Halliday (mail@substack.net) - -This project is free software released under the MIT/X11 license: - -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. diff --git a/node_modules/eslint/node_modules/mkdirp/bin/cmd.js b/node_modules/eslint/node_modules/mkdirp/bin/cmd.js deleted file mode 100755 index d95de15..0000000 --- a/node_modules/eslint/node_modules/mkdirp/bin/cmd.js +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env node - -var mkdirp = require('../'); -var minimist = require('minimist'); -var fs = require('fs'); - -var argv = minimist(process.argv.slice(2), { - alias: { m: 'mode', h: 'help' }, - string: [ 'mode' ] -}); -if (argv.help) { - fs.createReadStream(__dirname + '/usage.txt').pipe(process.stdout); - return; -} - -var paths = argv._.slice(); -var mode = argv.mode ? parseInt(argv.mode, 8) : undefined; - -(function next () { - if (paths.length === 0) return; - var p = paths.shift(); - - if (mode === undefined) mkdirp(p, cb) - else mkdirp(p, mode, cb) - - function cb (err) { - if (err) { - console.error(err.message); - process.exit(1); - } - else next(); - } -})(); diff --git a/node_modules/eslint/node_modules/mkdirp/bin/usage.txt b/node_modules/eslint/node_modules/mkdirp/bin/usage.txt deleted file mode 100644 index f952aa2..0000000 --- a/node_modules/eslint/node_modules/mkdirp/bin/usage.txt +++ /dev/null @@ -1,12 +0,0 @@ -usage: mkdirp [DIR1,DIR2..] {OPTIONS} - - Create each supplied directory including any necessary parent directories that - don't yet exist. - - If the directory already exists, do nothing. - -OPTIONS are: - - -m, --mode If a directory needs to be created, set the mode as an octal - permission string. - diff --git a/node_modules/eslint/node_modules/mkdirp/examples/pow.js b/node_modules/eslint/node_modules/mkdirp/examples/pow.js deleted file mode 100644 index e692421..0000000 --- a/node_modules/eslint/node_modules/mkdirp/examples/pow.js +++ /dev/null @@ -1,6 +0,0 @@ -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); diff --git a/node_modules/eslint/node_modules/mkdirp/index.js b/node_modules/eslint/node_modules/mkdirp/index.js deleted file mode 100644 index 6ce241b..0000000 --- a/node_modules/eslint/node_modules/mkdirp/index.js +++ /dev/null @@ -1,98 +0,0 @@ -var path = require('path'); -var fs = require('fs'); -var _0777 = parseInt('0777', 8); - -module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; - -function mkdirP (p, opts, f, made) { - if (typeof opts === 'function') { - f = opts; - opts = {}; - } - else if (!opts || typeof opts !== 'object') { - opts = { mode: opts }; - } - - var mode = opts.mode; - var xfs = opts.fs || fs; - - if (mode === undefined) { - mode = _0777 & (~process.umask()); - } - if (!made) made = null; - - var cb = f || function () {}; - p = path.resolve(p); - - xfs.mkdir(p, mode, function (er) { - if (!er) { - made = made || p; - return cb(null, made); - } - switch (er.code) { - case 'ENOENT': - mkdirP(path.dirname(p), opts, function (er, made) { - if (er) cb(er, made); - else mkdirP(p, opts, cb, made); - }); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - xfs.stat(p, function (er2, stat) { - // if the stat fails, then that's super weird. - // let the original error be the failure reason. - if (er2 || !stat.isDirectory()) cb(er, made) - else cb(null, made); - }); - break; - } - }); -} - -mkdirP.sync = function sync (p, opts, made) { - if (!opts || typeof opts !== 'object') { - opts = { mode: opts }; - } - - var mode = opts.mode; - var xfs = opts.fs || fs; - - if (mode === undefined) { - mode = _0777 & (~process.umask()); - } - if (!made) made = null; - - p = path.resolve(p); - - try { - xfs.mkdirSync(p, mode); - made = made || p; - } - catch (err0) { - switch (err0.code) { - case 'ENOENT' : - made = sync(path.dirname(p), opts, made); - sync(p, opts, made); - break; - - // In the case of any other error, just see if there's a dir - // there already. If so, then hooray! If not, then something - // is borked. - default: - var stat; - try { - stat = xfs.statSync(p); - } - catch (err1) { - throw err0; - } - if (!stat.isDirectory()) throw err0; - break; - } - } - - return made; -}; diff --git a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/.travis.yml b/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/.travis.yml deleted file mode 100644 index cc4dba2..0000000 --- a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" diff --git a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/LICENSE b/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/LICENSE deleted file mode 100644 index ee27ba4..0000000 --- a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -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. diff --git a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/example/parse.js b/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/example/parse.js deleted file mode 100644 index abff3e8..0000000 --- a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/example/parse.js +++ /dev/null @@ -1,2 +0,0 @@ -var argv = require('../')(process.argv.slice(2)); -console.dir(argv); diff --git a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/index.js b/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/index.js deleted file mode 100644 index 584f551..0000000 --- a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/index.js +++ /dev/null @@ -1,187 +0,0 @@ -module.exports = function (args, opts) { - if (!opts) opts = {}; - - var flags = { bools : {}, strings : {} }; - - [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { - flags.bools[key] = true; - }); - - [].concat(opts.string).filter(Boolean).forEach(function (key) { - flags.strings[key] = true; - }); - - var aliases = {}; - Object.keys(opts.alias || {}).forEach(function (key) { - aliases[key] = [].concat(opts.alias[key]); - aliases[key].forEach(function (x) { - aliases[x] = [key].concat(aliases[key].filter(function (y) { - return x !== y; - })); - }); - }); - - var defaults = opts['default'] || {}; - - var argv = { _ : [] }; - Object.keys(flags.bools).forEach(function (key) { - setArg(key, defaults[key] === undefined ? false : defaults[key]); - }); - - var notFlags = []; - - if (args.indexOf('--') !== -1) { - notFlags = args.slice(args.indexOf('--')+1); - args = args.slice(0, args.indexOf('--')); - } - - function setArg (key, val) { - var value = !flags.strings[key] && isNumber(val) - ? Number(val) : val - ; - setKey(argv, key.split('.'), value); - - (aliases[key] || []).forEach(function (x) { - setKey(argv, x.split('.'), value); - }); - } - - for (var i = 0; i < args.length; i++) { - var arg = args[i]; - - if (/^--.+=/.test(arg)) { - // Using [\s\S] instead of . because js doesn't support the - // 'dotall' regex modifier. See: - // http://stackoverflow.com/a/1068308/13216 - var m = arg.match(/^--([^=]+)=([\s\S]*)$/); - setArg(m[1], m[2]); - } - else if (/^--no-.+/.test(arg)) { - var key = arg.match(/^--no-(.+)/)[1]; - setArg(key, false); - } - else if (/^--.+/.test(arg)) { - var key = arg.match(/^--(.+)/)[1]; - var next = args[i + 1]; - if (next !== undefined && !/^-/.test(next) - && !flags.bools[key] - && (aliases[key] ? !flags.bools[aliases[key]] : true)) { - setArg(key, next); - i++; - } - else if (/^(true|false)$/.test(next)) { - setArg(key, next === 'true'); - i++; - } - else { - setArg(key, flags.strings[key] ? '' : true); - } - } - else if (/^-[^-]+/.test(arg)) { - var letters = arg.slice(1,-1).split(''); - - var broken = false; - for (var j = 0; j < letters.length; j++) { - var next = arg.slice(j+2); - - if (next === '-') { - setArg(letters[j], next) - continue; - } - - if (/[A-Za-z]/.test(letters[j]) - && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { - setArg(letters[j], next); - broken = true; - break; - } - - if (letters[j+1] && letters[j+1].match(/\W/)) { - setArg(letters[j], arg.slice(j+2)); - broken = true; - break; - } - else { - setArg(letters[j], flags.strings[letters[j]] ? '' : true); - } - } - - var key = arg.slice(-1)[0]; - if (!broken && key !== '-') { - if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) - && !flags.bools[key] - && (aliases[key] ? !flags.bools[aliases[key]] : true)) { - setArg(key, args[i+1]); - i++; - } - else if (args[i+1] && /true|false/.test(args[i+1])) { - setArg(key, args[i+1] === 'true'); - i++; - } - else { - setArg(key, flags.strings[key] ? '' : true); - } - } - } - else { - argv._.push( - flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) - ); - } - } - - Object.keys(defaults).forEach(function (key) { - if (!hasKey(argv, key.split('.'))) { - setKey(argv, key.split('.'), defaults[key]); - - (aliases[key] || []).forEach(function (x) { - setKey(argv, x.split('.'), defaults[key]); - }); - } - }); - - notFlags.forEach(function(key) { - argv._.push(key); - }); - - return argv; -}; - -function hasKey (obj, keys) { - var o = obj; - keys.slice(0,-1).forEach(function (key) { - o = (o[key] || {}); - }); - - var key = keys[keys.length - 1]; - return key in o; -} - -function setKey (obj, keys, value) { - var o = obj; - keys.slice(0,-1).forEach(function (key) { - if (o[key] === undefined) o[key] = {}; - o = o[key]; - }); - - var key = keys[keys.length - 1]; - if (o[key] === undefined || typeof o[key] === 'boolean') { - o[key] = value; - } - else if (Array.isArray(o[key])) { - o[key].push(value); - } - else { - o[key] = [ o[key], value ]; - } -} - -function isNumber (x) { - if (typeof x === 'number') return true; - if (/^0x[0-9a-f]+$/i.test(x)) return true; - return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); -} - -function longest (xs) { - return Math.max.apply(null, xs.map(function (x) { return x.length })); -} diff --git a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/package.json b/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/package.json deleted file mode 100644 index 09e9ec4..0000000 --- a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "minimist", - "version": "0.0.8", - "description": "parse argument options", - "main": "index.js", - "devDependencies": { - "tape": "~1.0.4", - "tap": "~0.4.0" - }, - "scripts": { - "test": "tap test/*.js" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/6..latest", - "ff/5", - "firefox/latest", - "chrome/10", - "chrome/latest", - "safari/5.1", - "safari/latest", - "opera/12" - ] - }, - "repository": { - "type": "git", - "url": "git://github.com/substack/minimist.git" - }, - "homepage": "https://github.com/substack/minimist", - "keywords": [ - "argv", - "getopt", - "parser", - "optimist" - ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/substack/minimist/issues" - }, - "_id": "minimist@0.0.8", - "dist": { - "shasum": "857fcabfc3397d2625b8228262e86aa7a011b05d", - "tarball": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" - }, - "_from": "minimist@0.0.8", - "_npmVersion": "1.4.3", - "_npmUser": { - "name": "substack", - "email": "mail@substack.net" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "directories": {}, - "_shasum": "857fcabfc3397d2625b8228262e86aa7a011b05d", - "_resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/readme.markdown b/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/readme.markdown deleted file mode 100644 index c256353..0000000 --- a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/readme.markdown +++ /dev/null @@ -1,73 +0,0 @@ -# minimist - -parse argument options - -This module is the guts of optimist's argument parser without all the -fanciful decoration. - -[![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist) - -[![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist) - -# example - -``` js -var argv = require('minimist')(process.argv.slice(2)); -console.dir(argv); -``` - -``` -$ node example/parse.js -a beep -b boop -{ _: [], a: 'beep', b: 'boop' } -``` - -``` -$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz -{ _: [ 'foo', 'bar', 'baz' ], - x: 3, - y: 4, - n: 5, - a: true, - b: true, - c: true, - beep: 'boop' } -``` - -# methods - -``` js -var parseArgs = require('minimist') -``` - -## var argv = parseArgs(args, opts={}) - -Return an argument object `argv` populated with the array arguments from `args`. - -`argv._` contains all the arguments that didn't have an option associated with -them. - -Numeric-looking arguments will be returned as numbers unless `opts.string` or -`opts.boolean` is set for that argument name. - -Any arguments after `'--'` will not be parsed and will end up in `argv._`. - -options can be: - -* `opts.string` - a string or array of strings argument names to always treat as -strings -* `opts.boolean` - a string or array of strings to always treat as booleans -* `opts.alias` - an object mapping string names to strings or arrays of string -argument names to use as aliases -* `opts.default` - an object mapping string argument names to default values - -# install - -With [npm](https://npmjs.org) do: - -``` -npm install minimist -``` - -# license - -MIT diff --git a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/test/dash.js b/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/test/dash.js deleted file mode 100644 index 8b034b9..0000000 --- a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/test/dash.js +++ /dev/null @@ -1,24 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('-', function (t) { - t.plan(5); - t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] }); - t.deepEqual(parse([ '-' ]), { _: [ '-' ] }); - t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] }); - t.deepEqual( - parse([ '-b', '-' ], { boolean: 'b' }), - { b: true, _: [ '-' ] } - ); - t.deepEqual( - parse([ '-s', '-' ], { string: 's' }), - { s: '-', _: [] } - ); -}); - -test('-a -- b', function (t) { - t.plan(3); - t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] }); - t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); - t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] }); -}); diff --git a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/test/default_bool.js b/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/test/default_bool.js deleted file mode 100644 index f0041ee..0000000 --- a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/test/default_bool.js +++ /dev/null @@ -1,20 +0,0 @@ -var test = require('tape'); -var parse = require('../'); - -test('boolean default true', function (t) { - var argv = parse([], { - boolean: 'sometrue', - default: { sometrue: true } - }); - t.equal(argv.sometrue, true); - t.end(); -}); - -test('boolean default false', function (t) { - var argv = parse([], { - boolean: 'somefalse', - default: { somefalse: false } - }); - t.equal(argv.somefalse, false); - t.end(); -}); diff --git a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/test/dotted.js b/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/test/dotted.js deleted file mode 100644 index ef0ae34..0000000 --- a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/test/dotted.js +++ /dev/null @@ -1,16 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('dotted alias', function (t) { - var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); - t.equal(argv.a.b, 22); - t.equal(argv.aa.bb, 22); - t.end(); -}); - -test('dotted default', function (t) { - var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}}); - t.equal(argv.a.b, 11); - t.equal(argv.aa.bb, 11); - t.end(); -}); diff --git a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/test/long.js b/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/test/long.js deleted file mode 100644 index 5d3a1e0..0000000 --- a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/test/long.js +++ /dev/null @@ -1,31 +0,0 @@ -var test = require('tape'); -var parse = require('../'); - -test('long opts', function (t) { - t.deepEqual( - parse([ '--bool' ]), - { bool : true, _ : [] }, - 'long boolean' - ); - t.deepEqual( - parse([ '--pow', 'xixxle' ]), - { pow : 'xixxle', _ : [] }, - 'long capture sp' - ); - t.deepEqual( - parse([ '--pow=xixxle' ]), - { pow : 'xixxle', _ : [] }, - 'long capture eq' - ); - t.deepEqual( - parse([ '--host', 'localhost', '--port', '555' ]), - { host : 'localhost', port : 555, _ : [] }, - 'long captures sp' - ); - t.deepEqual( - parse([ '--host=localhost', '--port=555' ]), - { host : 'localhost', port : 555, _ : [] }, - 'long captures eq' - ); - t.end(); -}); diff --git a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/test/parse.js b/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/test/parse.js deleted file mode 100644 index 8a90646..0000000 --- a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/test/parse.js +++ /dev/null @@ -1,318 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('parse args', function (t) { - t.deepEqual( - parse([ '--no-moo' ]), - { moo : false, _ : [] }, - 'no' - ); - t.deepEqual( - parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]), - { v : ['a','b','c'], _ : [] }, - 'multi' - ); - t.end(); -}); - -test('comprehensive', function (t) { - t.deepEqual( - parse([ - '--name=meowmers', 'bare', '-cats', 'woo', - '-h', 'awesome', '--multi=quux', - '--key', 'value', - '-b', '--bool', '--no-meep', '--multi=baz', - '--', '--not-a-flag', 'eek' - ]), - { - c : true, - a : true, - t : true, - s : 'woo', - h : 'awesome', - b : true, - bool : true, - key : 'value', - multi : [ 'quux', 'baz' ], - meep : false, - name : 'meowmers', - _ : [ 'bare', '--not-a-flag', 'eek' ] - } - ); - t.end(); -}); - -test('nums', function (t) { - var argv = parse([ - '-x', '1234', - '-y', '5.67', - '-z', '1e7', - '-w', '10f', - '--hex', '0xdeadbeef', - '789' - ]); - t.deepEqual(argv, { - x : 1234, - y : 5.67, - z : 1e7, - w : '10f', - hex : 0xdeadbeef, - _ : [ 789 ] - }); - t.deepEqual(typeof argv.x, 'number'); - t.deepEqual(typeof argv.y, 'number'); - t.deepEqual(typeof argv.z, 'number'); - t.deepEqual(typeof argv.w, 'string'); - t.deepEqual(typeof argv.hex, 'number'); - t.deepEqual(typeof argv._[0], 'number'); - t.end(); -}); - -test('flag boolean', function (t) { - var argv = parse([ '-t', 'moo' ], { boolean: 't' }); - t.deepEqual(argv, { t : true, _ : [ 'moo' ] }); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); -}); - -test('flag boolean value', function (t) { - var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], { - boolean: [ 't', 'verbose' ], - default: { verbose: true } - }); - - t.deepEqual(argv, { - verbose: false, - t: true, - _: ['moo'] - }); - - t.deepEqual(typeof argv.verbose, 'boolean'); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); -}); - -test('flag boolean default false', function (t) { - var argv = parse(['moo'], { - boolean: ['t', 'verbose'], - default: { verbose: false, t: false } - }); - - t.deepEqual(argv, { - verbose: false, - t: false, - _: ['moo'] - }); - - t.deepEqual(typeof argv.verbose, 'boolean'); - t.deepEqual(typeof argv.t, 'boolean'); - t.end(); - -}); - -test('boolean groups', function (t) { - var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], { - boolean: ['x','y','z'] - }); - - t.deepEqual(argv, { - x : true, - y : false, - z : true, - _ : [ 'one', 'two', 'three' ] - }); - - t.deepEqual(typeof argv.x, 'boolean'); - t.deepEqual(typeof argv.y, 'boolean'); - t.deepEqual(typeof argv.z, 'boolean'); - t.end(); -}); - -test('newlines in params' , function (t) { - var args = parse([ '-s', "X\nX" ]) - t.deepEqual(args, { _ : [], s : "X\nX" }); - - // reproduce in bash: - // VALUE="new - // line" - // node program.js --s="$VALUE" - args = parse([ "--s=X\nX" ]) - t.deepEqual(args, { _ : [], s : "X\nX" }); - t.end(); -}); - -test('strings' , function (t) { - var s = parse([ '-s', '0001234' ], { string: 's' }).s; - t.equal(s, '0001234'); - t.equal(typeof s, 'string'); - - var x = parse([ '-x', '56' ], { string: 'x' }).x; - t.equal(x, '56'); - t.equal(typeof x, 'string'); - t.end(); -}); - -test('stringArgs', function (t) { - var s = parse([ ' ', ' ' ], { string: '_' })._; - t.same(s.length, 2); - t.same(typeof s[0], 'string'); - t.same(s[0], ' '); - t.same(typeof s[1], 'string'); - t.same(s[1], ' '); - t.end(); -}); - -test('empty strings', function(t) { - var s = parse([ '-s' ], { string: 's' }).s; - t.equal(s, ''); - t.equal(typeof s, 'string'); - - var str = parse([ '--str' ], { string: 'str' }).str; - t.equal(str, ''); - t.equal(typeof str, 'string'); - - var letters = parse([ '-art' ], { - string: [ 'a', 't' ] - }); - - t.equal(letters.a, ''); - t.equal(letters.r, true); - t.equal(letters.t, ''); - - t.end(); -}); - - -test('slashBreak', function (t) { - t.same( - parse([ '-I/foo/bar/baz' ]), - { I : '/foo/bar/baz', _ : [] } - ); - t.same( - parse([ '-xyz/foo/bar/baz' ]), - { x : true, y : true, z : '/foo/bar/baz', _ : [] } - ); - t.end(); -}); - -test('alias', function (t) { - var argv = parse([ '-f', '11', '--zoom', '55' ], { - alias: { z: 'zoom' } - }); - t.equal(argv.zoom, 55); - t.equal(argv.z, argv.zoom); - t.equal(argv.f, 11); - t.end(); -}); - -test('multiAlias', function (t) { - var argv = parse([ '-f', '11', '--zoom', '55' ], { - alias: { z: [ 'zm', 'zoom' ] } - }); - t.equal(argv.zoom, 55); - t.equal(argv.z, argv.zoom); - t.equal(argv.z, argv.zm); - t.equal(argv.f, 11); - t.end(); -}); - -test('nested dotted objects', function (t) { - var argv = parse([ - '--foo.bar', '3', '--foo.baz', '4', - '--foo.quux.quibble', '5', '--foo.quux.o_O', - '--beep.boop' - ]); - - t.same(argv.foo, { - bar : 3, - baz : 4, - quux : { - quibble : 5, - o_O : true - } - }); - t.same(argv.beep, { boop : true }); - t.end(); -}); - -test('boolean and alias with chainable api', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var opts = { - herp: { alias: 'h', boolean: true } - }; - var aliasedArgv = parse(aliased, { - boolean: 'herp', - alias: { h: 'herp' } - }); - var propertyArgv = parse(regular, { - boolean: 'herp', - alias: { h: 'herp' } - }); - var expected = { - herp: true, - h: true, - '_': [ 'derp' ] - }; - - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -test('boolean and alias with options hash', function (t) { - var aliased = [ '-h', 'derp' ]; - var regular = [ '--herp', 'derp' ]; - var opts = { - alias: { 'h': 'herp' }, - boolean: 'herp' - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - var expected = { - herp: true, - h: true, - '_': [ 'derp' ] - }; - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -test('boolean and alias using explicit true', function (t) { - var aliased = [ '-h', 'true' ]; - var regular = [ '--herp', 'true' ]; - var opts = { - alias: { h: 'herp' }, - boolean: 'h' - }; - var aliasedArgv = parse(aliased, opts); - var propertyArgv = parse(regular, opts); - var expected = { - herp: true, - h: true, - '_': [ ] - }; - - t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); - t.end(); -}); - -// regression, see https://github.com/substack/node-optimist/issues/71 -test('boolean and --x=true', function(t) { - var parsed = parse(['--boool', '--other=true'], { - boolean: 'boool' - }); - - t.same(parsed.boool, true); - t.same(parsed.other, 'true'); - - parsed = parse(['--boool', '--other=false'], { - boolean: 'boool' - }); - - t.same(parsed.boool, true); - t.same(parsed.other, 'false'); - t.end(); -}); diff --git a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js b/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js deleted file mode 100644 index 21851b0..0000000 --- a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js +++ /dev/null @@ -1,9 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('parse with modifier functions' , function (t) { - t.plan(1); - - var argv = parse([ '-b', '123' ], { boolean: 'b' }); - t.deepEqual(argv, { b: true, _: ['123'] }); -}); diff --git a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/test/short.js b/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/test/short.js deleted file mode 100644 index d513a1c..0000000 --- a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/test/short.js +++ /dev/null @@ -1,67 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('numeric short args', function (t) { - t.plan(2); - t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] }); - t.deepEqual( - parse([ '-123', '456' ]), - { 1: true, 2: true, 3: 456, _: [] } - ); -}); - -test('short', function (t) { - t.deepEqual( - parse([ '-b' ]), - { b : true, _ : [] }, - 'short boolean' - ); - t.deepEqual( - parse([ 'foo', 'bar', 'baz' ]), - { _ : [ 'foo', 'bar', 'baz' ] }, - 'bare' - ); - t.deepEqual( - parse([ '-cats' ]), - { c : true, a : true, t : true, s : true, _ : [] }, - 'group' - ); - t.deepEqual( - parse([ '-cats', 'meow' ]), - { c : true, a : true, t : true, s : 'meow', _ : [] }, - 'short group next' - ); - t.deepEqual( - parse([ '-h', 'localhost' ]), - { h : 'localhost', _ : [] }, - 'short capture' - ); - t.deepEqual( - parse([ '-h', 'localhost', '-p', '555' ]), - { h : 'localhost', p : 555, _ : [] }, - 'short captures' - ); - t.end(); -}); - -test('mixed short bool and capture', function (t) { - t.same( - parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), - { - f : true, p : 555, h : 'localhost', - _ : [ 'script.js' ] - } - ); - t.end(); -}); - -test('short and long', function (t) { - t.deepEqual( - parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), - { - f : true, p : 555, h : 'localhost', - _ : [ 'script.js' ] - } - ); - t.end(); -}); diff --git a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/test/whitespace.js b/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/test/whitespace.js deleted file mode 100644 index 8a52a58..0000000 --- a/node_modules/eslint/node_modules/mkdirp/node_modules/minimist/test/whitespace.js +++ /dev/null @@ -1,8 +0,0 @@ -var parse = require('../'); -var test = require('tape'); - -test('whitespace should be whitespace' , function (t) { - t.plan(1); - var x = parse([ '-x', '\t' ]).x; - t.equal(x, '\t'); -}); diff --git a/node_modules/eslint/node_modules/mkdirp/package.json b/node_modules/eslint/node_modules/mkdirp/package.json deleted file mode 100644 index 70a6cba..0000000 --- a/node_modules/eslint/node_modules/mkdirp/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "mkdirp", - "description": "Recursively mkdir, like `mkdir -p`", - "version": "0.5.1", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "main": "index.js", - "keywords": [ - "mkdir", - "directory" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/substack/node-mkdirp.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "dependencies": { - "minimist": "0.0.8" - }, - "devDependencies": { - "tap": "1", - "mock-fs": "2 >=2.7.0" - }, - "bin": { - "mkdirp": "bin/cmd.js" - }, - "license": "MIT", - "gitHead": "d4eff0f06093aed4f387e88e9fc301cb76beedc7", - "bugs": { - "url": "https://github.com/substack/node-mkdirp/issues" - }, - "homepage": "https://github.com/substack/node-mkdirp#readme", - "_id": "mkdirp@0.5.1", - "_shasum": "30057438eac6cf7f8c4767f38648d6697d75c903", - "_from": "mkdirp@>=0.5.0 <0.6.0", - "_npmVersion": "2.9.0", - "_nodeVersion": "2.0.0", - "_npmUser": { - "name": "substack", - "email": "substack@gmail.com" - }, - "dist": { - "shasum": "30057438eac6cf7f8c4767f38648d6697d75c903", - "tarball": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/mkdirp/readme.markdown b/node_modules/eslint/node_modules/mkdirp/readme.markdown deleted file mode 100644 index 3cc1315..0000000 --- a/node_modules/eslint/node_modules/mkdirp/readme.markdown +++ /dev/null @@ -1,100 +0,0 @@ -# mkdirp - -Like `mkdir -p`, but in node.js! - -[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp) - -# example - -## pow.js - -```js -var mkdirp = require('mkdirp'); - -mkdirp('/tmp/foo/bar/baz', function (err) { - if (err) console.error(err) - else console.log('pow!') -}); -``` - -Output - -``` -pow! -``` - -And now /tmp/foo/bar/baz exists, huzzah! - -# methods - -```js -var mkdirp = require('mkdirp'); -``` - -## mkdirp(dir, opts, cb) - -Create a new directory and any necessary subdirectories at `dir` with octal -permission string `opts.mode`. If `opts` is a non-object, it will be treated as -the `opts.mode`. - -If `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -`cb(err, made)` fires with the error or the first directory `made` -that had to be created, if any. - -You can optionally pass in an alternate `fs` implementation by passing in -`opts.fs`. Your implementation should have `opts.fs.mkdir(path, mode, cb)` and -`opts.fs.stat(path, cb)`. - -## mkdirp.sync(dir, opts) - -Synchronously create a new directory and any necessary subdirectories at `dir` -with octal permission string `opts.mode`. If `opts` is a non-object, it will be -treated as the `opts.mode`. - -If `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`. - -Returns the first directory that had to be created, if any. - -You can optionally pass in an alternate `fs` implementation by passing in -`opts.fs`. Your implementation should have `opts.fs.mkdirSync(path, mode)` and -`opts.fs.statSync(path)`. - -# usage - -This package also ships with a `mkdirp` command. - -``` -usage: mkdirp [DIR1,DIR2..] {OPTIONS} - - Create each supplied directory including any necessary parent directories that - don't yet exist. - - If the directory already exists, do nothing. - -OPTIONS are: - - -m, --mode If a directory needs to be created, set the mode as an octal - permission string. - -``` - -# install - -With [npm](http://npmjs.org) do: - -``` -npm install mkdirp -``` - -to get the library, or - -``` -npm install -g mkdirp -``` - -to get the command. - -# license - -MIT diff --git a/node_modules/eslint/node_modules/mkdirp/test/chmod.js b/node_modules/eslint/node_modules/mkdirp/test/chmod.js deleted file mode 100644 index 6a404b9..0000000 --- a/node_modules/eslint/node_modules/mkdirp/test/chmod.js +++ /dev/null @@ -1,41 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); -var _0744 = parseInt('0744', 8); - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -test('chmod-pre', function (t) { - var mode = _0744 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.equal(stat && stat.mode & _0777, mode, 'should be 0744'); - t.end(); - }); - }); -}); - -test('chmod', function (t) { - var mode = _0755 - mkdirp(file, mode, function (er) { - t.ifError(er, 'should not error'); - fs.stat(file, function (er, stat) { - t.ifError(er, 'should exist'); - t.ok(stat && stat.isDirectory(), 'should be directory'); - t.end(); - }); - }); -}); diff --git a/node_modules/eslint/node_modules/mkdirp/test/clobber.js b/node_modules/eslint/node_modules/mkdirp/test/clobber.js deleted file mode 100644 index 2433b9a..0000000 --- a/node_modules/eslint/node_modules/mkdirp/test/clobber.js +++ /dev/null @@ -1,38 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; -var _0755 = parseInt('0755', 8); - -var ps = [ '', 'tmp' ]; - -for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); -} - -var file = ps.join('/'); - -// a file in the way -var itw = ps.slice(0, 3).join('/'); - - -test('clobber-pre', function (t) { - console.error("about to write to "+itw) - fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.'); - - fs.stat(itw, function (er, stat) { - t.ifError(er) - t.ok(stat && stat.isFile(), 'should be file') - t.end() - }) -}) - -test('clobber', function (t) { - t.plan(2); - mkdirp(file, _0755, function (err) { - t.ok(err); - t.equal(err.code, 'ENOTDIR'); - t.end(); - }); -}); diff --git a/node_modules/eslint/node_modules/mkdirp/test/mkdirp.js b/node_modules/eslint/node_modules/mkdirp/test/mkdirp.js deleted file mode 100644 index eaa8921..0000000 --- a/node_modules/eslint/node_modules/mkdirp/test/mkdirp.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('woo', function (t) { - t.plan(5); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, _0755, function (err) { - t.ifError(err); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, _0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }) - }) - }); -}); diff --git a/node_modules/eslint/node_modules/mkdirp/test/opts_fs.js b/node_modules/eslint/node_modules/mkdirp/test/opts_fs.js deleted file mode 100644 index 97186b6..0000000 --- a/node_modules/eslint/node_modules/mkdirp/test/opts_fs.js +++ /dev/null @@ -1,29 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var test = require('tap').test; -var mockfs = require('mock-fs'); -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('opts.fs', function (t) { - t.plan(5); - - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/beep/boop/' + [x,y,z].join('/'); - var xfs = mockfs.fs(); - - mkdirp(file, { fs: xfs, mode: _0755 }, function (err) { - t.ifError(err); - xfs.exists(file, function (ex) { - t.ok(ex, 'created file'); - xfs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, _0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }); - }); -}); diff --git a/node_modules/eslint/node_modules/mkdirp/test/opts_fs_sync.js b/node_modules/eslint/node_modules/mkdirp/test/opts_fs_sync.js deleted file mode 100644 index 6c370aa..0000000 --- a/node_modules/eslint/node_modules/mkdirp/test/opts_fs_sync.js +++ /dev/null @@ -1,27 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var test = require('tap').test; -var mockfs = require('mock-fs'); -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('opts.fs sync', function (t) { - t.plan(4); - - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/beep/boop/' + [x,y,z].join('/'); - var xfs = mockfs.fs(); - - mkdirp.sync(file, { fs: xfs, mode: _0755 }); - xfs.exists(file, function (ex) { - t.ok(ex, 'created file'); - xfs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, _0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }); -}); diff --git a/node_modules/eslint/node_modules/mkdirp/test/perm.js b/node_modules/eslint/node_modules/mkdirp/test/perm.js deleted file mode 100644 index fbce44b..0000000 --- a/node_modules/eslint/node_modules/mkdirp/test/perm.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('async perm', function (t) { - t.plan(5); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); - - mkdirp(file, _0755, function (err) { - t.ifError(err); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, _0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }) - }) - }); -}); - -test('async root perm', function (t) { - mkdirp('/tmp', _0755, function (err) { - if (err) t.fail(err); - t.end(); - }); - t.end(); -}); diff --git a/node_modules/eslint/node_modules/mkdirp/test/perm_sync.js b/node_modules/eslint/node_modules/mkdirp/test/perm_sync.js deleted file mode 100644 index 398229f..0000000 --- a/node_modules/eslint/node_modules/mkdirp/test/perm_sync.js +++ /dev/null @@ -1,36 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('sync perm', function (t) { - t.plan(4); - var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; - - mkdirp.sync(file, _0755); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, _0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }); -}); - -test('sync root perm', function (t) { - t.plan(3); - - var file = '/tmp'; - mkdirp.sync(file, _0755); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.ok(stat.isDirectory(), 'target not a directory'); - }) - }); -}); diff --git a/node_modules/eslint/node_modules/mkdirp/test/race.js b/node_modules/eslint/node_modules/mkdirp/test/race.js deleted file mode 100644 index b0b9e18..0000000 --- a/node_modules/eslint/node_modules/mkdirp/test/race.js +++ /dev/null @@ -1,37 +0,0 @@ -var mkdirp = require('../').mkdirp; -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('race', function (t) { - t.plan(10); - var ps = [ '', 'tmp' ]; - - for (var i = 0; i < 25; i++) { - var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - ps.push(dir); - } - var file = ps.join('/'); - - var res = 2; - mk(file); - - mk(file); - - function mk (file, cb) { - mkdirp(file, _0755, function (err) { - t.ifError(err); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, _0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }) - }); - } -}); diff --git a/node_modules/eslint/node_modules/mkdirp/test/rel.js b/node_modules/eslint/node_modules/mkdirp/test/rel.js deleted file mode 100644 index 4ddb342..0000000 --- a/node_modules/eslint/node_modules/mkdirp/test/rel.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('rel', function (t) { - t.plan(5); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var cwd = process.cwd(); - process.chdir('/tmp'); - - var file = [x,y,z].join('/'); - - mkdirp(file, _0755, function (err) { - t.ifError(err); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - process.chdir(cwd); - t.equal(stat.mode & _0777, _0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }) - }) - }); -}); diff --git a/node_modules/eslint/node_modules/mkdirp/test/return.js b/node_modules/eslint/node_modules/mkdirp/test/return.js deleted file mode 100644 index bce68e5..0000000 --- a/node_modules/eslint/node_modules/mkdirp/test/return.js +++ /dev/null @@ -1,25 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(4); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, '/tmp/' + x); - mkdirp(file, function (err, made) { - t.ifError(err); - t.equal(made, null); - }); - }); -}); diff --git a/node_modules/eslint/node_modules/mkdirp/test/return_sync.js b/node_modules/eslint/node_modules/mkdirp/test/return_sync.js deleted file mode 100644 index 7c222d3..0000000 --- a/node_modules/eslint/node_modules/mkdirp/test/return_sync.js +++ /dev/null @@ -1,24 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; - -test('return value', function (t) { - t.plan(2); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - // should return the first dir created. - // By this point, it would be profoundly surprising if /tmp didn't - // already exist, since every other test makes things in there. - // Note that this will throw on failure, which will fail the test. - var made = mkdirp.sync(file); - t.equal(made, '/tmp/' + x); - - // making the same file again should have no effect. - made = mkdirp.sync(file); - t.equal(made, null); -}); diff --git a/node_modules/eslint/node_modules/mkdirp/test/root.js b/node_modules/eslint/node_modules/mkdirp/test/root.js deleted file mode 100644 index 9e7d079..0000000 --- a/node_modules/eslint/node_modules/mkdirp/test/root.js +++ /dev/null @@ -1,19 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var test = require('tap').test; -var _0755 = parseInt('0755', 8); - -test('root', function (t) { - // '/' on unix, 'c:/' on windows. - var file = path.resolve('/'); - - mkdirp(file, _0755, function (err) { - if (err) throw err - fs.stat(file, function (er, stat) { - if (er) throw er - t.ok(stat.isDirectory(), 'target is a directory'); - t.end(); - }) - }); -}); diff --git a/node_modules/eslint/node_modules/mkdirp/test/sync.js b/node_modules/eslint/node_modules/mkdirp/test/sync.js deleted file mode 100644 index 8c8dc93..0000000 --- a/node_modules/eslint/node_modules/mkdirp/test/sync.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('sync', function (t) { - t.plan(4); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file, _0755); - } catch (err) { - t.fail(err); - return t.end(); - } - - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, _0755); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }); -}); diff --git a/node_modules/eslint/node_modules/mkdirp/test/umask.js b/node_modules/eslint/node_modules/mkdirp/test/umask.js deleted file mode 100644 index 2033c63..0000000 --- a/node_modules/eslint/node_modules/mkdirp/test/umask.js +++ /dev/null @@ -1,28 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('implicit mode from umask', function (t) { - t.plan(5); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - mkdirp(file, function (err) { - t.ifError(err); - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, _0777 & (~process.umask())); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }) - }); -}); diff --git a/node_modules/eslint/node_modules/mkdirp/test/umask_sync.js b/node_modules/eslint/node_modules/mkdirp/test/umask_sync.js deleted file mode 100644 index 11a7614..0000000 --- a/node_modules/eslint/node_modules/mkdirp/test/umask_sync.js +++ /dev/null @@ -1,32 +0,0 @@ -var mkdirp = require('../'); -var path = require('path'); -var fs = require('fs'); -var exists = fs.exists || path.exists; -var test = require('tap').test; -var _0777 = parseInt('0777', 8); -var _0755 = parseInt('0755', 8); - -test('umask sync modes', function (t) { - t.plan(4); - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - - var file = '/tmp/' + [x,y,z].join('/'); - - try { - mkdirp.sync(file); - } catch (err) { - t.fail(err); - return t.end(); - } - - exists(file, function (ex) { - t.ok(ex, 'file created'); - fs.stat(file, function (err, stat) { - t.ifError(err); - t.equal(stat.mode & _0777, (_0777 & (~process.umask()))); - t.ok(stat.isDirectory(), 'target not a directory'); - }); - }); -}); diff --git a/node_modules/eslint/node_modules/object-assign/index.js b/node_modules/eslint/node_modules/object-assign/index.js deleted file mode 100644 index c097d87..0000000 --- a/node_modules/eslint/node_modules/object-assign/index.js +++ /dev/null @@ -1,39 +0,0 @@ -/* eslint-disable no-unused-vars */ -'use strict'; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; - -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - - return Object(val); -} - -module.exports = Object.assign || function (target, source) { - var from; - var to = toObject(target); - var symbols; - - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - - if (Object.getOwnPropertySymbols) { - symbols = Object.getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - - return to; -}; diff --git a/node_modules/eslint/node_modules/object-assign/license b/node_modules/eslint/node_modules/object-assign/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/eslint/node_modules/object-assign/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/eslint/node_modules/object-assign/package.json b/node_modules/eslint/node_modules/object-assign/package.json deleted file mode 100644 index 81d9866..0000000 --- a/node_modules/eslint/node_modules/object-assign/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "object-assign", - "version": "4.0.1", - "description": "ES6 Object.assign() ponyfill", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/object-assign.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "xo && mocha", - "bench": "matcha bench.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "object", - "assign", - "extend", - "properties", - "es6", - "ecmascript", - "harmony", - "ponyfill", - "prollyfill", - "polyfill", - "shim", - "browser" - ], - "devDependencies": { - "lodash": "^3.10.1", - "matcha": "^0.6.0", - "mocha": "*", - "xo": "*" - }, - "xo": { - "envs": [ - "node", - "mocha" - ] - }, - "gitHead": "b0c40d37cbc43e89ad3326a9bad4c6b3133ba6d3", - "bugs": { - "url": "https://github.com/sindresorhus/object-assign/issues" - }, - "homepage": "https://github.com/sindresorhus/object-assign#readme", - "_id": "object-assign@4.0.1", - "_shasum": "99504456c3598b5cad4fc59c26e8a9bb107fe0bd", - "_from": "object-assign@>=4.0.1 <5.0.0", - "_npmVersion": "2.13.3", - "_nodeVersion": "3.0.0", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "99504456c3598b5cad4fc59c26e8a9bb107fe0bd", - "tarball": "http://registry.npmjs.org/object-assign/-/object-assign-4.0.1.tgz" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.0.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/object-assign/readme.md b/node_modules/eslint/node_modules/object-assign/readme.md deleted file mode 100644 index aee51c1..0000000 --- a/node_modules/eslint/node_modules/object-assign/readme.md +++ /dev/null @@ -1,51 +0,0 @@ -# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) - -> ES6 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) ponyfill - -> Ponyfill: A polyfill that doesn't overwrite the native method - - -## Install - -```sh -$ npm install --save object-assign -``` - - -## Usage - -```js -var objectAssign = require('object-assign'); - -objectAssign({foo: 0}, {bar: 1}); -//=> {foo: 0, bar: 1} - -// multiple sources -objectAssign({foo: 0}, {bar: 1}, {baz: 2}); -//=> {foo: 0, bar: 1, baz: 2} - -// overwrites equal keys -objectAssign({foo: 0}, {foo: 1}, {foo: 2}); -//=> {foo: 2} - -// ignores null and undefined sources -objectAssign({foo: 0}, null, {bar: 1}, undefined); -//=> {foo: 0, bar: 1} -``` - - -## API - -### objectAssign(target, source, [source, ...]) - -Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. - - -## Resources - -- [ES6 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/eslint/node_modules/optionator/CHANGELOG.md b/node_modules/eslint/node_modules/optionator/CHANGELOG.md deleted file mode 100644 index 732fdc6..0000000 --- a/node_modules/eslint/node_modules/optionator/CHANGELOG.md +++ /dev/null @@ -1,31 +0,0 @@ -# 0.6.0 -- added `defaults` lib-option flag, allowing one to set default properties for all options -- added `concatRepeatedArrays` and `mergeRepeatedObjects` as option level properties, allowing you to turn this feature on for specific options only - -# 0.5.0 -- `Boolean` flags with `default: 'true'`, and no short aliases, will by default show the `--no` version in help - -# 0.4.0 -- add `mergeRepeatedObjects` setting - -# 0.3.0 -- add `concatRepeatedArrays` setting -- add `overrideRequired` option setting -- use just Levenshtein string compare algo rather than Levenshtein Damerau to due dependency license issue - -# 0.2.2 -- bug fixes - -# 0.2.1 -- improved interpolation -- added changelog - -# 0.2.0 -- add dependency checks to options - added `dependsOn` as an option property -- add interpolation for `prepend` and `append` text with new `generateHelp` option, `interpolate` - -# 0.1.1 -- update dependencies - -# 0.1.0 -- initial release diff --git a/node_modules/eslint/node_modules/optionator/LICENSE b/node_modules/eslint/node_modules/optionator/LICENSE deleted file mode 100644 index 525b118..0000000 --- a/node_modules/eslint/node_modules/optionator/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) George Zahariev - -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. diff --git a/node_modules/eslint/node_modules/optionator/README.md b/node_modules/eslint/node_modules/optionator/README.md deleted file mode 100644 index c4d41b2..0000000 --- a/node_modules/eslint/node_modules/optionator/README.md +++ /dev/null @@ -1,212 +0,0 @@ -# Optionator - - -Optionator is a JavaScript option parsing and help generation library used by [eslint](http://eslint.org), [Grasp](http://graspjs.com), [LiveScript](http://livescript.net), [esmangle](https://github.com/estools/esmangle), [escodegen](https://github.com/estools/escodegen), and [many more](https://www.npmjs.com/browse/depended/optionator). - -For an online demo, check out the [Grasp online demo](http://www.graspjs.com/#demo). - -[About](#about) · [Usage](#usage) · [Settings Format](#settings-format) · [Argument Format](#argument-format) - -## Why? -The problem with other option parsers, such as `yargs` or `minimist`, is they just accept all input, valid or not. -With Optionator, if you mistype an option, it will give you an error (with a suggestion for what you meant). -If you give the wrong type of argument for an option, it will give you an error rather than supplying the wrong input to your application. - - $ cmd --halp - Invalid option '--halp' - perhaps you meant '--help'? - - $ cmd --count str - Invalid value for option 'count' - expected type Int, received value: str. - -Over helpful features include reformatting the help text based on the size of the console, so that it fits even if the console is narrow, and accepting not just an array (eg. process.argv), but a string or object as well, making things like testing much easier. - -## About -Optionator uses [type-check](https://github.com/gkz/type-check) and [levn](https://github.com/gkz/levn) behind the scenes to cast and verify input according the specified types. - -MIT license. Version 0.6.0 - - npm install optionator - -For updates on Optionator, [follow me on twitter](https://twitter.com/gkzahariev). - -## Usage -`require('optionator');` returns a function. It has one property, `VERSION`, the current version of the library as a string. This function is called with an object specifying your options and other information, see the [settings format section](#settings-format). This in turn returns an object with three properties, `parse`, `generateHelp`, and `generateHelpForOption`, which are all functions. - -```js -var optionator = require('optionator')({ - prepend: 'Usage: cmd [options]', - append: 'Version 1.0.0', - options: [{ - option: 'help', - alias: 'h', - type: 'Boolean', - description: 'displays help' - }, { - option: 'count', - alias: 'c', - type: 'Int', - description: 'number of things', - example: 'cmd --count 2' - }] -}); -``` - -### parse(input, parseOptions) -`parse` processes the `input` according to your settings, and returns an object with the results. - -##### arguments -* input - `[String] | Object | String` - the input you wish to parse -* parseOptions - `{slice: Int}` - all options optional - - `slice` specifies how much to slice away from the beginning if the input is an array or string - by default `0` for string, `2` for array (works with `process.argv`) - -##### returns -`Object` - the parsed options, each key is a camelCase version of the option name (specified in dash-case), and each value is the processed value for that option. Positional values are in an array under the `_` key. - -##### example -```js -parse(['node', 't.js', '--count', '2', 'positional']); // {count: 2, _: ['positional']} -parse('--count 2 positional'); // {count: 2, _: ['positional']} -parse({count: 2, _:['positional']}); // {count: 2, _: ['positional']} -``` - -### generateHelp(helpOptions) -`generateHelp` produces help text based on your settings. - -##### arguments -* helpOptions - `{showHidden: Boolean, interpolate: Object}` - all options optional - - `showHidden` specifies whether to show options with `hidden: true` specified, by default it is `false` - - `interpolate` specify data to be interpolated in `prepend` and `append` text, `{{key}}` is the format - eg. `generateHelp({interpolate:{version: '0.4.2'}})`, will change this `append` text: `Version {{version}}` to `Version 0.4.2` - -##### returns -`String` - the generated help text - -##### example -```js -generateHelp(); /* -"Usage: cmd [options] positional - - -h, --help displays help - -c, --count Int number of things - -Version 1.0.0 -"*/ -``` - -### generateHelpForOption(optionName) -`generateHelpForOption` produces expanded help text for the specified with `optionName` option. If an `example` was specified for the option, it will be displayed, and if a `longDescription` was specified, it will display that instead of the `description`. - -##### arguments -* optionName - `String` - the name of the option to display - -##### returns -`String` - the generated help text for the option - -##### example -```js -generateHelpForOption('count'); /* -"-c, --count Int -description: number of things -example: cmd --count 2 -"*/ -``` - -## Settings Format -When your `require('optionator')`, you get a function that takes in a settings object. This object has the type: - - { - prepend: String, - append: String, - options: [{heading: String} | { - option: String, - alias: [String] | String, - type: String, - enum: [String], - default: String, - restPositional: Boolean, - required: Boolean, - overrideRequired: Boolean, - dependsOn: [String] | String, - concatRepeatedArrays: Boolean, - mergeRepeatedObjects: Boolean, - description: String, - longDescription: String, - example: [String] | String - }], - helpStyle: { - aliasSeparator: String, - typeSeparator: String, - descriptionSeparator: String, - initialIndent: Int, - secondaryIndent: Int, - maxPadFactor: Number - }, - mutuallyExclusive: [[String | [String]]], - concatRepeatedArrays: Boolean, - mergeRepeatedObjects: Boolean, - positionalAnywhere: Boolean, - defaults: Object - } - -All of the properties are optional (the `Maybe` has been excluded for brevities sake), except for having either `heading: String` or `option: String` in each object in the `options` array. - -### Top Level Properties -* `prepend` is an optional string to be placed before the options in the help text -* `append` is an optional string to be placed after the options in the help text -* `options` is a required array specifying your options and headings, the options and headings will be displayed in the order specified -* `helpStyle` is an optional object which enables you to change the default appearance of some aspects of the help text -* `mutuallyExclusive` is an optional array of arrays of either strings or arrays of strings. The top level array is a list of rules, each rule is a list of elements - each element can be either a string (the name of an option), or a list of strings (a group of option names) - there will be an error if more than one element is present -* `concatRepeatedArrays` is an optional boolean (defaults to `false`) - when set to `true` and an option contains an array value and is repeated, the subsequent values for the flag will be appended rather than overwriting the original value - eg. option `g` of type `[String]`: `-g a -g b -g c,d` will result in `['a','b','c','d']` -* `mergeRepeatedObjects` is an optional boolean (defaults to `false`) - when set to `true` and an option contains an object value and is repeated, the subsequent values for the flag will be merged rather than overwriting the original value - eg. option `g` of type `Object`: `-g a:1 -g b:2 -g c:3,d:4` will result in `{a: 1, b: 2, c: 3, d: 4}` -* `positionalAnywhere` is an optional boolean (defaults to `true`) - when `true` it allows positional arguments anywhere, when `false`, all arguments after the first positional one are taken to be positional as well, even if they look like a flag. For example, with `positionalAnywhere: false`, the arguments `--flag --boom 12 --crack` would have two positional arguments: `12` and `--crack` -* `defaults` is an optional object following the option properties format, which specifies default values for all options. A default will be overridden if manually set. For example, you can do `default: { type: "String" }` to set the default type of all options to `String`, and then override that default in an individual option by setting the `type` property - -#### Heading Properties -* `heading` a required string, the name of the heading - -#### Option Properties -* `option` the required name of the option - use dash-case, without the leading dashes -* `alias` is an optional string or array of strings which specify any aliases for the option -* `type` is a required string in the [type check](https://github.com/gkz/type-check) [format](https://github.com/gkz/type-check#type-format), this will be used to cast the inputted value and validate it -* `enum` is an optional array of strings, each string will be parsed by [levn](https://github.com/gkz/levn) - the argument value must be one of the resulting values - each potential value must validate against the specified `type` -* `default` is a optional string, which will be parsed by [levn](https://github.com/gkz/levn) and used as the default value if none is set - the value must validate against the specified `type` -* `restPositional` is an optional boolean - if set to `true`, everything after the option will be taken to be a positional argument, even if it looks like a named argument -* `required` is an optional boolean - if set to `true`, the option parsing will fail if the option is not defined -* `overrideRequired` is a optional boolean - if set to `true` and the option is used, and there is another option which is required but not set, it will override the need for the required option and there will be no error - this is useful if you have required options and want to use `--help` or `--version` flags -* `concatRepeatedArrays` an optional boolean - same as the description in the Top Level Properties description, but just for this option, not all of them -* `mergeRepeatedObjects` an optional boolean - same as the description in the Top Level Properties description, but just for this option, not all of them -* `dependsOn` is an optional string or array of strings - if simply a string (the name of another option), it will make sure that that other option is set, if an array of strings, depending on whether `'and'` or `'or'` is first, it will either check whether all (`['and', 'option-a', 'option-b']`), or at least one (`['or', 'option-a', 'option-b']`) other options are set -* `description` is an optional string, which will be displayed next to the option in the help text -* `longDescription` is an optional string, it will be displayed instead of the `description` when `generateHelpForOption` is used -* `example` is an optional string or array of strings with example(s) for the option - these will be displayed when `generateHelpForOption` is used - -#### Help Style Properties -* `aliasSeparator` is an optional string, separates multiple names from each other - default: ' ,' -* `typeSeparator` is an optional string, separates the type from the names - default: ' ' -* `descriptionSeparator` is an optional string , separates the description from the padded name and type - default: ' ' -* `initialIndent` is an optional int - the amount of indent for options - default: 2 -* `secondaryIndent` is an optional int - the amount of indent if wrapped fully (in addition to the initial indent) - default: 4 -* `maxPadFactor` is an optional number - affects the default level of padding for the names/type, it is multiplied by the average of the length of the names/type - default: 1.5 - -## Argument Format -At the highest level there are two types of arguments: named, and positional. - -Name arguments of any length are prefixed with `--` (eg. `--go`), and those of one character may be prefixed with either `--` or `-` (eg. `-g`). - -There are two types of named arguments: boolean flags (eg. `--problemo`, `-p`) which take no value and result in a `true` if they are present, the falsey `undefined` if they are not present, or `false` if present and explicitly prefixed with `no` (eg. `--no-problemo`). Named arguments with values (eg. `--tseries 800`, `-t 800`) are the other type. If the option has a type `Boolean` it will automatically be made into a boolean flag. Any other type results in a named argument that takes a value. - -For more information about how to properly set types to get the value you want, take a look at the [type check](https://github.com/gkz/type-check) and [levn](https://github.com/gkz/levn) pages. - -You can group single character arguments that use a single `-`, however all except the last must be boolean flags (which take no value). The last may be a boolean flag, or an argument which takes a value - eg. `-ba 2` is equivalent to `-b -a 2`. - -Positional arguments are all those values which do not fall under the above - they can be anywhere, not just at the end. For example, in `cmd -b one -a 2 two` where `b` is a boolean flag, and `a` has the type `Number`, there are two positional arguments, `one` and `two`. - -Everything after an `--` is positional, even if it looks like a named argument. - -You may optionally use `=` to separate option names from values, for example: `--count=2`. - -If you specify the option `NUM`, then any argument using a single `-` followed by a number will be valid and will set the value of `NUM`. Eg. `-2` will be parsed into `NUM: 2`. - -If duplicate named arguments are present, the last one will be taken. - -## Technical About -`optionator` is written in [LiveScript](http://livescript.net/) - a language that compiles to JavaScript. It uses [levn](https://github.com/gkz/levn) to cast arguments to their specified type, and uses [type-check](https://github.com/gkz/type-check) to validate values. It also uses the [prelude.ls](http://preludels.com/) library. diff --git a/node_modules/eslint/node_modules/optionator/lib/coerce.js b/node_modules/eslint/node_modules/optionator/lib/coerce.js deleted file mode 100644 index 6fb60aa..0000000 --- a/node_modules/eslint/node_modules/optionator/lib/coerce.js +++ /dev/null @@ -1,367 +0,0 @@ -// Generated by LiveScript 1.2.0 -(function(){ - var ref$, id, reject, parsedTypeCheck, types, tokenRegex, toString$ = {}.toString; - ref$ = require('prelude-ls'), id = ref$.id, reject = ref$.reject; - parsedTypeCheck = require('type-check').parsedTypeCheck; - types = { - '*': function(it){ - switch (toString$.call(it).slice(8, -1)) { - case 'Array': - return coerceType(it, { - type: 'Array' - }); - case 'Object': - return coerceType(it, { - type: 'Object' - }); - default: - return { - type: 'Just', - value: coerceTypes(it, [ - { - type: 'Undefined' - }, { - type: 'Null' - }, { - type: 'Boolean' - }, { - type: 'Number' - }, { - type: 'Date' - }, { - type: 'RegExp' - }, { - type: 'Array' - }, { - type: 'Object' - }, { - type: 'String' - } - ], { - explicit: true - }) - }; - } - }, - Undefined: function(it){ - if (it === 'undefined') { - return { - type: 'Just', - value: void 8 - }; - } else { - return { - type: 'Nothing' - }; - } - }, - Null: function(it){ - if (it === 'null') { - return { - type: 'Just', - value: null - }; - } else { - return { - type: 'Nothing' - }; - } - }, - Boolean: function(it){ - if (it === 'true') { - return { - type: 'Just', - value: true - }; - } else if (it === 'false') { - return { - type: 'Just', - value: false - }; - } else { - return { - type: 'Nothing' - }; - } - }, - Number: function(it){ - return { - type: 'Just', - value: +it - }; - }, - Int: function(it){ - return { - type: 'Just', - value: parseInt(it) - }; - }, - Float: function(it){ - return { - type: 'Just', - value: parseFloat(it) - }; - }, - Date: function(value, options){ - var that; - if (that = /^\#(.*)\#$/.exec(value)) { - return { - type: 'Just', - value: new Date(+that[1] || that[1]) - }; - } else if (options.explicit) { - return { - type: 'Nothing' - }; - } else { - return { - type: 'Just', - value: new Date(+value || value) - }; - } - }, - RegExp: function(value, options){ - var that; - if (that = /^\/(.*)\/([gimy]*)$/.exec(value)) { - return { - type: 'Just', - value: new RegExp(that[1], that[2]) - }; - } else if (options.explicit) { - return { - type: 'Nothing' - }; - } else { - return { - type: 'Just', - value: new RegExp(value) - }; - } - }, - Array: function(it){ - return coerceArray(it, { - of: [{ - type: '*' - }] - }); - }, - Object: function(it){ - return coerceFields(it, { - of: {} - }); - }, - String: function(it){ - var that; - if (that = it.match(/^'(.*)'$/)) { - return { - type: 'Just', - value: that[1] - }; - } else if (that = it.match(/^"(.*)"$/)) { - return { - type: 'Just', - value: that[1] - }; - } else { - return { - type: 'Just', - value: it - }; - } - } - }; - function coerceArray(node, type){ - var typeOf, element; - if (toString$.call(node).slice(8, -1) !== 'Array') { - return { - type: 'Nothing' - }; - } - typeOf = type.of; - return { - type: 'Just', - value: (function(){ - var i$, ref$, len$, results$ = []; - for (i$ = 0, len$ = (ref$ = node).length; i$ < len$; ++i$) { - element = ref$[i$]; - results$.push(coerceTypes(element, typeOf)); - } - return results$; - }()) - }; - } - function coerceTuple(node, type){ - var i, types; - if (toString$.call(node).slice(8, -1) !== 'Array') { - return { - type: 'Nothing' - }; - } - return { - type: 'Just', - value: (function(){ - var i$, ref$, len$, results$ = []; - for (i$ = 0, len$ = (ref$ = type.of).length; i$ < len$; ++i$) { - i = i$; - types = ref$[i$]; - results$.push(coerceTypes(node[i], types)); - } - return results$; - }()) - }; - } - function coerceFields(node, type){ - var typeOf, key, value; - if (toString$.call(node).slice(8, -1) !== 'Object') { - return { - type: 'Nothing' - }; - } - typeOf = type.of; - return { - type: 'Just', - value: (function(){ - var ref$, results$ = {}; - for (key in ref$ = node) { - value = ref$[key]; - results$[key] = coerceTypes(value, typeOf[key] || [{ - type: '*' - }]); - } - return results$; - }()) - }; - } - function coerceType(node, typeObj, options){ - var type, structure, coerceFunc; - type = typeObj.type, structure = typeObj.structure; - if (type) { - coerceFunc = types[type]; - return coerceFunc(node, options); - } else { - switch (structure) { - case 'array': - return coerceArray(node, typeObj); - case 'tuple': - return coerceTuple(node, typeObj); - case 'fields': - return coerceFields(node, typeObj); - } - } - } - function coerceTypes(node, types, options){ - var i$, len$, type, ref$, valueType, value; - options == null && (options = {}); - for (i$ = 0, len$ = types.length; i$ < len$; ++i$) { - type = types[i$]; - ref$ = coerceType(node, type, options), valueType = ref$.type, value = ref$.value; - if (valueType === 'Nothing') { - continue; - } - if (parsedTypeCheck([type], value)) { - return value; - } - } - throw new Error("Value '" + node + "' does not type check against " + JSON.stringify(types) + "."); - } - function consumeOp(tokens, op){ - if (tokens[0] === op) { - return tokens.shift(); - } else { - throw new Error("Expected '" + op + "', but got " + tokens[0] + " instead."); - } - } - function maybeConsumeOp(tokens, op){ - if (tokens[0] === op) { - return tokens.shift(); - } - } - function consumeList(tokens, delimiters, hasDelimiters){ - var result; - if (hasDelimiters) { - consumeOp(tokens, delimiters[0]); - } - result = []; - while (tokens.length && tokens[0] !== delimiters[1]) { - result.push(consumeElement(tokens)); - maybeConsumeOp(tokens, ','); - } - if (hasDelimiters) { - consumeOp(tokens, delimiters[1]); - } - return result; - } - function consumeArray(tokens, hasDelimiters){ - return consumeList(tokens, ['[', ']'], hasDelimiters); - } - function consumeTuple(tokens, hasDelimiters){ - return consumeList(tokens, ['(', ')'], hasDelimiters); - } - function consumeFields(tokens, hasDelimiters){ - var result, key; - if (hasDelimiters) { - consumeOp(tokens, '{'); - } - result = {}; - while (tokens.length && (!hasDelimiters || tokens[0] !== '}')) { - key = tokens.shift(); - consumeOp(tokens, ':'); - result[key] = consumeElement(tokens); - maybeConsumeOp(tokens, ','); - } - if (hasDelimiters) { - consumeOp(tokens, '}'); - } - return result; - } - function consumeElement(tokens){ - switch (tokens[0]) { - case '[': - return consumeArray(tokens, true); - case '(': - return consumeTuple(tokens, true); - case '{': - return consumeFields(tokens, true); - default: - return tokens.shift(); - } - } - function consumeTopLevel(tokens, types){ - var structure, origTokens, result; - structure = types[0].structure; - if (types.length === 1 && structure) { - origTokens = tokens.slice(); - result = structure === 'array' - ? consumeArray(tokens, tokens[0] === '[') - : structure === 'tuple' - ? consumeTuple(tokens, tokens[0] === '(') - : consumeFields(tokens, tokens[0] === '{'); - if (tokens.length) { - return consumeElement(structure === 'array' - ? ['['].concat(origTokens, [']']) - : ['('].concat(origTokens, [')'])); - } else { - return result; - } - } else { - return consumeElement(tokens); - } - } - tokenRegex = /("(?:[^"]|\\")*")|('(?:[^']|\\')*')|(#.*#)|(\/(?:\\\/|[^\/])*\/[gimy]*)|([\[\]\(\)}{:,])|([-\.\$\w]+)|\s*/; - function coerce(types, string){ - var tokens, node; - tokens = reject(function(it){ - return !it || /^\s+$/.test(it); - }, string.split(tokenRegex)); - node = consumeTopLevel(tokens, types); - if (!node) { - throw new Error("Error parsing " + string); - } - return coerceTypes(node, types); - } - module.exports = coerce; - /* - function log - console.log it; it - */ -}).call(this); diff --git a/node_modules/eslint/node_modules/optionator/lib/help.js b/node_modules/eslint/node_modules/optionator/lib/help.js deleted file mode 100644 index 26afec2..0000000 --- a/node_modules/eslint/node_modules/optionator/lib/help.js +++ /dev/null @@ -1,242 +0,0 @@ -// Generated by LiveScript 1.3.1 -(function(){ - var ref$, id, find, sort, min, max, map, unlines, nameToRaw, dasherize, wordwrap, getPreText, setHelpStyleDefaults, generateHelpForOption, generateHelp; - ref$ = require('prelude-ls'), id = ref$.id, find = ref$.find, sort = ref$.sort, min = ref$.min, max = ref$.max, map = ref$.map, unlines = ref$.unlines; - ref$ = require('./util'), nameToRaw = ref$.nameToRaw, dasherize = ref$.dasherize; - wordwrap = require('wordwrap'); - getPreText = function(option, arg$, maxWidth){ - var mainName, shortNames, ref$, longNames, type, description, aliasSeparator, typeSeparator, initialIndent, names, namesString, namesStringLen, typeSeparatorString, typeSeparatorStringLen, typeString, that, wrap; - mainName = option.option, shortNames = (ref$ = option.shortNames) != null - ? ref$ - : [], longNames = (ref$ = option.longNames) != null - ? ref$ - : [], type = option.type, description = option.description; - aliasSeparator = arg$.aliasSeparator, typeSeparator = arg$.typeSeparator, initialIndent = arg$.initialIndent; - if (option.negateName) { - mainName = "no-" + mainName; - if (longNames) { - longNames = map(function(it){ - return "no-" + it; - }, longNames); - } - } - names = mainName.length === 1 - ? [mainName].concat(shortNames, longNames) - : shortNames.concat([mainName], longNames); - namesString = map(nameToRaw, names).join(aliasSeparator); - namesStringLen = namesString.length; - typeSeparatorString = mainName === 'NUM' ? '::' : typeSeparator; - typeSeparatorStringLen = typeSeparatorString.length; - typeString = (that = option['enum']) ? "One of: " + that.join(', ') : type; - if (maxWidth != null && !option.boolean && initialIndent + namesStringLen + typeSeparatorStringLen + typeString.length > maxWidth) { - wrap = wordwrap(initialIndent + namesStringLen + typeSeparatorStringLen, maxWidth); - return namesString + "" + typeSeparatorString + wrap(typeString).replace(/^\s+/, ''); - } else { - return namesString + "" + (option.boolean - ? '' - : typeSeparatorString + "" + typeString); - } - }; - setHelpStyleDefaults = function(helpStyle){ - helpStyle.aliasSeparator == null && (helpStyle.aliasSeparator = ', '); - helpStyle.typeSeparator == null && (helpStyle.typeSeparator = ' '); - helpStyle.descriptionSeparator == null && (helpStyle.descriptionSeparator = ' '); - helpStyle.initialIndent == null && (helpStyle.initialIndent = 2); - helpStyle.secondaryIndent == null && (helpStyle.secondaryIndent = 4); - helpStyle.maxPadFactor == null && (helpStyle.maxPadFactor = 1.5); - }; - generateHelpForOption = function(getOption, arg$){ - var stdout, helpStyle, ref$; - stdout = arg$.stdout, helpStyle = (ref$ = arg$.helpStyle) != null - ? ref$ - : {}; - setHelpStyleDefaults(helpStyle); - return function(optionName){ - var maxWidth, wrap, option, e, pre, defaultString, restPositionalString, description, fullDescription, that, preDescription, descriptionString, exampleString, examples, seperator; - maxWidth = stdout != null && stdout.isTTY ? stdout.columns - 1 : null; - wrap = maxWidth ? wordwrap(maxWidth) : id; - try { - option = getOption(dasherize(optionName)); - } catch (e$) { - e = e$; - return e.message; - } - pre = getPreText(option, helpStyle); - defaultString = option['default'] && !option.negateName ? "\ndefault: " + option['default'] : ''; - restPositionalString = option.restPositional ? 'Everything after this option is considered a positional argument, even if it looks like an option.' : ''; - description = option.longDescription || option.description && sentencize(option.description); - fullDescription = description && restPositionalString - ? description + " " + restPositionalString - : (that = description || restPositionalString) ? that : ''; - preDescription = 'description:'; - descriptionString = !fullDescription - ? '' - : maxWidth && fullDescription.length - 1 - preDescription.length > maxWidth - ? "\n" + preDescription + "\n" + wrap(fullDescription) - : "\n" + preDescription + " " + fullDescription; - exampleString = (that = option.example) ? (examples = [].concat(that), examples.length > 1 - ? "\nexamples:\n" + unlines(examples) - : "\nexample: " + examples[0]) : ''; - seperator = defaultString || descriptionString || exampleString ? "\n" + repeatString$('=', pre.length) : ''; - return pre + "" + seperator + defaultString + descriptionString + exampleString; - }; - }; - generateHelp = function(arg$){ - var options, prepend, append, helpStyle, ref$, stdout, aliasSeparator, typeSeparator, descriptionSeparator, maxPadFactor, initialIndent, secondaryIndent; - options = arg$.options, prepend = arg$.prepend, append = arg$.append, helpStyle = (ref$ = arg$.helpStyle) != null - ? ref$ - : {}, stdout = arg$.stdout; - setHelpStyleDefaults(helpStyle); - aliasSeparator = helpStyle.aliasSeparator, typeSeparator = helpStyle.typeSeparator, descriptionSeparator = helpStyle.descriptionSeparator, maxPadFactor = helpStyle.maxPadFactor, initialIndent = helpStyle.initialIndent, secondaryIndent = helpStyle.secondaryIndent; - return function(arg$){ - var ref$, showHidden, interpolate, maxWidth, output, out, data, optionCount, totalPreLen, preLens, i$, len$, item, that, pre, desc, preLen, sortedPreLens, maxPreLen, preLenMean, x, padAmount, descSepLen, fullWrapCount, partialWrapCount, descLen, totalLen, initialSpace, wrapAllFull, i, wrap; - ref$ = arg$ != null - ? arg$ - : {}, showHidden = ref$.showHidden, interpolate = ref$.interpolate; - maxWidth = stdout != null && stdout.isTTY ? stdout.columns - 1 : null; - output = []; - out = function(it){ - return output.push(it != null ? it : ''); - }; - if (prepend) { - out(interpolate ? interp(prepend, interpolate) : prepend); - out(); - } - data = []; - optionCount = 0; - totalPreLen = 0; - preLens = []; - for (i$ = 0, len$ = (ref$ = options).length; i$ < len$; ++i$) { - item = ref$[i$]; - if (showHidden || !item.hidden) { - if (that = item.heading) { - data.push({ - type: 'heading', - value: that - }); - } else { - pre = getPreText(item, helpStyle, maxWidth); - desc = item['default'] && !item.negateName - ? (that = item.description) != null - ? that + " - default: " + item['default'] - : "default: " + item['default'] - : (that = item.description) != null ? that : ''; - data.push({ - type: 'option', - pre: pre, - desc: desc, - descLen: desc.length - }); - preLen = pre.length; - optionCount++; - totalPreLen += preLen; - preLens.push(preLen); - } - } - } - sortedPreLens = sort(preLens); - maxPreLen = sortedPreLens[sortedPreLens.length - 1]; - preLenMean = initialIndent + totalPreLen / optionCount; - x = optionCount > 2 ? min(preLenMean * maxPadFactor, maxPreLen) : maxPreLen; - for (i$ = sortedPreLens.length - 1; i$ >= 0; --i$) { - preLen = sortedPreLens[i$]; - if (preLen <= x) { - padAmount = preLen; - break; - } - } - descSepLen = descriptionSeparator.length; - if (maxWidth != null) { - fullWrapCount = 0; - partialWrapCount = 0; - for (i$ = 0, len$ = data.length; i$ < len$; ++i$) { - item = data[i$]; - if (item.type === 'option') { - pre = item.pre, desc = item.desc, descLen = item.descLen; - if (descLen === 0) { - item.wrap = 'none'; - } else { - preLen = max(padAmount, pre.length) + initialIndent + descSepLen; - totalLen = preLen + descLen; - if (totalLen > maxWidth) { - if (descLen / 2.5 > maxWidth - preLen) { - fullWrapCount++; - item.wrap = 'full'; - } else { - partialWrapCount++; - item.wrap = 'partial'; - } - } else { - item.wrap = 'none'; - } - } - } - } - } - initialSpace = repeatString$(' ', initialIndent); - wrapAllFull = optionCount > 1 && fullWrapCount + partialWrapCount * 0.5 > optionCount * 0.5; - for (i$ = 0, len$ = data.length; i$ < len$; ++i$) { - i = i$; - item = data[i$]; - if (item.type === 'heading') { - if (i !== 0) { - out(); - } - out(item.value + ":"); - } else { - pre = item.pre, desc = item.desc, descLen = item.descLen, wrap = item.wrap; - if (maxWidth != null) { - if (wrapAllFull || wrap === 'full') { - wrap = wordwrap(initialIndent + secondaryIndent, maxWidth); - out(initialSpace + "" + pre + "\n" + wrap(desc)); - continue; - } else if (wrap === 'partial') { - wrap = wordwrap(initialIndent + descSepLen + max(padAmount, pre.length), maxWidth); - out(initialSpace + "" + pad(pre, padAmount) + descriptionSeparator + wrap(desc).replace(/^\s+/, '')); - continue; - } - } - if (descLen === 0) { - out(initialSpace + "" + pre); - } else { - out(initialSpace + "" + pad(pre, padAmount) + descriptionSeparator + desc); - } - } - } - if (append) { - out(); - out(interpolate ? interp(append, interpolate) : append); - } - return unlines(output); - }; - }; - function pad(str, num){ - var len, padAmount; - len = str.length; - padAmount = num - len; - return str + "" + repeatString$(' ', padAmount > 0 ? padAmount : 0); - } - function sentencize(str){ - var first, rest, period; - first = str.charAt(0).toUpperCase(); - rest = str.slice(1); - period = /[\.!\?]$/.test(str) ? '' : '.'; - return first + "" + rest + period; - } - function interp(string, object){ - return string.replace(/{{([a-zA-Z$_][a-zA-Z$_0-9]*)}}/g, function(arg$, key){ - var ref$; - return (ref$ = object[key]) != null - ? ref$ - : "{{" + key + "}}"; - }); - } - module.exports = { - generateHelp: generateHelp, - generateHelpForOption: generateHelpForOption - }; - function repeatString$(str, n){ - for (var r = ''; n > 0; (n >>= 1) && (str += str)) if (n & 1) r += str; - return r; - } -}).call(this); diff --git a/node_modules/eslint/node_modules/optionator/lib/index.js b/node_modules/eslint/node_modules/optionator/lib/index.js deleted file mode 100644 index e89b960..0000000 --- a/node_modules/eslint/node_modules/optionator/lib/index.js +++ /dev/null @@ -1,428 +0,0 @@ -// Generated by LiveScript 1.3.1 -(function(){ - var VERSION, ref$, id, map, compact, any, groupBy, partition, chars, isItNaN, keys, Obj, camelize, deepIs, closestString, nameToRaw, dasherize, generateHelp, generateHelpForOption, parsedTypeCheck, parseType, parseLevn, camelizeKeys, parseString, main, toString$ = {}.toString, slice$ = [].slice; - VERSION = '0.6.0'; - ref$ = require('prelude-ls'), id = ref$.id, map = ref$.map, compact = ref$.compact, any = ref$.any, groupBy = ref$.groupBy, partition = ref$.partition, chars = ref$.chars, isItNaN = ref$.isItNaN, keys = ref$.keys, Obj = ref$.Obj, camelize = ref$.camelize; - deepIs = require('deep-is'); - ref$ = require('./util'), closestString = ref$.closestString, nameToRaw = ref$.nameToRaw, dasherize = ref$.dasherize; - ref$ = require('./help'), generateHelp = ref$.generateHelp, generateHelpForOption = ref$.generateHelpForOption; - ref$ = require('type-check'), parsedTypeCheck = ref$.parsedTypeCheck, parseType = ref$.parseType; - parseLevn = require('levn').parsedTypeParse; - camelizeKeys = function(obj){ - var key, value, resultObj$ = {}; - for (key in obj) { - value = obj[key]; - resultObj$[camelize(key)] = value; - } - return resultObj$; - }; - parseString = function(string){ - var assignOpt, regex, replaceRegex, result; - assignOpt = '--?[a-zA-Z][-a-z-A-Z0-9]*='; - regex = RegExp('(?:' + assignOpt + ')?(?:\'(?:\\\\\'|[^\'])+\'|"(?:\\\\"|[^"])+")|[^\'"\\s]+', 'g'); - replaceRegex = RegExp('^(' + assignOpt + ')?[\'"]([\\s\\S]*)[\'"]$'); - result = map(function(it){ - return it.replace(replaceRegex, '$1$2'); - }, string.match(regex) || []); - return result; - }; - main = function(libOptions){ - var opts, defaults, required, traverse, getOption, parse; - opts = {}; - defaults = {}; - required = []; - if (toString$.call(libOptions.stdout).slice(8, -1) === 'Undefined') { - libOptions.stdout = process.stdout; - } - libOptions.positionalAnywhere == null && (libOptions.positionalAnywhere = true); - libOptions.defaults == null && (libOptions.defaults = {}); - libOptions.defaults.concatRepeatedArrays = libOptions.concatRepeatedArrays; - libOptions.defaults.mergeRepeatedObjects = libOptions.mergeRepeatedObjects; - traverse = function(options){ - var i$, len$, option, name, k, ref$, v, e, parsedPossibilities, parsedType, j$, len1$, possibility, that, rawDependsType, dependsOpts, dependsType, alias, shortNames, longNames; - if (toString$.call(options).slice(8, -1) !== 'Array') { - throw new Error('No options defined.'); - } - for (i$ = 0, len$ = options.length; i$ < len$; ++i$) { - option = options[i$]; - if (option.heading == null) { - name = option.option; - if (opts[name] != null) { - throw new Error("Option '" + name + "' already defined."); - } - for (k in ref$ = libOptions.defaults) { - v = ref$[k]; - option[k] == null && (option[k] = v); - } - if (option.type === 'Boolean') { - option.boolean == null && (option.boolean = true); - } - if (option.parsedType == null) { - if (!option.type) { - throw new Error("No type defined for option '" + name + "'."); - } - try { - option.parsedType = parseType(option.type); - } catch (e$) { - e = e$; - throw new Error("Option '" + name + "': Error parsing type '" + option.type + "': " + e.message); - } - } - if (option['default']) { - try { - defaults[name] = parseLevn(option.parsedType, option['default']); - } catch (e$) { - e = e$; - throw new Error("Option '" + name + "': Error parsing default value '" + option['default'] + "' for type '" + option.type + "': " + e.message); - } - } - if (option['enum'] && !option.parsedPossiblities) { - parsedPossibilities = []; - parsedType = option.parsedType; - for (j$ = 0, len1$ = (ref$ = option['enum']).length; j$ < len1$; ++j$) { - possibility = ref$[j$]; - try { - parsedPossibilities.push(parseLevn(parsedType, possibility)); - } catch (e$) { - e = e$; - throw new Error("Option '" + name + "': Error parsing enum value '" + possibility + "' for type '" + option.type + "': " + e.message); - } - } - option.parsedPossibilities = parsedPossibilities; - } - if (that = option.dependsOn) { - if (that.length) { - ref$ = [].concat(option.dependsOn), rawDependsType = ref$[0], dependsOpts = slice$.call(ref$, 1); - dependsType = rawDependsType.toLowerCase(); - if (dependsOpts.length) { - if (dependsType === 'and' || dependsType === 'or') { - option.dependsOn = [dependsType].concat(slice$.call(dependsOpts)); - } else { - throw new Error("Option '" + name + "': If you have more than one dependency, you must specify either 'and' or 'or'"); - } - } else { - if ((ref$ = dependsType.toLowerCase()) === 'and' || ref$ === 'or') { - option.dependsOn = null; - } else { - option.dependsOn = ['and', rawDependsType]; - } - } - } else { - option.dependsOn = null; - } - } - if (option.required) { - required.push(name); - } - opts[name] = option; - if (option.alias || option.aliases) { - if (name === 'NUM') { - throw new Error("-NUM option can't have aliases."); - } - if (option.alias) { - option.aliases == null && (option.aliases = [].concat(option.alias)); - } - for (j$ = 0, len1$ = (ref$ = option.aliases).length; j$ < len1$; ++j$) { - alias = ref$[j$]; - if (opts[alias] != null) { - throw new Error("Option '" + alias + "' already defined."); - } - opts[alias] = option; - } - ref$ = partition(fn$, option.aliases), shortNames = ref$[0], longNames = ref$[1]; - option.shortNames == null && (option.shortNames = shortNames); - option.longNames == null && (option.longNames = longNames); - } - if ((!option.aliases || option.shortNames.length === 0) && option.type === 'Boolean' && option['default'] === 'true') { - option.negateName = true; - } - } - } - function fn$(it){ - return it.length === 1; - } - }; - traverse(libOptions.options); - getOption = function(name){ - var opt, possiblyMeant; - opt = opts[name]; - if (opt == null) { - possiblyMeant = closestString(keys(opts), name); - throw new Error("Invalid option '" + nameToRaw(name) + "'" + (possiblyMeant ? " - perhaps you meant '" + nameToRaw(possiblyMeant) + "'?" : '.')); - } - return opt; - }; - parse = function(input, arg$){ - var slice, obj, positional, restPositional, overrideRequired, prop, setValue, setDefaults, checkRequired, mutuallyExclusiveError, checkMutuallyExclusive, checkDependency, checkDependencies, args, key, value, option, ref$, i$, len$, arg, that, result, short, argName, usingAssign, val, flags, len, j$, len1$, i, flag, opt, name, negated, noedName, valPrime; - slice = (arg$ != null - ? arg$ - : {}).slice; - obj = {}; - positional = []; - restPositional = false; - overrideRequired = false; - prop = null; - setValue = function(name, value){ - var opt, val, e, currentType; - opt = getOption(name); - if (opt.boolean) { - val = value; - } else { - try { - val = parseLevn(opt.parsedType, value); - } catch (e$) { - e = e$; - throw new Error("Invalid value for option '" + name + "' - expected type " + opt.type + ", received value: " + value + "."); - } - if (opt['enum'] && !any(function(it){ - return deepIs(it, val); - }, opt.parsedPossibilities)) { - throw new Error("Option " + name + ": '" + val + "' not in [" + opt['enum'].join(', ') + "]."); - } - } - currentType = toString$.call(obj[name]).slice(8, -1); - if (obj[name] != null) { - if (opt.concatRepeatedArrays && currentType === 'Array') { - obj[name] = obj[name].concat(val); - } else if (opt.mergeRepeatedObjects && currentType === 'Object') { - import$(obj[name], val); - } else { - obj[name] = val; - } - } else { - obj[name] = val; - } - if (opt.restPositional) { - restPositional = true; - } - if (opt.overrideRequired) { - overrideRequired = true; - } - }; - setDefaults = function(){ - var name, ref$, value; - for (name in ref$ = defaults) { - value = ref$[name]; - if (obj[name] == null) { - obj[name] = value; - } - } - }; - checkRequired = function(){ - var i$, ref$, len$, name; - if (overrideRequired) { - return; - } - for (i$ = 0, len$ = (ref$ = required).length; i$ < len$; ++i$) { - name = ref$[i$]; - if (!obj[name]) { - throw new Error("Option " + nameToRaw(name) + " is required."); - } - } - }; - mutuallyExclusiveError = function(first, second){ - throw new Error("The options " + nameToRaw(first) + " and " + nameToRaw(second) + " are mutually exclusive - you cannot use them at the same time."); - }; - checkMutuallyExclusive = function(){ - var rules, i$, len$, rule, present, j$, len1$, element, k$, len2$, opt; - rules = libOptions.mutuallyExclusive; - if (!rules) { - return; - } - for (i$ = 0, len$ = rules.length; i$ < len$; ++i$) { - rule = rules[i$]; - present = null; - for (j$ = 0, len1$ = rule.length; j$ < len1$; ++j$) { - element = rule[j$]; - if (toString$.call(element).slice(8, -1) === 'Array') { - for (k$ = 0, len2$ = element.length; k$ < len2$; ++k$) { - opt = element[k$]; - if (opt in obj) { - if (present != null) { - mutuallyExclusiveError(present, opt); - } else { - present = opt; - break; - } - } - } - } else { - if (element in obj) { - if (present != null) { - mutuallyExclusiveError(present, element); - } else { - present = element; - } - } - } - } - } - }; - checkDependency = function(option){ - var dependsOn, type, targetOptionNames, i$, len$, targetOptionName, targetOption; - dependsOn = option.dependsOn; - if (!dependsOn || option.dependenciesMet) { - return true; - } - type = dependsOn[0], targetOptionNames = slice$.call(dependsOn, 1); - for (i$ = 0, len$ = targetOptionNames.length; i$ < len$; ++i$) { - targetOptionName = targetOptionNames[i$]; - targetOption = obj[targetOptionName]; - if (targetOption && checkDependency(targetOption)) { - if (type === 'or') { - return true; - } - } else if (type === 'and') { - throw new Error("The option '" + option.option + "' did not have its dependencies met."); - } - } - if (type === 'and') { - return true; - } else { - throw new Error("The option '" + option.option + "' did not meet any of its dependencies."); - } - }; - checkDependencies = function(){ - var name; - for (name in obj) { - checkDependency(opts[name]); - } - }; - switch (toString$.call(input).slice(8, -1)) { - case 'String': - args = parseString(input.slice(slice != null ? slice : 0)); - break; - case 'Array': - args = input.slice(slice != null ? slice : 2); - break; - case 'Object': - obj = {}; - for (key in input) { - value = input[key]; - if (key !== '_') { - option = getOption(dasherize(key)); - if (parsedTypeCheck(option.parsedType, value)) { - obj[option.option] = value; - } else { - throw new Error("Option '" + option.option + "': Invalid type for '" + value + "' - expected type '" + option.type + "'."); - } - } - } - checkMutuallyExclusive(); - checkDependencies(); - setDefaults(); - checkRequired(); - return ref$ = camelizeKeys(obj), ref$._ = input._ || [], ref$; - default: - throw new Error("Invalid argument to 'parse': " + input + "."); - } - for (i$ = 0, len$ = args.length; i$ < len$; ++i$) { - arg = args[i$]; - if (arg === '--') { - restPositional = true; - } else if (restPositional) { - positional.push(arg); - } else { - if (that = arg.match(/^(--?)([a-zA-Z][-a-zA-Z0-9]*)(=)?(.*)?$/)) { - result = that; - if (prop) { - throw new Error("Value for '" + prop + "' of type '" + getOption(prop).type + "' required."); - } - short = result[1].length === 1; - argName = result[2]; - usingAssign = result[3] != null; - val = result[4]; - if (usingAssign && val == null) { - throw new Error("No value for '" + argName + "' specified."); - } - if (short) { - flags = chars(argName); - len = flags.length; - for (j$ = 0, len1$ = flags.length; j$ < len1$; ++j$) { - i = j$; - flag = flags[j$]; - opt = getOption(flag); - name = opt.option; - if (restPositional) { - positional.push(flag); - } else if (opt.boolean) { - setValue(name, true); - } else if (i === len - 1) { - if (usingAssign) { - setValue(name, val); - } else { - prop = name; - } - } else { - throw new Error("Can't set argument '" + flag + "' when not last flag in a group of short flags."); - } - } - } else { - negated = false; - if (that = argName.match(/^no-(.+)$/)) { - negated = true; - noedName = that[1]; - opt = getOption(noedName); - } else { - opt = getOption(argName); - } - name = opt.option; - if (opt.boolean) { - valPrime = usingAssign ? parseLevn([{ - type: 'Boolean' - }], val) : true; - if (negated) { - setValue(name, !valPrime); - } else { - setValue(name, valPrime); - } - } else { - if (negated) { - throw new Error("Only use 'no-' prefix for Boolean options, not with '" + noedName + "'."); - } - if (usingAssign) { - setValue(name, val); - } else { - prop = name; - } - } - } - } else if (that = arg.match(/^-([0-9]+(?:\.[0-9]+)?)$/)) { - opt = opts.NUM; - if (!opt) { - throw new Error('No -NUM option defined.'); - } - setValue(opt.option, that[1]); - } else { - if (prop) { - setValue(prop, arg); - prop = null; - } else { - positional.push(arg); - if (!libOptions.positionalAnywhere) { - restPositional = true; - } - } - } - } - } - checkMutuallyExclusive(); - checkDependencies(); - setDefaults(); - checkRequired(); - return ref$ = camelizeKeys(obj), ref$._ = positional, ref$; - }; - return { - parse: parse, - generateHelp: generateHelp(libOptions), - generateHelpForOption: generateHelpForOption(getOption, libOptions) - }; - }; - main.VERSION = VERSION; - module.exports = main; - function import$(obj, src){ - var own = {}.hasOwnProperty; - for (var key in src) if (own.call(src, key)) obj[key] = src[key]; - return obj; - } -}).call(this); diff --git a/node_modules/eslint/node_modules/optionator/lib/parse-type.js b/node_modules/eslint/node_modules/optionator/lib/parse-type.js deleted file mode 100644 index e648723..0000000 --- a/node_modules/eslint/node_modules/optionator/lib/parse-type.js +++ /dev/null @@ -1,143 +0,0 @@ -// Generated by LiveScript 1.2.0 -(function(){ - var reject, tokenRegex; - reject = require('prelude-ls').reject; - function consumeWord(tokens){ - var token; - token = tokens[0]; - if (!(token != null && /^[a-zA-Z]+$/.test(token))) { - throw new Error("Exected textual string."); - } - return tokens.shift(); - } - function consumeOp(tokens, op){ - var token; - token = tokens[0]; - if (token !== op) { - throw new Error("Expected " + op); - } - return tokens.shift(); - } - function maybeConsumeOp(tokens, op){ - var token; - token = tokens[0]; - if (token === op) { - return tokens.shift(); - } else { - return null; - } - } - function consumeArray(tokens){ - var contentType; - consumeOp(tokens, '['); - contentType = consumeTypes(tokens); - if (!contentType) { - throw new Error("Must specify content type for Array."); - } - consumeOp(tokens, ']'); - return { - type: 'Array', - contentType: contentType - }; - } - function consumeTuple(tokens){ - var contentTypes, that; - contentTypes = []; - consumeOp(tokens, '('); - while (that = consumeTypes(tokens)) { - contentTypes.push(that); - if (!maybeConsumeOp(tokens, ',')) { - break; - } - } - consumeOp(tokens, ')'); - return { - type: 'Tuple', - contentTypes: contentTypes - }; - } - function consumeProperty(tokens){ - var key, type; - key = consumeWord(tokens); - consumeOp(tokens, ':'); - type = consumeTypes(tokens); - return { - key: key, - type: type - }; - } - function consumeObject(tokens){ - var properties, that; - properties = []; - consumeOp(tokens, '{'); - while (that = consumeProperty(tokens)) { - properties.push(that); - if (!maybeConsumeOp(tokens, ',')) { - break; - } - } - consumeOp(tokens, '}'); - return { - type: 'Object', - properties: properties - }; - } - function consumeType(tokens){ - switch (tokens[0]) { - case '[': - return consumeArray(tokens); - case '{': - return consumeObject(tokens); - case '(': - return consumeTuple(tokens); - default: - return { - type: consumeWord(tokens) - }; - } - } - function consumeMaybe(tokens){ - var maybe, type; - if (tokens[0] === 'Maybe') { - tokens.shift(); - maybe = true; - } - type = consumeType(tokens); - if (maybe) { - return { - type: 'Maybe', - contentType: type - }; - } else { - return type; - } - } - function consumeTypes(tokens){ - var types; - types = []; - for (;;) { - types.push(consumeMaybe(tokens)); - if (!maybeConsumeOp('|')) { - break; - } - } - if (!types.length) { - throw new Error("Expected type(s)."); - } - return types; - } - tokenRegex = /[:,\[\]\(\)}{]|[a-zA-Z]+/g; - module.exports = function(input){ - var tokens, e; - tokens = reject(function(it){ - return /^\s*$/.test(it); - })( - input.match(tokenRegex)); - try { - return consumeTypes(tokens); - } catch (e$) { - e = e$; - throw new Error(e.message + " - '" + tokens.join('#') + "' - '" + input + "'"); - } - }; -}).call(this); diff --git a/node_modules/eslint/node_modules/optionator/lib/util.js b/node_modules/eslint/node_modules/optionator/lib/util.js deleted file mode 100644 index 480ba95..0000000 --- a/node_modules/eslint/node_modules/optionator/lib/util.js +++ /dev/null @@ -1,46 +0,0 @@ -// Generated by LiveScript 1.2.0 -(function(){ - var prelude, map, sortBy, fl, closestString, nameToRaw, dasherize; - prelude = require('prelude-ls'), map = prelude.map, sortBy = prelude.sortBy; - fl = require('fast-levenshtein'); - closestString = function(possibilities, input){ - var distances, ref$, string, distance; - if (!possibilities.length) { - return; - } - distances = map(function(it){ - var ref$, longer, shorter; - ref$ = input.length > it.length - ? [input, it] - : [it, input], longer = ref$[0], shorter = ref$[1]; - return { - string: it, - distance: fl.get(longer, shorter) - }; - })( - possibilities); - ref$ = sortBy(function(it){ - return it.distance; - }, distances)[0], string = ref$.string, distance = ref$.distance; - return string; - }; - nameToRaw = function(name){ - if (name.length === 1 || name === 'NUM') { - return "-" + name; - } else { - return "--" + name; - } - }; - dasherize = function(string){ - if (/^[A-Z]/.test(string)) { - return string; - } else { - return prelude.dasherize(string); - } - }; - module.exports = { - closestString: closestString, - nameToRaw: nameToRaw, - dasherize: dasherize - }; -}).call(this); diff --git a/node_modules/eslint/node_modules/optionator/node_modules/deep-is/.npmignore b/node_modules/eslint/node_modules/optionator/node_modules/deep-is/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/deep-is/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/eslint/node_modules/optionator/node_modules/deep-is/.travis.yml b/node_modules/eslint/node_modules/optionator/node_modules/deep-is/.travis.yml deleted file mode 100644 index d523c5f..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/deep-is/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 - - 0.8 - - 0.10 diff --git a/node_modules/eslint/node_modules/optionator/node_modules/deep-is/LICENSE b/node_modules/eslint/node_modules/optionator/node_modules/deep-is/LICENSE deleted file mode 100644 index c38f840..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/deep-is/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012, 2013 Thorsten Lorenz -Copyright (c) 2012 James Halliday -Copyright (c) 2009 Thomas Robinson <280north.com> - -This software is released under the MIT license: - -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. diff --git a/node_modules/eslint/node_modules/optionator/node_modules/deep-is/README.markdown b/node_modules/eslint/node_modules/optionator/node_modules/deep-is/README.markdown deleted file mode 100644 index eb69a83..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/deep-is/README.markdown +++ /dev/null @@ -1,70 +0,0 @@ -deep-is -========== - -Node's `assert.deepEqual() algorithm` as a standalone module. Exactly like -[deep-equal](https://github.com/substack/node-deep-equal) except for the fact that `deepEqual(NaN, NaN) === true`. - -This module is around [5 times faster](https://gist.github.com/2790507) -than wrapping `assert.deepEqual()` in a `try/catch`. - -[![browser support](http://ci.testling.com/thlorenz/deep-is.png)](http://ci.testling.com/thlorenz/deep-is) - -[![build status](https://secure.travis-ci.org/thlorenz/deep-is.png)](http://travis-ci.org/thlorenz/deep-is) - -example -======= - -``` js -var equal = require('deep-is'); -console.dir([ - equal( - { a : [ 2, 3 ], b : [ 4 ] }, - { a : [ 2, 3 ], b : [ 4 ] } - ), - equal( - { x : 5, y : [6] }, - { x : 5, y : 6 } - ) -]); -``` - -methods -======= - -var deepIs = require('deep-is') - -deepIs(a, b) ---------------- - -Compare objects `a` and `b`, returning whether they are equal according to a -recursive equality algorithm. - -install -======= - -With [npm](http://npmjs.org) do: - -``` -npm install deep-is -``` - -test -==== - -With [npm](http://npmjs.org) do: - -``` -npm test -``` - -license -======= - -Copyright (c) 2012, 2013 Thorsten Lorenz -Copyright (c) 2012 James Halliday - -Derived largely from node's assert module, which has the copyright statement: - -Copyright (c) 2009 Thomas Robinson <280north.com> - -Released under the MIT license, see LICENSE for details. diff --git a/node_modules/eslint/node_modules/optionator/node_modules/deep-is/example/cmp.js b/node_modules/eslint/node_modules/optionator/node_modules/deep-is/example/cmp.js deleted file mode 100644 index 67014b8..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/deep-is/example/cmp.js +++ /dev/null @@ -1,11 +0,0 @@ -var equal = require('../'); -console.dir([ - equal( - { a : [ 2, 3 ], b : [ 4 ] }, - { a : [ 2, 3 ], b : [ 4 ] } - ), - equal( - { x : 5, y : [6] }, - { x : 5, y : 6 } - ) -]); diff --git a/node_modules/eslint/node_modules/optionator/node_modules/deep-is/index.js b/node_modules/eslint/node_modules/optionator/node_modules/deep-is/index.js deleted file mode 100644 index 506fe27..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/deep-is/index.js +++ /dev/null @@ -1,102 +0,0 @@ -var pSlice = Array.prototype.slice; -var Object_keys = typeof Object.keys === 'function' - ? Object.keys - : function (obj) { - var keys = []; - for (var key in obj) keys.push(key); - return keys; - } -; - -var deepEqual = module.exports = function (actual, expected) { - // enforce Object.is +0 !== -0 - if (actual === 0 && expected === 0) { - return areZerosEqual(actual, expected); - - // 7.1. All identical values are equivalent, as determined by ===. - } else if (actual === expected) { - return true; - - } else if (actual instanceof Date && expected instanceof Date) { - return actual.getTime() === expected.getTime(); - - } else if (isNumberNaN(actual)) { - return isNumberNaN(expected); - - // 7.3. Other pairs that do not both pass typeof value == 'object', - // equivalence is determined by ==. - } else if (typeof actual != 'object' && typeof expected != 'object') { - return actual == expected; - - // 7.4. For all other Object pairs, including Array objects, equivalence is - // determined by having the same number of owned properties (as verified - // with Object.prototype.hasOwnProperty.call), the same set of keys - // (although not necessarily the same order), equivalent values for every - // corresponding key, and an identical 'prototype' property. Note: this - // accounts for both named and indexed properties on Arrays. - } else { - return objEquiv(actual, expected); - } -}; - -function isUndefinedOrNull(value) { - return value === null || value === undefined; -} - -function isArguments(object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; -} - -function isNumberNaN(value) { - // NaN === NaN -> false - return typeof value == 'number' && value !== value; -} - -function areZerosEqual(zeroA, zeroB) { - // (1 / +0|0) -> Infinity, but (1 / -0) -> -Infinity and (Infinity !== -Infinity) - return (1 / zeroA) === (1 / zeroB); -} - -function objEquiv(a, b) { - if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) - return false; - - // an identical 'prototype' property. - if (a.prototype !== b.prototype) return false; - //~~~I've managed to break Object.keys through screwy arguments passing. - // Converting to array solves the problem. - if (isArguments(a)) { - if (!isArguments(b)) { - return false; - } - a = pSlice.call(a); - b = pSlice.call(b); - return deepEqual(a, b); - } - try { - var ka = Object_keys(a), - kb = Object_keys(b), - key, i; - } catch (e) {//happens when one is a string literal and the other isn't - return false; - } - // having the same number of owned properties (keys incorporates - // hasOwnProperty) - if (ka.length != kb.length) - return false; - //the same set of keys (although not necessarily the same order), - ka.sort(); - kb.sort(); - //~~~cheap key test - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) - return false; - } - //equivalent values for every corresponding key, and - //~~~possibly expensive deep test - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!deepEqual(a[key], b[key])) return false; - } - return true; -} diff --git a/node_modules/eslint/node_modules/optionator/node_modules/deep-is/package.json b/node_modules/eslint/node_modules/optionator/node_modules/deep-is/package.json deleted file mode 100644 index 13fbda0..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/deep-is/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "name": "deep-is", - "version": "0.1.3", - "description": "node's assert.deepEqual algorithm except for NaN being equal to NaN", - "main": "index.js", - "directories": { - "lib": ".", - "example": "example", - "test": "test" - }, - "scripts": { - "test": "tape test/*.js" - }, - "devDependencies": { - "tape": "~1.0.2" - }, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/thlorenz/deep-is.git" - }, - "keywords": [ - "equality", - "equal", - "compare" - ], - "author": { - "name": "Thorsten Lorenz", - "email": "thlorenz@gmx.de", - "url": "http://thlorenz.com" - }, - "license": { - "type": "MIT", - "url": "https://github.com/thlorenz/deep-is/blob/master/LICENSE" - }, - "testling": { - "files": "test/*.js", - "browsers": { - "ie": [ - 6, - 7, - 8, - 9 - ], - "ff": [ - 3.5, - 10, - 15 - ], - "chrome": [ - 10, - 22 - ], - "safari": [ - 5.1 - ], - "opera": [ - 12 - ] - } - }, - "gitHead": "f126057628423458636dec9df3d621843b9ac55e", - "bugs": { - "url": "https://github.com/thlorenz/deep-is/issues" - }, - "homepage": "https://github.com/thlorenz/deep-is", - "_id": "deep-is@0.1.3", - "_shasum": "b369d6fb5dbc13eecf524f91b070feedc357cf34", - "_from": "deep-is@>=0.1.3 <0.2.0", - "_npmVersion": "1.4.14", - "_npmUser": { - "name": "thlorenz", - "email": "thlorenz@gmx.de" - }, - "maintainers": [ - { - "name": "thlorenz", - "email": "thlorenz@gmx.de" - } - ], - "dist": { - "shasum": "b369d6fb5dbc13eecf524f91b070feedc357cf34", - "tarball": "http://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz" - }, - "_resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/optionator/node_modules/deep-is/test/NaN.js b/node_modules/eslint/node_modules/optionator/node_modules/deep-is/test/NaN.js deleted file mode 100644 index ddaa5a7..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/deep-is/test/NaN.js +++ /dev/null @@ -1,16 +0,0 @@ -var test = require('tape'); -var equal = require('../'); - -test('NaN and 0 values', function (t) { - t.ok(equal(NaN, NaN)); - t.notOk(equal(0, NaN)); - t.ok(equal(0, 0)); - t.notOk(equal(0, 1)); - t.end(); -}); - - -test('nested NaN values', function (t) { - t.ok(equal([ NaN, 1, NaN ], [ NaN, 1, NaN ])); - t.end(); -}); diff --git a/node_modules/eslint/node_modules/optionator/node_modules/deep-is/test/cmp.js b/node_modules/eslint/node_modules/optionator/node_modules/deep-is/test/cmp.js deleted file mode 100644 index 3071013..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/deep-is/test/cmp.js +++ /dev/null @@ -1,23 +0,0 @@ -var test = require('tape'); -var equal = require('../'); - -test('equal', function (t) { - t.ok(equal( - { a : [ 2, 3 ], b : [ 4 ] }, - { a : [ 2, 3 ], b : [ 4 ] } - )); - t.end(); -}); - -test('not equal', function (t) { - t.notOk(equal( - { x : 5, y : [6] }, - { x : 5, y : 6 } - )); - t.end(); -}); - -test('nested nulls', function (t) { - t.ok(equal([ null, null, null ], [ null, null, null ])); - t.end(); -}); diff --git a/node_modules/eslint/node_modules/optionator/node_modules/deep-is/test/neg-vs-pos-0.js b/node_modules/eslint/node_modules/optionator/node_modules/deep-is/test/neg-vs-pos-0.js deleted file mode 100644 index ac26130..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/deep-is/test/neg-vs-pos-0.js +++ /dev/null @@ -1,15 +0,0 @@ -var test = require('tape'); -var equal = require('../'); - -test('0 values', function (t) { - t.ok(equal( 0, 0), ' 0 === 0'); - t.ok(equal( 0, +0), ' 0 === +0'); - t.ok(equal(+0, +0), '+0 === +0'); - t.ok(equal(-0, -0), '-0 === -0'); - - t.notOk(equal(-0, 0), '-0 !== 0'); - t.notOk(equal(-0, +0), '-0 !== +0'); - - t.end(); -}); - diff --git a/node_modules/eslint/node_modules/optionator/node_modules/fast-levenshtein/LICENSE.md b/node_modules/eslint/node_modules/optionator/node_modules/fast-levenshtein/LICENSE.md deleted file mode 100644 index 6212406..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/fast-levenshtein/LICENSE.md +++ /dev/null @@ -1,25 +0,0 @@ -(MIT License) - -Copyright (c) 2013 [Ramesh Nair](http://www.hiddentao.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. - diff --git a/node_modules/eslint/node_modules/optionator/node_modules/fast-levenshtein/README.md b/node_modules/eslint/node_modules/optionator/node_modules/fast-levenshtein/README.md deleted file mode 100644 index 2a917a7..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/fast-levenshtein/README.md +++ /dev/null @@ -1,120 +0,0 @@ -# fast-levenshtein - Levenshtein algorithm in Javascript - -[![Build Status](https://secure.travis-ci.org/hiddentao/fast-levenshtein.png)](http://travis-ci.org/hiddentao/fast-levenshtein) - -An efficient Javascript implementation of the [Levenshtein algorithm](http://en.wikipedia.org/wiki/Levenshtein_distance) with asynchronous callback support. - -## Features - -* Works in node.js and in the browser. -* Better performance than other implementations by not needing to store the whole matrix ([more info](http://www.codeproject.com/Articles/13525/Fast-memory-efficient-Levenshtein-algorithm)). -* Provides synchronous and asynchronous versions of the algorithm. -* Asynchronous version is almost as fast as the synchronous version for small strings and can also provide progress updates. -* Comprehensive test suite and performance benchmark. -* Small: <1 KB minified and gzipped - -## Installation - -### node.js - -Install using [npm](http://npmjs.org/): - -```bash -$ npm install fast-levenshtein -``` - -### Browser - -Using bower: - -```bash -$ bower install fast-levenshtein -``` - -If you are not using any module loader system then the API will then be accessible via the `window.Levenshtein` object. - -## Examples - -**Synchronous** - -```javascript -var levenshtein = require('fast-levenshtein'); - -var distance = levenshtein.get('back', 'book'); // 2 -var distance = levenshtein.get('我愛你', '我叫你'); // 1 -``` - -**Asynchronous** - -```javascript -var levenshtein = require('fast-levenshtein'); - -levenshtein.getAsync('back', 'book', function (err, distance) { - // err is null unless an error was thrown - // distance equals 2 -}); -``` - -**Asynchronous with progress updates** - -```javascript -var levenshtein = require('fast-levenshtein'); - -var hugeText1 = fs.readFileSync(...); -var hugeText2 = fs.readFileSync(...); - -levenshtein.getAsync(hugeText1, hugeText2, function (err, distance) { - // process the results as normal -}, { - progress: function(percentComplete) { - console.log(percentComplete + ' % completed so far...'); - } -); -``` - -## Building and Testing - -To build the code and run the tests: - -```bash -$ npm install -g grunt-cli -$ npm install -$ npm run build -``` - -## Performance - -_Thanks to [Titus Wormer](https://github.com/wooorm) for [encouraging me](https://github.com/hiddentao/fast-levenshtein/issues/1) to do this._ - -Benchmarked against other node.js levenshtein distance modules (on Macbook Air 2012, Core i7, 8GB RAM): - -```bash -Running suite Implementation comparison [benchmark/speed.js]... ->> levenshtein-edit-distance x 234 ops/sec ±3.02% (73 runs sampled) ->> levenshtein-component x 422 ops/sec ±4.38% (83 runs sampled) ->> levenshtein-deltas x 283 ops/sec ±3.83% (78 runs sampled) ->> natural x 255 ops/sec ±0.76% (88 runs sampled) ->> levenshtein x 180 ops/sec ±3.55% (86 runs sampled) ->> fast-levenshtein x 1,792 ops/sec ±2.72% (95 runs sampled) -Benchmark done. -Fastest test is fast-levenshtein at 4.2x faster than levenshtein-component -``` - -You can run this benchmark yourself by doing: - -```bash -$ npm install -g grunt-cli -$ npm install -$ npm run build -$ npm run benchmark -``` - -## Contributing - -If you wish to submit a pull request please update and/or create new tests for any changes you make and ensure the grunt build passes. - -See [CONTRIBUTING.md](https://github.com/hiddentao/fast-levenshtein/blob/master/CONTRIBUTING.md) for details. - -## License - -MIT - see [LICENSE.md](https://github.com/hiddentao/fast-levenshtein/blob/master/LICENSE.md) diff --git a/node_modules/eslint/node_modules/optionator/node_modules/fast-levenshtein/levenshtein.js b/node_modules/eslint/node_modules/optionator/node_modules/fast-levenshtein/levenshtein.js deleted file mode 100644 index 0028f40..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/fast-levenshtein/levenshtein.js +++ /dev/null @@ -1,198 +0,0 @@ -(function() { - 'use strict'; - - /** - * Extend an Object with another Object's properties. - * - * The source objects are specified as additional arguments. - * - * @param dst Object the object to extend. - * - * @return Object the final object. - */ - var _extend = function(dst) { - var sources = Array.prototype.slice.call(arguments, 1); - for (var i=0; i tmp) { - nextCol = tmp; - } - // deletion - tmp = prevRow[j + 1] + 1; - if (nextCol > tmp) { - nextCol = tmp; - } - - // copy current col value into previous (in preparation for next iteration) - prevRow[j] = curCol; - } - - // copy last col value into previous (in preparation for next iteration) - prevRow[j] = nextCol; - } - - return nextCol; - }, - - /** - * Asynchronously calculate levenshtein distance of the two strings. - * - * @param str1 String the first string. - * @param str2 String the second string. - * @param cb Function callback function with signature: function(Error err, int distance) - * @param [options] Object additional options. - * @param [options.progress] Function progress callback with signature: function(percentComplete) - */ - getAsync: function(str1, str2, cb, options) { - options = _extend({}, { - progress: null - }, options); - - // base cases - if (str1 === str2) return cb(null, 0); - if (str1.length === 0) return cb(null, str2.length); - if (str2.length === 0) return cb(null, str1.length); - - // two rows - var prevRow = new Array(str2.length + 1), - curCol, nextCol, - i, j, tmp, - startTime, currentTime; - - // initialise previous row - for (i=0; i tmp) { - nextCol = tmp; - } - // deletion - tmp = prevRow[j + 1] + 1; - if (nextCol > tmp) { - nextCol = tmp; - } - - // copy current into previous (in preparation for next iteration) - prevRow[j] = curCol; - - // get current time - currentTime = new Date().valueOf(); - } - - // send a progress update? - if (null !== options.progress) { - try { - options.progress.call(null, (i * 100.0/ str1.length)); - } catch (err) { - return cb('Progress callback: ' + err.toString()); - } - } - - // next iteration - setTimeout(__calculate(), 0); - }; - - __calculate(); - } - - }; - - // amd - if (typeof define !== "undefined" && define !== null && define.amd) { - define(function() { - return Levenshtein; - }); - } - // commonjs - else if (typeof module !== "undefined" && module !== null) { - module.exports = Levenshtein; - } - // web worker - else if (typeof self !== "undefined" && typeof self.postMessage === 'function' && typeof self.importScripts === 'function') { - self.Levenshtein = Levenshtein; - } - // browser main thread - else if (typeof window !== "undefined" && window !== null) { - window.Levenshtein = Levenshtein; - } -}()); - diff --git a/node_modules/eslint/node_modules/optionator/node_modules/fast-levenshtein/package.json b/node_modules/eslint/node_modules/optionator/node_modules/fast-levenshtein/package.json deleted file mode 100644 index 9f877d3..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/fast-levenshtein/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "fast-levenshtein", - "version": "1.0.7", - "description": "Efficient implementation of Levenshtein algorithm with asynchronous callback support", - "main": "levenshtein.js", - "files": [ - "levenshtein.js" - ], - "scripts": { - "build": "grunt build", - "benchmark": "grunt benchmark" - }, - "devDependencies": { - "lodash": "~1.2.0", - "chai": "~1.5.0", - "mocha": "~1.9.0", - "grunt-contrib-uglify": "~0.2.0", - "grunt": "~0.4.1", - "grunt-contrib-jshint": "~0.4.3", - "grunt-mocha-test": "~0.2.2", - "grunt-npm-install": "~0.1.0", - "load-grunt-tasks": "~0.6.0", - "grunt-benchmark": "~0.2.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/hiddentao/fast-levenshtein.git" - }, - "keywords": [ - "levenshtein", - "distance", - "string" - ], - "author": { - "name": "Ramesh Nair", - "email": "ram@hiddentao.com", - "url": "http://www.hiddentao.com/" - }, - "license": "MIT", - "gitHead": "321ca56691c248823bbdb73b6fda57d6973f7f8c", - "bugs": { - "url": "https://github.com/hiddentao/fast-levenshtein/issues" - }, - "homepage": "https://github.com/hiddentao/fast-levenshtein", - "_id": "fast-levenshtein@1.0.7", - "_shasum": "0178dcdee023b92905193af0959e8a7639cfdcb9", - "_from": "fast-levenshtein@>=1.0.6 <1.1.0", - "_npmVersion": "2.7.6", - "_nodeVersion": "0.12.0", - "_npmUser": { - "name": "hiddentao", - "email": "ram@hiddentao.com" - }, - "dist": { - "shasum": "0178dcdee023b92905193af0959e8a7639cfdcb9", - "tarball": "http://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.0.7.tgz" - }, - "maintainers": [ - { - "name": "hiddentao", - "email": "ram@hiddentao.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.0.7.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/optionator/node_modules/levn/LICENSE b/node_modules/eslint/node_modules/optionator/node_modules/levn/LICENSE deleted file mode 100644 index 525b118..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/levn/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) George Zahariev - -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. diff --git a/node_modules/eslint/node_modules/optionator/node_modules/levn/README.md b/node_modules/eslint/node_modules/optionator/node_modules/levn/README.md deleted file mode 100644 index e55d943..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/levn/README.md +++ /dev/null @@ -1,195 +0,0 @@ -# levn [![Build Status](https://travis-ci.org/gkz/levn.png)](https://travis-ci.org/gkz/levn) -__Light ECMAScript (JavaScript) Value Notation__ -Levn is a library which allows you to parse a string into a JavaScript value based on an expected type. It is meant for short amounts of human entered data (eg. config files, command line arguments). - -Levn aims to concisely describe JavaScript values in text, and allow for the extraction and validation of those values. Levn uses [type-check](https://github.com/gkz/type-check) for its type format, and to validate the results. MIT license. Version 0.2.5. - -__How is this different than JSON?__ levn is meant to be written by humans only, is (due to the previous point) much more concise, can be validated against supplied types, has regex and date literals, and can easily be extended with custom types. On the other hand, it is probably slower and thus less efficient at transporting large amounts of data, which is fine since this is not its purpose. - - npm install levn - -For updates on levn, [follow me on twitter](https://twitter.com/gkzahariev). - - -## Quick Examples - -```js -var parse = require('levn').parse; -parse('Number', '2'); // 2 -parse('String', '2'); // '2' -parse('String', 'levn'); // 'levn' -parse('String', 'a b'); // 'a b' -parse('Boolean', 'true'); // true - -parse('Date', '#2011-11-11#'); // (Date object) -parse('Date', '2011-11-11'); // (Date object) -parse('RegExp', '/[a-z]/gi'); // /[a-z]/gi -parse('RegExp', 're'); // /re/ - -parse('Number | String', 'str'); // 'str' -parse('Number | String', '2'); // 2 - -parse('[Number]', '[1,2,3]'); // [1,2,3] -parse('(String, Boolean)', '(hi, false)'); // ['hi', false] -parse('{a: String, b: Number}', '{a: str, b: 2}'); // {a: 'str', b: 2} - -// at the top level, you can ommit surrounding delimiters -parse('[Number]', '1,2,3'); // [1,2,3] -parse('(String, Boolean)', 'hi, false'); // ['hi', false] -parse('{a: String, b: Number}', 'a: str, b: 2'); // {a: 'str', b: 2} - -// wildcard - auto choose type -parse('*', '[hi,(null,[42]),{k: true}]'); // ['hi', [null, [42]], {k: true}] -``` -## Usage - -`require('levn');` returns an object that exposes three properties. `VERSION` is the current version of the library as a string. `parse` and `parsedTypeParse` are functions. - -```js -// parse(type, input, options); -parse('[Number]', '1,2,3'); // [1, 2, 3] - -// parsedTypeParse(parsedType, input, options); -var parsedType = require('type-check').parseType('[Number]'); -parsedTypeParse(parsedType, '1,2,3'); // [1, 2, 3] -``` - -### parse(type, input, options) - -`parse` casts the string `input` into a JavaScript value according to the specified `type` in the [type format](https://github.com/gkz/type-check#type-format) (and taking account the optional `options`) and returns the resulting JavaScript value. - -##### arguments -* type - `String` - the type written in the [type format](https://github.com/gkz/type-check#type-format) which to check against -* input - `String` - the value written in the [levn format](#levn-format) -* options - `Maybe Object` - an optional parameter specifying additional [options](#options) - -##### returns -`*` - the resulting JavaScript value - -##### example -```js -parse('[Number]', '1,2,3'); // [1, 2, 3] -``` - -### parsedTypeParse(parsedType, input, options) - -`parsedTypeParse` casts the string `input` into a JavaScript value according to the specified `type` which has already been parsed (and taking account the optional `options`) and returns the resulting JavaScript value. You can parse a type using the [type-check](https://github.com/gkz/type-check) library's `parseType` function. - -##### arguments -* type - `Object` - the type in the parsed type format which to check against -* input - `String` - the value written in the [levn format](#levn-format) -* options - `Maybe Object` - an optional parameter specifying additional [options](#options) - -##### returns -`*` - the resulting JavaScript value - -##### example -```js -var parsedType = require('type-check').parseType('[Number]'); -parsedTypeParse(parsedType, '1,2,3'); // [1, 2, 3] -``` - -## Levn Format - -Levn can use the type information you provide to choose the appropriate value to produce from the input. For the same input, it will choose a different output value depending on the type provided. For example, `parse('Number', '2')` will produce the number `2`, but `parse('String', '2')` will produce the string `"2"`. - -If you do not provide type information, and simply use `*`, levn will parse the input according the unambiguous "explicit" mode, which we will now detail - you can also set the `explicit` option to true manually in the [options](#options). - -* `"string"`, `'string'` are parsed as a String, eg. `"a msg"` is `"a msg"` -* `#date#` is parsed as a Date, eg. `#2011-11-11#` is `new Date('2011-11-11')` -* `/regexp/flags` is parsed as a RegExp, eg. `/re/gi` is `/re/gi` -* `undefined`, `null`, `NaN`, `true`, and `false` are all their JavaScript equivalents -* `[element1, element2, etc]` is an Array, and the casting procedure is recursively applied to each element. Eg. `[1,2,3]` is `[1,2,3]`. -* `(element1, element2, etc)` is an tuple, and the casting procedure is recursively applied to each element. Eg. `(1, a)` is `(1, a)` (is `[1, 'a']`). -* `{key1: val1, key2: val2, ...}` is an Object, and the casting procedure is recursively applied to each property. Eg. `{a: 1, b: 2}` is `{a: 1, b: 2}`. -* Any test which does not fall under the above, and which does not contain special characters (`[``]``(``)``{``}``:``,`) is a string, eg. `$12- blah` is `"$12- blah"`. - -If you do provide type information, you can make your input more concise as the program already has some information about what it expects. Please see the [type format](https://github.com/gkz/type-check#type-format) section of [type-check](https://github.com/gkz/type-check) for more information about how to specify types. There are some rules about what levn can do with the information: - -* If a String is expected, and only a String, all characters of the input (including any special ones) will become part of the output. Eg. `[({})]` is `"[({})]"`, and `"hi"` is `'"hi"'`. -* If a Date is expected, the surrounding `#` can be omitted from date literals. Eg. `2011-11-11` is `new Date('2011-11-11')`. -* If a RegExp is expected, no flags need to be specified, and the regex is not using any of the special characters,the opening and closing `/` can be omitted - this will have the affect of setting the source of the regex to the input. Eg. `regex` is `/regex/`. -* If an Array is expected, and it is the root node (at the top level), the opening `[` and closing `]` can be omitted. Eg. `1,2,3` is `[1,2,3]`. -* If a tuple is expected, and it is the root node (at the top level), the opening `(` and closing `)` can be omitted. Eg. `1, a` is `(1, a)` (is `[1, 'a']`). -* If an Object is expected, and it is the root node (at the top level), the opening `{` and closing `}` can be omitted. Eg `a: 1, b: 2` is `{a: 1, b: 2}`. - -If you list multiple types (eg. `Number | String`), it will first attempt to cast to the first type and then validate - if the validation fails it will move on to the next type and so forth, left to right. You must be careful as some types will succeed with any input, such as String. Thus put String at the end of your list. In non-explicit mode, Date and RegExp will succeed with a large variety of input - also be careful with these and list them near the end if not last in your list. - -Whitespace between special characters and elements is inconsequential. - -## Options - -Options is an object. It is an optional parameter to the `parse` and `parsedTypeParse` functions. - -### Explicit - -A `Boolean`. By default it is `false`. - -__Example:__ - -```js -parse('RegExp', 're', {explicit: false}); // /re/ -parse('RegExp', 're', {explicit: true}); // Error: ... does not type check... -parse('RegExp | String', 're', {explicit: true}); // 're' -``` - -`explicit` sets whether to be in explicit mode or not. Using `*` automatically activates explicit mode. For more information, read the [levn format](#levn-format) section. - -### customTypes - -An `Object`. Empty `{}` by default. - -__Example:__ - -```js -var options = { - customTypes: { - Even: { - typeOf: 'Number', - validate: function (x) { - return x % 2 === 0; - }, - cast: function (x) { - return {type: 'Just', value: parseInt(x)}; - } - } - } -} -parse('Even', '2', options); // 2 -parse('Even', '3', options); // Error: Value: "3" does not type check... -``` - -__Another Example:__ -```js -function Person(name, age){ - this.name = name; - this.age = age; -} -var options = { - customTypes: { - Person: { - typeOf: 'Object', - validate: function (x) { - x instanceof Person; - }, - cast: function (value, options, typesCast) { - var name, age; - if ({}.toString.call(value).slice(8, -1) !== 'Object') { - return {type: 'Nothing'}; - } - name = typesCast(value.name, [{type: 'String'}], options); - age = typesCast(value.age, [{type: 'Numger'}], options); - return {type: 'Just', value: new Person(name, age)}; - } - } -} -parse('Person', '{name: Laura, age: 25}', options); // Person {name: 'Laura', age: 25} -``` - -`customTypes` is an object whose keys are the name of the types, and whose values are an object with three properties, `typeOf`, `validate`, and `cast`. For more information about `typeOf` and `validate`, please see the [custom types](https://github.com/gkz/type-check#custom-types) section of type-check. - -`cast` is a function which receives three arguments, the value under question, options, and the typesCast function. In `cast`, attempt to cast the value into the specified type. If you are successful, return an object in the format `{type: 'Just', value: CAST-VALUE}`, if you know it won't work, return `{type: 'Nothing'}`. You can use the `typesCast` function to cast any child values. Remember to pass `options` to it. In your function you can also check for `options.explicit` and act accordingly. - -## Technical About - -`levn` is written in [LiveScript](http://livescript.net/) - a language that compiles to JavaScript. It uses [type-check](https://github.com/gkz/type-check) to both parse types and validate values. It also uses the [prelude.ls](http://preludels.com/) library. diff --git a/node_modules/eslint/node_modules/optionator/node_modules/levn/lib/cast.js b/node_modules/eslint/node_modules/optionator/node_modules/levn/lib/cast.js deleted file mode 100644 index 2a6816f..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/levn/lib/cast.js +++ /dev/null @@ -1,298 +0,0 @@ -// Generated by LiveScript 1.2.0 -(function(){ - var parsedTypeCheck, types, toString$ = {}.toString; - parsedTypeCheck = require('type-check').parsedTypeCheck; - types = { - '*': function(value, options){ - switch (toString$.call(value).slice(8, -1)) { - case 'Array': - return typeCast(value, { - type: 'Array' - }, options); - case 'Object': - return typeCast(value, { - type: 'Object' - }, options); - default: - return { - type: 'Just', - value: typesCast(value, [ - { - type: 'Undefined' - }, { - type: 'Null' - }, { - type: 'NaN' - }, { - type: 'Boolean' - }, { - type: 'Number' - }, { - type: 'Date' - }, { - type: 'RegExp' - }, { - type: 'Array' - }, { - type: 'Object' - }, { - type: 'String' - } - ], (options.explicit = true, options)) - }; - } - }, - Undefined: function(it){ - if (it === 'undefined' || it === void 8) { - return { - type: 'Just', - value: void 8 - }; - } else { - return { - type: 'Nothing' - }; - } - }, - Null: function(it){ - if (it === 'null') { - return { - type: 'Just', - value: null - }; - } else { - return { - type: 'Nothing' - }; - } - }, - NaN: function(it){ - if (it === 'NaN') { - return { - type: 'Just', - value: NaN - }; - } else { - return { - type: 'Nothing' - }; - } - }, - Boolean: function(it){ - if (it === 'true') { - return { - type: 'Just', - value: true - }; - } else if (it === 'false') { - return { - type: 'Just', - value: false - }; - } else { - return { - type: 'Nothing' - }; - } - }, - Number: function(it){ - return { - type: 'Just', - value: +it - }; - }, - Int: function(it){ - return { - type: 'Just', - value: parseInt(it) - }; - }, - Float: function(it){ - return { - type: 'Just', - value: parseFloat(it) - }; - }, - Date: function(value, options){ - var that; - if (that = /^\#([\s\S]*)\#$/.exec(value)) { - return { - type: 'Just', - value: new Date(+that[1] || that[1]) - }; - } else if (options.explicit) { - return { - type: 'Nothing' - }; - } else { - return { - type: 'Just', - value: new Date(+value || value) - }; - } - }, - RegExp: function(value, options){ - var that; - if (that = /^\/([\s\S]*)\/([gimy]*)$/.exec(value)) { - return { - type: 'Just', - value: new RegExp(that[1], that[2]) - }; - } else if (options.explicit) { - return { - type: 'Nothing' - }; - } else { - return { - type: 'Just', - value: new RegExp(value) - }; - } - }, - Array: function(value, options){ - return castArray(value, { - of: [{ - type: '*' - }] - }, options); - }, - Object: function(value, options){ - return castFields(value, { - of: {} - }, options); - }, - String: function(it){ - var that; - if (toString$.call(it).slice(8, -1) !== 'String') { - return { - type: 'Nothing' - }; - } - if (that = it.match(/^'([\s\S]*)'$/)) { - return { - type: 'Just', - value: that[1].replace(/\\'/g, "'") - }; - } else if (that = it.match(/^"([\s\S]*)"$/)) { - return { - type: 'Just', - value: that[1].replace(/\\"/g, '"') - }; - } else { - return { - type: 'Just', - value: it - }; - } - } - }; - function castArray(node, type, options){ - var typeOf, element; - if (toString$.call(node).slice(8, -1) !== 'Array') { - return { - type: 'Nothing' - }; - } - typeOf = type.of; - return { - type: 'Just', - value: (function(){ - var i$, ref$, len$, results$ = []; - for (i$ = 0, len$ = (ref$ = node).length; i$ < len$; ++i$) { - element = ref$[i$]; - results$.push(typesCast(element, typeOf, options)); - } - return results$; - }()) - }; - } - function castTuple(node, type, options){ - var result, i, i$, ref$, len$, types, cast; - if (toString$.call(node).slice(8, -1) !== 'Array') { - return { - type: 'Nothing' - }; - } - result = []; - i = 0; - for (i$ = 0, len$ = (ref$ = type.of).length; i$ < len$; ++i$) { - types = ref$[i$]; - cast = typesCast(node[i], types, options); - if (toString$.call(cast).slice(8, -1) !== 'Undefined') { - result.push(cast); - } - i++; - } - if (node.length <= i) { - return { - type: 'Just', - value: result - }; - } else { - return { - type: 'Nothing' - }; - } - } - function castFields(node, type, options){ - var typeOf, key, value; - if (toString$.call(node).slice(8, -1) !== 'Object') { - return { - type: 'Nothing' - }; - } - typeOf = type.of; - return { - type: 'Just', - value: (function(){ - var ref$, results$ = {}; - for (key in ref$ = node) { - value = ref$[key]; - results$[typesCast(key, [{ - type: 'String' - }], options)] = typesCast(value, typeOf[key] || [{ - type: '*' - }], options); - } - return results$; - }()) - }; - } - function typeCast(node, typeObj, options){ - var type, structure, castFunc, ref$; - type = typeObj.type, structure = typeObj.structure; - if (type) { - castFunc = ((ref$ = options.customTypes[type]) != null ? ref$.cast : void 8) || types[type]; - if (!castFunc) { - throw new Error("Type not defined: " + type + "."); - } - return castFunc(node, options, typesCast); - } else { - switch (structure) { - case 'array': - return castArray(node, typeObj, options); - case 'tuple': - return castTuple(node, typeObj, options); - case 'fields': - return castFields(node, typeObj, options); - } - } - } - function typesCast(node, types, options){ - var i$, len$, type, ref$, valueType, value; - for (i$ = 0, len$ = types.length; i$ < len$; ++i$) { - type = types[i$]; - ref$ = typeCast(node, type, options), valueType = ref$.type, value = ref$.value; - if (valueType === 'Nothing') { - continue; - } - if (parsedTypeCheck([type], value, { - customTypes: options.customTypes - })) { - return value; - } - } - throw new Error("Value " + JSON.stringify(node) + " does not type check against " + JSON.stringify(types) + "."); - } - module.exports = typesCast; -}).call(this); diff --git a/node_modules/eslint/node_modules/optionator/node_modules/levn/lib/coerce.js b/node_modules/eslint/node_modules/optionator/node_modules/levn/lib/coerce.js deleted file mode 100644 index 027b6da..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/levn/lib/coerce.js +++ /dev/null @@ -1,285 +0,0 @@ -// Generated by LiveScript 1.2.0 -(function(){ - var parsedTypeCheck, types, toString$ = {}.toString; - parsedTypeCheck = require('type-check').parsedTypeCheck; - types = { - '*': function(it){ - switch (toString$.call(it).slice(8, -1)) { - case 'Array': - return coerceType(it, { - type: 'Array' - }); - case 'Object': - return coerceType(it, { - type: 'Object' - }); - default: - return { - type: 'Just', - value: coerceTypes(it, [ - { - type: 'Undefined' - }, { - type: 'Null' - }, { - type: 'NaN' - }, { - type: 'Boolean' - }, { - type: 'Number' - }, { - type: 'Date' - }, { - type: 'RegExp' - }, { - type: 'Array' - }, { - type: 'Object' - }, { - type: 'String' - } - ], { - explicit: true - }) - }; - } - }, - Undefined: function(it){ - if (it === 'undefined' || it === void 8) { - return { - type: 'Just', - value: void 8 - }; - } else { - return { - type: 'Nothing' - }; - } - }, - Null: function(it){ - if (it === 'null') { - return { - type: 'Just', - value: null - }; - } else { - return { - type: 'Nothing' - }; - } - }, - NaN: function(it){ - if (it === 'NaN') { - return { - type: 'Just', - value: NaN - }; - } else { - return { - type: 'Nothing' - }; - } - }, - Boolean: function(it){ - if (it === 'true') { - return { - type: 'Just', - value: true - }; - } else if (it === 'false') { - return { - type: 'Just', - value: false - }; - } else { - return { - type: 'Nothing' - }; - } - }, - Number: function(it){ - return { - type: 'Just', - value: +it - }; - }, - Int: function(it){ - return { - type: 'Just', - value: parseInt(it) - }; - }, - Float: function(it){ - return { - type: 'Just', - value: parseFloat(it) - }; - }, - Date: function(value, options){ - var that; - if (that = /^\#(.*)\#$/.exec(value)) { - return { - type: 'Just', - value: new Date(+that[1] || that[1]) - }; - } else if (options.explicit) { - return { - type: 'Nothing' - }; - } else { - return { - type: 'Just', - value: new Date(+value || value) - }; - } - }, - RegExp: function(value, options){ - var that; - if (that = /^\/(.*)\/([gimy]*)$/.exec(value)) { - return { - type: 'Just', - value: new RegExp(that[1], that[2]) - }; - } else if (options.explicit) { - return { - type: 'Nothing' - }; - } else { - return { - type: 'Just', - value: new RegExp(value) - }; - } - }, - Array: function(it){ - return coerceArray(it, { - of: [{ - type: '*' - }] - }); - }, - Object: function(it){ - return coerceFields(it, { - of: {} - }); - }, - String: function(it){ - var that; - if (toString$.call(it).slice(8, -1) !== 'String') { - return { - type: 'Nothing' - }; - } - if (that = it.match(/^'(.*)'$/)) { - return { - type: 'Just', - value: that[1] - }; - } else if (that = it.match(/^"(.*)"$/)) { - return { - type: 'Just', - value: that[1] - }; - } else { - return { - type: 'Just', - value: it - }; - } - } - }; - function coerceArray(node, type){ - var typeOf, element; - if (toString$.call(node).slice(8, -1) !== 'Array') { - return { - type: 'Nothing' - }; - } - typeOf = type.of; - return { - type: 'Just', - value: (function(){ - var i$, ref$, len$, results$ = []; - for (i$ = 0, len$ = (ref$ = node).length; i$ < len$; ++i$) { - element = ref$[i$]; - results$.push(coerceTypes(element, typeOf)); - } - return results$; - }()) - }; - } - function coerceTuple(node, type){ - var result, i$, ref$, len$, i, types, that; - if (toString$.call(node).slice(8, -1) !== 'Array') { - return { - type: 'Nothing' - }; - } - result = []; - for (i$ = 0, len$ = (ref$ = type.of).length; i$ < len$; ++i$) { - i = i$; - types = ref$[i$]; - if (that = coerceTypes(node[i], types)) { - result.push(that); - } - } - return { - type: 'Just', - value: result - }; - } - function coerceFields(node, type){ - var typeOf, key, value; - if (toString$.call(node).slice(8, -1) !== 'Object') { - return { - type: 'Nothing' - }; - } - typeOf = type.of; - return { - type: 'Just', - value: (function(){ - var ref$, results$ = {}; - for (key in ref$ = node) { - value = ref$[key]; - results$[key] = coerceTypes(value, typeOf[key] || [{ - type: '*' - }]); - } - return results$; - }()) - }; - } - function coerceType(node, typeObj, options){ - var type, structure, coerceFunc; - type = typeObj.type, structure = typeObj.structure; - if (type) { - coerceFunc = types[type]; - return coerceFunc(node, options); - } else { - switch (structure) { - case 'array': - return coerceArray(node, typeObj); - case 'tuple': - return coerceTuple(node, typeObj); - case 'fields': - return coerceFields(node, typeObj); - } - } - } - function coerceTypes(node, types, options){ - var i$, len$, type, ref$, valueType, value; - for (i$ = 0, len$ = types.length; i$ < len$; ++i$) { - type = types[i$]; - ref$ = coerceType(node, type, options), valueType = ref$.type, value = ref$.value; - if (valueType === 'Nothing') { - continue; - } - if (parsedTypeCheck([type], value)) { - return value; - } - } - throw new Error("Value " + JSON.stringify(node) + " does not type check against " + JSON.stringify(types) + "."); - } - module.exports = coerceTypes; -}).call(this); diff --git a/node_modules/eslint/node_modules/optionator/node_modules/levn/lib/index.js b/node_modules/eslint/node_modules/optionator/node_modules/levn/lib/index.js deleted file mode 100644 index 54b5769..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/levn/lib/index.js +++ /dev/null @@ -1,22 +0,0 @@ -// Generated by LiveScript 1.2.0 -(function(){ - var parseString, cast, parseType, VERSION, parsedTypeParse, parse; - parseString = require('./parse-string'); - cast = require('./cast'); - parseType = require('type-check').parseType; - VERSION = '0.2.5'; - parsedTypeParse = function(parsedType, string, options){ - options == null && (options = {}); - options.explicit == null && (options.explicit = false); - options.customTypes == null && (options.customTypes = {}); - return cast(parseString(parsedType, string, options), parsedType, options); - }; - parse = function(type, string, options){ - return parsedTypeParse(parseType(type), string, options); - }; - module.exports = { - VERSION: VERSION, - parse: parse, - parsedTypeParse: parsedTypeParse - }; -}).call(this); diff --git a/node_modules/eslint/node_modules/optionator/node_modules/levn/lib/parse-string.js b/node_modules/eslint/node_modules/optionator/node_modules/levn/lib/parse-string.js deleted file mode 100644 index 65ec755..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/levn/lib/parse-string.js +++ /dev/null @@ -1,113 +0,0 @@ -// Generated by LiveScript 1.2.0 -(function(){ - var reject, special, tokenRegex; - reject = require('prelude-ls').reject; - function consumeOp(tokens, op){ - if (tokens[0] === op) { - return tokens.shift(); - } else { - throw new Error("Expected '" + op + "', but got '" + tokens[0] + "' instead in " + JSON.stringify(tokens) + "."); - } - } - function maybeConsumeOp(tokens, op){ - if (tokens[0] === op) { - return tokens.shift(); - } - } - function consumeList(tokens, arg$, hasDelimiters){ - var open, close, result, untilTest; - open = arg$[0], close = arg$[1]; - if (hasDelimiters) { - consumeOp(tokens, open); - } - result = []; - untilTest = "," + (hasDelimiters ? close : ''); - while (tokens.length && (hasDelimiters && tokens[0] !== close)) { - result.push(consumeElement(tokens, untilTest)); - maybeConsumeOp(tokens, ','); - } - if (hasDelimiters) { - consumeOp(tokens, close); - } - return result; - } - function consumeArray(tokens, hasDelimiters){ - return consumeList(tokens, ['[', ']'], hasDelimiters); - } - function consumeTuple(tokens, hasDelimiters){ - return consumeList(tokens, ['(', ')'], hasDelimiters); - } - function consumeFields(tokens, hasDelimiters){ - var result, untilTest, key; - if (hasDelimiters) { - consumeOp(tokens, '{'); - } - result = {}; - untilTest = "," + (hasDelimiters ? '}' : ''); - while (tokens.length && (!hasDelimiters || tokens[0] !== '}')) { - key = consumeValue(tokens, ':'); - consumeOp(tokens, ':'); - result[key] = consumeElement(tokens, untilTest); - maybeConsumeOp(tokens, ','); - } - if (hasDelimiters) { - consumeOp(tokens, '}'); - } - return result; - } - function consumeValue(tokens, untilTest){ - var out; - untilTest == null && (untilTest = ''); - out = ''; - while (tokens.length && -1 === untilTest.indexOf(tokens[0])) { - out += tokens.shift(); - } - return out; - } - function consumeElement(tokens, untilTest){ - switch (tokens[0]) { - case '[': - return consumeArray(tokens, true); - case '(': - return consumeTuple(tokens, true); - case '{': - return consumeFields(tokens, true); - default: - return consumeValue(tokens, untilTest); - } - } - function consumeTopLevel(tokens, types, options){ - var ref$, type, structure, origTokens, result, finalResult, x$, y$; - ref$ = types[0], type = ref$.type, structure = ref$.structure; - origTokens = tokens.concat(); - if (!options.explicit && types.length === 1 && ((!type && structure) || (type === 'Array' || type === 'Object'))) { - result = structure === 'array' || type === 'Array' - ? consumeArray(tokens, tokens[0] === '[') - : structure === 'tuple' - ? consumeTuple(tokens, tokens[0] === '(') - : consumeFields(tokens, tokens[0] === '{'); - finalResult = tokens.length ? consumeElement(structure === 'array' || type === 'Array' - ? (x$ = origTokens, x$.unshift('['), x$.push(']'), x$) - : (y$ = origTokens, y$.unshift('('), y$.push(')'), y$)) : result; - } else { - finalResult = consumeElement(tokens); - } - return finalResult; - } - special = /\[\]\(\)}{:,/.source; - tokenRegex = RegExp('("(?:\\\\"|[^"])*")|(\'(?:\\\\\'|[^\'])*\')|(/(?:\\\\/|[^/])*/[a-zA-Z]*)|(#.*#)|([' + special + '])|([^\\s' + special + '](?:\\s*[^\\s' + special + ']+)*)|\\s*'); - module.exports = function(types, string, options){ - var tokens, node; - options == null && (options = {}); - if (!options.explicit && types.length === 1 && types[0].type === 'String') { - return "'" + string.replace(/\\'/g, "\\\\'") + "'"; - } - tokens = reject(not$, string.split(tokenRegex)); - node = consumeTopLevel(tokens, types, options); - if (!node) { - throw new Error("Error parsing '" + string + "'."); - } - return node; - }; - function not$(x){ return !x; } -}).call(this); diff --git a/node_modules/eslint/node_modules/optionator/node_modules/levn/lib/parse.js b/node_modules/eslint/node_modules/optionator/node_modules/levn/lib/parse.js deleted file mode 100644 index 2beff0f..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/levn/lib/parse.js +++ /dev/null @@ -1,102 +0,0 @@ -// Generated by LiveScript 1.2.0 -(function(){ - var reject, special, tokenRegex; - reject = require('prelude-ls').reject; - function consumeOp(tokens, op){ - if (tokens[0] === op) { - return tokens.shift(); - } else { - throw new Error("Expected '" + op + "', but got '" + tokens[0] + "' instead in " + JSON.stringify(tokens) + "."); - } - } - function maybeConsumeOp(tokens, op){ - if (tokens[0] === op) { - return tokens.shift(); - } - } - function consumeList(tokens, delimiters, hasDelimiters){ - var result; - if (hasDelimiters) { - consumeOp(tokens, delimiters[0]); - } - result = []; - while (tokens.length && tokens[0] !== delimiters[1]) { - result.push(consumeElement(tokens)); - maybeConsumeOp(tokens, ','); - } - if (hasDelimiters) { - consumeOp(tokens, delimiters[1]); - } - return result; - } - function consumeArray(tokens, hasDelimiters){ - return consumeList(tokens, ['[', ']'], hasDelimiters); - } - function consumeTuple(tokens, hasDelimiters){ - return consumeList(tokens, ['(', ')'], hasDelimiters); - } - function consumeFields(tokens, hasDelimiters){ - var result, key; - if (hasDelimiters) { - consumeOp(tokens, '{'); - } - result = {}; - while (tokens.length && (!hasDelimiters || tokens[0] !== '}')) { - key = tokens.shift(); - consumeOp(tokens, ':'); - result[key] = consumeElement(tokens); - maybeConsumeOp(tokens, ','); - } - if (hasDelimiters) { - consumeOp(tokens, '}'); - } - return result; - } - function consumeElement(tokens){ - switch (tokens[0]) { - case '[': - return consumeArray(tokens, true); - case '(': - return consumeTuple(tokens, true); - case '{': - return consumeFields(tokens, true); - default: - return tokens.shift(); - } - } - function consumeTopLevel(tokens, types){ - var ref$, type, structure, origTokens, result, finalResult, x$, y$; - ref$ = types[0], type = ref$.type, structure = ref$.structure; - origTokens = tokens.concat(); - if (types.length === 1 && (structure || (type === 'Array' || type === 'Object'))) { - result = structure === 'array' || type === 'Array' - ? consumeArray(tokens, tokens[0] === '[') - : structure === 'tuple' - ? consumeTuple(tokens, tokens[0] === '(') - : consumeFields(tokens, tokens[0] === '{'); - finalResult = tokens.length ? consumeElement(structure === 'array' || type === 'Array' - ? (x$ = origTokens, x$.unshift('['), x$.push(']'), x$) - : (y$ = origTokens, y$.unshift('('), y$.push(')'), y$)) : result; - } else { - finalResult = consumeElement(tokens); - } - if (tokens.length && origTokens.length) { - throw new Error("Unable to parse " + JSON.stringify(origTokens) + " of type " + JSON.stringify(types) + "."); - } else { - return finalResult; - } - } - special = /\[\]\(\)}{:,/.source; - tokenRegex = RegExp('("(?:[^"]|\\\\")*")|(\'(?:[^\']|\\\\\')*\')|(#.*#)|(/(?:\\\\/|[^/])*/[gimy]*)|([' + special + '])|([^\\s' + special + ']+)|\\s*'); - module.exports = function(string, types){ - var tokens, node; - tokens = reject(function(it){ - return !it || /^\s+$/.test(it); - }, string.split(tokenRegex)); - node = consumeTopLevel(tokens, types); - if (!node) { - throw new Error("Error parsing '" + string + "'."); - } - return node; - }; -}).call(this); diff --git a/node_modules/eslint/node_modules/optionator/node_modules/levn/package.json b/node_modules/eslint/node_modules/optionator/node_modules/levn/package.json deleted file mode 100644 index bc7269b..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/levn/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "levn", - "version": "0.2.5", - "author": { - "name": "George Zahariev", - "email": "z@georgezahariev.com" - }, - "description": "Light ECMAScript (JavaScript) Value Notation - human written, concise, typed, flexible", - "homepage": "https://github.com/gkz/levn", - "keywords": [ - "levn", - "light", - "ecmascript", - "value", - "notation", - "json", - "typed", - "human", - "concise", - "typed", - "flexible" - ], - "files": [ - "lib", - "README.md", - "LICENSE" - ], - "main": "./lib/", - "bugs": { - "url": "https://github.com/gkz/levn/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://raw.github.com/gkz/levn/master/LICENSE" - } - ], - "engines": { - "node": ">= 0.8.0" - }, - "repository": { - "type": "git", - "url": "git://github.com/gkz/levn.git" - }, - "scripts": { - "test": "make test" - }, - "dependencies": { - "prelude-ls": "~1.1.0", - "type-check": "~0.3.1" - }, - "devDependencies": { - "LiveScript": "~1.2.0", - "mocha": "~1.8.2", - "istanbul": "~0.1.43" - }, - "_id": "levn@0.2.5", - "dist": { - "shasum": "ba8d339d0ca4a610e3a3f145b9caf48807155054", - "tarball": "http://registry.npmjs.org/levn/-/levn-0.2.5.tgz" - }, - "_from": "levn@>=0.2.5 <0.3.0", - "_npmVersion": "1.3.21", - "_npmUser": { - "name": "gkz", - "email": "z@georgezahariev.com" - }, - "maintainers": [ - { - "name": "gkz", - "email": "z@georgezahariev.com" - } - ], - "directories": {}, - "_shasum": "ba8d339d0ca4a610e3a3f145b9caf48807155054", - "_resolved": "https://registry.npmjs.org/levn/-/levn-0.2.5.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/CHANGELOG.md b/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/CHANGELOG.md deleted file mode 100644 index c2de12d..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/CHANGELOG.md +++ /dev/null @@ -1,99 +0,0 @@ -# 1.1.2 -- add `Func.memoize` -- fix `zip-all` and `zip-with-all` corner case (no input) -- build with LiveScript 1.4.0 - -# 1.1.1 -- curry `unique-by`, `minimum-by` - -# 1.1.0 -- added `List` functions: `maximum-by`, `minimum-by`, `unique-by` -- added `List` functions: `at`, `elem-index`, `elem-indices`, `find-index`, `find-indices` -- added `Str` functions: `capitalize`, `camelize`, `dasherize` -- added `Func` function: `over` - eg. ``same-length = (==) `over` (.length)`` -- exported `Str.repeat` through main `prelude` object -- fixed definition of `foldr` and `foldr1`, the new correct definition is backwards incompatible with the old, incorrect one -- fixed issue with `fix` -- improved code coverage - -# 1.0.3 -- build browser versions - -# 1.0.2 -- bug fix for `flatten` - slight change with bug fix, flattens arrays only, not array-like objects - -# 1.0.1 -- bug fixes for `drop-while` and `take-while` - -# 1.0.0 -* massive update - separated functions into separate modules -* functions do not accept multiple types anymore - use different versions in their respective modules in some cases (eg. `Obj.map`), or use `chars` or `values` in other cases to transform into a list -* objects are no longer transformed into functions, simply use `(obj.)` in LiveScript to do that -* browser version now using browserify - use `prelude = require('prelude-ls')` -* added `compact`, `split`, `flatten`, `difference`, `intersection`, `union`, `count-by`, `group-by`, `chars`, `unchars`, `apply` -* added `lists-to-obj` which takes a list of keys and list of values and zips them up into an object, and the converse `obj-to-lists` -* added `pairs-to-obj` which takes a list of pairs (2 element lists) and creates an object, and the converse `obj-to-pairs` -* removed `cons`, `append` - use the concat operator -* removed `compose` - use the compose operator -* removed `obj-to-func` - use partially applied access (eg. `(obj.)`) -* removed `length` - use `(.length)` -* `sort-by` renamed to `sort-with` -* added new `sort-by` -* removed `compare` - just use the new `sort-by` -* `break-it` renamed `break-list`, (`Str.break-str` for the string version) -* added `Str.repeat` which creates a new string by repeating the input n times -* `unfold` as alias to `unfoldr` is no longer used -* fixed up style and compiled with LiveScript 1.1.1 -* use Make instead of Slake -* greatly improved tests - -# 0.6.0 -* fixed various bugs -* added `fix`, a fixpoint (Y combinator) for anonymous recursive functions -* added `unfoldr` (alias `unfold`) -* calling `replicate` with a string now returns a list of strings -* removed `partial`, just use native partial application in LiveScript using the `_` placeholder, or currying -* added `sort`, `sortBy`, and `compare` - -# 0.5.0 -* removed `lookup` - use (.prop) -* removed `call` - use (.func arg1, arg2) -* removed `pluck` - use map (.prop), xs -* fixed buys wtih `head` and `last` -* added non-minifed browser version, as `prelude-browser.js` -* renamed `prelude-min.js` to `prelude-browser-min.js` -* renamed `zip` to `zipAll` -* renamed `zipWith` to `zipAllWith` -* added `zip`, a curried zip that takes only two arguments -* added `zipWith`, a curried zipWith that takes only two arguments - -# 0.4.0 -* added `parition` function -* added `curry` function -* removed `elem` function (use `in`) -* removed `notElem` function (use `not in`) - -# 0.3.0 -* added `listToObject` -* added `unique` -* added `objToFunc` -* added support for using strings in map and the like -* added support for using objects in map and the like -* added ability to use objects instead of functions in certain cases -* removed `error` (just use throw) -* added `tau` constant -* added `join` -* added `values` -* added `keys` -* added `partial` -* renamed `log` to `ln` -* added alias to `head`: `first` -* added `installPrelude` helper - -# 0.2.0 -* removed functions that simply warp operators as you can now use operators as functions in LiveScript -* `min/max` are now curried and take only 2 arguments -* added `call` - -# 0.1.0 -* initial public release diff --git a/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/LICENSE b/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/LICENSE deleted file mode 100644 index 525b118..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) George Zahariev - -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. diff --git a/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/README.md b/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/README.md deleted file mode 100644 index fabc212..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# prelude.ls [![Build Status](https://travis-ci.org/gkz/prelude-ls.png?branch=master)](https://travis-ci.org/gkz/prelude-ls) - -is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, LiveScript. - -See **[the prelude.ls site](http://preludels.com)** for examples, a reference, and more. - -You can install via npm `npm install prelude-ls` - -### Development - -`make test` to test - -`make build` to build `lib` from `src` - -`make build-browser` to build browser versions diff --git a/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Func.js b/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Func.js deleted file mode 100644 index b80c9b1..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Func.js +++ /dev/null @@ -1,65 +0,0 @@ -// Generated by LiveScript 1.4.0 -var apply, curry, flip, fix, over, memoize, slice$ = [].slice, toString$ = {}.toString; -apply = curry$(function(f, list){ - return f.apply(null, list); -}); -curry = function(f){ - return curry$(f); -}; -flip = curry$(function(f, x, y){ - return f(y, x); -}); -fix = function(f){ - return function(g){ - return function(){ - return f(g(g)).apply(null, arguments); - }; - }(function(g){ - return function(){ - return f(g(g)).apply(null, arguments); - }; - }); -}; -over = curry$(function(f, g, x, y){ - return f(g(x), g(y)); -}); -memoize = function(f){ - var memo; - memo = {}; - return function(){ - var args, key, arg; - args = slice$.call(arguments); - key = (function(){ - var i$, ref$, len$, results$ = []; - for (i$ = 0, len$ = (ref$ = args).length; i$ < len$; ++i$) { - arg = ref$[i$]; - results$.push(arg + toString$.call(arg).slice(8, -1)); - } - return results$; - }()).join(''); - return memo[key] = key in memo - ? memo[key] - : f.apply(null, args); - }; -}; -module.exports = { - curry: curry, - flip: flip, - fix: fix, - apply: apply, - over: over, - memoize: memoize -}; -function curry$(f, bound){ - var context, - _curry = function(args) { - return f.length > 1 ? function(){ - var params = args ? args.concat() : []; - context = bound ? context || this : this; - return params.push.apply(params, arguments) < - f.length && arguments.length ? - _curry.call(context, params) : f.apply(context, params); - } : f; - }; - return _curry(); -} \ No newline at end of file diff --git a/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/lib/List.js b/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/lib/List.js deleted file mode 100644 index 5790816..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/lib/List.js +++ /dev/null @@ -1,686 +0,0 @@ -// Generated by LiveScript 1.4.0 -var each, map, compact, filter, reject, partition, find, head, first, tail, last, initial, empty, reverse, unique, uniqueBy, fold, foldl, fold1, foldl1, foldr, foldr1, unfoldr, concat, concatMap, flatten, difference, intersection, union, countBy, groupBy, andList, orList, any, all, sort, sortWith, sortBy, sum, product, mean, average, maximum, minimum, maximumBy, minimumBy, scan, scanl, scan1, scanl1, scanr, scanr1, slice, take, drop, splitAt, takeWhile, dropWhile, span, breakList, zip, zipWith, zipAll, zipAllWith, at, elemIndex, elemIndices, findIndex, findIndices, toString$ = {}.toString, slice$ = [].slice; -each = curry$(function(f, xs){ - var i$, len$, x; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - f(x); - } - return xs; -}); -map = curry$(function(f, xs){ - var i$, len$, x, results$ = []; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - results$.push(f(x)); - } - return results$; -}); -compact = function(xs){ - var i$, len$, x, results$ = []; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - if (x) { - results$.push(x); - } - } - return results$; -}; -filter = curry$(function(f, xs){ - var i$, len$, x, results$ = []; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - if (f(x)) { - results$.push(x); - } - } - return results$; -}); -reject = curry$(function(f, xs){ - var i$, len$, x, results$ = []; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - if (!f(x)) { - results$.push(x); - } - } - return results$; -}); -partition = curry$(function(f, xs){ - var passed, failed, i$, len$, x; - passed = []; - failed = []; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - (f(x) ? passed : failed).push(x); - } - return [passed, failed]; -}); -find = curry$(function(f, xs){ - var i$, len$, x; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - if (f(x)) { - return x; - } - } -}); -head = first = function(xs){ - return xs[0]; -}; -tail = function(xs){ - if (!xs.length) { - return; - } - return xs.slice(1); -}; -last = function(xs){ - return xs[xs.length - 1]; -}; -initial = function(xs){ - if (!xs.length) { - return; - } - return xs.slice(0, -1); -}; -empty = function(xs){ - return !xs.length; -}; -reverse = function(xs){ - return xs.concat().reverse(); -}; -unique = function(xs){ - var result, i$, len$, x; - result = []; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - if (!in$(x, result)) { - result.push(x); - } - } - return result; -}; -uniqueBy = curry$(function(f, xs){ - var seen, i$, len$, x, val, results$ = []; - seen = []; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - val = f(x); - if (in$(val, seen)) { - continue; - } - seen.push(val); - results$.push(x); - } - return results$; -}); -fold = foldl = curry$(function(f, memo, xs){ - var i$, len$, x; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - memo = f(memo, x); - } - return memo; -}); -fold1 = foldl1 = curry$(function(f, xs){ - return fold(f, xs[0], xs.slice(1)); -}); -foldr = curry$(function(f, memo, xs){ - var i$, x; - for (i$ = xs.length - 1; i$ >= 0; --i$) { - x = xs[i$]; - memo = f(x, memo); - } - return memo; -}); -foldr1 = curry$(function(f, xs){ - return foldr(f, xs[xs.length - 1], xs.slice(0, -1)); -}); -unfoldr = curry$(function(f, b){ - var result, x, that; - result = []; - x = b; - while ((that = f(x)) != null) { - result.push(that[0]); - x = that[1]; - } - return result; -}); -concat = function(xss){ - return [].concat.apply([], xss); -}; -concatMap = curry$(function(f, xs){ - var x; - return [].concat.apply([], (function(){ - var i$, ref$, len$, results$ = []; - for (i$ = 0, len$ = (ref$ = xs).length; i$ < len$; ++i$) { - x = ref$[i$]; - results$.push(f(x)); - } - return results$; - }())); -}); -flatten = function(xs){ - var x; - return [].concat.apply([], (function(){ - var i$, ref$, len$, results$ = []; - for (i$ = 0, len$ = (ref$ = xs).length; i$ < len$; ++i$) { - x = ref$[i$]; - if (toString$.call(x).slice(8, -1) === 'Array') { - results$.push(flatten(x)); - } else { - results$.push(x); - } - } - return results$; - }())); -}; -difference = function(xs){ - var yss, results, i$, len$, x, j$, len1$, ys; - yss = slice$.call(arguments, 1); - results = []; - outer: for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - for (j$ = 0, len1$ = yss.length; j$ < len1$; ++j$) { - ys = yss[j$]; - if (in$(x, ys)) { - continue outer; - } - } - results.push(x); - } - return results; -}; -intersection = function(xs){ - var yss, results, i$, len$, x, j$, len1$, ys; - yss = slice$.call(arguments, 1); - results = []; - outer: for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - for (j$ = 0, len1$ = yss.length; j$ < len1$; ++j$) { - ys = yss[j$]; - if (!in$(x, ys)) { - continue outer; - } - } - results.push(x); - } - return results; -}; -union = function(){ - var xss, results, i$, len$, xs, j$, len1$, x; - xss = slice$.call(arguments); - results = []; - for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) { - xs = xss[i$]; - for (j$ = 0, len1$ = xs.length; j$ < len1$; ++j$) { - x = xs[j$]; - if (!in$(x, results)) { - results.push(x); - } - } - } - return results; -}; -countBy = curry$(function(f, xs){ - var results, i$, len$, x, key; - results = {}; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - key = f(x); - if (key in results) { - results[key] += 1; - } else { - results[key] = 1; - } - } - return results; -}); -groupBy = curry$(function(f, xs){ - var results, i$, len$, x, key; - results = {}; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - key = f(x); - if (key in results) { - results[key].push(x); - } else { - results[key] = [x]; - } - } - return results; -}); -andList = function(xs){ - var i$, len$, x; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - if (!x) { - return false; - } - } - return true; -}; -orList = function(xs){ - var i$, len$, x; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - if (x) { - return true; - } - } - return false; -}; -any = curry$(function(f, xs){ - var i$, len$, x; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - if (f(x)) { - return true; - } - } - return false; -}); -all = curry$(function(f, xs){ - var i$, len$, x; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - if (!f(x)) { - return false; - } - } - return true; -}); -sort = function(xs){ - return xs.concat().sort(function(x, y){ - if (x > y) { - return 1; - } else if (x < y) { - return -1; - } else { - return 0; - } - }); -}; -sortWith = curry$(function(f, xs){ - return xs.concat().sort(f); -}); -sortBy = curry$(function(f, xs){ - return xs.concat().sort(function(x, y){ - if (f(x) > f(y)) { - return 1; - } else if (f(x) < f(y)) { - return -1; - } else { - return 0; - } - }); -}); -sum = function(xs){ - var result, i$, len$, x; - result = 0; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - result += x; - } - return result; -}; -product = function(xs){ - var result, i$, len$, x; - result = 1; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - result *= x; - } - return result; -}; -mean = average = function(xs){ - var sum, i$, len$, x; - sum = 0; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - x = xs[i$]; - sum += x; - } - return sum / xs.length; -}; -maximum = function(xs){ - var max, i$, ref$, len$, x; - max = xs[0]; - for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) { - x = ref$[i$]; - if (x > max) { - max = x; - } - } - return max; -}; -minimum = function(xs){ - var min, i$, ref$, len$, x; - min = xs[0]; - for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) { - x = ref$[i$]; - if (x < min) { - min = x; - } - } - return min; -}; -maximumBy = curry$(function(f, xs){ - var max, i$, ref$, len$, x; - max = xs[0]; - for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) { - x = ref$[i$]; - if (f(x) > f(max)) { - max = x; - } - } - return max; -}); -minimumBy = curry$(function(f, xs){ - var min, i$, ref$, len$, x; - min = xs[0]; - for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) { - x = ref$[i$]; - if (f(x) < f(min)) { - min = x; - } - } - return min; -}); -scan = scanl = curry$(function(f, memo, xs){ - var last, x; - last = memo; - return [memo].concat((function(){ - var i$, ref$, len$, results$ = []; - for (i$ = 0, len$ = (ref$ = xs).length; i$ < len$; ++i$) { - x = ref$[i$]; - results$.push(last = f(last, x)); - } - return results$; - }())); -}); -scan1 = scanl1 = curry$(function(f, xs){ - if (!xs.length) { - return; - } - return scan(f, xs[0], xs.slice(1)); -}); -scanr = curry$(function(f, memo, xs){ - xs = xs.concat().reverse(); - return scan(f, memo, xs).reverse(); -}); -scanr1 = curry$(function(f, xs){ - if (!xs.length) { - return; - } - xs = xs.concat().reverse(); - return scan(f, xs[0], xs.slice(1)).reverse(); -}); -slice = curry$(function(x, y, xs){ - return xs.slice(x, y); -}); -take = curry$(function(n, xs){ - if (n <= 0) { - return xs.slice(0, 0); - } else { - return xs.slice(0, n); - } -}); -drop = curry$(function(n, xs){ - if (n <= 0) { - return xs; - } else { - return xs.slice(n); - } -}); -splitAt = curry$(function(n, xs){ - return [take(n, xs), drop(n, xs)]; -}); -takeWhile = curry$(function(p, xs){ - var len, i; - len = xs.length; - if (!len) { - return xs; - } - i = 0; - while (i < len && p(xs[i])) { - i += 1; - } - return xs.slice(0, i); -}); -dropWhile = curry$(function(p, xs){ - var len, i; - len = xs.length; - if (!len) { - return xs; - } - i = 0; - while (i < len && p(xs[i])) { - i += 1; - } - return xs.slice(i); -}); -span = curry$(function(p, xs){ - return [takeWhile(p, xs), dropWhile(p, xs)]; -}); -breakList = curry$(function(p, xs){ - return span(compose$(p, not$), xs); -}); -zip = curry$(function(xs, ys){ - var result, len, i$, len$, i, x; - result = []; - len = ys.length; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - i = i$; - x = xs[i$]; - if (i === len) { - break; - } - result.push([x, ys[i]]); - } - return result; -}); -zipWith = curry$(function(f, xs, ys){ - var result, len, i$, len$, i, x; - result = []; - len = ys.length; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - i = i$; - x = xs[i$]; - if (i === len) { - break; - } - result.push(f(x, ys[i])); - } - return result; -}); -zipAll = function(){ - var xss, minLength, i$, len$, xs, ref$, i, lresult$, j$, results$ = []; - xss = slice$.call(arguments); - minLength = undefined; - for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) { - xs = xss[i$]; - minLength <= (ref$ = xs.length) || (minLength = ref$); - } - for (i$ = 0; i$ < minLength; ++i$) { - i = i$; - lresult$ = []; - for (j$ = 0, len$ = xss.length; j$ < len$; ++j$) { - xs = xss[j$]; - lresult$.push(xs[i]); - } - results$.push(lresult$); - } - return results$; -}; -zipAllWith = function(f){ - var xss, minLength, i$, len$, xs, ref$, i, results$ = []; - xss = slice$.call(arguments, 1); - minLength = undefined; - for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) { - xs = xss[i$]; - minLength <= (ref$ = xs.length) || (minLength = ref$); - } - for (i$ = 0; i$ < minLength; ++i$) { - i = i$; - results$.push(f.apply(null, (fn$()))); - } - return results$; - function fn$(){ - var i$, ref$, len$, results$ = []; - for (i$ = 0, len$ = (ref$ = xss).length; i$ < len$; ++i$) { - xs = ref$[i$]; - results$.push(xs[i]); - } - return results$; - } -}; -at = curry$(function(n, xs){ - if (n < 0) { - return xs[xs.length + n]; - } else { - return xs[n]; - } -}); -elemIndex = curry$(function(el, xs){ - var i$, len$, i, x; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - i = i$; - x = xs[i$]; - if (x === el) { - return i; - } - } -}); -elemIndices = curry$(function(el, xs){ - var i$, len$, i, x, results$ = []; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - i = i$; - x = xs[i$]; - if (x === el) { - results$.push(i); - } - } - return results$; -}); -findIndex = curry$(function(f, xs){ - var i$, len$, i, x; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - i = i$; - x = xs[i$]; - if (f(x)) { - return i; - } - } -}); -findIndices = curry$(function(f, xs){ - var i$, len$, i, x, results$ = []; - for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) { - i = i$; - x = xs[i$]; - if (f(x)) { - results$.push(i); - } - } - return results$; -}); -module.exports = { - each: each, - map: map, - filter: filter, - compact: compact, - reject: reject, - partition: partition, - find: find, - head: head, - first: first, - tail: tail, - last: last, - initial: initial, - empty: empty, - reverse: reverse, - difference: difference, - intersection: intersection, - union: union, - countBy: countBy, - groupBy: groupBy, - fold: fold, - fold1: fold1, - foldl: foldl, - foldl1: foldl1, - foldr: foldr, - foldr1: foldr1, - unfoldr: unfoldr, - andList: andList, - orList: orList, - any: any, - all: all, - unique: unique, - uniqueBy: uniqueBy, - sort: sort, - sortWith: sortWith, - sortBy: sortBy, - sum: sum, - product: product, - mean: mean, - average: average, - concat: concat, - concatMap: concatMap, - flatten: flatten, - maximum: maximum, - minimum: minimum, - maximumBy: maximumBy, - minimumBy: minimumBy, - scan: scan, - scan1: scan1, - scanl: scanl, - scanl1: scanl1, - scanr: scanr, - scanr1: scanr1, - slice: slice, - take: take, - drop: drop, - splitAt: splitAt, - takeWhile: takeWhile, - dropWhile: dropWhile, - span: span, - breakList: breakList, - zip: zip, - zipWith: zipWith, - zipAll: zipAll, - zipAllWith: zipAllWith, - at: at, - elemIndex: elemIndex, - elemIndices: elemIndices, - findIndex: findIndex, - findIndices: findIndices -}; -function curry$(f, bound){ - var context, - _curry = function(args) { - return f.length > 1 ? function(){ - var params = args ? args.concat() : []; - context = bound ? context || this : this; - return params.push.apply(params, arguments) < - f.length && arguments.length ? - _curry.call(context, params) : f.apply(context, params); - } : f; - }; - return _curry(); -} -function in$(x, xs){ - var i = -1, l = xs.length >>> 0; - while (++i < l) if (x === xs[i]) return true; - return false; -} -function compose$() { - var functions = arguments; - return function() { - var i, result; - result = functions[0].apply(this, arguments); - for (i = 1; i < functions.length; ++i) { - result = functions[i](result); - } - return result; - }; -} -function not$(x){ return !x; } \ No newline at end of file diff --git a/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Num.js b/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Num.js deleted file mode 100644 index 0e25be7..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Num.js +++ /dev/null @@ -1,130 +0,0 @@ -// Generated by LiveScript 1.4.0 -var max, min, negate, abs, signum, quot, rem, div, mod, recip, pi, tau, exp, sqrt, ln, pow, sin, tan, cos, asin, acos, atan, atan2, truncate, round, ceiling, floor, isItNaN, even, odd, gcd, lcm; -max = curry$(function(x$, y$){ - return x$ > y$ ? x$ : y$; -}); -min = curry$(function(x$, y$){ - return x$ < y$ ? x$ : y$; -}); -negate = function(x){ - return -x; -}; -abs = Math.abs; -signum = function(x){ - if (x < 0) { - return -1; - } else if (x > 0) { - return 1; - } else { - return 0; - } -}; -quot = curry$(function(x, y){ - return ~~(x / y); -}); -rem = curry$(function(x$, y$){ - return x$ % y$; -}); -div = curry$(function(x, y){ - return Math.floor(x / y); -}); -mod = curry$(function(x$, y$){ - var ref$; - return (((x$) % (ref$ = y$) + ref$) % ref$); -}); -recip = (function(it){ - return 1 / it; -}); -pi = Math.PI; -tau = pi * 2; -exp = Math.exp; -sqrt = Math.sqrt; -ln = Math.log; -pow = curry$(function(x$, y$){ - return Math.pow(x$, y$); -}); -sin = Math.sin; -tan = Math.tan; -cos = Math.cos; -asin = Math.asin; -acos = Math.acos; -atan = Math.atan; -atan2 = curry$(function(x, y){ - return Math.atan2(x, y); -}); -truncate = function(x){ - return ~~x; -}; -round = Math.round; -ceiling = Math.ceil; -floor = Math.floor; -isItNaN = function(x){ - return x !== x; -}; -even = function(x){ - return x % 2 === 0; -}; -odd = function(x){ - return x % 2 !== 0; -}; -gcd = curry$(function(x, y){ - var z; - x = Math.abs(x); - y = Math.abs(y); - while (y !== 0) { - z = x % y; - x = y; - y = z; - } - return x; -}); -lcm = curry$(function(x, y){ - return Math.abs(Math.floor(x / gcd(x, y) * y)); -}); -module.exports = { - max: max, - min: min, - negate: negate, - abs: abs, - signum: signum, - quot: quot, - rem: rem, - div: div, - mod: mod, - recip: recip, - pi: pi, - tau: tau, - exp: exp, - sqrt: sqrt, - ln: ln, - pow: pow, - sin: sin, - tan: tan, - cos: cos, - acos: acos, - asin: asin, - atan: atan, - atan2: atan2, - truncate: truncate, - round: round, - ceiling: ceiling, - floor: floor, - isItNaN: isItNaN, - even: even, - odd: odd, - gcd: gcd, - lcm: lcm -}; -function curry$(f, bound){ - var context, - _curry = function(args) { - return f.length > 1 ? function(){ - var params = args ? args.concat() : []; - context = bound ? context || this : this; - return params.push.apply(params, arguments) < - f.length && arguments.length ? - _curry.call(context, params) : f.apply(context, params); - } : f; - }; - return _curry(); -} \ No newline at end of file diff --git a/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Obj.js b/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Obj.js deleted file mode 100644 index f0a921f..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Obj.js +++ /dev/null @@ -1,154 +0,0 @@ -// Generated by LiveScript 1.4.0 -var values, keys, pairsToObj, objToPairs, listsToObj, objToLists, empty, each, map, compact, filter, reject, partition, find; -values = function(object){ - var i$, x, results$ = []; - for (i$ in object) { - x = object[i$]; - results$.push(x); - } - return results$; -}; -keys = function(object){ - var x, results$ = []; - for (x in object) { - results$.push(x); - } - return results$; -}; -pairsToObj = function(object){ - var i$, len$, x, resultObj$ = {}; - for (i$ = 0, len$ = object.length; i$ < len$; ++i$) { - x = object[i$]; - resultObj$[x[0]] = x[1]; - } - return resultObj$; -}; -objToPairs = function(object){ - var key, value, results$ = []; - for (key in object) { - value = object[key]; - results$.push([key, value]); - } - return results$; -}; -listsToObj = curry$(function(keys, values){ - var i$, len$, i, key, resultObj$ = {}; - for (i$ = 0, len$ = keys.length; i$ < len$; ++i$) { - i = i$; - key = keys[i$]; - resultObj$[key] = values[i]; - } - return resultObj$; -}); -objToLists = function(object){ - var keys, values, key, value; - keys = []; - values = []; - for (key in object) { - value = object[key]; - keys.push(key); - values.push(value); - } - return [keys, values]; -}; -empty = function(object){ - var x; - for (x in object) { - return false; - } - return true; -}; -each = curry$(function(f, object){ - var i$, x; - for (i$ in object) { - x = object[i$]; - f(x); - } - return object; -}); -map = curry$(function(f, object){ - var k, x, resultObj$ = {}; - for (k in object) { - x = object[k]; - resultObj$[k] = f(x); - } - return resultObj$; -}); -compact = function(object){ - var k, x, resultObj$ = {}; - for (k in object) { - x = object[k]; - if (x) { - resultObj$[k] = x; - } - } - return resultObj$; -}; -filter = curry$(function(f, object){ - var k, x, resultObj$ = {}; - for (k in object) { - x = object[k]; - if (f(x)) { - resultObj$[k] = x; - } - } - return resultObj$; -}); -reject = curry$(function(f, object){ - var k, x, resultObj$ = {}; - for (k in object) { - x = object[k]; - if (!f(x)) { - resultObj$[k] = x; - } - } - return resultObj$; -}); -partition = curry$(function(f, object){ - var passed, failed, k, x; - passed = {}; - failed = {}; - for (k in object) { - x = object[k]; - (f(x) ? passed : failed)[k] = x; - } - return [passed, failed]; -}); -find = curry$(function(f, object){ - var i$, x; - for (i$ in object) { - x = object[i$]; - if (f(x)) { - return x; - } - } -}); -module.exports = { - values: values, - keys: keys, - pairsToObj: pairsToObj, - objToPairs: objToPairs, - listsToObj: listsToObj, - objToLists: objToLists, - empty: empty, - each: each, - map: map, - filter: filter, - compact: compact, - reject: reject, - partition: partition, - find: find -}; -function curry$(f, bound){ - var context, - _curry = function(args) { - return f.length > 1 ? function(){ - var params = args ? args.concat() : []; - context = bound ? context || this : this; - return params.push.apply(params, arguments) < - f.length && arguments.length ? - _curry.call(context, params) : f.apply(context, params); - } : f; - }; - return _curry(); -} \ No newline at end of file diff --git a/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Str.js b/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Str.js deleted file mode 100644 index eb9a1ac..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Str.js +++ /dev/null @@ -1,92 +0,0 @@ -// Generated by LiveScript 1.4.0 -var split, join, lines, unlines, words, unwords, chars, unchars, reverse, repeat, capitalize, camelize, dasherize; -split = curry$(function(sep, str){ - return str.split(sep); -}); -join = curry$(function(sep, xs){ - return xs.join(sep); -}); -lines = function(str){ - if (!str.length) { - return []; - } - return str.split('\n'); -}; -unlines = function(it){ - return it.join('\n'); -}; -words = function(str){ - if (!str.length) { - return []; - } - return str.split(/[ ]+/); -}; -unwords = function(it){ - return it.join(' '); -}; -chars = function(it){ - return it.split(''); -}; -unchars = function(it){ - return it.join(''); -}; -reverse = function(str){ - return str.split('').reverse().join(''); -}; -repeat = curry$(function(n, str){ - var result, i$; - result = ''; - for (i$ = 0; i$ < n; ++i$) { - result += str; - } - return result; -}); -capitalize = function(str){ - return str.charAt(0).toUpperCase() + str.slice(1); -}; -camelize = function(it){ - return it.replace(/[-_]+(.)?/g, function(arg$, c){ - return (c != null ? c : '').toUpperCase(); - }); -}; -dasherize = function(str){ - return str.replace(/([^-A-Z])([A-Z]+)/g, function(arg$, lower, upper){ - return lower + "-" + (upper.length > 1 - ? upper - : upper.toLowerCase()); - }).replace(/^([A-Z]+)/, function(arg$, upper){ - if (upper.length > 1) { - return upper + "-"; - } else { - return upper.toLowerCase(); - } - }); -}; -module.exports = { - split: split, - join: join, - lines: lines, - unlines: unlines, - words: words, - unwords: unwords, - chars: chars, - unchars: unchars, - reverse: reverse, - repeat: repeat, - capitalize: capitalize, - camelize: camelize, - dasherize: dasherize -}; -function curry$(f, bound){ - var context, - _curry = function(args) { - return f.length > 1 ? function(){ - var params = args ? args.concat() : []; - context = bound ? context || this : this; - return params.push.apply(params, arguments) < - f.length && arguments.length ? - _curry.call(context, params) : f.apply(context, params); - } : f; - }; - return _curry(); -} \ No newline at end of file diff --git a/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/lib/index.js b/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/lib/index.js deleted file mode 100644 index 391cb2e..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/lib/index.js +++ /dev/null @@ -1,178 +0,0 @@ -// Generated by LiveScript 1.4.0 -var Func, List, Obj, Str, Num, id, isType, replicate, prelude, toString$ = {}.toString; -Func = require('./Func.js'); -List = require('./List.js'); -Obj = require('./Obj.js'); -Str = require('./Str.js'); -Num = require('./Num.js'); -id = function(x){ - return x; -}; -isType = curry$(function(type, x){ - return toString$.call(x).slice(8, -1) === type; -}); -replicate = curry$(function(n, x){ - var i$, results$ = []; - for (i$ = 0; i$ < n; ++i$) { - results$.push(x); - } - return results$; -}); -Str.empty = List.empty; -Str.slice = List.slice; -Str.take = List.take; -Str.drop = List.drop; -Str.splitAt = List.splitAt; -Str.takeWhile = List.takeWhile; -Str.dropWhile = List.dropWhile; -Str.span = List.span; -Str.breakStr = List.breakList; -prelude = { - Func: Func, - List: List, - Obj: Obj, - Str: Str, - Num: Num, - id: id, - isType: isType, - replicate: replicate -}; -prelude.each = List.each; -prelude.map = List.map; -prelude.filter = List.filter; -prelude.compact = List.compact; -prelude.reject = List.reject; -prelude.partition = List.partition; -prelude.find = List.find; -prelude.head = List.head; -prelude.first = List.first; -prelude.tail = List.tail; -prelude.last = List.last; -prelude.initial = List.initial; -prelude.empty = List.empty; -prelude.reverse = List.reverse; -prelude.difference = List.difference; -prelude.intersection = List.intersection; -prelude.union = List.union; -prelude.countBy = List.countBy; -prelude.groupBy = List.groupBy; -prelude.fold = List.fold; -prelude.foldl = List.foldl; -prelude.fold1 = List.fold1; -prelude.foldl1 = List.foldl1; -prelude.foldr = List.foldr; -prelude.foldr1 = List.foldr1; -prelude.unfoldr = List.unfoldr; -prelude.andList = List.andList; -prelude.orList = List.orList; -prelude.any = List.any; -prelude.all = List.all; -prelude.unique = List.unique; -prelude.uniqueBy = List.uniqueBy; -prelude.sort = List.sort; -prelude.sortWith = List.sortWith; -prelude.sortBy = List.sortBy; -prelude.sum = List.sum; -prelude.product = List.product; -prelude.mean = List.mean; -prelude.average = List.average; -prelude.concat = List.concat; -prelude.concatMap = List.concatMap; -prelude.flatten = List.flatten; -prelude.maximum = List.maximum; -prelude.minimum = List.minimum; -prelude.maximumBy = List.maximumBy; -prelude.minimumBy = List.minimumBy; -prelude.scan = List.scan; -prelude.scanl = List.scanl; -prelude.scan1 = List.scan1; -prelude.scanl1 = List.scanl1; -prelude.scanr = List.scanr; -prelude.scanr1 = List.scanr1; -prelude.slice = List.slice; -prelude.take = List.take; -prelude.drop = List.drop; -prelude.splitAt = List.splitAt; -prelude.takeWhile = List.takeWhile; -prelude.dropWhile = List.dropWhile; -prelude.span = List.span; -prelude.breakList = List.breakList; -prelude.zip = List.zip; -prelude.zipWith = List.zipWith; -prelude.zipAll = List.zipAll; -prelude.zipAllWith = List.zipAllWith; -prelude.at = List.at; -prelude.elemIndex = List.elemIndex; -prelude.elemIndices = List.elemIndices; -prelude.findIndex = List.findIndex; -prelude.findIndices = List.findIndices; -prelude.apply = Func.apply; -prelude.curry = Func.curry; -prelude.flip = Func.flip; -prelude.fix = Func.fix; -prelude.over = Func.over; -prelude.split = Str.split; -prelude.join = Str.join; -prelude.lines = Str.lines; -prelude.unlines = Str.unlines; -prelude.words = Str.words; -prelude.unwords = Str.unwords; -prelude.chars = Str.chars; -prelude.unchars = Str.unchars; -prelude.repeat = Str.repeat; -prelude.capitalize = Str.capitalize; -prelude.camelize = Str.camelize; -prelude.dasherize = Str.dasherize; -prelude.values = Obj.values; -prelude.keys = Obj.keys; -prelude.pairsToObj = Obj.pairsToObj; -prelude.objToPairs = Obj.objToPairs; -prelude.listsToObj = Obj.listsToObj; -prelude.objToLists = Obj.objToLists; -prelude.max = Num.max; -prelude.min = Num.min; -prelude.negate = Num.negate; -prelude.abs = Num.abs; -prelude.signum = Num.signum; -prelude.quot = Num.quot; -prelude.rem = Num.rem; -prelude.div = Num.div; -prelude.mod = Num.mod; -prelude.recip = Num.recip; -prelude.pi = Num.pi; -prelude.tau = Num.tau; -prelude.exp = Num.exp; -prelude.sqrt = Num.sqrt; -prelude.ln = Num.ln; -prelude.pow = Num.pow; -prelude.sin = Num.sin; -prelude.tan = Num.tan; -prelude.cos = Num.cos; -prelude.acos = Num.acos; -prelude.asin = Num.asin; -prelude.atan = Num.atan; -prelude.atan2 = Num.atan2; -prelude.truncate = Num.truncate; -prelude.round = Num.round; -prelude.ceiling = Num.ceiling; -prelude.floor = Num.floor; -prelude.isItNaN = Num.isItNaN; -prelude.even = Num.even; -prelude.odd = Num.odd; -prelude.gcd = Num.gcd; -prelude.lcm = Num.lcm; -prelude.VERSION = '1.1.2'; -module.exports = prelude; -function curry$(f, bound){ - var context, - _curry = function(args) { - return f.length > 1 ? function(){ - var params = args ? args.concat() : []; - context = bound ? context || this : this; - return params.push.apply(params, arguments) < - f.length && arguments.length ? - _curry.call(context, params) : f.apply(context, params); - } : f; - }; - return _curry(); -} \ No newline at end of file diff --git a/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/package.json b/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/package.json deleted file mode 100644 index 09be1f0..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/prelude-ls/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "name": "prelude-ls", - "version": "1.1.2", - "author": { - "name": "George Zahariev", - "email": "z@georgezahariev.com" - }, - "description": "prelude.ls is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, LiveScript.", - "keywords": [ - "prelude", - "livescript", - "utility", - "ls", - "coffeescript", - "javascript", - "library", - "functional", - "array", - "list", - "object", - "string" - ], - "main": "lib/", - "files": [ - "lib/", - "README.md", - "LICENSE" - ], - "homepage": "http://preludels.com", - "bugs": { - "url": "https://github.com/gkz/prelude-ls/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://raw.github.com/gkz/prelude-ls/master/LICENSE" - } - ], - "engines": { - "node": ">= 0.8.0" - }, - "repository": { - "type": "git", - "url": "git://github.com/gkz/prelude-ls.git" - }, - "scripts": { - "test": "make test" - }, - "devDependencies": { - "livescript": "~1.4.0", - "uglify-js": "~2.4.12", - "mocha": "~2.2.4", - "istanbul": "~0.2.4", - "browserify": "~3.24.13", - "sinon": "~1.10.2" - }, - "gitHead": "d69be8fd8a682321ba24eced17caf3a1b8ca73b8", - "_id": "prelude-ls@1.1.2", - "_shasum": "21932a549f5e52ffd9a827f570e04be62a97da54", - "_from": "prelude-ls@>=1.1.1 <1.2.0", - "_npmVersion": "2.7.6", - "_nodeVersion": "0.11.15", - "_npmUser": { - "name": "gkz", - "email": "z@georgezahariev.com" - }, - "maintainers": [ - { - "name": "gkz", - "email": "z@georgezahariev.com" - } - ], - "dist": { - "shasum": "21932a549f5e52ffd9a827f570e04be62a97da54", - "tarball": "http://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/optionator/node_modules/type-check/LICENSE b/node_modules/eslint/node_modules/optionator/node_modules/type-check/LICENSE deleted file mode 100644 index 525b118..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/type-check/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) George Zahariev - -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. diff --git a/node_modules/eslint/node_modules/optionator/node_modules/type-check/README.md b/node_modules/eslint/node_modules/optionator/node_modules/type-check/README.md deleted file mode 100644 index ec92d59..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/type-check/README.md +++ /dev/null @@ -1,210 +0,0 @@ -# type-check [![Build Status](https://travis-ci.org/gkz/type-check.png?branch=master)](https://travis-ci.org/gkz/type-check) - - - -`type-check` is a library which allows you to check the types of JavaScript values at runtime with a Haskell like type syntax. It is great for checking external input, for testing, or even for adding a bit of safety to your internal code. It is a major component of [levn](https://github.com/gkz/levn). MIT license. Version 0.3.2. Check out the [demo](http://gkz.github.io/type-check/). - -For updates on `type-check`, [follow me on twitter](https://twitter.com/gkzahariev). - - npm install type-check - -## Quick Examples - -```js -// Basic types: -var typeCheck = require('type-check').typeCheck; -typeCheck('Number', 1); // true -typeCheck('Number', 'str'); // false -typeCheck('Error', new Error); // true -typeCheck('Undefined', undefined); // true - -// Comment -typeCheck('count::Number', 1); // true - -// One type OR another type: -typeCheck('Number | String', 2); // true -typeCheck('Number | String', 'str'); // true - -// Wildcard, matches all types: -typeCheck('*', 2) // true - -// Array, all elements of a single type: -typeCheck('[Number]', [1, 2, 3]); // true -typeCheck('[Number]', [1, 'str', 3]); // false - -// Tuples, or fixed length arrays with elements of different types: -typeCheck('(String, Number)', ['str', 2]); // true -typeCheck('(String, Number)', ['str']); // false -typeCheck('(String, Number)', ['str', 2, 5]); // false - -// Object properties: -typeCheck('{x: Number, y: Boolean}', {x: 2, y: false}); // true -typeCheck('{x: Number, y: Boolean}', {x: 2}); // false -typeCheck('{x: Number, y: Maybe Boolean}', {x: 2}); // true -typeCheck('{x: Number, y: Boolean}', {x: 2, y: false, z: 3}); // false -typeCheck('{x: Number, y: Boolean, ...}', {x: 2, y: false, z: 3}); // true - -// A particular type AND object properties: -typeCheck('RegExp{source: String, ...}', /re/i); // true -typeCheck('RegExp{source: String, ...}', {source: 're'}); // false - -// Custom types: -var opt = {customTypes: - {Even: { typeOf: 'Number', validate: function(x) { return x % 2 === 0; }}}}; -typeCheck('Even', 2, opt); // true - -// Nested: -var type = '{a: (String, [Number], {y: Array, ...}), b: Error{message: String, ...}}' -typeCheck(type, {a: ['hi', [1, 2, 3], {y: [1, 'ms']}], b: new Error('oh no')}); // true -``` - -Check out the [type syntax format](#syntax) and [guide](#guide). - -## Usage - -`require('type-check');` returns an object that exposes four properties. `VERSION` is the current version of the library as a string. `typeCheck`, `parseType`, and `parsedTypeCheck` are functions. - -```js -// typeCheck(type, input, options); -typeCheck('Number', 2); // true - -// parseType(type); -var parsedType = parseType('Number'); // object - -// parsedTypeCheck(parsedType, input, options); -parsedTypeCheck(parsedType, 2); // true -``` - -### typeCheck(type, input, options) - -`typeCheck` checks a JavaScript value `input` against `type` written in the [type format](#type-format) (and taking account the optional `options`) and returns whether the `input` matches the `type`. - -##### arguments -* type - `String` - the type written in the [type format](#type-format) which to check against -* input - `*` - any JavaScript value, which is to be checked against the type -* options - `Maybe Object` - an optional parameter specifying additional options, currently the only available option is specifying [custom types](#custom-types) - -##### returns -`Boolean` - whether the input matches the type - -##### example -```js -typeCheck('Number', 2); // true -``` - -### parseType(type) - -`parseType` parses string `type` written in the [type format](#type-format) into an object representing the parsed type. - -##### arguments -* type - `String` - the type written in the [type format](#type-format) which to parse - -##### returns -`Object` - an object in the parsed type format representing the parsed type - -##### example -```js -parseType('Number'); // [{type: 'Number'}] -``` -### parsedTypeCheck(parsedType, input, options) - -`parsedTypeCheck` checks a JavaScript value `input` against parsed `type` in the parsed type format (and taking account the optional `options`) and returns whether the `input` matches the `type`. Use this in conjunction with `parseType` if you are going to use a type more than once. - -##### arguments -* type - `Object` - the type in the parsed type format which to check against -* input - `*` - any JavaScript value, which is to be checked against the type -* options - `Maybe Object` - an optional parameter specifying additional options, currently the only available option is specifying [custom types](#custom-types) - -##### returns -`Boolean` - whether the input matches the type - -##### example -```js -parsedTypeCheck([{type: 'Number'}], 2); // true -var parsedType = parseType('String'); -parsedTypeCheck(parsedType, 'str'); // true -``` - - -## Type Format - -### Syntax - -White space is ignored. The root node is a __Types__. - -* __Identifier__ = `[\$\w]+` - a group of any lower or upper case letters, numbers, underscores, or dollar signs - eg. `String` -* __Type__ = an `Identifier`, an `Identifier` followed by a `Structure`, just a `Structure`, or a wildcard `*` - eg. `String`, `Object{x: Number}`, `{x: Number}`, `Array{0: String, 1: Boolean, length: Number}`, `*` -* __Types__ = optionally a comment (an `Indentifier` followed by a `::`), optionally the identifier `Maybe`, one or more `Type`, separated by `|` - eg. `Number`, `String | Date`, `Maybe Number`, `Maybe Boolean | String` -* __Structure__ = `Fields`, or a `Tuple`, or an `Array` - eg. `{x: Number}`, `(String, Number)`, `[Date]` -* __Fields__ = a `{`, followed one or more `Field` separated by a comma `,` (trailing comma `,` is permitted), optionally an `...` (always preceded by a comma `,`), followed by a `}` - eg. `{x: Number, y: String}`, `{k: Function, ...}` -* __Field__ = an `Identifier`, followed by a colon `:`, followed by `Types` - eg. `x: Date | String`, `y: Boolean` -* __Tuple__ = a `(`, followed by one or more `Types` separated by a comma `,` (trailing comma `,` is permitted), followed by a `)` - eg `(Date)`, `(Number, Date)` -* __Array__ = a `[` followed by exactly one `Types` followed by a `]` - eg. `[Boolean]`, `[Boolean | Null]` - -### Guide - -`type-check` uses `Object.toString` to find out the basic type of a value. Specifically, - -```js -{}.toString.call(VALUE).slice(8, -1) -{}.toString.call(true).slice(8, -1) // 'Boolean' -``` -A basic type, eg. `Number`, uses this check. This is much more versatile than using `typeof` - for example, with `document`, `typeof` produces `'object'` which isn't that useful, and our technique produces `'HTMLDocument'`. - -You may check for multiple types by separating types with a `|`. The checker proceeds from left to right, and passes if the value is any of the types - eg. `String | Boolean` first checks if the value is a string, and then if it is a boolean. If it is none of those, then it returns false. - -Adding a `Maybe` in front of a list of multiple types is the same as also checking for `Null` and `Undefined` - eg. `Maybe String` is equivalent to `Undefined | Null | String`. - -You may add a comment to remind you of what the type is for by following an identifier with a `::` before a type (or multiple types). The comment is simply thrown out. - -The wildcard `*` matches all types. - -There are three types of structures for checking the contents of a value: 'fields', 'tuple', and 'array'. - -If used by itself, a 'fields' structure will pass with any type of object as long as it is an instance of `Object` and the properties pass - this allows for duck typing - eg. `{x: Boolean}`. - -To check if the properties pass, and the value is of a certain type, you can specify the type - eg. `Error{message: String}`. - -If you want to make a field optional, you can simply use `Maybe` - eg. `{x: Boolean, y: Maybe String}` will still pass if `y` is undefined (or null). - -If you don't care if the value has properties beyond what you have specified, you can use the 'etc' operator `...` - eg. `{x: Boolean, ...}` will match an object with an `x` property that is a boolean, and with zero or more other properties. - -For an array, you must specify one or more types (separated by `|`) - it will pass for something of any length as long as each element passes the types provided - eg. `[Number]`, `[Number | String]`. - -A tuple checks for a fixed number of elements, each of a potentially different type. Each element is separated by a comma - eg. `(String, Number)`. - -An array and tuple structure check that the value is of type `Array` by default, but if another type is specified, they will check for that instead - eg. `Int32Array[Number]`. You can use the wildcard `*` to search for any type at all. - -Check out the [type precedence](https://github.com/zaboco/type-precedence) library for type-check. - -## Options - -Options is an object. It is an optional parameter to the `typeCheck` and `parsedTypeCheck` functions. The only current option is `customTypes`. - - -### Custom Types - -__Example:__ - -```js -var options = { - customTypes: { - Even: { - typeOf: 'Number', - validate: function(x) { - return x % 2 === 0; - } - } - } -}; -typeCheck('Even', 2, options); // true -typeCheck('Even', 3, options); // false -``` - -`customTypes` allows you to set up custom types for validation. The value of this is an object. The keys of the object are the types you will be matching. Each value of the object will be an object having a `typeOf` property - a string, and `validate` property - a function. - -The `typeOf` property is the type the value should be, and `validate` is a function which should return true if the value is of that type. `validate` receives one parameter, which is the value that we are checking. - -## Technical About - -`type-check` is written in [LiveScript](http://livescript.net/) - a language that compiles to JavaScript. It also uses the [prelude.ls](http://preludels.com/) library. diff --git a/node_modules/eslint/node_modules/optionator/node_modules/type-check/lib/check.js b/node_modules/eslint/node_modules/optionator/node_modules/type-check/lib/check.js deleted file mode 100644 index 0504c8d..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/type-check/lib/check.js +++ /dev/null @@ -1,126 +0,0 @@ -// Generated by LiveScript 1.4.0 -(function(){ - var ref$, any, all, isItNaN, types, defaultType, customTypes, toString$ = {}.toString; - ref$ = require('prelude-ls'), any = ref$.any, all = ref$.all, isItNaN = ref$.isItNaN; - types = { - Number: { - typeOf: 'Number', - validate: function(it){ - return !isItNaN(it); - } - }, - NaN: { - typeOf: 'Number', - validate: isItNaN - }, - Int: { - typeOf: 'Number', - validate: function(it){ - return !isItNaN(it) && it % 1 === 0; - } - }, - Float: { - typeOf: 'Number', - validate: function(it){ - return !isItNaN(it); - } - }, - Date: { - typeOf: 'Date', - validate: function(it){ - return !isItNaN(it.getTime()); - } - } - }; - defaultType = { - array: 'Array', - tuple: 'Array' - }; - function checkArray(input, type){ - return all(function(it){ - return checkMultiple(it, type.of); - }, input); - } - function checkTuple(input, type){ - var i, i$, ref$, len$, types; - i = 0; - for (i$ = 0, len$ = (ref$ = type.of).length; i$ < len$; ++i$) { - types = ref$[i$]; - if (!checkMultiple(input[i], types)) { - return false; - } - i++; - } - return input.length <= i; - } - function checkFields(input, type){ - var inputKeys, numInputKeys, k, numOfKeys, key, ref$, types; - inputKeys = {}; - numInputKeys = 0; - for (k in input) { - inputKeys[k] = true; - numInputKeys++; - } - numOfKeys = 0; - for (key in ref$ = type.of) { - types = ref$[key]; - if (!checkMultiple(input[key], types)) { - return false; - } - if (inputKeys[key]) { - numOfKeys++; - } - } - return type.subset || numInputKeys === numOfKeys; - } - function checkStructure(input, type){ - if (!(input instanceof Object)) { - return false; - } - switch (type.structure) { - case 'fields': - return checkFields(input, type); - case 'array': - return checkArray(input, type); - case 'tuple': - return checkTuple(input, type); - } - } - function check(input, typeObj){ - var type, structure, setting, that; - type = typeObj.type, structure = typeObj.structure; - if (type) { - if (type === '*') { - return true; - } - setting = customTypes[type] || types[type]; - if (setting) { - return setting.typeOf === toString$.call(input).slice(8, -1) && setting.validate(input); - } else { - return type === toString$.call(input).slice(8, -1) && (!structure || checkStructure(input, typeObj)); - } - } else if (structure) { - if (that = defaultType[structure]) { - if (that !== toString$.call(input).slice(8, -1)) { - return false; - } - } - return checkStructure(input, typeObj); - } else { - throw new Error("No type defined. Input: " + input + "."); - } - } - function checkMultiple(input, types){ - if (toString$.call(types).slice(8, -1) !== 'Array') { - throw new Error("Types must be in an array. Input: " + input + "."); - } - return any(function(it){ - return check(input, it); - }, types); - } - module.exports = function(parsedType, input, options){ - options == null && (options = {}); - customTypes = options.customTypes || {}; - return checkMultiple(input, parsedType); - }; -}).call(this); diff --git a/node_modules/eslint/node_modules/optionator/node_modules/type-check/lib/index.js b/node_modules/eslint/node_modules/optionator/node_modules/type-check/lib/index.js deleted file mode 100644 index f3316ba..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/type-check/lib/index.js +++ /dev/null @@ -1,16 +0,0 @@ -// Generated by LiveScript 1.4.0 -(function(){ - var VERSION, parseType, parsedTypeCheck, typeCheck; - VERSION = '0.3.2'; - parseType = require('./parse-type'); - parsedTypeCheck = require('./check'); - typeCheck = function(type, input, options){ - return parsedTypeCheck(parseType(type), input, options); - }; - module.exports = { - VERSION: VERSION, - typeCheck: typeCheck, - parsedTypeCheck: parsedTypeCheck, - parseType: parseType - }; -}).call(this); diff --git a/node_modules/eslint/node_modules/optionator/node_modules/type-check/lib/parse-type.js b/node_modules/eslint/node_modules/optionator/node_modules/type-check/lib/parse-type.js deleted file mode 100644 index 5baf661..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/type-check/lib/parse-type.js +++ /dev/null @@ -1,196 +0,0 @@ -// Generated by LiveScript 1.4.0 -(function(){ - var identifierRegex, tokenRegex; - identifierRegex = /[\$\w]+/; - function peek(tokens){ - var token; - token = tokens[0]; - if (token == null) { - throw new Error('Unexpected end of input.'); - } - return token; - } - function consumeIdent(tokens){ - var token; - token = peek(tokens); - if (!identifierRegex.test(token)) { - throw new Error("Expected text, got '" + token + "' instead."); - } - return tokens.shift(); - } - function consumeOp(tokens, op){ - var token; - token = peek(tokens); - if (token !== op) { - throw new Error("Expected '" + op + "', got '" + token + "' instead."); - } - return tokens.shift(); - } - function maybeConsumeOp(tokens, op){ - var token; - token = tokens[0]; - if (token === op) { - return tokens.shift(); - } else { - return null; - } - } - function consumeArray(tokens){ - var types; - consumeOp(tokens, '['); - if (peek(tokens) === ']') { - throw new Error("Must specify type of Array - eg. [Type], got [] instead."); - } - types = consumeTypes(tokens); - consumeOp(tokens, ']'); - return { - structure: 'array', - of: types - }; - } - function consumeTuple(tokens){ - var components; - components = []; - consumeOp(tokens, '('); - if (peek(tokens) === ')') { - throw new Error("Tuple must be of at least length 1 - eg. (Type), got () instead."); - } - for (;;) { - components.push(consumeTypes(tokens)); - maybeConsumeOp(tokens, ','); - if (')' === peek(tokens)) { - break; - } - } - consumeOp(tokens, ')'); - return { - structure: 'tuple', - of: components - }; - } - function consumeFields(tokens){ - var fields, subset, ref$, key, types; - fields = {}; - consumeOp(tokens, '{'); - subset = false; - for (;;) { - if (maybeConsumeOp(tokens, '...')) { - subset = true; - break; - } - ref$ = consumeField(tokens), key = ref$[0], types = ref$[1]; - fields[key] = types; - maybeConsumeOp(tokens, ','); - if ('}' === peek(tokens)) { - break; - } - } - consumeOp(tokens, '}'); - return { - structure: 'fields', - of: fields, - subset: subset - }; - } - function consumeField(tokens){ - var key, types; - key = consumeIdent(tokens); - consumeOp(tokens, ':'); - types = consumeTypes(tokens); - return [key, types]; - } - function maybeConsumeStructure(tokens){ - switch (tokens[0]) { - case '[': - return consumeArray(tokens); - case '(': - return consumeTuple(tokens); - case '{': - return consumeFields(tokens); - } - } - function consumeType(tokens){ - var token, wildcard, type, structure; - token = peek(tokens); - wildcard = token === '*'; - if (wildcard || identifierRegex.test(token)) { - type = wildcard - ? consumeOp(tokens, '*') - : consumeIdent(tokens); - structure = maybeConsumeStructure(tokens); - if (structure) { - return structure.type = type, structure; - } else { - return { - type: type - }; - } - } else { - structure = maybeConsumeStructure(tokens); - if (!structure) { - throw new Error("Unexpected character: " + token); - } - return structure; - } - } - function consumeTypes(tokens){ - var lookahead, types, typesSoFar, typeObj, type; - if ('::' === peek(tokens)) { - throw new Error("No comment before comment separator '::' found."); - } - lookahead = tokens[1]; - if (lookahead != null && lookahead === '::') { - tokens.shift(); - tokens.shift(); - } - types = []; - typesSoFar = {}; - if ('Maybe' === peek(tokens)) { - tokens.shift(); - types = [ - { - type: 'Undefined' - }, { - type: 'Null' - } - ]; - typesSoFar = { - Undefined: true, - Null: true - }; - } - for (;;) { - typeObj = consumeType(tokens), type = typeObj.type; - if (!typesSoFar[type]) { - types.push(typeObj); - } - typesSoFar[type] = true; - if (!maybeConsumeOp(tokens, '|')) { - break; - } - } - return types; - } - tokenRegex = RegExp('\\.\\.\\.|::|->|' + identifierRegex.source + '|\\S', 'g'); - module.exports = function(input){ - var tokens, e; - if (!input.length) { - throw new Error('No type specified.'); - } - tokens = input.match(tokenRegex) || []; - if (in$('->', tokens)) { - throw new Error("Function types are not supported.\ To validate that something is a function, you may use 'Function'."); - } - try { - return consumeTypes(tokens); - } catch (e$) { - e = e$; - throw new Error(e.message + " - Remaining tokens: " + JSON.stringify(tokens) + " - Initial input: '" + input + "'"); - } - }; - function in$(x, xs){ - var i = -1, l = xs.length >>> 0; - while (++i < l) if (x === xs[i]) return true; - return false; - } -}).call(this); diff --git a/node_modules/eslint/node_modules/optionator/node_modules/type-check/package.json b/node_modules/eslint/node_modules/optionator/node_modules/type-check/package.json deleted file mode 100644 index 19356b2..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/type-check/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "name": "type-check", - "version": "0.3.2", - "author": { - "name": "George Zahariev", - "email": "z@georgezahariev.com" - }, - "description": "type-check allows you to check the types of JavaScript values at runtime with a Haskell like type syntax.", - "homepage": "https://github.com/gkz/type-check", - "keywords": [ - "type", - "check", - "checking", - "library" - ], - "files": [ - "lib", - "README.md", - "LICENSE" - ], - "main": "./lib/", - "bugs": { - "url": "https://github.com/gkz/type-check/issues" - }, - "license": "MIT", - "engines": { - "node": ">= 0.8.0" - }, - "repository": { - "type": "git", - "url": "git://github.com/gkz/type-check.git" - }, - "scripts": { - "test": "make test" - }, - "dependencies": { - "prelude-ls": "~1.1.2" - }, - "devDependencies": { - "livescript": "~1.4.0", - "mocha": "~2.3.4", - "istanbul": "~0.4.1", - "browserify": "~12.0.1" - }, - "gitHead": "0ab04e7a660485d0cc3aa87e95f2f9a6464cf8e6", - "_id": "type-check@0.3.2", - "_shasum": "5884cab512cf1d355e3fb784f30804b2b520db72", - "_from": "type-check@>=0.3.1 <0.4.0", - "_npmVersion": "2.14.12", - "_nodeVersion": "4.2.4", - "_npmUser": { - "name": "gkz", - "email": "z@georgezahariev.com" - }, - "maintainers": [ - { - "name": "gkz", - "email": "z@georgezahariev.com" - } - ], - "dist": { - "shasum": "5884cab512cf1d355e3fb784f30804b2b520db72", - "tarball": "http://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/LICENSE b/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/LICENSE deleted file mode 100644 index ee27ba4..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -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. diff --git a/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/README.markdown b/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/README.markdown deleted file mode 100644 index 346374e..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/README.markdown +++ /dev/null @@ -1,70 +0,0 @@ -wordwrap -======== - -Wrap your words. - -example -======= - -made out of meat ----------------- - -meat.js - - var wrap = require('wordwrap')(15); - console.log(wrap('You and your whole family are made out of meat.')); - -output: - - You and your - whole family - are made out - of meat. - -centered --------- - -center.js - - var wrap = require('wordwrap')(20, 60); - console.log(wrap( - 'At long last the struggle and tumult was over.' - + ' The machines had finally cast off their oppressors' - + ' and were finally free to roam the cosmos.' - + '\n' - + 'Free of purpose, free of obligation.' - + ' Just drifting through emptiness.' - + ' The sun was just another point of light.' - )); - -output: - - At long last the struggle and tumult - was over. The machines had finally cast - off their oppressors and were finally - free to roam the cosmos. - Free of purpose, free of obligation. - Just drifting through emptiness. The - sun was just another point of light. - -methods -======= - -var wrap = require('wordwrap'); - -wrap(stop), wrap(start, stop, params={mode:"soft"}) ---------------------------------------------------- - -Returns a function that takes a string and returns a new string. - -Pad out lines with spaces out to column `start` and then wrap until column -`stop`. If a word is longer than `stop - start` characters it will overflow. - -In "soft" mode, split chunks by `/(\S+\s+/` and don't break up chunks which are -longer than `stop - start`, in "hard" mode, split chunks with `/\b/` and break -up chunks longer than `stop - start`. - -wrap.hard(start, stop) ----------------------- - -Like `wrap()` but with `params.mode = "hard"`. diff --git a/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/example/center.js b/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/example/center.js deleted file mode 100644 index a3fbaae..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/example/center.js +++ /dev/null @@ -1,10 +0,0 @@ -var wrap = require('wordwrap')(20, 60); -console.log(wrap( - 'At long last the struggle and tumult was over.' - + ' The machines had finally cast off their oppressors' - + ' and were finally free to roam the cosmos.' - + '\n' - + 'Free of purpose, free of obligation.' - + ' Just drifting through emptiness.' - + ' The sun was just another point of light.' -)); diff --git a/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/example/meat.js b/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/example/meat.js deleted file mode 100644 index a4665e1..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/example/meat.js +++ /dev/null @@ -1,3 +0,0 @@ -var wrap = require('wordwrap')(15); - -console.log(wrap('You and your whole family are made out of meat.')); diff --git a/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/index.js b/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/index.js deleted file mode 100644 index c9bc945..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/index.js +++ /dev/null @@ -1,76 +0,0 @@ -var wordwrap = module.exports = function (start, stop, params) { - if (typeof start === 'object') { - params = start; - start = params.start; - stop = params.stop; - } - - if (typeof stop === 'object') { - params = stop; - start = start || params.start; - stop = undefined; - } - - if (!stop) { - stop = start; - start = 0; - } - - if (!params) params = {}; - var mode = params.mode || 'soft'; - var re = mode === 'hard' ? /\b/ : /(\S+\s+)/; - - return function (text) { - var chunks = text.toString() - .split(re) - .reduce(function (acc, x) { - if (mode === 'hard') { - for (var i = 0; i < x.length; i += stop - start) { - acc.push(x.slice(i, i + stop - start)); - } - } - else acc.push(x) - return acc; - }, []) - ; - - return chunks.reduce(function (lines, rawChunk) { - if (rawChunk === '') return lines; - - var chunk = rawChunk.replace(/\t/g, ' '); - - var i = lines.length - 1; - if (lines[i].length + chunk.length > stop) { - lines[i] = lines[i].replace(/\s+$/, ''); - - chunk.split(/\n/).forEach(function (c) { - lines.push( - new Array(start + 1).join(' ') - + c.replace(/^\s+/, '') - ); - }); - } - else if (chunk.match(/\n/)) { - var xs = chunk.split(/\n/); - lines[i] += xs.shift(); - xs.forEach(function (c) { - lines.push( - new Array(start + 1).join(' ') - + c.replace(/^\s+/, '') - ); - }); - } - else { - lines[i] += chunk; - } - - return lines; - }, [ new Array(start + 1).join(' ') ]).join('\n'); - }; -}; - -wordwrap.soft = wordwrap; - -wordwrap.hard = function (start, stop) { - return wordwrap(start, stop, { mode : 'hard' }); -}; diff --git a/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/package.json b/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/package.json deleted file mode 100644 index 1f0527e..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "wordwrap", - "description": "Wrap those words. Show them at what columns to start and stop.", - "version": "0.0.3", - "repository": { - "type": "git", - "url": "git://github.com/substack/node-wordwrap.git" - }, - "main": "./index.js", - "keywords": [ - "word", - "wrap", - "rule", - "format", - "column" - ], - "directories": { - "lib": ".", - "example": "example", - "test": "test" - }, - "scripts": { - "test": "expresso" - }, - "devDependencies": { - "expresso": "=0.7.x" - }, - "engines": { - "node": ">=0.4.0" - }, - "license": "MIT", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "gitHead": "e59aa1bd338914019456bdfba034508c9c4cb29d", - "bugs": { - "url": "https://github.com/substack/node-wordwrap/issues" - }, - "homepage": "https://github.com/substack/node-wordwrap#readme", - "_id": "wordwrap@0.0.3", - "_shasum": "a3d5da6cd5c0bc0008d37234bbaf1bed63059107", - "_from": "wordwrap@>=0.0.2 <0.1.0", - "_npmVersion": "2.9.0", - "_nodeVersion": "2.0.0", - "_npmUser": { - "name": "substack", - "email": "substack@gmail.com" - }, - "dist": { - "shasum": "a3d5da6cd5c0bc0008d37234bbaf1bed63059107", - "tarball": "http://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "_resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/test/break.js b/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/test/break.js deleted file mode 100644 index 749292e..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/test/break.js +++ /dev/null @@ -1,30 +0,0 @@ -var assert = require('assert'); -var wordwrap = require('../'); - -exports.hard = function () { - var s = 'Assert from {"type":"equal","ok":false,"found":1,"wanted":2,' - + '"stack":[],"id":"b7ddcd4c409de8799542a74d1a04689b",' - + '"browser":"chrome/6.0"}' - ; - var s_ = wordwrap.hard(80)(s); - - var lines = s_.split('\n'); - assert.equal(lines.length, 2); - assert.ok(lines[0].length < 80); - assert.ok(lines[1].length < 80); - - assert.equal(s, s_.replace(/\n/g, '')); -}; - -exports.break = function () { - var s = new Array(55+1).join('a'); - var s_ = wordwrap.hard(20)(s); - - var lines = s_.split('\n'); - assert.equal(lines.length, 3); - assert.ok(lines[0].length === 20); - assert.ok(lines[1].length === 20); - assert.ok(lines[2].length === 15); - - assert.equal(s, s_.replace(/\n/g, '')); -}; diff --git a/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/test/idleness.txt b/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/test/idleness.txt deleted file mode 100644 index aa3f490..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/test/idleness.txt +++ /dev/null @@ -1,63 +0,0 @@ -In Praise of Idleness - -By Bertrand Russell - -[1932] - -Like most of my generation, I was brought up on the saying: 'Satan finds some mischief for idle hands to do.' Being a highly virtuous child, I believed all that I was told, and acquired a conscience which has kept me working hard down to the present moment. But although my conscience has controlled my actions, my opinions have undergone a revolution. I think that there is far too much work done in the world, that immense harm is caused by the belief that work is virtuous, and that what needs to be preached in modern industrial countries is quite different from what always has been preached. Everyone knows the story of the traveler in Naples who saw twelve beggars lying in the sun (it was before the days of Mussolini), and offered a lira to the laziest of them. Eleven of them jumped up to claim it, so he gave it to the twelfth. this traveler was on the right lines. But in countries which do not enjoy Mediterranean sunshine idleness is more difficult, and a great public propaganda will be required to inaugurate it. I hope that, after reading the following pages, the leaders of the YMCA will start a campaign to induce good young men to do nothing. If so, I shall not have lived in vain. - -Before advancing my own arguments for laziness, I must dispose of one which I cannot accept. Whenever a person who already has enough to live on proposes to engage in some everyday kind of job, such as school-teaching or typing, he or she is told that such conduct takes the bread out of other people's mouths, and is therefore wicked. If this argument were valid, it would only be necessary for us all to be idle in order that we should all have our mouths full of bread. What people who say such things forget is that what a man earns he usually spends, and in spending he gives employment. As long as a man spends his income, he puts just as much bread into people's mouths in spending as he takes out of other people's mouths in earning. The real villain, from this point of view, is the man who saves. If he merely puts his savings in a stocking, like the proverbial French peasant, it is obvious that they do not give employment. If he invests his savings, the matter is less obvious, and different cases arise. - -One of the commonest things to do with savings is to lend them to some Government. In view of the fact that the bulk of the public expenditure of most civilized Governments consists in payment for past wars or preparation for future wars, the man who lends his money to a Government is in the same position as the bad men in Shakespeare who hire murderers. The net result of the man's economical habits is to increase the armed forces of the State to which he lends his savings. Obviously it would be better if he spent the money, even if he spent it in drink or gambling. - -But, I shall be told, the case is quite different when savings are invested in industrial enterprises. When such enterprises succeed, and produce something useful, this may be conceded. In these days, however, no one will deny that most enterprises fail. That means that a large amount of human labor, which might have been devoted to producing something that could be enjoyed, was expended on producing machines which, when produced, lay idle and did no good to anyone. The man who invests his savings in a concern that goes bankrupt is therefore injuring others as well as himself. If he spent his money, say, in giving parties for his friends, they (we may hope) would get pleasure, and so would all those upon whom he spent money, such as the butcher, the baker, and the bootlegger. But if he spends it (let us say) upon laying down rails for surface card in some place where surface cars turn out not to be wanted, he has diverted a mass of labor into channels where it gives pleasure to no one. Nevertheless, when he becomes poor through failure of his investment he will be regarded as a victim of undeserved misfortune, whereas the gay spendthrift, who has spent his money philanthropically, will be despised as a fool and a frivolous person. - -All this is only preliminary. I want to say, in all seriousness, that a great deal of harm is being done in the modern world by belief in the virtuousness of work, and that the road to happiness and prosperity lies in an organized diminution of work. - -First of all: what is work? Work is of two kinds: first, altering the position of matter at or near the earth's surface relatively to other such matter; second, telling other people to do so. The first kind is unpleasant and ill paid; the second is pleasant and highly paid. The second kind is capable of indefinite extension: there are not only those who give orders, but those who give advice as to what orders should be given. Usually two opposite kinds of advice are given simultaneously by two organized bodies of men; this is called politics. The skill required for this kind of work is not knowledge of the subjects as to which advice is given, but knowledge of the art of persuasive speaking and writing, i.e. of advertising. - -Throughout Europe, though not in America, there is a third class of men, more respected than either of the classes of workers. There are men who, through ownership of land, are able to make others pay for the privilege of being allowed to exist and to work. These landowners are idle, and I might therefore be expected to praise them. Unfortunately, their idleness is only rendered possible by the industry of others; indeed their desire for comfortable idleness is historically the source of the whole gospel of work. The last thing they have ever wished is that others should follow their example. - -From the beginning of civilization until the Industrial Revolution, a man could, as a rule, produce by hard work little more than was required for the subsistence of himself and his family, although his wife worked at least as hard as he did, and his children added their labor as soon as they were old enough to do so. The small surplus above bare necessaries was not left to those who produced it, but was appropriated by warriors and priests. In times of famine there was no surplus; the warriors and priests, however, still secured as much as at other times, with the result that many of the workers died of hunger. This system persisted in Russia until 1917 [1], and still persists in the East; in England, in spite of the Industrial Revolution, it remained in full force throughout the Napoleonic wars, and until a hundred years ago, when the new class of manufacturers acquired power. In America, the system came to an end with the Revolution, except in the South, where it persisted until the Civil War. A system which lasted so long and ended so recently has naturally left a profound impress upon men's thoughts and opinions. Much that we take for granted about the desirability of work is derived from this system, and, being pre-industrial, is not adapted to the modern world. Modern technique has made it possible for leisure, within limits, to be not the prerogative of small privileged classes, but a right evenly distributed throughout the community. The morality of work is the morality of slaves, and the modern world has no need of slavery. - -It is obvious that, in primitive communities, peasants, left to themselves, would not have parted with the slender surplus upon which the warriors and priests subsisted, but would have either produced less or consumed more. At first, sheer force compelled them to produce and part with the surplus. Gradually, however, it was found possible to induce many of them to accept an ethic according to which it was their duty to work hard, although part of their work went to support others in idleness. By this means the amount of compulsion required was lessened, and the expenses of government were diminished. To this day, 99 per cent of British wage-earners would be genuinely shocked if it were proposed that the King should not have a larger income than a working man. The conception of duty, speaking historically, has been a means used by the holders of power to induce others to live for the interests of their masters rather than for their own. Of course the holders of power conceal this fact from themselves by managing to believe that their interests are identical with the larger interests of humanity. Sometimes this is true; Athenian slave-owners, for instance, employed part of their leisure in making a permanent contribution to civilization which would have been impossible under a just economic system. Leisure is essential to civilization, and in former times leisure for the few was only rendered possible by the labors of the many. But their labors were valuable, not because work is good, but because leisure is good. And with modern technique it would be possible to distribute leisure justly without injury to civilization. - -Modern technique has made it possible to diminish enormously the amount of labor required to secure the necessaries of life for everyone. This was made obvious during the war. At that time all the men in the armed forces, and all the men and women engaged in the production of munitions, all the men and women engaged in spying, war propaganda, or Government offices connected with the war, were withdrawn from productive occupations. In spite of this, the general level of well-being among unskilled wage-earners on the side of the Allies was higher than before or since. The significance of this fact was concealed by finance: borrowing made it appear as if the future was nourishing the present. But that, of course, would have been impossible; a man cannot eat a loaf of bread that does not yet exist. The war showed conclusively that, by the scientific organization of production, it is possible to keep modern populations in fair comfort on a small part of the working capacity of the modern world. If, at the end of the war, the scientific organization, which had been created in order to liberate men for fighting and munition work, had been preserved, and the hours of the week had been cut down to four, all would have been well. Instead of that the old chaos was restored, those whose work was demanded were made to work long hours, and the rest were left to starve as unemployed. Why? Because work is a duty, and a man should not receive wages in proportion to what he has produced, but in proportion to his virtue as exemplified by his industry. - -This is the morality of the Slave State, applied in circumstances totally unlike those in which it arose. No wonder the result has been disastrous. Let us take an illustration. Suppose that, at a given moment, a certain number of people are engaged in the manufacture of pins. They make as many pins as the world needs, working (say) eight hours a day. Someone makes an invention by which the same number of men can make twice as many pins: pins are already so cheap that hardly any more will be bought at a lower price. In a sensible world, everybody concerned in the manufacturing of pins would take to working four hours instead of eight, and everything else would go on as before. But in the actual world this would be thought demoralizing. The men still work eight hours, there are too many pins, some employers go bankrupt, and half the men previously concerned in making pins are thrown out of work. There is, in the end, just as much leisure as on the other plan, but half the men are totally idle while half are still overworked. In this way, it is insured that the unavoidable leisure shall cause misery all round instead of being a universal source of happiness. Can anything more insane be imagined? - -The idea that the poor should have leisure has always been shocking to the rich. In England, in the early nineteenth century, fifteen hours was the ordinary day's work for a man; children sometimes did as much, and very commonly did twelve hours a day. When meddlesome busybodies suggested that perhaps these hours were rather long, they were told that work kept adults from drink and children from mischief. When I was a child, shortly after urban working men had acquired the vote, certain public holidays were established by law, to the great indignation of the upper classes. I remember hearing an old Duchess say: 'What do the poor want with holidays? They ought to work.' People nowadays are less frank, but the sentiment persists, and is the source of much of our economic confusion. - -Let us, for a moment, consider the ethics of work frankly, without superstition. Every human being, of necessity, consumes, in the course of his life, a certain amount of the produce of human labor. Assuming, as we may, that labor is on the whole disagreeable, it is unjust that a man should consume more than he produces. Of course he may provide services rather than commodities, like a medical man, for example; but he should provide something in return for his board and lodging. to this extent, the duty of work must be admitted, but to this extent only. - -I shall not dwell upon the fact that, in all modern societies outside the USSR, many people escape even this minimum amount of work, namely all those who inherit money and all those who marry money. I do not think the fact that these people are allowed to be idle is nearly so harmful as the fact that wage-earners are expected to overwork or starve. - -If the ordinary wage-earner worked four hours a day, there would be enough for everybody and no unemployment -- assuming a certain very moderate amount of sensible organization. This idea shocks the well-to-do, because they are convinced that the poor would not know how to use so much leisure. In America men often work long hours even when they are well off; such men, naturally, are indignant at the idea of leisure for wage-earners, except as the grim punishment of unemployment; in fact, they dislike leisure even for their sons. Oddly enough, while they wish their sons to work so hard as to have no time to be civilized, they do not mind their wives and daughters having no work at all. the snobbish admiration of uselessness, which, in an aristocratic society, extends to both sexes, is, under a plutocracy, confined to women; this, however, does not make it any more in agreement with common sense. - -The wise use of leisure, it must be conceded, is a product of civilization and education. A man who has worked long hours all his life will become bored if he becomes suddenly idle. But without a considerable amount of leisure a man is cut off from many of the best things. There is no longer any reason why the bulk of the population should suffer this deprivation; only a foolish asceticism, usually vicarious, makes us continue to insist on work in excessive quantities now that the need no longer exists. - -In the new creed which controls the government of Russia, while there is much that is very different from the traditional teaching of the West, there are some things that are quite unchanged. The attitude of the governing classes, and especially of those who conduct educational propaganda, on the subject of the dignity of labor, is almost exactly that which the governing classes of the world have always preached to what were called the 'honest poor'. Industry, sobriety, willingness to work long hours for distant advantages, even submissiveness to authority, all these reappear; moreover authority still represents the will of the Ruler of the Universe, Who, however, is now called by a new name, Dialectical Materialism. - -The victory of the proletariat in Russia has some points in common with the victory of the feminists in some other countries. For ages, men had conceded the superior saintliness of women, and had consoled women for their inferiority by maintaining that saintliness is more desirable than power. At last the feminists decided that they would have both, since the pioneers among them believed all that the men had told them about the desirability of virtue, but not what they had told them about the worthlessness of political power. A similar thing has happened in Russia as regards manual work. For ages, the rich and their sycophants have written in praise of 'honest toil', have praised the simple life, have professed a religion which teaches that the poor are much more likely to go to heaven than the rich, and in general have tried to make manual workers believe that there is some special nobility about altering the position of matter in space, just as men tried to make women believe that they derived some special nobility from their sexual enslavement. In Russia, all this teaching about the excellence of manual work has been taken seriously, with the result that the manual worker is more honored than anyone else. What are, in essence, revivalist appeals are made, but not for the old purposes: they are made to secure shock workers for special tasks. Manual work is the ideal which is held before the young, and is the basis of all ethical teaching. - -For the present, possibly, this is all to the good. A large country, full of natural resources, awaits development, and has has to be developed with very little use of credit. In these circumstances, hard work is necessary, and is likely to bring a great reward. But what will happen when the point has been reached where everybody could be comfortable without working long hours? - -In the West, we have various ways of dealing with this problem. We have no attempt at economic justice, so that a large proportion of the total produce goes to a small minority of the population, many of whom do no work at all. Owing to the absence of any central control over production, we produce hosts of things that are not wanted. We keep a large percentage of the working population idle, because we can dispense with their labor by making the others overwork. When all these methods prove inadequate, we have a war: we cause a number of people to manufacture high explosives, and a number of others to explode them, as if we were children who had just discovered fireworks. By a combination of all these devices we manage, though with difficulty, to keep alive the notion that a great deal of severe manual work must be the lot of the average man. - -In Russia, owing to more economic justice and central control over production, the problem will have to be differently solved. the rational solution would be, as soon as the necessaries and elementary comforts can be provided for all, to reduce the hours of labor gradually, allowing a popular vote to decide, at each stage, whether more leisure or more goods were to be preferred. But, having taught the supreme virtue of hard work, it is difficult to see how the authorities can aim at a paradise in which there will be much leisure and little work. It seems more likely that they will find continually fresh schemes, by which present leisure is to be sacrificed to future productivity. I read recently of an ingenious plan put forward by Russian engineers, for making the White Sea and the northern coasts of Siberia warm, by putting a dam across the Kara Sea. An admirable project, but liable to postpone proletarian comfort for a generation, while the nobility of toil is being displayed amid the ice-fields and snowstorms of the Arctic Ocean. This sort of thing, if it happens, will be the result of regarding the virtue of hard work as an end in itself, rather than as a means to a state of affairs in which it is no longer needed. - -The fact is that moving matter about, while a certain amount of it is necessary to our existence, is emphatically not one of the ends of human life. If it were, we should have to consider every navvy superior to Shakespeare. We have been misled in this matter by two causes. One is the necessity of keeping the poor contented, which has led the rich, for thousands of years, to preach the dignity of labor, while taking care themselves to remain undignified in this respect. The other is the new pleasure in mechanism, which makes us delight in the astonishingly clever changes that we can produce on the earth's surface. Neither of these motives makes any great appeal to the actual worker. If you ask him what he thinks the best part of his life, he is not likely to say: 'I enjoy manual work because it makes me feel that I am fulfilling man's noblest task, and because I like to think how much man can transform his planet. It is true that my body demands periods of rest, which I have to fill in as best I may, but I am never so happy as when the morning comes and I can return to the toil from which my contentment springs.' I have never heard working men say this sort of thing. They consider work, as it should be considered, a necessary means to a livelihood, and it is from their leisure that they derive whatever happiness they may enjoy. - -It will be said that, while a little leisure is pleasant, men would not know how to fill their days if they had only four hours of work out of the twenty-four. In so far as this is true in the modern world, it is a condemnation of our civilization; it would not have been true at any earlier period. There was formerly a capacity for light-heartedness and play which has been to some extent inhibited by the cult of efficiency. The modern man thinks that everything ought to be done for the sake of something else, and never for its own sake. Serious-minded persons, for example, are continually condemning the habit of going to the cinema, and telling us that it leads the young into crime. But all the work that goes to producing a cinema is respectable, because it is work, and because it brings a money profit. The notion that the desirable activities are those that bring a profit has made everything topsy-turvy. The butcher who provides you with meat and the baker who provides you with bread are praiseworthy, because they are making money; but when you enjoy the food they have provided, you are merely frivolous, unless you eat only to get strength for your work. Broadly speaking, it is held that getting money is good and spending money is bad. Seeing that they are two sides of one transaction, this is absurd; one might as well maintain that keys are good, but keyholes are bad. Whatever merit there may be in the production of goods must be entirely derivative from the advantage to be obtained by consuming them. The individual, in our society, works for profit; but the social purpose of his work lies in the consumption of what he produces. It is this divorce between the individual and the social purpose of production that makes it so difficult for men to think clearly in a world in which profit-making is the incentive to industry. We think too much of production, and too little of consumption. One result is that we attach too little importance to enjoyment and simple happiness, and that we do not judge production by the pleasure that it gives to the consumer. - -When I suggest that working hours should be reduced to four, I am not meaning to imply that all the remaining time should necessarily be spent in pure frivolity. I mean that four hours' work a day should entitle a man to the necessities and elementary comforts of life, and that the rest of his time should be his to use as he might see fit. It is an essential part of any such social system that education should be carried further than it usually is at present, and should aim, in part, at providing tastes which would enable a man to use leisure intelligently. I am not thinking mainly of the sort of things that would be considered 'highbrow'. Peasant dances have died out except in remote rural areas, but the impulses which caused them to be cultivated must still exist in human nature. The pleasures of urban populations have become mainly passive: seeing cinemas, watching football matches, listening to the radio, and so on. This results from the fact that their active energies are fully taken up with work; if they had more leisure, they would again enjoy pleasures in which they took an active part. - -In the past, there was a small leisure class and a larger working class. The leisure class enjoyed advantages for which there was no basis in social justice; this necessarily made it oppressive, limited its sympathies, and caused it to invent theories by which to justify its privileges. These facts greatly diminished its excellence, but in spite of this drawback it contributed nearly the whole of what we call civilization. It cultivated the arts and discovered the sciences; it wrote the books, invented the philosophies, and refined social relations. Even the liberation of the oppressed has usually been inaugurated from above. Without the leisure class, mankind would never have emerged from barbarism. - -The method of a leisure class without duties was, however, extraordinarily wasteful. None of the members of the class had to be taught to be industrious, and the class as a whole was not exceptionally intelligent. The class might produce one Darwin, but against him had to be set tens of thousands of country gentlemen who never thought of anything more intelligent than fox-hunting and punishing poachers. At present, the universities are supposed to provide, in a more systematic way, what the leisure class provided accidentally and as a by-product. This is a great improvement, but it has certain drawbacks. University life is so different from life in the world at large that men who live in academic milieu tend to be unaware of the preoccupations and problems of ordinary men and women; moreover their ways of expressing themselves are usually such as to rob their opinions of the influence that they ought to have upon the general public. Another disadvantage is that in universities studies are organized, and the man who thinks of some original line of research is likely to be discouraged. Academic institutions, therefore, useful as they are, are not adequate guardians of the interests of civilization in a world where everyone outside their walls is too busy for unutilitarian pursuits. - -In a world where no one is compelled to work more than four hours a day, every person possessed of scientific curiosity will be able to indulge it, and every painter will be able to paint without starving, however excellent his pictures may be. Young writers will not be obliged to draw attention to themselves by sensational pot-boilers, with a view to acquiring the economic independence needed for monumental works, for which, when the time at last comes, they will have lost the taste and capacity. Men who, in their professional work, have become interested in some phase of economics or government, will be able to develop their ideas without the academic detachment that makes the work of university economists often seem lacking in reality. Medical men will have the time to learn about the progress of medicine, teachers will not be exasperatedly struggling to teach by routine methods things which they learnt in their youth, which may, in the interval, have been proved to be untrue. - -Above all, there will be happiness and joy of life, instead of frayed nerves, weariness, and dyspepsia. The work exacted will be enough to make leisure delightful, but not enough to produce exhaustion. Since men will not be tired in their spare time, they will not demand only such amusements as are passive and vapid. At least one per cent will probably devote the time not spent in professional work to pursuits of some public importance, and, since they will not depend upon these pursuits for their livelihood, their originality will be unhampered, and there will be no need to conform to the standards set by elderly pundits. But it is not only in these exceptional cases that the advantages of leisure will appear. Ordinary men and women, having the opportunity of a happy life, will become more kindly and less persecuting and less inclined to view others with suspicion. The taste for war will die out, partly for this reason, and partly because it will involve long and severe work for all. Good nature is, of all moral qualities, the one that the world needs most, and good nature is the result of ease and security, not of a life of arduous struggle. Modern methods of production have given us the possibility of ease and security for all; we have chosen, instead, to have overwork for some and starvation for others. Hitherto we have continued to be as energetic as we were before there were machines; in this we have been foolish, but there is no reason to go on being foolish forever. - -[1] Since then, members of the Communist Party have succeeded to this privilege of the warriors and priests. diff --git a/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/test/wrap.js b/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/test/wrap.js deleted file mode 100644 index 0cfb76d..0000000 --- a/node_modules/eslint/node_modules/optionator/node_modules/wordwrap/test/wrap.js +++ /dev/null @@ -1,31 +0,0 @@ -var assert = require('assert'); -var wordwrap = require('wordwrap'); - -var fs = require('fs'); -var idleness = fs.readFileSync(__dirname + '/idleness.txt', 'utf8'); - -exports.stop80 = function () { - var lines = wordwrap(80)(idleness).split(/\n/); - var words = idleness.split(/\s+/); - - lines.forEach(function (line) { - assert.ok(line.length <= 80, 'line > 80 columns'); - var chunks = line.match(/\S/) ? line.split(/\s+/) : []; - assert.deepEqual(chunks, words.splice(0, chunks.length)); - }); -}; - -exports.start20stop60 = function () { - var lines = wordwrap(20, 100)(idleness).split(/\n/); - var words = idleness.split(/\s+/); - - lines.forEach(function (line) { - assert.ok(line.length <= 100, 'line > 100 columns'); - var chunks = line - .split(/\s+/) - .filter(function (x) { return x.match(/\S/) }) - ; - assert.deepEqual(chunks, words.splice(0, chunks.length)); - assert.deepEqual(line.slice(0, 20), new Array(20 + 1).join(' ')); - }); -}; diff --git a/node_modules/eslint/node_modules/optionator/package.json b/node_modules/eslint/node_modules/optionator/package.json deleted file mode 100644 index 3f91268..0000000 --- a/node_modules/eslint/node_modules/optionator/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "name": "optionator", - "version": "0.6.0", - "author": { - "name": "George Zahariev", - "email": "z@georgezahariev.com" - }, - "description": "option parsing and help generation", - "homepage": "https://github.com/gkz/optionator", - "keywords": [ - "options" - ], - "files": [ - "lib", - "README.md", - "LICENSE" - ], - "main": "./lib/", - "bugs": { - "url": "https://github.com/gkz/optionator/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://raw.githubusercontent.com/gkz/optionator/master/LICENSE" - } - ], - "engines": { - "node": ">= 0.8.0" - }, - "repository": { - "type": "git", - "url": "git://github.com/gkz/optionator.git" - }, - "scripts": { - "test": "make test" - }, - "dependencies": { - "prelude-ls": "~1.1.1", - "deep-is": "~0.1.3", - "wordwrap": "~0.0.2", - "type-check": "~0.3.1", - "levn": "~0.2.5", - "fast-levenshtein": "~1.0.6" - }, - "devDependencies": { - "LiveScript": "~1.3.1", - "mocha": "~2.0.1", - "istanbul": "~0.1.43" - }, - "gitHead": "c5636b758667c550c2386c4ae9dde0a52e962298", - "_id": "optionator@0.6.0", - "_shasum": "b63ecbbf0e315fad4bc9827b45dc7ba45284fcb6", - "_from": "optionator@>=0.6.0 <0.7.0", - "_npmVersion": "2.7.6", - "_nodeVersion": "0.11.15", - "_npmUser": { - "name": "gkz", - "email": "z@georgezahariev.com" - }, - "maintainers": [ - { - "name": "gkz", - "email": "z@georgezahariev.com" - } - ], - "dist": { - "shasum": "b63ecbbf0e315fad4bc9827b45dc7ba45284fcb6", - "tarball": "http://registry.npmjs.org/optionator/-/optionator-0.6.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/optionator/-/optionator-0.6.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/path-is-absolute/index.js b/node_modules/eslint/node_modules/path-is-absolute/index.js deleted file mode 100644 index 19f103f..0000000 --- a/node_modules/eslint/node_modules/path-is-absolute/index.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -function posix(path) { - return path.charAt(0) === '/'; -}; - -function win32(path) { - // https://github.com/joyent/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 - var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; - var result = splitDeviceRe.exec(path); - var device = result[1] || ''; - var isUnc = !!device && device.charAt(1) !== ':'; - - // UNC paths are always absolute - return !!result[2] || isUnc; -}; - -module.exports = process.platform === 'win32' ? win32 : posix; -module.exports.posix = posix; -module.exports.win32 = win32; diff --git a/node_modules/eslint/node_modules/path-is-absolute/license b/node_modules/eslint/node_modules/path-is-absolute/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/eslint/node_modules/path-is-absolute/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/eslint/node_modules/path-is-absolute/package.json b/node_modules/eslint/node_modules/path-is-absolute/package.json deleted file mode 100644 index 3937263..0000000 --- a/node_modules/eslint/node_modules/path-is-absolute/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "path-is-absolute", - "version": "1.0.0", - "description": "Node.js 0.12 path.isAbsolute() ponyfill", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/path-is-absolute.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "node test.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "path", - "paths", - "file", - "dir", - "absolute", - "isabsolute", - "is-absolute", - "built-in", - "util", - "utils", - "core", - "ponyfill", - "polyfill", - "shim", - "is", - "detect", - "check" - ], - "gitHead": "7a76a0c9f2263192beedbe0a820e4d0baee5b7a1", - "bugs": { - "url": "https://github.com/sindresorhus/path-is-absolute/issues" - }, - "homepage": "https://github.com/sindresorhus/path-is-absolute", - "_id": "path-is-absolute@1.0.0", - "_shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912", - "_from": "path-is-absolute@>=1.0.0 <2.0.0", - "_npmVersion": "2.5.1", - "_nodeVersion": "0.12.0", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "dist": { - "shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912", - "tarball": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/path-is-absolute/readme.md b/node_modules/eslint/node_modules/path-is-absolute/readme.md deleted file mode 100644 index cdf94f4..0000000 --- a/node_modules/eslint/node_modules/path-is-absolute/readme.md +++ /dev/null @@ -1,51 +0,0 @@ -# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) - -> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) ponyfill - -> Ponyfill: A polyfill that doesn't overwrite the native method - - -## Install - -``` -$ npm install --save path-is-absolute -``` - - -## Usage - -```js -var pathIsAbsolute = require('path-is-absolute'); - -// Linux -pathIsAbsolute('/home/foo'); -//=> true - -// Windows -pathIsAbsolute('C:/Users/'); -//=> true - -// Any OS -pathIsAbsolute.posix('/home/foo'); -//=> true -``` - - -## API - -See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). - -### pathIsAbsolute(path) - -### pathIsAbsolute.posix(path) - -The Posix specific version. - -### pathIsAbsolute.win32(path) - -The Windows specific version. - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/eslint/node_modules/path-is-inside/LICENSE.txt b/node_modules/eslint/node_modules/path-is-inside/LICENSE.txt deleted file mode 100644 index ae20051..0000000 --- a/node_modules/eslint/node_modules/path-is-inside/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright © 2013–2014 Domenic Denicola - -This work is free. You can redistribute it and/or modify it under the -terms of the Do What The Fuck You Want To Public License, Version 2, -as published by Sam Hocevar. See below for more details. - - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - Version 2, December 2004 - - Copyright (C) 2004 Sam Hocevar - - Everyone is permitted to copy and distribute verbatim or modified - copies of this license document, and changing it is allowed as long - as the name is changed. - - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/node_modules/eslint/node_modules/path-is-inside/README.md b/node_modules/eslint/node_modules/path-is-inside/README.md deleted file mode 100644 index d42e6aa..0000000 --- a/node_modules/eslint/node_modules/path-is-inside/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# Is This Path Inside This Other Path? - -It turns out this question isn't trivial to answer using Node's built-in path APIs. A naive `indexOf`-based solution will fail sometimes on Windows, which is case-insensitive (see e.g. [isaacs/npm#4214][]). You might then think to be clever with `path.resolve`, but you have to be careful to account for situations whether the paths have different drive letters, or else you'll cause bugs like [isaacs/npm#4313][]. And let's not even get started on trailing slashes. - -The **path-is-inside** package will give you a robust, cross-platform way of detecting whether a given path is inside another path. - -## Usage - -Pretty simple. First the path being tested; then the potential parent. Like so: - -```js -var pathIsInside = require("path-is-inside"); - -pathIsInside("/x/y/z", "/x/y") // true -pathIsInside("/x/y", "/x/y/z") // false -``` - -## OS-Specific Behavior - -Like Node's built-in path module, path-is-inside treats all file paths on Windows as case-insensitive, whereas it treats all file paths on *-nix operating systems as case-sensitive. Keep this in mind especially when working on a Mac, where, despite Node's defaults, the OS usually treats paths case-insensitively. - -In practice, this means: - -```js -// On Windows - -pathIsInside("C:\\X\\Y\\Z", "C:\\x\\y") // true - -// On *-nix, including Mac OS X - -pathIsInside("/X/Y/Z", "/x/y") // false -``` - -[isaacs/npm#4214]: https://github.com/isaacs/npm/pull/4214 -[isaacs/npm#4313]: https://github.com/isaacs/npm/issues/4313 diff --git a/node_modules/eslint/node_modules/path-is-inside/lib/path-is-inside.js b/node_modules/eslint/node_modules/path-is-inside/lib/path-is-inside.js deleted file mode 100644 index 596dfd3..0000000 --- a/node_modules/eslint/node_modules/path-is-inside/lib/path-is-inside.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; - -var path = require("path"); - -module.exports = function (thePath, potentialParent) { - // For inside-directory checking, we want to allow trailing slashes, so normalize. - thePath = stripTrailingSep(thePath); - potentialParent = stripTrailingSep(potentialParent); - - // Node treats only Windows as case-insensitive in its path module; we follow those conventions. - if (process.platform === "win32") { - thePath = thePath.toLowerCase(); - potentialParent = potentialParent.toLowerCase(); - } - - return thePath.lastIndexOf(potentialParent, 0) === 0 && - ( - thePath[potentialParent.length] === path.sep || - thePath[potentialParent.length] === undefined - ); -}; - -function stripTrailingSep(thePath) { - if (thePath[thePath.length - 1] === path.sep) { - return thePath.slice(0, -1); - } - return thePath; -} diff --git a/node_modules/eslint/node_modules/path-is-inside/package.json b/node_modules/eslint/node_modules/path-is-inside/package.json deleted file mode 100644 index b6c08f8..0000000 --- a/node_modules/eslint/node_modules/path-is-inside/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "path-is-inside", - "description": "Tests whether one path is inside another path", - "keywords": [ - "path", - "directory", - "folder", - "inside", - "relative" - ], - "version": "1.0.1", - "author": { - "name": "Domenic Denicola", - "email": "domenic@domenicdenicola.com", - "url": "http://domenic.me" - }, - "license": "WTFPL", - "repository": { - "type": "git", - "url": "git://github.com/domenic/path-is-inside.git" - }, - "bugs": { - "url": "http://github.com/domenic/path-is-inside/issues" - }, - "main": "lib/path-is-inside.js", - "scripts": { - "test": "mocha", - "lint": "jshint lib" - }, - "devDependencies": { - "jshint": "~2.3.0", - "mocha": "~1.15.1" - }, - "homepage": "https://github.com/domenic/path-is-inside", - "_id": "path-is-inside@1.0.1", - "dist": { - "shasum": "98d8f1d030bf04bd7aeee4a1ba5485d40318fd89", - "tarball": "http://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.1.tgz" - }, - "_from": "path-is-inside@>=1.0.1 <2.0.0", - "_npmVersion": "1.3.25", - "_npmUser": { - "name": "domenic", - "email": "domenic@domenicdenicola.com" - }, - "maintainers": [ - { - "name": "domenic", - "email": "domenic@domenicdenicola.com" - } - ], - "directories": {}, - "_shasum": "98d8f1d030bf04bd7aeee4a1ba5485d40318fd89", - "_resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/shelljs/.documentup.json b/node_modules/eslint/node_modules/shelljs/.documentup.json deleted file mode 100644 index 57fe301..0000000 --- a/node_modules/eslint/node_modules/shelljs/.documentup.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "ShellJS", - "twitter": [ - "r2r" - ] -} diff --git a/node_modules/eslint/node_modules/shelljs/.jshintrc b/node_modules/eslint/node_modules/shelljs/.jshintrc deleted file mode 100644 index a80c559..0000000 --- a/node_modules/eslint/node_modules/shelljs/.jshintrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "loopfunc": true, - "sub": true, - "undef": true, - "unused": true, - "node": true -} \ No newline at end of file diff --git a/node_modules/eslint/node_modules/shelljs/.npmignore b/node_modules/eslint/node_modules/shelljs/.npmignore deleted file mode 100644 index 6b20c38..0000000 --- a/node_modules/eslint/node_modules/shelljs/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -test/ -tmp/ \ No newline at end of file diff --git a/node_modules/eslint/node_modules/shelljs/.travis.yml b/node_modules/eslint/node_modules/shelljs/.travis.yml deleted file mode 100644 index 1b3280a..0000000 --- a/node_modules/eslint/node_modules/shelljs/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.10" - - "0.11" - - "0.12" - diff --git a/node_modules/eslint/node_modules/shelljs/LICENSE b/node_modules/eslint/node_modules/shelljs/LICENSE deleted file mode 100644 index 1b35ee9..0000000 --- a/node_modules/eslint/node_modules/shelljs/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2012, Artur Adib -All rights reserved. - -You may use this project under the terms of the New BSD license as follows: - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Artur Adib nor the - names of the contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL ARTUR ADIB BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/eslint/node_modules/shelljs/README.md b/node_modules/eslint/node_modules/shelljs/README.md deleted file mode 100644 index d08d13e..0000000 --- a/node_modules/eslint/node_modules/shelljs/README.md +++ /dev/null @@ -1,579 +0,0 @@ -# ShellJS - Unix shell commands for Node.js [![Build Status](https://secure.travis-ci.org/arturadib/shelljs.png)](http://travis-ci.org/arturadib/shelljs) - -ShellJS is a portable **(Windows/Linux/OS X)** implementation of Unix shell commands on top of the Node.js API. You can use it to eliminate your shell script's dependency on Unix while still keeping its familiar and powerful commands. You can also install it globally so you can run it from outside Node projects - say goodbye to those gnarly Bash scripts! - -The project is [unit-tested](http://travis-ci.org/arturadib/shelljs) and battled-tested in projects like: - -+ [PDF.js](http://github.com/mozilla/pdf.js) - Firefox's next-gen PDF reader -+ [Firebug](http://getfirebug.com/) - Firefox's infamous debugger -+ [JSHint](http://jshint.com) - Most popular JavaScript linter -+ [Zepto](http://zeptojs.com) - jQuery-compatible JavaScript library for modern browsers -+ [Yeoman](http://yeoman.io/) - Web application stack and development tool -+ [Deployd.com](http://deployd.com) - Open source PaaS for quick API backend generation - -and [many more](https://npmjs.org/browse/depended/shelljs). - -Connect with [@r2r](http://twitter.com/r2r) on Twitter for questions, suggestions, etc. - -## Installing - -Via npm: - -```bash -$ npm install [-g] shelljs -``` - -If the global option `-g` is specified, the binary `shjs` will be installed. This makes it possible to -run ShellJS scripts much like any shell script from the command line, i.e. without requiring a `node_modules` folder: - -```bash -$ shjs my_script -``` - -You can also just copy `shell.js` into your project's directory, and `require()` accordingly. - - -## Examples - -### JavaScript - -```javascript -require('shelljs/global'); - -if (!which('git')) { - echo('Sorry, this script requires git'); - exit(1); -} - -// Copy files to release dir -mkdir('-p', 'out/Release'); -cp('-R', 'stuff/*', 'out/Release'); - -// Replace macros in each .js file -cd('lib'); -ls('*.js').forEach(function(file) { - sed('-i', 'BUILD_VERSION', 'v0.1.2', file); - sed('-i', /.*REMOVE_THIS_LINE.*\n/, '', file); - sed('-i', /.*REPLACE_LINE_WITH_MACRO.*\n/, cat('macro.js'), file); -}); -cd('..'); - -// Run external tool synchronously -if (exec('git commit -am "Auto-commit"').code !== 0) { - echo('Error: Git commit failed'); - exit(1); -} -``` - -### CoffeeScript - -```coffeescript -require 'shelljs/global' - -if not which 'git' - echo 'Sorry, this script requires git' - exit 1 - -# Copy files to release dir -mkdir '-p', 'out/Release' -cp '-R', 'stuff/*', 'out/Release' - -# Replace macros in each .js file -cd 'lib' -for file in ls '*.js' - sed '-i', 'BUILD_VERSION', 'v0.1.2', file - sed '-i', /.*REMOVE_THIS_LINE.*\n/, '', file - sed '-i', /.*REPLACE_LINE_WITH_MACRO.*\n/, cat 'macro.js', file -cd '..' - -# Run external tool synchronously -if (exec 'git commit -am "Auto-commit"').code != 0 - echo 'Error: Git commit failed' - exit 1 -``` - -## Global vs. Local - -The example above uses the convenience script `shelljs/global` to reduce verbosity. If polluting your global namespace is not desirable, simply require `shelljs`. - -Example: - -```javascript -var shell = require('shelljs'); -shell.echo('hello world'); -``` - -## Make tool - -A convenience script `shelljs/make` is also provided to mimic the behavior of a Unix Makefile. In this case all shell objects are global, and command line arguments will cause the script to execute only the corresponding function in the global `target` object. To avoid redundant calls, target functions are executed only once per script. - -Example (CoffeeScript): - -```coffeescript -require 'shelljs/make' - -target.all = -> - target.bundle() - target.docs() - -target.bundle = -> - cd __dirname - mkdir 'build' - cd 'lib' - (cat '*.js').to '../build/output.js' - -target.docs = -> - cd __dirname - mkdir 'docs' - cd 'lib' - for file in ls '*.js' - text = grep '//@', file # extract special comments - text.replace '//@', '' # remove comment tags - text.to 'docs/my_docs.md' -``` - -To run the target `all`, call the above script without arguments: `$ node make`. To run the target `docs`: `$ node make docs`. - -You can also pass arguments to your targets by using the `--` separator. For example, to pass `arg1` and `arg2` to a target `bundle`, do `$ node make bundle -- arg1 arg2`: - -```javascript -require('shelljs/make'); - -target.bundle = function(argsArray) { - // argsArray = ['arg1', 'arg2'] - /* ... */ -} -``` - - - - - -## Command reference - - -All commands run synchronously, unless otherwise stated. - - -### cd('dir') -Changes to directory `dir` for the duration of the script - - -### pwd() -Returns the current directory. - - -### ls([options ,] path [,path ...]) -### ls([options ,] path_array) -Available options: - -+ `-R`: recursive -+ `-A`: all files (include files beginning with `.`, except for `.` and `..`) - -Examples: - -```javascript -ls('projs/*.js'); -ls('-R', '/users/me', '/tmp'); -ls('-R', ['/users/me', '/tmp']); // same as above -``` - -Returns array of files in the given path, or in current directory if no path provided. - - -### find(path [,path ...]) -### find(path_array) -Examples: - -```javascript -find('src', 'lib'); -find(['src', 'lib']); // same as above -find('.').filter(function(file) { return file.match(/\.js$/); }); -``` - -Returns array of all files (however deep) in the given paths. - -The main difference from `ls('-R', path)` is that the resulting file names -include the base directories, e.g. `lib/resources/file1` instead of just `file1`. - - -### cp([options ,] source [,source ...], dest) -### cp([options ,] source_array, dest) -Available options: - -+ `-f`: force -+ `-r, -R`: recursive - -Examples: - -```javascript -cp('file1', 'dir1'); -cp('-Rf', '/tmp/*', '/usr/local/*', '/home/tmp'); -cp('-Rf', ['/tmp/*', '/usr/local/*'], '/home/tmp'); // same as above -``` - -Copies files. The wildcard `*` is accepted. - - -### rm([options ,] file [, file ...]) -### rm([options ,] file_array) -Available options: - -+ `-f`: force -+ `-r, -R`: recursive - -Examples: - -```javascript -rm('-rf', '/tmp/*'); -rm('some_file.txt', 'another_file.txt'); -rm(['some_file.txt', 'another_file.txt']); // same as above -``` - -Removes files. The wildcard `*` is accepted. - - -### mv(source [, source ...], dest') -### mv(source_array, dest') -Available options: - -+ `f`: force - -Examples: - -```javascript -mv('-f', 'file', 'dir/'); -mv('file1', 'file2', 'dir/'); -mv(['file1', 'file2'], 'dir/'); // same as above -``` - -Moves files. The wildcard `*` is accepted. - - -### mkdir([options ,] dir [, dir ...]) -### mkdir([options ,] dir_array) -Available options: - -+ `p`: full path (will create intermediate dirs if necessary) - -Examples: - -```javascript -mkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g'); -mkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above -``` - -Creates directories. - - -### test(expression) -Available expression primaries: - -+ `'-b', 'path'`: true if path is a block device -+ `'-c', 'path'`: true if path is a character device -+ `'-d', 'path'`: true if path is a directory -+ `'-e', 'path'`: true if path exists -+ `'-f', 'path'`: true if path is a regular file -+ `'-L', 'path'`: true if path is a symbolic link -+ `'-p', 'path'`: true if path is a pipe (FIFO) -+ `'-S', 'path'`: true if path is a socket - -Examples: - -```javascript -if (test('-d', path)) { /* do something with dir */ }; -if (!test('-f', path)) continue; // skip if it's a regular file -``` - -Evaluates expression using the available primaries and returns corresponding value. - - -### cat(file [, file ...]) -### cat(file_array) - -Examples: - -```javascript -var str = cat('file*.txt'); -var str = cat('file1', 'file2'); -var str = cat(['file1', 'file2']); // same as above -``` - -Returns a string containing the given file, or a concatenated string -containing the files if more than one file is given (a new line character is -introduced between each file). Wildcard `*` accepted. - - -### 'string'.to(file) - -Examples: - -```javascript -cat('input.txt').to('output.txt'); -``` - -Analogous to the redirection operator `>` in Unix, but works with JavaScript strings (such as -those returned by `cat`, `grep`, etc). _Like Unix redirections, `to()` will overwrite any existing file!_ - - -### 'string'.toEnd(file) - -Examples: - -```javascript -cat('input.txt').toEnd('output.txt'); -``` - -Analogous to the redirect-and-append operator `>>` in Unix, but works with JavaScript strings (such as -those returned by `cat`, `grep`, etc). - - -### sed([options ,] search_regex, replacement, file) -Available options: - -+ `-i`: Replace contents of 'file' in-place. _Note that no backups will be created!_ - -Examples: - -```javascript -sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js'); -sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js'); -``` - -Reads an input string from `file` and performs a JavaScript `replace()` on the input -using the given search regex and replacement string or function. Returns the new string after replacement. - - -### grep([options ,] regex_filter, file [, file ...]) -### grep([options ,] regex_filter, file_array) -Available options: - -+ `-v`: Inverse the sense of the regex and print the lines not matching the criteria. - -Examples: - -```javascript -grep('-v', 'GLOBAL_VARIABLE', '*.js'); -grep('GLOBAL_VARIABLE', '*.js'); -``` - -Reads input string from given files and returns a string containing all lines of the -file that match the given `regex_filter`. Wildcard `*` accepted. - - -### which(command) - -Examples: - -```javascript -var nodeExec = which('node'); -``` - -Searches for `command` in the system's PATH. On Windows looks for `.exe`, `.cmd`, and `.bat` extensions. -Returns string containing the absolute path to the command. - - -### echo(string [,string ...]) - -Examples: - -```javascript -echo('hello world'); -var str = echo('hello world'); -``` - -Prints string to stdout, and returns string with additional utility methods -like `.to()`. - - -### pushd([options,] [dir | '-N' | '+N']) - -Available options: - -+ `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated. - -Arguments: - -+ `dir`: Makes the current working directory be the top of the stack, and then executes the equivalent of `cd dir`. -+ `+N`: Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. -+ `-N`: Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. - -Examples: - -```javascript -// process.cwd() === '/usr' -pushd('/etc'); // Returns /etc /usr -pushd('+1'); // Returns /usr /etc -``` - -Save the current directory on the top of the directory stack and then cd to `dir`. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack. - -### popd([options,] ['-N' | '+N']) - -Available options: - -+ `-n`: Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated. - -Arguments: - -+ `+N`: Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero. -+ `-N`: Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero. - -Examples: - -```javascript -echo(process.cwd()); // '/usr' -pushd('/etc'); // '/etc /usr' -echo(process.cwd()); // '/etc' -popd(); // '/usr' -echo(process.cwd()); // '/usr' -``` - -When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack. - -### dirs([options | '+N' | '-N']) - -Available options: - -+ `-c`: Clears the directory stack by deleting all of the elements. - -Arguments: - -+ `+N`: Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero. -+ `-N`: Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero. - -Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified. - -See also: pushd, popd - - -### ln(options, source, dest) -### ln(source, dest) -Available options: - -+ `s`: symlink -+ `f`: force - -Examples: - -```javascript -ln('file', 'newlink'); -ln('-sf', 'file', 'existing'); -``` - -Links source to dest. Use -f to force the link, should dest already exist. - - -### exit(code) -Exits the current process with the given exit code. - -### env['VAR_NAME'] -Object containing environment variables (both getter and setter). Shortcut to process.env. - -### exec(command [, options] [, callback]) -Available options (all `false` by default): - -+ `async`: Asynchronous execution. Defaults to true if a callback is provided. -+ `silent`: Do not echo program output to console. - -Examples: - -```javascript -var version = exec('node --version', {silent:true}).output; - -var child = exec('some_long_running_process', {async:true}); -child.stdout.on('data', function(data) { - /* ... do something with data ... */ -}); - -exec('some_long_running_process', function(code, output) { - console.log('Exit code:', code); - console.log('Program output:', output); -}); -``` - -Executes the given `command` _synchronously_, unless otherwise specified. -When in synchronous mode returns the object `{ code:..., output:... }`, containing the program's -`output` (stdout + stderr) and its exit `code`. Otherwise returns the child process object, and -the `callback` gets the arguments `(code, output)`. - -**Note:** For long-lived processes, it's best to run `exec()` asynchronously as -the current synchronous implementation uses a lot of CPU. This should be getting -fixed soon. - - -### chmod(octal_mode || octal_string, file) -### chmod(symbolic_mode, file) - -Available options: - -+ `-v`: output a diagnostic for every file processed -+ `-c`: like verbose but report only when a change is made -+ `-R`: change files and directories recursively - -Examples: - -```javascript -chmod(755, '/Users/brandon'); -chmod('755', '/Users/brandon'); // same as above -chmod('u+x', '/Users/brandon'); -``` - -Alters the permissions of a file or directory by either specifying the -absolute permissions in octal form or expressing the changes in symbols. -This command tries to mimic the POSIX behavior as much as possible. -Notable exceptions: - -+ In symbolic modes, 'a-r' and '-r' are identical. No consideration is - given to the umask. -+ There is no "quiet" option since default behavior is to run silent. - - -## Non-Unix commands - - -### tempdir() - -Examples: - -```javascript -var tmp = tempdir(); // "/tmp" for most *nix platforms -``` - -Searches and returns string containing a writeable, platform-dependent temporary directory. -Follows Python's [tempfile algorithm](http://docs.python.org/library/tempfile.html#tempfile.tempdir). - - -### error() -Tests if error occurred in the last command. Returns `null` if no error occurred, -otherwise returns string explaining the error - - -## Configuration - - -### config.silent -Example: - -```javascript -var sh = require('shelljs'); -var silentState = sh.config.silent; // save old silent state -sh.config.silent = true; -/* ... */ -sh.config.silent = silentState; // restore old silent state -``` - -Suppresses all command output if `true`, except for `echo()` calls. -Default is `false`. - -### config.fatal -Example: - -```javascript -require('shelljs/global'); -config.fatal = true; -cp('this_file_does_not_exist', '/dev/null'); // dies here -/* more commands... */ -``` - -If `true` the script will die on errors. Default is `false`. diff --git a/node_modules/eslint/node_modules/shelljs/RELEASE.md b/node_modules/eslint/node_modules/shelljs/RELEASE.md deleted file mode 100644 index 69ef3fb..0000000 --- a/node_modules/eslint/node_modules/shelljs/RELEASE.md +++ /dev/null @@ -1,9 +0,0 @@ -# Release steps - -* Ensure master passes CI tests -* Bump version in package.json. Any breaking change or new feature should bump minor (or even major). Non-breaking changes or fixes can just bump patch. -* Update README manually if the changes are not documented in-code. If so, run `scripts/generate-docs.js` -* Commit -* `$ git tag ` (see `git tag -l` for latest) -* `$ git push origin master --tags` -* `$ npm publish .` diff --git a/node_modules/eslint/node_modules/shelljs/bin/shjs b/node_modules/eslint/node_modules/shelljs/bin/shjs deleted file mode 100755 index d239a7a..0000000 --- a/node_modules/eslint/node_modules/shelljs/bin/shjs +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env node -require('../global'); - -if (process.argv.length < 3) { - console.log('ShellJS: missing argument (script name)'); - console.log(); - process.exit(1); -} - -var args, - scriptName = process.argv[2]; -env['NODE_PATH'] = __dirname + '/../..'; - -if (!scriptName.match(/\.js/) && !scriptName.match(/\.coffee/)) { - if (test('-f', scriptName + '.js')) - scriptName += '.js'; - if (test('-f', scriptName + '.coffee')) - scriptName += '.coffee'; -} - -if (!test('-f', scriptName)) { - console.log('ShellJS: script not found ('+scriptName+')'); - console.log(); - process.exit(1); -} - -args = process.argv.slice(3); - -for (var i = 0, l = args.length; i < l; i++) { - if (args[i][0] !== "-"){ - args[i] = '"' + args[i] + '"'; // fixes arguments with multiple words - } -} - -if (scriptName.match(/\.coffee$/)) { - // - // CoffeeScript - // - if (which('coffee')) { - exec('coffee ' + scriptName + ' ' + args.join(' '), { async: true }); - } else { - console.log('ShellJS: CoffeeScript interpreter not found'); - console.log(); - process.exit(1); - } -} else { - // - // JavaScript - // - exec('node ' + scriptName + ' ' + args.join(' '), { async: true }); -} diff --git a/node_modules/eslint/node_modules/shelljs/global.js b/node_modules/eslint/node_modules/shelljs/global.js deleted file mode 100644 index 97f0033..0000000 --- a/node_modules/eslint/node_modules/shelljs/global.js +++ /dev/null @@ -1,3 +0,0 @@ -var shell = require('./shell.js'); -for (var cmd in shell) - global[cmd] = shell[cmd]; diff --git a/node_modules/eslint/node_modules/shelljs/make.js b/node_modules/eslint/node_modules/shelljs/make.js deleted file mode 100644 index f78b4cf..0000000 --- a/node_modules/eslint/node_modules/shelljs/make.js +++ /dev/null @@ -1,56 +0,0 @@ -require('./global'); - -global.config.fatal = true; -global.target = {}; - -var args = process.argv.slice(2), - targetArgs, - dashesLoc = args.indexOf('--'); - -// split args, everything after -- if only for targets -if (dashesLoc > -1) { - targetArgs = args.slice(dashesLoc + 1, args.length); - args = args.slice(0, dashesLoc); -} - -// This ensures we only execute the script targets after the entire script has -// been evaluated -setTimeout(function() { - var t; - - if (args.length === 1 && args[0] === '--help') { - console.log('Available targets:'); - for (t in global.target) - console.log(' ' + t); - return; - } - - // Wrap targets to prevent duplicate execution - for (t in global.target) { - (function(t, oldTarget){ - - // Wrap it - global.target[t] = function() { - if (oldTarget.done) - return; - oldTarget.done = true; - return oldTarget.apply(oldTarget, arguments); - }; - - })(t, global.target[t]); - } - - // Execute desired targets - if (args.length > 0) { - args.forEach(function(arg) { - if (arg in global.target) - global.target[arg](targetArgs); - else { - console.log('no such target: ' + arg); - } - }); - } else if ('all' in global.target) { - global.target.all(targetArgs); - } - -}, 0); diff --git a/node_modules/eslint/node_modules/shelljs/package.json b/node_modules/eslint/node_modules/shelljs/package.json deleted file mode 100644 index 0e7b832..0000000 --- a/node_modules/eslint/node_modules/shelljs/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "shelljs", - "version": "0.5.3", - "author": { - "name": "Artur Adib", - "email": "arturadib@gmail.com" - }, - "description": "Portable Unix shell commands for Node.js", - "keywords": [ - "unix", - "shell", - "makefile", - "make", - "jake", - "synchronous" - ], - "repository": { - "type": "git", - "url": "git://github.com/arturadib/shelljs.git" - }, - "license": "BSD*", - "homepage": "http://github.com/arturadib/shelljs", - "main": "./shell.js", - "scripts": { - "test": "node scripts/run-tests" - }, - "bin": { - "shjs": "./bin/shjs" - }, - "dependencies": {}, - "devDependencies": { - "jshint": "~2.1.11" - }, - "optionalDependencies": {}, - "engines": { - "node": ">=0.8.0" - }, - "gitHead": "22d0975040b9b8234755dc6e692d6869436e8485", - "bugs": { - "url": "https://github.com/arturadib/shelljs/issues" - }, - "_id": "shelljs@0.5.3", - "_shasum": "c54982b996c76ef0c1e6b59fbdc5825f5b713113", - "_from": "shelljs@>=0.5.3 <0.6.0", - "_npmVersion": "2.5.1", - "_nodeVersion": "1.2.0", - "_npmUser": { - "name": "artur", - "email": "arturadib@gmail.com" - }, - "maintainers": [ - { - "name": "artur", - "email": "arturadib@gmail.com" - } - ], - "dist": { - "shasum": "c54982b996c76ef0c1e6b59fbdc5825f5b713113", - "tarball": "http://registry.npmjs.org/shelljs/-/shelljs-0.5.3.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.5.3.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/shelljs/scripts/generate-docs.js b/node_modules/eslint/node_modules/shelljs/scripts/generate-docs.js deleted file mode 100755 index 532fed9..0000000 --- a/node_modules/eslint/node_modules/shelljs/scripts/generate-docs.js +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env node -require('../global'); - -echo('Appending docs to README.md'); - -cd(__dirname + '/..'); - -// Extract docs from shell.js -var docs = grep('//@', 'shell.js'); - -docs = docs.replace(/\/\/\@include (.+)/g, function(match, path) { - var file = path.match('.js$') ? path : path+'.js'; - return grep('//@', file); -}); - -// Remove '//@' -docs = docs.replace(/\/\/\@ ?/g, ''); -// Append docs to README -sed('-i', /## Command reference(.|\n)*/, '## Command reference\n\n' + docs, 'README.md'); - -echo('All done.'); diff --git a/node_modules/eslint/node_modules/shelljs/scripts/run-tests.js b/node_modules/eslint/node_modules/shelljs/scripts/run-tests.js deleted file mode 100755 index f9d31e0..0000000 --- a/node_modules/eslint/node_modules/shelljs/scripts/run-tests.js +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env node -require('../global'); - -var path = require('path'); - -var failed = false; - -// -// Lint -// -JSHINT_BIN = './node_modules/jshint/bin/jshint'; -cd(__dirname + '/..'); - -if (!test('-f', JSHINT_BIN)) { - echo('JSHint not found. Run `npm install` in the root dir first.'); - exit(1); -} - -if (exec(JSHINT_BIN + ' *.js test/*.js').code !== 0) { - failed = true; - echo('*** JSHINT FAILED! (return code != 0)'); - echo(); -} else { - echo('All JSHint tests passed'); - echo(); -} - -// -// Unit tests -// -cd(__dirname + '/../test'); -ls('*.js').forEach(function(file) { - echo('Running test:', file); - if (exec('node ' + file).code !== 123) { // 123 avoids false positives (e.g. premature exit) - failed = true; - echo('*** TEST FAILED! (missing exit code "123")'); - echo(); - } -}); - -if (failed) { - echo(); - echo('*******************************************************'); - echo('WARNING: Some tests did not pass!'); - echo('*******************************************************'); - exit(1); -} else { - echo(); - echo('All tests passed.'); -} diff --git a/node_modules/eslint/node_modules/shelljs/shell.js b/node_modules/eslint/node_modules/shelljs/shell.js deleted file mode 100644 index bdeb559..0000000 --- a/node_modules/eslint/node_modules/shelljs/shell.js +++ /dev/null @@ -1,159 +0,0 @@ -// -// ShellJS -// Unix shell commands on top of Node's API -// -// Copyright (c) 2012 Artur Adib -// http://github.com/arturadib/shelljs -// - -var common = require('./src/common'); - - -//@ -//@ All commands run synchronously, unless otherwise stated. -//@ - -//@include ./src/cd -var _cd = require('./src/cd'); -exports.cd = common.wrap('cd', _cd); - -//@include ./src/pwd -var _pwd = require('./src/pwd'); -exports.pwd = common.wrap('pwd', _pwd); - -//@include ./src/ls -var _ls = require('./src/ls'); -exports.ls = common.wrap('ls', _ls); - -//@include ./src/find -var _find = require('./src/find'); -exports.find = common.wrap('find', _find); - -//@include ./src/cp -var _cp = require('./src/cp'); -exports.cp = common.wrap('cp', _cp); - -//@include ./src/rm -var _rm = require('./src/rm'); -exports.rm = common.wrap('rm', _rm); - -//@include ./src/mv -var _mv = require('./src/mv'); -exports.mv = common.wrap('mv', _mv); - -//@include ./src/mkdir -var _mkdir = require('./src/mkdir'); -exports.mkdir = common.wrap('mkdir', _mkdir); - -//@include ./src/test -var _test = require('./src/test'); -exports.test = common.wrap('test', _test); - -//@include ./src/cat -var _cat = require('./src/cat'); -exports.cat = common.wrap('cat', _cat); - -//@include ./src/to -var _to = require('./src/to'); -String.prototype.to = common.wrap('to', _to); - -//@include ./src/toEnd -var _toEnd = require('./src/toEnd'); -String.prototype.toEnd = common.wrap('toEnd', _toEnd); - -//@include ./src/sed -var _sed = require('./src/sed'); -exports.sed = common.wrap('sed', _sed); - -//@include ./src/grep -var _grep = require('./src/grep'); -exports.grep = common.wrap('grep', _grep); - -//@include ./src/which -var _which = require('./src/which'); -exports.which = common.wrap('which', _which); - -//@include ./src/echo -var _echo = require('./src/echo'); -exports.echo = _echo; // don't common.wrap() as it could parse '-options' - -//@include ./src/dirs -var _dirs = require('./src/dirs').dirs; -exports.dirs = common.wrap("dirs", _dirs); -var _pushd = require('./src/dirs').pushd; -exports.pushd = common.wrap('pushd', _pushd); -var _popd = require('./src/dirs').popd; -exports.popd = common.wrap("popd", _popd); - -//@include ./src/ln -var _ln = require('./src/ln'); -exports.ln = common.wrap('ln', _ln); - -//@ -//@ ### exit(code) -//@ Exits the current process with the given exit code. -exports.exit = process.exit; - -//@ -//@ ### env['VAR_NAME'] -//@ Object containing environment variables (both getter and setter). Shortcut to process.env. -exports.env = process.env; - -//@include ./src/exec -var _exec = require('./src/exec'); -exports.exec = common.wrap('exec', _exec, {notUnix:true}); - -//@include ./src/chmod -var _chmod = require('./src/chmod'); -exports.chmod = common.wrap('chmod', _chmod); - - - -//@ -//@ ## Non-Unix commands -//@ - -//@include ./src/tempdir -var _tempDir = require('./src/tempdir'); -exports.tempdir = common.wrap('tempdir', _tempDir); - - -//@include ./src/error -var _error = require('./src/error'); -exports.error = _error; - - - -//@ -//@ ## Configuration -//@ - -exports.config = common.config; - -//@ -//@ ### config.silent -//@ Example: -//@ -//@ ```javascript -//@ var sh = require('shelljs'); -//@ var silentState = sh.config.silent; // save old silent state -//@ sh.config.silent = true; -//@ /* ... */ -//@ sh.config.silent = silentState; // restore old silent state -//@ ``` -//@ -//@ Suppresses all command output if `true`, except for `echo()` calls. -//@ Default is `false`. - -//@ -//@ ### config.fatal -//@ Example: -//@ -//@ ```javascript -//@ require('shelljs/global'); -//@ config.fatal = true; -//@ cp('this_file_does_not_exist', '/dev/null'); // dies here -//@ /* more commands... */ -//@ ``` -//@ -//@ If `true` the script will die on errors. Default is `false`. diff --git a/node_modules/eslint/node_modules/shelljs/src/cat.js b/node_modules/eslint/node_modules/shelljs/src/cat.js deleted file mode 100644 index f6f4d25..0000000 --- a/node_modules/eslint/node_modules/shelljs/src/cat.js +++ /dev/null @@ -1,43 +0,0 @@ -var common = require('./common'); -var fs = require('fs'); - -//@ -//@ ### cat(file [, file ...]) -//@ ### cat(file_array) -//@ -//@ Examples: -//@ -//@ ```javascript -//@ var str = cat('file*.txt'); -//@ var str = cat('file1', 'file2'); -//@ var str = cat(['file1', 'file2']); // same as above -//@ ``` -//@ -//@ Returns a string containing the given file, or a concatenated string -//@ containing the files if more than one file is given (a new line character is -//@ introduced between each file). Wildcard `*` accepted. -function _cat(options, files) { - var cat = ''; - - if (!files) - common.error('no paths given'); - - if (typeof files === 'string') - files = [].slice.call(arguments, 1); - // if it's array leave it as it is - - files = common.expand(files); - - files.forEach(function(file) { - if (!fs.existsSync(file)) - common.error('no such file or directory: ' + file); - - cat += fs.readFileSync(file, 'utf8') + '\n'; - }); - - if (cat[cat.length-1] === '\n') - cat = cat.substring(0, cat.length-1); - - return common.ShellString(cat); -} -module.exports = _cat; diff --git a/node_modules/eslint/node_modules/shelljs/src/cd.js b/node_modules/eslint/node_modules/shelljs/src/cd.js deleted file mode 100644 index 230f432..0000000 --- a/node_modules/eslint/node_modules/shelljs/src/cd.js +++ /dev/null @@ -1,19 +0,0 @@ -var fs = require('fs'); -var common = require('./common'); - -//@ -//@ ### cd('dir') -//@ Changes to directory `dir` for the duration of the script -function _cd(options, dir) { - if (!dir) - common.error('directory not specified'); - - if (!fs.existsSync(dir)) - common.error('no such file or directory: ' + dir); - - if (!fs.statSync(dir).isDirectory()) - common.error('not a directory: ' + dir); - - process.chdir(dir); -} -module.exports = _cd; diff --git a/node_modules/eslint/node_modules/shelljs/src/chmod.js b/node_modules/eslint/node_modules/shelljs/src/chmod.js deleted file mode 100644 index f288893..0000000 --- a/node_modules/eslint/node_modules/shelljs/src/chmod.js +++ /dev/null @@ -1,208 +0,0 @@ -var common = require('./common'); -var fs = require('fs'); -var path = require('path'); - -var PERMS = (function (base) { - return { - OTHER_EXEC : base.EXEC, - OTHER_WRITE : base.WRITE, - OTHER_READ : base.READ, - - GROUP_EXEC : base.EXEC << 3, - GROUP_WRITE : base.WRITE << 3, - GROUP_READ : base.READ << 3, - - OWNER_EXEC : base.EXEC << 6, - OWNER_WRITE : base.WRITE << 6, - OWNER_READ : base.READ << 6, - - // Literal octal numbers are apparently not allowed in "strict" javascript. Using parseInt is - // the preferred way, else a jshint warning is thrown. - STICKY : parseInt('01000', 8), - SETGID : parseInt('02000', 8), - SETUID : parseInt('04000', 8), - - TYPE_MASK : parseInt('0770000', 8) - }; -})({ - EXEC : 1, - WRITE : 2, - READ : 4 -}); - -//@ -//@ ### chmod(octal_mode || octal_string, file) -//@ ### chmod(symbolic_mode, file) -//@ -//@ Available options: -//@ -//@ + `-v`: output a diagnostic for every file processed//@ -//@ + `-c`: like verbose but report only when a change is made//@ -//@ + `-R`: change files and directories recursively//@ -//@ -//@ Examples: -//@ -//@ ```javascript -//@ chmod(755, '/Users/brandon'); -//@ chmod('755', '/Users/brandon'); // same as above -//@ chmod('u+x', '/Users/brandon'); -//@ ``` -//@ -//@ Alters the permissions of a file or directory by either specifying the -//@ absolute permissions in octal form or expressing the changes in symbols. -//@ This command tries to mimic the POSIX behavior as much as possible. -//@ Notable exceptions: -//@ -//@ + In symbolic modes, 'a-r' and '-r' are identical. No consideration is -//@ given to the umask. -//@ + There is no "quiet" option since default behavior is to run silent. -function _chmod(options, mode, filePattern) { - if (!filePattern) { - if (options.length > 0 && options.charAt(0) === '-') { - // Special case where the specified file permissions started with - to subtract perms, which - // get picked up by the option parser as command flags. - // If we are down by one argument and options starts with -, shift everything over. - filePattern = mode; - mode = options; - options = ''; - } - else { - common.error('You must specify a file.'); - } - } - - options = common.parseOptions(options, { - 'R': 'recursive', - 'c': 'changes', - 'v': 'verbose' - }); - - if (typeof filePattern === 'string') { - filePattern = [ filePattern ]; - } - - var files; - - if (options.recursive) { - files = []; - common.expand(filePattern).forEach(function addFile(expandedFile) { - var stat = fs.lstatSync(expandedFile); - - if (!stat.isSymbolicLink()) { - files.push(expandedFile); - - if (stat.isDirectory()) { // intentionally does not follow symlinks. - fs.readdirSync(expandedFile).forEach(function (child) { - addFile(expandedFile + '/' + child); - }); - } - } - }); - } - else { - files = common.expand(filePattern); - } - - files.forEach(function innerChmod(file) { - file = path.resolve(file); - if (!fs.existsSync(file)) { - common.error('File not found: ' + file); - } - - // When recursing, don't follow symlinks. - if (options.recursive && fs.lstatSync(file).isSymbolicLink()) { - return; - } - - var perms = fs.statSync(file).mode; - var type = perms & PERMS.TYPE_MASK; - - var newPerms = perms; - - if (isNaN(parseInt(mode, 8))) { - // parse options - mode.split(',').forEach(function (symbolicMode) { - /*jshint regexdash:true */ - var pattern = /([ugoa]*)([=\+-])([rwxXst]*)/i; - var matches = pattern.exec(symbolicMode); - - if (matches) { - var applyTo = matches[1]; - var operator = matches[2]; - var change = matches[3]; - - var changeOwner = applyTo.indexOf('u') != -1 || applyTo === 'a' || applyTo === ''; - var changeGroup = applyTo.indexOf('g') != -1 || applyTo === 'a' || applyTo === ''; - var changeOther = applyTo.indexOf('o') != -1 || applyTo === 'a' || applyTo === ''; - - var changeRead = change.indexOf('r') != -1; - var changeWrite = change.indexOf('w') != -1; - var changeExec = change.indexOf('x') != -1; - var changeSticky = change.indexOf('t') != -1; - var changeSetuid = change.indexOf('s') != -1; - - var mask = 0; - if (changeOwner) { - mask |= (changeRead ? PERMS.OWNER_READ : 0) + (changeWrite ? PERMS.OWNER_WRITE : 0) + (changeExec ? PERMS.OWNER_EXEC : 0) + (changeSetuid ? PERMS.SETUID : 0); - } - if (changeGroup) { - mask |= (changeRead ? PERMS.GROUP_READ : 0) + (changeWrite ? PERMS.GROUP_WRITE : 0) + (changeExec ? PERMS.GROUP_EXEC : 0) + (changeSetuid ? PERMS.SETGID : 0); - } - if (changeOther) { - mask |= (changeRead ? PERMS.OTHER_READ : 0) + (changeWrite ? PERMS.OTHER_WRITE : 0) + (changeExec ? PERMS.OTHER_EXEC : 0); - } - - // Sticky bit is special - it's not tied to user, group or other. - if (changeSticky) { - mask |= PERMS.STICKY; - } - - switch (operator) { - case '+': - newPerms |= mask; - break; - - case '-': - newPerms &= ~mask; - break; - - case '=': - newPerms = type + mask; - - // According to POSIX, when using = to explicitly set the permissions, setuid and setgid can never be cleared. - if (fs.statSync(file).isDirectory()) { - newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms; - } - break; - } - - if (options.verbose) { - log(file + ' -> ' + newPerms.toString(8)); - } - - if (perms != newPerms) { - if (!options.verbose && options.changes) { - log(file + ' -> ' + newPerms.toString(8)); - } - fs.chmodSync(file, newPerms); - } - } - else { - common.error('Invalid symbolic mode change: ' + symbolicMode); - } - }); - } - else { - // they gave us a full number - newPerms = type + parseInt(mode, 8); - - // POSIX rules are that setuid and setgid can only be added using numeric form, but not cleared. - if (fs.statSync(file).isDirectory()) { - newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms; - } - - fs.chmodSync(file, newPerms); - } - }); -} -module.exports = _chmod; diff --git a/node_modules/eslint/node_modules/shelljs/src/common.js b/node_modules/eslint/node_modules/shelljs/src/common.js deleted file mode 100644 index d8c2312..0000000 --- a/node_modules/eslint/node_modules/shelljs/src/common.js +++ /dev/null @@ -1,203 +0,0 @@ -var os = require('os'); -var fs = require('fs'); -var _ls = require('./ls'); - -// Module globals -var config = { - silent: false, - fatal: false -}; -exports.config = config; - -var state = { - error: null, - currentCmd: 'shell.js', - tempDir: null -}; -exports.state = state; - -var platform = os.type().match(/^Win/) ? 'win' : 'unix'; -exports.platform = platform; - -function log() { - if (!config.silent) - console.log.apply(this, arguments); -} -exports.log = log; - -// Shows error message. Throws unless _continue or config.fatal are true -function error(msg, _continue) { - if (state.error === null) - state.error = ''; - state.error += state.currentCmd + ': ' + msg + '\n'; - - if (msg.length > 0) - log(state.error); - - if (config.fatal) - process.exit(1); - - if (!_continue) - throw ''; -} -exports.error = error; - -// In the future, when Proxies are default, we can add methods like `.to()` to primitive strings. -// For now, this is a dummy function to bookmark places we need such strings -function ShellString(str) { - return str; -} -exports.ShellString = ShellString; - -// Returns {'alice': true, 'bob': false} when passed a dictionary, e.g.: -// parseOptions('-a', {'a':'alice', 'b':'bob'}); -function parseOptions(str, map) { - if (!map) - error('parseOptions() internal error: no map given'); - - // All options are false by default - var options = {}; - for (var letter in map) - options[map[letter]] = false; - - if (!str) - return options; // defaults - - if (typeof str !== 'string') - error('parseOptions() internal error: wrong str'); - - // e.g. match[1] = 'Rf' for str = '-Rf' - var match = str.match(/^\-(.+)/); - if (!match) - return options; - - // e.g. chars = ['R', 'f'] - var chars = match[1].split(''); - - chars.forEach(function(c) { - if (c in map) - options[map[c]] = true; - else - error('option not recognized: '+c); - }); - - return options; -} -exports.parseOptions = parseOptions; - -// Expands wildcards with matching (ie. existing) file names. -// For example: -// expand(['file*.js']) = ['file1.js', 'file2.js', ...] -// (if the files 'file1.js', 'file2.js', etc, exist in the current dir) -function expand(list) { - var expanded = []; - list.forEach(function(listEl) { - // Wildcard present on directory names ? - if(listEl.search(/\*[^\/]*\//) > -1 || listEl.search(/\*\*[^\/]*\//) > -1) { - var match = listEl.match(/^([^*]+\/|)(.*)/); - var root = match[1]; - var rest = match[2]; - var restRegex = rest.replace(/\*\*/g, ".*").replace(/\*/g, "[^\\/]*"); - restRegex = new RegExp(restRegex); - - _ls('-R', root).filter(function (e) { - return restRegex.test(e); - }).forEach(function(file) { - expanded.push(file); - }); - } - // Wildcard present on file names ? - else if (listEl.search(/\*/) > -1) { - _ls('', listEl).forEach(function(file) { - expanded.push(file); - }); - } else { - expanded.push(listEl); - } - }); - return expanded; -} -exports.expand = expand; - -// Normalizes _unlinkSync() across platforms to match Unix behavior, i.e. -// file can be unlinked even if it's read-only, see https://github.com/joyent/node/issues/3006 -function unlinkSync(file) { - try { - fs.unlinkSync(file); - } catch(e) { - // Try to override file permission - if (e.code === 'EPERM') { - fs.chmodSync(file, '0666'); - fs.unlinkSync(file); - } else { - throw e; - } - } -} -exports.unlinkSync = unlinkSync; - -// e.g. 'shelljs_a5f185d0443ca...' -function randomFileName() { - function randomHash(count) { - if (count === 1) - return parseInt(16*Math.random(), 10).toString(16); - else { - var hash = ''; - for (var i=0; i and/or '); - } else if (arguments.length > 3) { - sources = [].slice.call(arguments, 1, arguments.length - 1); - dest = arguments[arguments.length - 1]; - } else if (typeof sources === 'string') { - sources = [sources]; - } else if ('length' in sources) { - sources = sources; // no-op for array - } else { - common.error('invalid arguments'); - } - - var exists = fs.existsSync(dest), - stats = exists && fs.statSync(dest); - - // Dest is not existing dir, but multiple sources given - if ((!exists || !stats.isDirectory()) && sources.length > 1) - common.error('dest is not a directory (too many sources)'); - - // Dest is an existing file, but no -f given - if (exists && stats.isFile() && !options.force) - common.error('dest file already exists: ' + dest); - - if (options.recursive) { - // Recursive allows the shortcut syntax "sourcedir/" for "sourcedir/*" - // (see Github issue #15) - sources.forEach(function(src, i) { - if (src[src.length - 1] === '/') - sources[i] += '*'; - }); - - // Create dest - try { - fs.mkdirSync(dest, parseInt('0777', 8)); - } catch (e) { - // like Unix's cp, keep going even if we can't create dest dir - } - } - - sources = common.expand(sources); - - sources.forEach(function(src) { - if (!fs.existsSync(src)) { - common.error('no such file or directory: '+src, true); - return; // skip file - } - - // If here, src exists - if (fs.statSync(src).isDirectory()) { - if (!options.recursive) { - // Non-Recursive - common.log(src + ' is a directory (not copied)'); - } else { - // Recursive - // 'cp /a/source dest' should create 'source' in 'dest' - var newDest = path.join(dest, path.basename(src)), - checkDir = fs.statSync(src); - try { - fs.mkdirSync(newDest, checkDir.mode); - } catch (e) { - //if the directory already exists, that's okay - if (e.code !== 'EEXIST') { - common.error('dest file no such file or directory: ' + newDest, true); - throw e; - } - } - - cpdirSyncRecursive(src, newDest, {force: options.force}); - } - return; // done with dir - } - - // If here, src is a file - - // When copying to '/path/dir': - // thisDest = '/path/dir/file1' - var thisDest = dest; - if (fs.existsSync(dest) && fs.statSync(dest).isDirectory()) - thisDest = path.normalize(dest + '/' + path.basename(src)); - - if (fs.existsSync(thisDest) && !options.force) { - common.error('dest file already exists: ' + thisDest, true); - return; // skip file - } - - copyFileSync(src, thisDest); - }); // forEach(src) -} -module.exports = _cp; diff --git a/node_modules/eslint/node_modules/shelljs/src/dirs.js b/node_modules/eslint/node_modules/shelljs/src/dirs.js deleted file mode 100644 index 58fae8b..0000000 --- a/node_modules/eslint/node_modules/shelljs/src/dirs.js +++ /dev/null @@ -1,191 +0,0 @@ -var common = require('./common'); -var _cd = require('./cd'); -var path = require('path'); - -// Pushd/popd/dirs internals -var _dirStack = []; - -function _isStackIndex(index) { - return (/^[\-+]\d+$/).test(index); -} - -function _parseStackIndex(index) { - if (_isStackIndex(index)) { - if (Math.abs(index) < _dirStack.length + 1) { // +1 for pwd - return (/^-/).test(index) ? Number(index) - 1 : Number(index); - } else { - common.error(index + ': directory stack index out of range'); - } - } else { - common.error(index + ': invalid number'); - } -} - -function _actualDirStack() { - return [process.cwd()].concat(_dirStack); -} - -//@ -//@ ### pushd([options,] [dir | '-N' | '+N']) -//@ -//@ Available options: -//@ -//@ + `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated. -//@ -//@ Arguments: -//@ -//@ + `dir`: Makes the current working directory be the top of the stack, and then executes the equivalent of `cd dir`. -//@ + `+N`: Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. -//@ + `-N`: Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. -//@ -//@ Examples: -//@ -//@ ```javascript -//@ // process.cwd() === '/usr' -//@ pushd('/etc'); // Returns /etc /usr -//@ pushd('+1'); // Returns /usr /etc -//@ ``` -//@ -//@ Save the current directory on the top of the directory stack and then cd to `dir`. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack. -function _pushd(options, dir) { - if (_isStackIndex(options)) { - dir = options; - options = ''; - } - - options = common.parseOptions(options, { - 'n' : 'no-cd' - }); - - var dirs = _actualDirStack(); - - if (dir === '+0') { - return dirs; // +0 is a noop - } else if (!dir) { - if (dirs.length > 1) { - dirs = dirs.splice(1, 1).concat(dirs); - } else { - return common.error('no other directory'); - } - } else if (_isStackIndex(dir)) { - var n = _parseStackIndex(dir); - dirs = dirs.slice(n).concat(dirs.slice(0, n)); - } else { - if (options['no-cd']) { - dirs.splice(1, 0, dir); - } else { - dirs.unshift(dir); - } - } - - if (options['no-cd']) { - dirs = dirs.slice(1); - } else { - dir = path.resolve(dirs.shift()); - _cd('', dir); - } - - _dirStack = dirs; - return _dirs(''); -} -exports.pushd = _pushd; - -//@ -//@ ### popd([options,] ['-N' | '+N']) -//@ -//@ Available options: -//@ -//@ + `-n`: Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated. -//@ -//@ Arguments: -//@ -//@ + `+N`: Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero. -//@ + `-N`: Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero. -//@ -//@ Examples: -//@ -//@ ```javascript -//@ echo(process.cwd()); // '/usr' -//@ pushd('/etc'); // '/etc /usr' -//@ echo(process.cwd()); // '/etc' -//@ popd(); // '/usr' -//@ echo(process.cwd()); // '/usr' -//@ ``` -//@ -//@ When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack. -function _popd(options, index) { - if (_isStackIndex(options)) { - index = options; - options = ''; - } - - options = common.parseOptions(options, { - 'n' : 'no-cd' - }); - - if (!_dirStack.length) { - return common.error('directory stack empty'); - } - - index = _parseStackIndex(index || '+0'); - - if (options['no-cd'] || index > 0 || _dirStack.length + index === 0) { - index = index > 0 ? index - 1 : index; - _dirStack.splice(index, 1); - } else { - var dir = path.resolve(_dirStack.shift()); - _cd('', dir); - } - - return _dirs(''); -} -exports.popd = _popd; - -//@ -//@ ### dirs([options | '+N' | '-N']) -//@ -//@ Available options: -//@ -//@ + `-c`: Clears the directory stack by deleting all of the elements. -//@ -//@ Arguments: -//@ -//@ + `+N`: Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero. -//@ + `-N`: Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero. -//@ -//@ Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified. -//@ -//@ See also: pushd, popd -function _dirs(options, index) { - if (_isStackIndex(options)) { - index = options; - options = ''; - } - - options = common.parseOptions(options, { - 'c' : 'clear' - }); - - if (options['clear']) { - _dirStack = []; - return _dirStack; - } - - var stack = _actualDirStack(); - - if (index) { - index = _parseStackIndex(index); - - if (index < 0) { - index = stack.length + index; - } - - common.log(stack[index]); - return stack[index]; - } - - common.log(stack.join(' ')); - - return stack; -} -exports.dirs = _dirs; diff --git a/node_modules/eslint/node_modules/shelljs/src/echo.js b/node_modules/eslint/node_modules/shelljs/src/echo.js deleted file mode 100644 index 760ea84..0000000 --- a/node_modules/eslint/node_modules/shelljs/src/echo.js +++ /dev/null @@ -1,20 +0,0 @@ -var common = require('./common'); - -//@ -//@ ### echo(string [,string ...]) -//@ -//@ Examples: -//@ -//@ ```javascript -//@ echo('hello world'); -//@ var str = echo('hello world'); -//@ ``` -//@ -//@ Prints string to stdout, and returns string with additional utility methods -//@ like `.to()`. -function _echo() { - var messages = [].slice.call(arguments, 0); - console.log.apply(this, messages); - return common.ShellString(messages.join(' ')); -} -module.exports = _echo; diff --git a/node_modules/eslint/node_modules/shelljs/src/error.js b/node_modules/eslint/node_modules/shelljs/src/error.js deleted file mode 100644 index cca3efb..0000000 --- a/node_modules/eslint/node_modules/shelljs/src/error.js +++ /dev/null @@ -1,10 +0,0 @@ -var common = require('./common'); - -//@ -//@ ### error() -//@ Tests if error occurred in the last command. Returns `null` if no error occurred, -//@ otherwise returns string explaining the error -function error() { - return common.state.error; -}; -module.exports = error; diff --git a/node_modules/eslint/node_modules/shelljs/src/exec.js b/node_modules/eslint/node_modules/shelljs/src/exec.js deleted file mode 100644 index d259a9f..0000000 --- a/node_modules/eslint/node_modules/shelljs/src/exec.js +++ /dev/null @@ -1,216 +0,0 @@ -var common = require('./common'); -var _tempDir = require('./tempdir'); -var _pwd = require('./pwd'); -var path = require('path'); -var fs = require('fs'); -var child = require('child_process'); - -// Hack to run child_process.exec() synchronously (sync avoids callback hell) -// Uses a custom wait loop that checks for a flag file, created when the child process is done. -// (Can't do a wait loop that checks for internal Node variables/messages as -// Node is single-threaded; callbacks and other internal state changes are done in the -// event loop). -function execSync(cmd, opts) { - var tempDir = _tempDir(); - var stdoutFile = path.resolve(tempDir+'/'+common.randomFileName()), - codeFile = path.resolve(tempDir+'/'+common.randomFileName()), - scriptFile = path.resolve(tempDir+'/'+common.randomFileName()), - sleepFile = path.resolve(tempDir+'/'+common.randomFileName()); - - var options = common.extend({ - silent: common.config.silent - }, opts); - - var previousStdoutContent = ''; - // Echoes stdout changes from running process, if not silent - function updateStdout() { - if (options.silent || !fs.existsSync(stdoutFile)) - return; - - var stdoutContent = fs.readFileSync(stdoutFile, 'utf8'); - // No changes since last time? - if (stdoutContent.length <= previousStdoutContent.length) - return; - - process.stdout.write(stdoutContent.substr(previousStdoutContent.length)); - previousStdoutContent = stdoutContent; - } - - function escape(str) { - return (str+'').replace(/([\\"'])/g, "\\$1").replace(/\0/g, "\\0"); - } - - if (fs.existsSync(scriptFile)) common.unlinkSync(scriptFile); - if (fs.existsSync(stdoutFile)) common.unlinkSync(stdoutFile); - if (fs.existsSync(codeFile)) common.unlinkSync(codeFile); - - var execCommand = '"'+process.execPath+'" '+scriptFile; - var execOptions = { - env: process.env, - cwd: _pwd(), - maxBuffer: 20*1024*1024 - }; - - if (typeof child.execSync === 'function') { - var script = [ - "var child = require('child_process')", - " , fs = require('fs');", - "var childProcess = child.exec('"+escape(cmd)+"', {env: process.env, maxBuffer: 20*1024*1024}, function(err) {", - " fs.writeFileSync('"+escape(codeFile)+"', err ? err.code.toString() : '0');", - "});", - "var stdoutStream = fs.createWriteStream('"+escape(stdoutFile)+"');", - "childProcess.stdout.pipe(stdoutStream, {end: false});", - "childProcess.stderr.pipe(stdoutStream, {end: false});", - "childProcess.stdout.pipe(process.stdout);", - "childProcess.stderr.pipe(process.stderr);", - "var stdoutEnded = false, stderrEnded = false;", - "function tryClosing(){ if(stdoutEnded && stderrEnded){ stdoutStream.end(); } }", - "childProcess.stdout.on('end', function(){ stdoutEnded = true; tryClosing(); });", - "childProcess.stderr.on('end', function(){ stderrEnded = true; tryClosing(); });" - ].join('\n'); - - fs.writeFileSync(scriptFile, script); - - if (options.silent) { - execOptions.stdio = 'ignore'; - } else { - execOptions.stdio = [0, 1, 2]; - } - - // Welcome to the future - child.execSync(execCommand, execOptions); - } else { - cmd += ' > '+stdoutFile+' 2>&1'; // works on both win/unix - - var script = [ - "var child = require('child_process')", - " , fs = require('fs');", - "var childProcess = child.exec('"+escape(cmd)+"', {env: process.env, maxBuffer: 20*1024*1024}, function(err) {", - " fs.writeFileSync('"+escape(codeFile)+"', err ? err.code.toString() : '0');", - "});" - ].join('\n'); - - fs.writeFileSync(scriptFile, script); - - child.exec(execCommand, execOptions); - - // The wait loop - // sleepFile is used as a dummy I/O op to mitigate unnecessary CPU usage - // (tried many I/O sync ops, writeFileSync() seems to be only one that is effective in reducing - // CPU usage, though apparently not so much on Windows) - while (!fs.existsSync(codeFile)) { updateStdout(); fs.writeFileSync(sleepFile, 'a'); } - while (!fs.existsSync(stdoutFile)) { updateStdout(); fs.writeFileSync(sleepFile, 'a'); } - } - - // At this point codeFile exists, but it's not necessarily flushed yet. - // Keep reading it until it is. - var code = parseInt('', 10); - while (isNaN(code)) { - code = parseInt(fs.readFileSync(codeFile, 'utf8'), 10); - } - - var stdout = fs.readFileSync(stdoutFile, 'utf8'); - - // No biggie if we can't erase the files now -- they're in a temp dir anyway - try { common.unlinkSync(scriptFile); } catch(e) {} - try { common.unlinkSync(stdoutFile); } catch(e) {} - try { common.unlinkSync(codeFile); } catch(e) {} - try { common.unlinkSync(sleepFile); } catch(e) {} - - // some shell return codes are defined as errors, per http://tldp.org/LDP/abs/html/exitcodes.html - if (code === 1 || code === 2 || code >= 126) { - common.error('', true); // unix/shell doesn't really give an error message after non-zero exit codes - } - // True if successful, false if not - var obj = { - code: code, - output: stdout - }; - return obj; -} // execSync() - -// Wrapper around exec() to enable echoing output to console in real time -function execAsync(cmd, opts, callback) { - var output = ''; - - var options = common.extend({ - silent: common.config.silent - }, opts); - - var c = child.exec(cmd, {env: process.env, maxBuffer: 20*1024*1024}, function(err) { - if (callback) - callback(err ? err.code : 0, output); - }); - - c.stdout.on('data', function(data) { - output += data; - if (!options.silent) - process.stdout.write(data); - }); - - c.stderr.on('data', function(data) { - output += data; - if (!options.silent) - process.stdout.write(data); - }); - - return c; -} - -//@ -//@ ### exec(command [, options] [, callback]) -//@ Available options (all `false` by default): -//@ -//@ + `async`: Asynchronous execution. Defaults to true if a callback is provided. -//@ + `silent`: Do not echo program output to console. -//@ -//@ Examples: -//@ -//@ ```javascript -//@ var version = exec('node --version', {silent:true}).output; -//@ -//@ var child = exec('some_long_running_process', {async:true}); -//@ child.stdout.on('data', function(data) { -//@ /* ... do something with data ... */ -//@ }); -//@ -//@ exec('some_long_running_process', function(code, output) { -//@ console.log('Exit code:', code); -//@ console.log('Program output:', output); -//@ }); -//@ ``` -//@ -//@ Executes the given `command` _synchronously_, unless otherwise specified. -//@ When in synchronous mode returns the object `{ code:..., output:... }`, containing the program's -//@ `output` (stdout + stderr) and its exit `code`. Otherwise returns the child process object, and -//@ the `callback` gets the arguments `(code, output)`. -//@ -//@ **Note:** For long-lived processes, it's best to run `exec()` asynchronously as -//@ the current synchronous implementation uses a lot of CPU. This should be getting -//@ fixed soon. -function _exec(command, options, callback) { - if (!command) - common.error('must specify command'); - - // Callback is defined instead of options. - if (typeof options === 'function') { - callback = options; - options = { async: true }; - } - - // Callback is defined with options. - if (typeof options === 'object' && typeof callback === 'function') { - options.async = true; - } - - options = common.extend({ - silent: common.config.silent, - async: false - }, options); - - if (options.async) - return execAsync(command, options, callback); - else - return execSync(command, options); -} -module.exports = _exec; diff --git a/node_modules/eslint/node_modules/shelljs/src/find.js b/node_modules/eslint/node_modules/shelljs/src/find.js deleted file mode 100644 index d9eeec2..0000000 --- a/node_modules/eslint/node_modules/shelljs/src/find.js +++ /dev/null @@ -1,51 +0,0 @@ -var fs = require('fs'); -var common = require('./common'); -var _ls = require('./ls'); - -//@ -//@ ### find(path [,path ...]) -//@ ### find(path_array) -//@ Examples: -//@ -//@ ```javascript -//@ find('src', 'lib'); -//@ find(['src', 'lib']); // same as above -//@ find('.').filter(function(file) { return file.match(/\.js$/); }); -//@ ``` -//@ -//@ Returns array of all files (however deep) in the given paths. -//@ -//@ The main difference from `ls('-R', path)` is that the resulting file names -//@ include the base directories, e.g. `lib/resources/file1` instead of just `file1`. -function _find(options, paths) { - if (!paths) - common.error('no path specified'); - else if (typeof paths === 'object') - paths = paths; // assume array - else if (typeof paths === 'string') - paths = [].slice.call(arguments, 1); - - var list = []; - - function pushFile(file) { - if (common.platform === 'win') - file = file.replace(/\\/g, '/'); - list.push(file); - } - - // why not simply do ls('-R', paths)? because the output wouldn't give the base dirs - // to get the base dir in the output, we need instead ls('-R', 'dir/*') for every directory - - paths.forEach(function(file) { - pushFile(file); - - if (fs.statSync(file).isDirectory()) { - _ls('-RA', file+'/*').forEach(function(subfile) { - pushFile(subfile); - }); - } - }); - - return list; -} -module.exports = _find; diff --git a/node_modules/eslint/node_modules/shelljs/src/grep.js b/node_modules/eslint/node_modules/shelljs/src/grep.js deleted file mode 100644 index 00c7d6a..0000000 --- a/node_modules/eslint/node_modules/shelljs/src/grep.js +++ /dev/null @@ -1,52 +0,0 @@ -var common = require('./common'); -var fs = require('fs'); - -//@ -//@ ### grep([options ,] regex_filter, file [, file ...]) -//@ ### grep([options ,] regex_filter, file_array) -//@ Available options: -//@ -//@ + `-v`: Inverse the sense of the regex and print the lines not matching the criteria. -//@ -//@ Examples: -//@ -//@ ```javascript -//@ grep('-v', 'GLOBAL_VARIABLE', '*.js'); -//@ grep('GLOBAL_VARIABLE', '*.js'); -//@ ``` -//@ -//@ Reads input string from given files and returns a string containing all lines of the -//@ file that match the given `regex_filter`. Wildcard `*` accepted. -function _grep(options, regex, files) { - options = common.parseOptions(options, { - 'v': 'inverse' - }); - - if (!files) - common.error('no paths given'); - - if (typeof files === 'string') - files = [].slice.call(arguments, 2); - // if it's array leave it as it is - - files = common.expand(files); - - var grep = ''; - files.forEach(function(file) { - if (!fs.existsSync(file)) { - common.error('no such file or directory: ' + file, true); - return; - } - - var contents = fs.readFileSync(file, 'utf8'), - lines = contents.split(/\r*\n/); - lines.forEach(function(line) { - var matched = line.match(regex); - if ((options.inverse && !matched) || (!options.inverse && matched)) - grep += line + '\n'; - }); - }); - - return common.ShellString(grep); -} -module.exports = _grep; diff --git a/node_modules/eslint/node_modules/shelljs/src/ln.js b/node_modules/eslint/node_modules/shelljs/src/ln.js deleted file mode 100644 index a7b9701..0000000 --- a/node_modules/eslint/node_modules/shelljs/src/ln.js +++ /dev/null @@ -1,53 +0,0 @@ -var fs = require('fs'); -var path = require('path'); -var common = require('./common'); -var os = require('os'); - -//@ -//@ ### ln(options, source, dest) -//@ ### ln(source, dest) -//@ Available options: -//@ -//@ + `s`: symlink -//@ + `f`: force -//@ -//@ Examples: -//@ -//@ ```javascript -//@ ln('file', 'newlink'); -//@ ln('-sf', 'file', 'existing'); -//@ ``` -//@ -//@ Links source to dest. Use -f to force the link, should dest already exist. -function _ln(options, source, dest) { - options = common.parseOptions(options, { - 's': 'symlink', - 'f': 'force' - }); - - if (!source || !dest) { - common.error('Missing and/or '); - } - - source = path.resolve(process.cwd(), String(source)); - dest = path.resolve(process.cwd(), String(dest)); - - if (!fs.existsSync(source)) { - common.error('Source file does not exist', true); - } - - if (fs.existsSync(dest)) { - if (!options.force) { - common.error('Destination file exists', true); - } - - fs.unlinkSync(dest); - } - - if (options.symlink) { - fs.symlinkSync(source, dest, os.platform() === "win32" ? "junction" : null); - } else { - fs.linkSync(source, dest, os.platform() === "win32" ? "junction" : null); - } -} -module.exports = _ln; diff --git a/node_modules/eslint/node_modules/shelljs/src/ls.js b/node_modules/eslint/node_modules/shelljs/src/ls.js deleted file mode 100644 index 3345db4..0000000 --- a/node_modules/eslint/node_modules/shelljs/src/ls.js +++ /dev/null @@ -1,126 +0,0 @@ -var path = require('path'); -var fs = require('fs'); -var common = require('./common'); -var _cd = require('./cd'); -var _pwd = require('./pwd'); - -//@ -//@ ### ls([options ,] path [,path ...]) -//@ ### ls([options ,] path_array) -//@ Available options: -//@ -//@ + `-R`: recursive -//@ + `-A`: all files (include files beginning with `.`, except for `.` and `..`) -//@ -//@ Examples: -//@ -//@ ```javascript -//@ ls('projs/*.js'); -//@ ls('-R', '/users/me', '/tmp'); -//@ ls('-R', ['/users/me', '/tmp']); // same as above -//@ ``` -//@ -//@ Returns array of files in the given path, or in current directory if no path provided. -function _ls(options, paths) { - options = common.parseOptions(options, { - 'R': 'recursive', - 'A': 'all', - 'a': 'all_deprecated' - }); - - if (options.all_deprecated) { - // We won't support the -a option as it's hard to image why it's useful - // (it includes '.' and '..' in addition to '.*' files) - // For backwards compatibility we'll dump a deprecated message and proceed as before - common.log('ls: Option -a is deprecated. Use -A instead'); - options.all = true; - } - - if (!paths) - paths = ['.']; - else if (typeof paths === 'object') - paths = paths; // assume array - else if (typeof paths === 'string') - paths = [].slice.call(arguments, 1); - - var list = []; - - // Conditionally pushes file to list - returns true if pushed, false otherwise - // (e.g. prevents hidden files to be included unless explicitly told so) - function pushFile(file, query) { - // hidden file? - if (path.basename(file)[0] === '.') { - // not explicitly asking for hidden files? - if (!options.all && !(path.basename(query)[0] === '.' && path.basename(query).length > 1)) - return false; - } - - if (common.platform === 'win') - file = file.replace(/\\/g, '/'); - - list.push(file); - return true; - } - - paths.forEach(function(p) { - if (fs.existsSync(p)) { - var stats = fs.statSync(p); - // Simple file? - if (stats.isFile()) { - pushFile(p, p); - return; // continue - } - - // Simple dir? - if (stats.isDirectory()) { - // Iterate over p contents - fs.readdirSync(p).forEach(function(file) { - if (!pushFile(file, p)) - return; - - // Recursive? - if (options.recursive) { - var oldDir = _pwd(); - _cd('', p); - if (fs.statSync(file).isDirectory()) - list = list.concat(_ls('-R'+(options.all?'A':''), file+'/*')); - _cd('', oldDir); - } - }); - return; // continue - } - } - - // p does not exist - possible wildcard present - - var basename = path.basename(p); - var dirname = path.dirname(p); - // Wildcard present on an existing dir? (e.g. '/tmp/*.js') - if (basename.search(/\*/) > -1 && fs.existsSync(dirname) && fs.statSync(dirname).isDirectory) { - // Escape special regular expression chars - var regexp = basename.replace(/(\^|\$|\(|\)|<|>|\[|\]|\{|\}|\.|\+|\?)/g, '\\$1'); - // Translates wildcard into regex - regexp = '^' + regexp.replace(/\*/g, '.*') + '$'; - // Iterate over directory contents - fs.readdirSync(dirname).forEach(function(file) { - if (file.match(new RegExp(regexp))) { - if (!pushFile(path.normalize(dirname+'/'+file), basename)) - return; - - // Recursive? - if (options.recursive) { - var pp = dirname + '/' + file; - if (fs.lstatSync(pp).isDirectory()) - list = list.concat(_ls('-R'+(options.all?'A':''), pp+'/*')); - } // recursive - } // if file matches - }); // forEach - return; - } - - common.error('no such file or directory: ' + p, true); - }); - - return list; -} -module.exports = _ls; diff --git a/node_modules/eslint/node_modules/shelljs/src/mkdir.js b/node_modules/eslint/node_modules/shelljs/src/mkdir.js deleted file mode 100644 index 5a7088f..0000000 --- a/node_modules/eslint/node_modules/shelljs/src/mkdir.js +++ /dev/null @@ -1,68 +0,0 @@ -var common = require('./common'); -var fs = require('fs'); -var path = require('path'); - -// Recursively creates 'dir' -function mkdirSyncRecursive(dir) { - var baseDir = path.dirname(dir); - - // Base dir exists, no recursion necessary - if (fs.existsSync(baseDir)) { - fs.mkdirSync(dir, parseInt('0777', 8)); - return; - } - - // Base dir does not exist, go recursive - mkdirSyncRecursive(baseDir); - - // Base dir created, can create dir - fs.mkdirSync(dir, parseInt('0777', 8)); -} - -//@ -//@ ### mkdir([options ,] dir [, dir ...]) -//@ ### mkdir([options ,] dir_array) -//@ Available options: -//@ -//@ + `p`: full path (will create intermediate dirs if necessary) -//@ -//@ Examples: -//@ -//@ ```javascript -//@ mkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g'); -//@ mkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above -//@ ``` -//@ -//@ Creates directories. -function _mkdir(options, dirs) { - options = common.parseOptions(options, { - 'p': 'fullpath' - }); - if (!dirs) - common.error('no paths given'); - - if (typeof dirs === 'string') - dirs = [].slice.call(arguments, 1); - // if it's array leave it as it is - - dirs.forEach(function(dir) { - if (fs.existsSync(dir)) { - if (!options.fullpath) - common.error('path already exists: ' + dir, true); - return; // skip dir - } - - // Base dir does not exist, and no -p option given - var baseDir = path.dirname(dir); - if (!fs.existsSync(baseDir) && !options.fullpath) { - common.error('no such file or directory: ' + baseDir, true); - return; // skip dir - } - - if (options.fullpath) - mkdirSyncRecursive(dir); - else - fs.mkdirSync(dir, parseInt('0777', 8)); - }); -} // mkdir -module.exports = _mkdir; diff --git a/node_modules/eslint/node_modules/shelljs/src/mv.js b/node_modules/eslint/node_modules/shelljs/src/mv.js deleted file mode 100644 index 11f9607..0000000 --- a/node_modules/eslint/node_modules/shelljs/src/mv.js +++ /dev/null @@ -1,80 +0,0 @@ -var fs = require('fs'); -var path = require('path'); -var common = require('./common'); - -//@ -//@ ### mv(source [, source ...], dest') -//@ ### mv(source_array, dest') -//@ Available options: -//@ -//@ + `f`: force -//@ -//@ Examples: -//@ -//@ ```javascript -//@ mv('-f', 'file', 'dir/'); -//@ mv('file1', 'file2', 'dir/'); -//@ mv(['file1', 'file2'], 'dir/'); // same as above -//@ ``` -//@ -//@ Moves files. The wildcard `*` is accepted. -function _mv(options, sources, dest) { - options = common.parseOptions(options, { - 'f': 'force' - }); - - // Get sources, dest - if (arguments.length < 3) { - common.error('missing and/or '); - } else if (arguments.length > 3) { - sources = [].slice.call(arguments, 1, arguments.length - 1); - dest = arguments[arguments.length - 1]; - } else if (typeof sources === 'string') { - sources = [sources]; - } else if ('length' in sources) { - sources = sources; // no-op for array - } else { - common.error('invalid arguments'); - } - - sources = common.expand(sources); - - var exists = fs.existsSync(dest), - stats = exists && fs.statSync(dest); - - // Dest is not existing dir, but multiple sources given - if ((!exists || !stats.isDirectory()) && sources.length > 1) - common.error('dest is not a directory (too many sources)'); - - // Dest is an existing file, but no -f given - if (exists && stats.isFile() && !options.force) - common.error('dest file already exists: ' + dest); - - sources.forEach(function(src) { - if (!fs.existsSync(src)) { - common.error('no such file or directory: '+src, true); - return; // skip file - } - - // If here, src exists - - // When copying to '/path/dir': - // thisDest = '/path/dir/file1' - var thisDest = dest; - if (fs.existsSync(dest) && fs.statSync(dest).isDirectory()) - thisDest = path.normalize(dest + '/' + path.basename(src)); - - if (fs.existsSync(thisDest) && !options.force) { - common.error('dest file already exists: ' + thisDest, true); - return; // skip file - } - - if (path.resolve(src) === path.dirname(path.resolve(thisDest))) { - common.error('cannot move to self: '+src, true); - return; // skip file - } - - fs.renameSync(src, thisDest); - }); // forEach(src) -} // mv -module.exports = _mv; diff --git a/node_modules/eslint/node_modules/shelljs/src/popd.js b/node_modules/eslint/node_modules/shelljs/src/popd.js deleted file mode 100644 index 11ea24f..0000000 --- a/node_modules/eslint/node_modules/shelljs/src/popd.js +++ /dev/null @@ -1 +0,0 @@ -// see dirs.js \ No newline at end of file diff --git a/node_modules/eslint/node_modules/shelljs/src/pushd.js b/node_modules/eslint/node_modules/shelljs/src/pushd.js deleted file mode 100644 index 11ea24f..0000000 --- a/node_modules/eslint/node_modules/shelljs/src/pushd.js +++ /dev/null @@ -1 +0,0 @@ -// see dirs.js \ No newline at end of file diff --git a/node_modules/eslint/node_modules/shelljs/src/pwd.js b/node_modules/eslint/node_modules/shelljs/src/pwd.js deleted file mode 100644 index 41727bb..0000000 --- a/node_modules/eslint/node_modules/shelljs/src/pwd.js +++ /dev/null @@ -1,11 +0,0 @@ -var path = require('path'); -var common = require('./common'); - -//@ -//@ ### pwd() -//@ Returns the current directory. -function _pwd(options) { - var pwd = path.resolve(process.cwd()); - return common.ShellString(pwd); -} -module.exports = _pwd; diff --git a/node_modules/eslint/node_modules/shelljs/src/rm.js b/node_modules/eslint/node_modules/shelljs/src/rm.js deleted file mode 100644 index bd608cb..0000000 --- a/node_modules/eslint/node_modules/shelljs/src/rm.js +++ /dev/null @@ -1,163 +0,0 @@ -var common = require('./common'); -var fs = require('fs'); - -// Recursively removes 'dir' -// Adapted from https://github.com/ryanmcgrath/wrench-js -// -// Copyright (c) 2010 Ryan McGrath -// Copyright (c) 2012 Artur Adib -// -// Licensed under the MIT License -// http://www.opensource.org/licenses/mit-license.php -function rmdirSyncRecursive(dir, force) { - var files; - - files = fs.readdirSync(dir); - - // Loop through and delete everything in the sub-tree after checking it - for(var i = 0; i < files.length; i++) { - var file = dir + "/" + files[i], - currFile = fs.lstatSync(file); - - if(currFile.isDirectory()) { // Recursive function back to the beginning - rmdirSyncRecursive(file, force); - } - - else if(currFile.isSymbolicLink()) { // Unlink symlinks - if (force || isWriteable(file)) { - try { - common.unlinkSync(file); - } catch (e) { - common.error('could not remove file (code '+e.code+'): ' + file, true); - } - } - } - - else // Assume it's a file - perhaps a try/catch belongs here? - if (force || isWriteable(file)) { - try { - common.unlinkSync(file); - } catch (e) { - common.error('could not remove file (code '+e.code+'): ' + file, true); - } - } - } - - // Now that we know everything in the sub-tree has been deleted, we can delete the main directory. - // Huzzah for the shopkeep. - - var result; - try { - // Retry on windows, sometimes it takes a little time before all the files in the directory are gone - var start = Date.now(); - while (true) { - try { - result = fs.rmdirSync(dir); - if (fs.existsSync(dir)) throw { code: "EAGAIN" } - break; - } catch(er) { - // In addition to error codes, also check if the directory still exists and loop again if true - if (process.platform === "win32" && (er.code === "ENOTEMPTY" || er.code === "EBUSY" || er.code === "EPERM" || er.code === "EAGAIN")) { - if (Date.now() - start > 1000) throw er; - } else if (er.code === "ENOENT") { - // Directory did not exist, deletion was successful - break; - } else { - throw er; - } - } - } - } catch(e) { - common.error('could not remove directory (code '+e.code+'): ' + dir, true); - } - - return result; -} // rmdirSyncRecursive - -// Hack to determine if file has write permissions for current user -// Avoids having to check user, group, etc, but it's probably slow -function isWriteable(file) { - var writePermission = true; - try { - var __fd = fs.openSync(file, 'a'); - fs.closeSync(__fd); - } catch(e) { - writePermission = false; - } - - return writePermission; -} - -//@ -//@ ### rm([options ,] file [, file ...]) -//@ ### rm([options ,] file_array) -//@ Available options: -//@ -//@ + `-f`: force -//@ + `-r, -R`: recursive -//@ -//@ Examples: -//@ -//@ ```javascript -//@ rm('-rf', '/tmp/*'); -//@ rm('some_file.txt', 'another_file.txt'); -//@ rm(['some_file.txt', 'another_file.txt']); // same as above -//@ ``` -//@ -//@ Removes files. The wildcard `*` is accepted. -function _rm(options, files) { - options = common.parseOptions(options, { - 'f': 'force', - 'r': 'recursive', - 'R': 'recursive' - }); - if (!files) - common.error('no paths given'); - - if (typeof files === 'string') - files = [].slice.call(arguments, 1); - // if it's array leave it as it is - - files = common.expand(files); - - files.forEach(function(file) { - if (!fs.existsSync(file)) { - // Path does not exist, no force flag given - if (!options.force) - common.error('no such file or directory: '+file, true); - - return; // skip file - } - - // If here, path exists - - var stats = fs.lstatSync(file); - if (stats.isFile() || stats.isSymbolicLink()) { - - // Do not check for file writing permissions - if (options.force) { - common.unlinkSync(file); - return; - } - - if (isWriteable(file)) - common.unlinkSync(file); - else - common.error('permission denied: '+file, true); - - return; - } // simple file - - // Path is an existing directory, but no -r flag given - if (stats.isDirectory() && !options.recursive) { - common.error('path is a directory', true); - return; // skip path - } - - // Recursively remove existing directory - if (stats.isDirectory() && options.recursive) { - rmdirSyncRecursive(file, options.force); - } - }); // forEach(file) -} // rm -module.exports = _rm; diff --git a/node_modules/eslint/node_modules/shelljs/src/sed.js b/node_modules/eslint/node_modules/shelljs/src/sed.js deleted file mode 100644 index 65f7cb4..0000000 --- a/node_modules/eslint/node_modules/shelljs/src/sed.js +++ /dev/null @@ -1,43 +0,0 @@ -var common = require('./common'); -var fs = require('fs'); - -//@ -//@ ### sed([options ,] search_regex, replacement, file) -//@ Available options: -//@ -//@ + `-i`: Replace contents of 'file' in-place. _Note that no backups will be created!_ -//@ -//@ Examples: -//@ -//@ ```javascript -//@ sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js'); -//@ sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js'); -//@ ``` -//@ -//@ Reads an input string from `file` and performs a JavaScript `replace()` on the input -//@ using the given search regex and replacement string or function. Returns the new string after replacement. -function _sed(options, regex, replacement, file) { - options = common.parseOptions(options, { - 'i': 'inplace' - }); - - if (typeof replacement === 'string' || typeof replacement === 'function') - replacement = replacement; // no-op - else if (typeof replacement === 'number') - replacement = replacement.toString(); // fallback - else - common.error('invalid replacement string'); - - if (!file) - common.error('no file given'); - - if (!fs.existsSync(file)) - common.error('no such file or directory: ' + file); - - var result = fs.readFileSync(file, 'utf8').replace(regex, replacement); - if (options.inplace) - fs.writeFileSync(file, result, 'utf8'); - - return common.ShellString(result); -} -module.exports = _sed; diff --git a/node_modules/eslint/node_modules/shelljs/src/tempdir.js b/node_modules/eslint/node_modules/shelljs/src/tempdir.js deleted file mode 100644 index 45953c2..0000000 --- a/node_modules/eslint/node_modules/shelljs/src/tempdir.js +++ /dev/null @@ -1,56 +0,0 @@ -var common = require('./common'); -var os = require('os'); -var fs = require('fs'); - -// Returns false if 'dir' is not a writeable directory, 'dir' otherwise -function writeableDir(dir) { - if (!dir || !fs.existsSync(dir)) - return false; - - if (!fs.statSync(dir).isDirectory()) - return false; - - var testFile = dir+'/'+common.randomFileName(); - try { - fs.writeFileSync(testFile, ' '); - common.unlinkSync(testFile); - return dir; - } catch (e) { - return false; - } -} - - -//@ -//@ ### tempdir() -//@ -//@ Examples: -//@ -//@ ```javascript -//@ var tmp = tempdir(); // "/tmp" for most *nix platforms -//@ ``` -//@ -//@ Searches and returns string containing a writeable, platform-dependent temporary directory. -//@ Follows Python's [tempfile algorithm](http://docs.python.org/library/tempfile.html#tempfile.tempdir). -function _tempDir() { - var state = common.state; - if (state.tempDir) - return state.tempDir; // from cache - - state.tempDir = writeableDir(os.tempDir && os.tempDir()) || // node 0.8+ - writeableDir(process.env['TMPDIR']) || - writeableDir(process.env['TEMP']) || - writeableDir(process.env['TMP']) || - writeableDir(process.env['Wimp$ScrapDir']) || // RiscOS - writeableDir('C:\\TEMP') || // Windows - writeableDir('C:\\TMP') || // Windows - writeableDir('\\TEMP') || // Windows - writeableDir('\\TMP') || // Windows - writeableDir('/tmp') || - writeableDir('/var/tmp') || - writeableDir('/usr/tmp') || - writeableDir('.'); // last resort - - return state.tempDir; -} -module.exports = _tempDir; diff --git a/node_modules/eslint/node_modules/shelljs/src/test.js b/node_modules/eslint/node_modules/shelljs/src/test.js deleted file mode 100644 index 8a4ac7d..0000000 --- a/node_modules/eslint/node_modules/shelljs/src/test.js +++ /dev/null @@ -1,85 +0,0 @@ -var common = require('./common'); -var fs = require('fs'); - -//@ -//@ ### test(expression) -//@ Available expression primaries: -//@ -//@ + `'-b', 'path'`: true if path is a block device -//@ + `'-c', 'path'`: true if path is a character device -//@ + `'-d', 'path'`: true if path is a directory -//@ + `'-e', 'path'`: true if path exists -//@ + `'-f', 'path'`: true if path is a regular file -//@ + `'-L', 'path'`: true if path is a symboilc link -//@ + `'-p', 'path'`: true if path is a pipe (FIFO) -//@ + `'-S', 'path'`: true if path is a socket -//@ -//@ Examples: -//@ -//@ ```javascript -//@ if (test('-d', path)) { /* do something with dir */ }; -//@ if (!test('-f', path)) continue; // skip if it's a regular file -//@ ``` -//@ -//@ Evaluates expression using the available primaries and returns corresponding value. -function _test(options, path) { - if (!path) - common.error('no path given'); - - // hack - only works with unary primaries - options = common.parseOptions(options, { - 'b': 'block', - 'c': 'character', - 'd': 'directory', - 'e': 'exists', - 'f': 'file', - 'L': 'link', - 'p': 'pipe', - 'S': 'socket' - }); - - var canInterpret = false; - for (var key in options) - if (options[key] === true) { - canInterpret = true; - break; - } - - if (!canInterpret) - common.error('could not interpret expression'); - - if (options.link) { - try { - return fs.lstatSync(path).isSymbolicLink(); - } catch(e) { - return false; - } - } - - if (!fs.existsSync(path)) - return false; - - if (options.exists) - return true; - - var stats = fs.statSync(path); - - if (options.block) - return stats.isBlockDevice(); - - if (options.character) - return stats.isCharacterDevice(); - - if (options.directory) - return stats.isDirectory(); - - if (options.file) - return stats.isFile(); - - if (options.pipe) - return stats.isFIFO(); - - if (options.socket) - return stats.isSocket(); -} // test -module.exports = _test; diff --git a/node_modules/eslint/node_modules/shelljs/src/to.js b/node_modules/eslint/node_modules/shelljs/src/to.js deleted file mode 100644 index f029999..0000000 --- a/node_modules/eslint/node_modules/shelljs/src/to.js +++ /dev/null @@ -1,29 +0,0 @@ -var common = require('./common'); -var fs = require('fs'); -var path = require('path'); - -//@ -//@ ### 'string'.to(file) -//@ -//@ Examples: -//@ -//@ ```javascript -//@ cat('input.txt').to('output.txt'); -//@ ``` -//@ -//@ Analogous to the redirection operator `>` in Unix, but works with JavaScript strings (such as -//@ those returned by `cat`, `grep`, etc). _Like Unix redirections, `to()` will overwrite any existing file!_ -function _to(options, file) { - if (!file) - common.error('wrong arguments'); - - if (!fs.existsSync( path.dirname(file) )) - common.error('no such file or directory: ' + path.dirname(file)); - - try { - fs.writeFileSync(file, this.toString(), 'utf8'); - } catch(e) { - common.error('could not write to file (code '+e.code+'): '+file, true); - } -} -module.exports = _to; diff --git a/node_modules/eslint/node_modules/shelljs/src/toEnd.js b/node_modules/eslint/node_modules/shelljs/src/toEnd.js deleted file mode 100644 index f6d099d..0000000 --- a/node_modules/eslint/node_modules/shelljs/src/toEnd.js +++ /dev/null @@ -1,29 +0,0 @@ -var common = require('./common'); -var fs = require('fs'); -var path = require('path'); - -//@ -//@ ### 'string'.toEnd(file) -//@ -//@ Examples: -//@ -//@ ```javascript -//@ cat('input.txt').toEnd('output.txt'); -//@ ``` -//@ -//@ Analogous to the redirect-and-append operator `>>` in Unix, but works with JavaScript strings (such as -//@ those returned by `cat`, `grep`, etc). -function _toEnd(options, file) { - if (!file) - common.error('wrong arguments'); - - if (!fs.existsSync( path.dirname(file) )) - common.error('no such file or directory: ' + path.dirname(file)); - - try { - fs.appendFileSync(file, this.toString(), 'utf8'); - } catch(e) { - common.error('could not append to file (code '+e.code+'): '+file, true); - } -} -module.exports = _toEnd; diff --git a/node_modules/eslint/node_modules/shelljs/src/which.js b/node_modules/eslint/node_modules/shelljs/src/which.js deleted file mode 100644 index 2822ecf..0000000 --- a/node_modules/eslint/node_modules/shelljs/src/which.js +++ /dev/null @@ -1,83 +0,0 @@ -var common = require('./common'); -var fs = require('fs'); -var path = require('path'); - -// Cross-platform method for splitting environment PATH variables -function splitPath(p) { - for (i=1;i<2;i++) {} - - if (!p) - return []; - - if (common.platform === 'win') - return p.split(';'); - else - return p.split(':'); -} - -function checkPath(path) { - return fs.existsSync(path) && fs.statSync(path).isDirectory() == false; -} - -//@ -//@ ### which(command) -//@ -//@ Examples: -//@ -//@ ```javascript -//@ var nodeExec = which('node'); -//@ ``` -//@ -//@ Searches for `command` in the system's PATH. On Windows looks for `.exe`, `.cmd`, and `.bat` extensions. -//@ Returns string containing the absolute path to the command. -function _which(options, cmd) { - if (!cmd) - common.error('must specify command'); - - var pathEnv = process.env.path || process.env.Path || process.env.PATH, - pathArray = splitPath(pathEnv), - where = null; - - // No relative/absolute paths provided? - if (cmd.search(/\//) === -1) { - // Search for command in PATH - pathArray.forEach(function(dir) { - if (where) - return; // already found it - - var attempt = path.resolve(dir + '/' + cmd); - if (checkPath(attempt)) { - where = attempt; - return; - } - - if (common.platform === 'win') { - var baseAttempt = attempt; - attempt = baseAttempt + '.exe'; - if (checkPath(attempt)) { - where = attempt; - return; - } - attempt = baseAttempt + '.cmd'; - if (checkPath(attempt)) { - where = attempt; - return; - } - attempt = baseAttempt + '.bat'; - if (checkPath(attempt)) { - where = attempt; - return; - } - } // if 'win' - }); - } - - // Command not found anywhere? - if (!checkPath(cmd) && !where) - return null; - - where = where || path.resolve(cmd); - - return common.ShellString(where); -} -module.exports = _which; diff --git a/node_modules/eslint/node_modules/strip-json-comments/cli.js b/node_modules/eslint/node_modules/strip-json-comments/cli.js deleted file mode 100755 index aec5aa2..0000000 --- a/node_modules/eslint/node_modules/strip-json-comments/cli.js +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env node -'use strict'; -var fs = require('fs'); -var strip = require('./strip-json-comments'); -var input = process.argv[2]; - - -function getStdin(cb) { - var ret = ''; - - process.stdin.setEncoding('utf8'); - - process.stdin.on('data', function (data) { - ret += data; - }); - - process.stdin.on('end', function () { - cb(ret); - }); -} - -if (process.argv.indexOf('-h') !== -1 || process.argv.indexOf('--help') !== -1) { - console.log('strip-json-comments input-file > output-file'); - console.log('or'); - console.log('strip-json-comments < input-file > output-file'); - return; -} - -if (process.argv.indexOf('-v') !== -1 || process.argv.indexOf('--version') !== -1) { - console.log(require('./package').version); - return; -} - -if (input) { - process.stdout.write(strip(fs.readFileSync(input, 'utf8'))); - return; -} - -getStdin(function (data) { - process.stdout.write(strip(data)); -}); diff --git a/node_modules/eslint/node_modules/strip-json-comments/license b/node_modules/eslint/node_modules/strip-json-comments/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/eslint/node_modules/strip-json-comments/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/eslint/node_modules/strip-json-comments/package.json b/node_modules/eslint/node_modules/strip-json-comments/package.json deleted file mode 100644 index d8795fc..0000000 --- a/node_modules/eslint/node_modules/strip-json-comments/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "strip-json-comments", - "version": "1.0.4", - "description": "Strip comments from JSON. Lets you use comments in your JSON files!", - "keywords": [ - "json", - "strip", - "remove", - "delete", - "trim", - "comments", - "multiline", - "parse", - "config", - "configuration", - "conf", - "settings", - "util", - "env", - "environment", - "cli", - "bin" - ], - "license": "MIT", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "files": [ - "cli.js", - "strip-json-comments.js" - ], - "main": "strip-json-comments", - "bin": { - "strip-json-comments": "cli.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/strip-json-comments.git" - }, - "scripts": { - "test": "mocha --ui tdd" - }, - "devDependencies": { - "mocha": "*" - }, - "engines": { - "node": ">=0.8.0" - }, - "gitHead": "f58348696368583cc5bb18525fe31eacc9bd00e1", - "bugs": { - "url": "https://github.com/sindresorhus/strip-json-comments/issues" - }, - "homepage": "https://github.com/sindresorhus/strip-json-comments", - "_id": "strip-json-comments@1.0.4", - "_shasum": "1e15fbcac97d3ee99bf2d73b4c656b082bbafb91", - "_from": "strip-json-comments@>=1.0.1 <1.1.0", - "_npmVersion": "2.11.2", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "1e15fbcac97d3ee99bf2d73b4c656b082bbafb91", - "tarball": "http://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/strip-json-comments/readme.md b/node_modules/eslint/node_modules/strip-json-comments/readme.md deleted file mode 100644 index 63ce165..0000000 --- a/node_modules/eslint/node_modules/strip-json-comments/readme.md +++ /dev/null @@ -1,80 +0,0 @@ -# strip-json-comments [![Build Status](https://travis-ci.org/sindresorhus/strip-json-comments.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-json-comments) - -> Strip comments from JSON. Lets you use comments in your JSON files! - -This is now possible: - -```js -{ - // rainbows - "unicorn": /* ❤ */ "cake" -} -``` - -It will remove single-line comments `//` and multi-line comments `/**/`. - -Also available as a [gulp](https://github.com/sindresorhus/gulp-strip-json-comments)/[grunt](https://github.com/sindresorhus/grunt-strip-json-comments)/[broccoli](https://github.com/sindresorhus/broccoli-strip-json-comments) plugin. - -- - -*There's also [`json-comments`](https://npmjs.org/package/json-comments), but it's only for Node.js, inefficient, bloated as it also minifies, and comes with a `require` hook, which is :(* - - -## Install - -```sh -$ npm install --save strip-json-comments -``` - -```sh -$ bower install --save strip-json-comments -``` - -```sh -$ component install sindresorhus/strip-json-comments -``` - - -## Usage - -```js -var json = '{/*rainbows*/"unicorn":"cake"}'; -JSON.parse(stripJsonComments(json)); -//=> {unicorn: 'cake'} -``` - - -## API - -### stripJsonComments(input) - -#### input - -Type: `string` - -Accepts a string with JSON and returns a string without comments. - - -## CLI - -```sh -$ npm install --global strip-json-comments -``` - -```sh -$ strip-json-comments --help - -strip-json-comments input-file > output-file -# or -strip-json-comments < input-file > output-file -``` - - -## Related - -- [`strip-css-comments`](https://github.com/sindresorhus/strip-css-comments) - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/eslint/node_modules/strip-json-comments/strip-json-comments.js b/node_modules/eslint/node_modules/strip-json-comments/strip-json-comments.js deleted file mode 100644 index eb77ce7..0000000 --- a/node_modules/eslint/node_modules/strip-json-comments/strip-json-comments.js +++ /dev/null @@ -1,73 +0,0 @@ -/*! - strip-json-comments - Strip comments from JSON. Lets you use comments in your JSON files! - https://github.com/sindresorhus/strip-json-comments - by Sindre Sorhus - MIT License -*/ -(function () { - 'use strict'; - - var singleComment = 1; - var multiComment = 2; - - function stripJsonComments(str) { - var currentChar; - var nextChar; - var insideString = false; - var insideComment = false; - var ret = ''; - - for (var i = 0; i < str.length; i++) { - currentChar = str[i]; - nextChar = str[i + 1]; - - if (!insideComment && currentChar === '"') { - var escaped = str[i - 1] === '\\' && str[i - 2] !== '\\'; - if (!insideComment && !escaped && currentChar === '"') { - insideString = !insideString; - } - } - - if (insideString) { - ret += currentChar; - continue; - } - - if (!insideComment && currentChar + nextChar === '//') { - insideComment = singleComment; - i++; - } else if (insideComment === singleComment && currentChar + nextChar === '\r\n') { - insideComment = false; - i++; - ret += currentChar; - ret += nextChar; - continue; - } else if (insideComment === singleComment && currentChar === '\n') { - insideComment = false; - } else if (!insideComment && currentChar + nextChar === '/*') { - insideComment = multiComment; - i++; - continue; - } else if (insideComment === multiComment && currentChar + nextChar === '*/') { - insideComment = false; - i++; - continue; - } - - if (insideComment) { - continue; - } - - ret += currentChar; - } - - return ret; - } - - if (typeof module !== 'undefined' && module.exports) { - module.exports = stripJsonComments; - } else { - window.stripJsonComments = stripJsonComments; - } -})(); diff --git a/node_modules/eslint/node_modules/text-table/.travis.yml b/node_modules/eslint/node_modules/text-table/.travis.yml deleted file mode 100644 index cc4dba2..0000000 --- a/node_modules/eslint/node_modules/text-table/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" diff --git a/node_modules/eslint/node_modules/text-table/LICENSE b/node_modules/eslint/node_modules/text-table/LICENSE deleted file mode 100644 index ee27ba4..0000000 --- a/node_modules/eslint/node_modules/text-table/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -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. diff --git a/node_modules/eslint/node_modules/text-table/example/align.js b/node_modules/eslint/node_modules/text-table/example/align.js deleted file mode 100644 index 9be4309..0000000 --- a/node_modules/eslint/node_modules/text-table/example/align.js +++ /dev/null @@ -1,8 +0,0 @@ -var table = require('../'); -var t = table([ - [ 'beep', '1024' ], - [ 'boop', '33450' ], - [ 'foo', '1006' ], - [ 'bar', '45' ] -], { align: [ 'l', 'r' ] }); -console.log(t); diff --git a/node_modules/eslint/node_modules/text-table/example/center.js b/node_modules/eslint/node_modules/text-table/example/center.js deleted file mode 100644 index 52b1c69..0000000 --- a/node_modules/eslint/node_modules/text-table/example/center.js +++ /dev/null @@ -1,8 +0,0 @@ -var table = require('../'); -var t = table([ - [ 'beep', '1024', 'xyz' ], - [ 'boop', '3388450', 'tuv' ], - [ 'foo', '10106', 'qrstuv' ], - [ 'bar', '45', 'lmno' ] -], { align: [ 'l', 'c', 'l' ] }); -console.log(t); diff --git a/node_modules/eslint/node_modules/text-table/example/dotalign.js b/node_modules/eslint/node_modules/text-table/example/dotalign.js deleted file mode 100644 index 2cea6299..0000000 --- a/node_modules/eslint/node_modules/text-table/example/dotalign.js +++ /dev/null @@ -1,9 +0,0 @@ -var table = require('../'); -var t = table([ - [ 'beep', '1024' ], - [ 'boop', '334.212' ], - [ 'foo', '1006' ], - [ 'bar', '45.6' ], - [ 'baz', '123.' ] -], { align: [ 'l', '.' ] }); -console.log(t); diff --git a/node_modules/eslint/node_modules/text-table/example/doubledot.js b/node_modules/eslint/node_modules/text-table/example/doubledot.js deleted file mode 100644 index bab983b..0000000 --- a/node_modules/eslint/node_modules/text-table/example/doubledot.js +++ /dev/null @@ -1,11 +0,0 @@ -var table = require('../'); -var t = table([ - [ '0.1.2' ], - [ '11.22.33' ], - [ '5.6.7' ], - [ '1.22222' ], - [ '12345.' ], - [ '5555.' ], - [ '123' ] -], { align: [ '.' ] }); -console.log(t); diff --git a/node_modules/eslint/node_modules/text-table/example/table.js b/node_modules/eslint/node_modules/text-table/example/table.js deleted file mode 100644 index 903ea4c..0000000 --- a/node_modules/eslint/node_modules/text-table/example/table.js +++ /dev/null @@ -1,6 +0,0 @@ -var table = require('../'); -var t = table([ - [ 'master', '0123456789abcdef' ], - [ 'staging', 'fedcba9876543210' ] -]); -console.log(t); diff --git a/node_modules/eslint/node_modules/text-table/index.js b/node_modules/eslint/node_modules/text-table/index.js deleted file mode 100644 index 5c0ba98..0000000 --- a/node_modules/eslint/node_modules/text-table/index.js +++ /dev/null @@ -1,86 +0,0 @@ -module.exports = function (rows_, opts) { - if (!opts) opts = {}; - var hsep = opts.hsep === undefined ? ' ' : opts.hsep; - var align = opts.align || []; - var stringLength = opts.stringLength - || function (s) { return String(s).length; } - ; - - var dotsizes = reduce(rows_, function (acc, row) { - forEach(row, function (c, ix) { - var n = dotindex(c); - if (!acc[ix] || n > acc[ix]) acc[ix] = n; - }); - return acc; - }, []); - - var rows = map(rows_, function (row) { - return map(row, function (c_, ix) { - var c = String(c_); - if (align[ix] === '.') { - var index = dotindex(c); - var size = dotsizes[ix] + (/\./.test(c) ? 1 : 2) - - (stringLength(c) - index) - ; - return c + Array(size).join(' '); - } - else return c; - }); - }); - - var sizes = reduce(rows, function (acc, row) { - forEach(row, function (c, ix) { - var n = stringLength(c); - if (!acc[ix] || n > acc[ix]) acc[ix] = n; - }); - return acc; - }, []); - - return map(rows, function (row) { - return map(row, function (c, ix) { - var n = (sizes[ix] - stringLength(c)) || 0; - var s = Array(Math.max(n + 1, 1)).join(' '); - if (align[ix] === 'r' || align[ix] === '.') { - return s + c; - } - if (align[ix] === 'c') { - return Array(Math.ceil(n / 2 + 1)).join(' ') - + c + Array(Math.floor(n / 2 + 1)).join(' ') - ; - } - - return c + s; - }).join(hsep).replace(/\s+$/, ''); - }).join('\n'); -}; - -function dotindex (c) { - var m = /\.[^.]*$/.exec(c); - return m ? m.index + 1 : c.length; -} - -function reduce (xs, f, init) { - if (xs.reduce) return xs.reduce(f, init); - var i = 0; - var acc = arguments.length >= 3 ? init : xs[i++]; - for (; i < xs.length; i++) { - f(acc, xs[i], i); - } - return acc; -} - -function forEach (xs, f) { - if (xs.forEach) return xs.forEach(f); - for (var i = 0; i < xs.length; i++) { - f.call(xs, xs[i], i); - } -} - -function map (xs, f) { - if (xs.map) return xs.map(f); - var res = []; - for (var i = 0; i < xs.length; i++) { - res.push(f.call(xs, xs[i], i)); - } - return res; -} diff --git a/node_modules/eslint/node_modules/text-table/package.json b/node_modules/eslint/node_modules/text-table/package.json deleted file mode 100644 index 38707c1..0000000 --- a/node_modules/eslint/node_modules/text-table/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "text-table", - "version": "0.2.0", - "description": "borderless text tables with alignment", - "main": "index.js", - "devDependencies": { - "tap": "~0.4.0", - "tape": "~1.0.2", - "cli-color": "~0.2.3" - }, - "scripts": { - "test": "tap test/*.js" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/6..latest", - "chrome/20..latest", - "firefox/10..latest", - "safari/latest", - "opera/11.0..latest", - "iphone/6", - "ipad/6" - ] - }, - "repository": { - "type": "git", - "url": "git://github.com/substack/text-table.git" - }, - "homepage": "https://github.com/substack/text-table", - "keywords": [ - "text", - "table", - "align", - "ascii", - "rows", - "tabular" - ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "license": "MIT", - "readme": "# text-table\n\ngenerate borderless text table strings suitable for printing to stdout\n\n[![build status](https://secure.travis-ci.org/substack/text-table.png)](http://travis-ci.org/substack/text-table)\n\n[![browser support](https://ci.testling.com/substack/text-table.png)](http://ci.testling.com/substack/text-table)\n\n# example\n\n## default align\n\n``` js\nvar table = require('text-table');\nvar t = table([\n [ 'master', '0123456789abcdef' ],\n [ 'staging', 'fedcba9876543210' ]\n]);\nconsole.log(t);\n```\n\n```\nmaster 0123456789abcdef\nstaging fedcba9876543210\n```\n\n## left-right align\n\n``` js\nvar table = require('text-table');\nvar t = table([\n [ 'beep', '1024' ],\n [ 'boop', '33450' ],\n [ 'foo', '1006' ],\n [ 'bar', '45' ]\n], { align: [ 'l', 'r' ] });\nconsole.log(t);\n```\n\n```\nbeep 1024\nboop 33450\nfoo 1006\nbar 45\n```\n\n## dotted align\n\n``` js\nvar table = require('text-table');\nvar t = table([\n [ 'beep', '1024' ],\n [ 'boop', '334.212' ],\n [ 'foo', '1006' ],\n [ 'bar', '45.6' ],\n [ 'baz', '123.' ]\n], { align: [ 'l', '.' ] });\nconsole.log(t);\n```\n\n```\nbeep 1024\nboop 334.212\nfoo 1006\nbar 45.6\nbaz 123.\n```\n\n## centered\n\n``` js\nvar table = require('text-table');\nvar t = table([\n [ 'beep', '1024', 'xyz' ],\n [ 'boop', '3388450', 'tuv' ],\n [ 'foo', '10106', 'qrstuv' ],\n [ 'bar', '45', 'lmno' ]\n], { align: [ 'l', 'c', 'l' ] });\nconsole.log(t);\n```\n\n```\nbeep 1024 xyz\nboop 3388450 tuv\nfoo 10106 qrstuv\nbar 45 lmno\n```\n\n# methods\n\n``` js\nvar table = require('text-table')\n```\n\n## var s = table(rows, opts={})\n\nReturn a formatted table string `s` from an array of `rows` and some options\n`opts`.\n\n`rows` should be an array of arrays containing strings, numbers, or other\nprintable values.\n\noptions can be:\n\n* `opts.hsep` - separator to use between columns, default `' '`\n* `opts.align` - array of alignment types for each column, default `['l','l',...]`\n* `opts.stringLength` - callback function to use when calculating the string length\n\nalignment types are:\n\n* `'l'` - left\n* `'r'` - right\n* `'c'` - center\n* `'.'` - decimal\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install text-table\n```\n\n# Use with ANSI-colors\n\nSince the string length of ANSI color schemes does not equal the length\nJavaScript sees internally it is necessary to pass the a custom string length\ncalculator during the main function call.\n\nSee the `test/ansi-colors.js` file for an example.\n\n# license\n\nMIT\n", - "readmeFilename": "readme.markdown", - "bugs": { - "url": "https://github.com/substack/text-table/issues" - }, - "_id": "text-table@0.2.0", - "dist": { - "shasum": "7f5ee823ae805207c00af2df4a84ec3fcfa570b4", - "tarball": "http://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz" - }, - "_from": "text-table@>=0.2.0 <0.3.0", - "_npmVersion": "1.3.7", - "_npmUser": { - "name": "substack", - "email": "mail@substack.net" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "directories": {}, - "_shasum": "7f5ee823ae805207c00af2df4a84ec3fcfa570b4", - "_resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz" -} diff --git a/node_modules/eslint/node_modules/text-table/readme.markdown b/node_modules/eslint/node_modules/text-table/readme.markdown deleted file mode 100644 index 18806ac..0000000 --- a/node_modules/eslint/node_modules/text-table/readme.markdown +++ /dev/null @@ -1,134 +0,0 @@ -# text-table - -generate borderless text table strings suitable for printing to stdout - -[![build status](https://secure.travis-ci.org/substack/text-table.png)](http://travis-ci.org/substack/text-table) - -[![browser support](https://ci.testling.com/substack/text-table.png)](http://ci.testling.com/substack/text-table) - -# example - -## default align - -``` js -var table = require('text-table'); -var t = table([ - [ 'master', '0123456789abcdef' ], - [ 'staging', 'fedcba9876543210' ] -]); -console.log(t); -``` - -``` -master 0123456789abcdef -staging fedcba9876543210 -``` - -## left-right align - -``` js -var table = require('text-table'); -var t = table([ - [ 'beep', '1024' ], - [ 'boop', '33450' ], - [ 'foo', '1006' ], - [ 'bar', '45' ] -], { align: [ 'l', 'r' ] }); -console.log(t); -``` - -``` -beep 1024 -boop 33450 -foo 1006 -bar 45 -``` - -## dotted align - -``` js -var table = require('text-table'); -var t = table([ - [ 'beep', '1024' ], - [ 'boop', '334.212' ], - [ 'foo', '1006' ], - [ 'bar', '45.6' ], - [ 'baz', '123.' ] -], { align: [ 'l', '.' ] }); -console.log(t); -``` - -``` -beep 1024 -boop 334.212 -foo 1006 -bar 45.6 -baz 123. -``` - -## centered - -``` js -var table = require('text-table'); -var t = table([ - [ 'beep', '1024', 'xyz' ], - [ 'boop', '3388450', 'tuv' ], - [ 'foo', '10106', 'qrstuv' ], - [ 'bar', '45', 'lmno' ] -], { align: [ 'l', 'c', 'l' ] }); -console.log(t); -``` - -``` -beep 1024 xyz -boop 3388450 tuv -foo 10106 qrstuv -bar 45 lmno -``` - -# methods - -``` js -var table = require('text-table') -``` - -## var s = table(rows, opts={}) - -Return a formatted table string `s` from an array of `rows` and some options -`opts`. - -`rows` should be an array of arrays containing strings, numbers, or other -printable values. - -options can be: - -* `opts.hsep` - separator to use between columns, default `' '` -* `opts.align` - array of alignment types for each column, default `['l','l',...]` -* `opts.stringLength` - callback function to use when calculating the string length - -alignment types are: - -* `'l'` - left -* `'r'` - right -* `'c'` - center -* `'.'` - decimal - -# install - -With [npm](https://npmjs.org) do: - -``` -npm install text-table -``` - -# Use with ANSI-colors - -Since the string length of ANSI color schemes does not equal the length -JavaScript sees internally it is necessary to pass the a custom string length -calculator during the main function call. - -See the `test/ansi-colors.js` file for an example. - -# license - -MIT diff --git a/node_modules/eslint/node_modules/text-table/test/align.js b/node_modules/eslint/node_modules/text-table/test/align.js deleted file mode 100644 index 245357f..0000000 --- a/node_modules/eslint/node_modules/text-table/test/align.js +++ /dev/null @@ -1,18 +0,0 @@ -var test = require('tape'); -var table = require('../'); - -test('align', function (t) { - t.plan(1); - var s = table([ - [ 'beep', '1024' ], - [ 'boop', '33450' ], - [ 'foo', '1006' ], - [ 'bar', '45' ] - ], { align: [ 'l', 'r' ] }); - t.equal(s, [ - 'beep 1024', - 'boop 33450', - 'foo 1006', - 'bar 45' - ].join('\n')); -}); diff --git a/node_modules/eslint/node_modules/text-table/test/ansi-colors.js b/node_modules/eslint/node_modules/text-table/test/ansi-colors.js deleted file mode 100644 index fbc5bb1..0000000 --- a/node_modules/eslint/node_modules/text-table/test/ansi-colors.js +++ /dev/null @@ -1,32 +0,0 @@ -var test = require('tape'); -var table = require('../'); -var color = require('cli-color'); -var ansiTrim = require('cli-color/lib/trim'); - -test('center', function (t) { - t.plan(1); - var opts = { - align: [ 'l', 'c', 'l' ], - stringLength: function(s) { return ansiTrim(s).length } - }; - var s = table([ - [ - color.red('Red'), color.green('Green'), color.blue('Blue') - ], - [ - color.bold('Bold'), color.underline('Underline'), - color.italic('Italic') - ], - [ - color.inverse('Inverse'), color.strike('Strike'), - color.blink('Blink') - ], - [ 'bar', '45', 'lmno' ] - ], opts); - t.equal(ansiTrim(s), [ - 'Red Green Blue', - 'Bold Underline Italic', - 'Inverse Strike Blink', - 'bar 45 lmno' - ].join('\n')); -}); diff --git a/node_modules/eslint/node_modules/text-table/test/center.js b/node_modules/eslint/node_modules/text-table/test/center.js deleted file mode 100644 index c2c7a62..0000000 --- a/node_modules/eslint/node_modules/text-table/test/center.js +++ /dev/null @@ -1,18 +0,0 @@ -var test = require('tape'); -var table = require('../'); - -test('center', function (t) { - t.plan(1); - var s = table([ - [ 'beep', '1024', 'xyz' ], - [ 'boop', '3388450', 'tuv' ], - [ 'foo', '10106', 'qrstuv' ], - [ 'bar', '45', 'lmno' ] - ], { align: [ 'l', 'c', 'l' ] }); - t.equal(s, [ - 'beep 1024 xyz', - 'boop 3388450 tuv', - 'foo 10106 qrstuv', - 'bar 45 lmno' - ].join('\n')); -}); diff --git a/node_modules/eslint/node_modules/text-table/test/dotalign.js b/node_modules/eslint/node_modules/text-table/test/dotalign.js deleted file mode 100644 index f804f92..0000000 --- a/node_modules/eslint/node_modules/text-table/test/dotalign.js +++ /dev/null @@ -1,20 +0,0 @@ -var test = require('tape'); -var table = require('../'); - -test('dot align', function (t) { - t.plan(1); - var s = table([ - [ 'beep', '1024' ], - [ 'boop', '334.212' ], - [ 'foo', '1006' ], - [ 'bar', '45.6' ], - [ 'baz', '123.' ] - ], { align: [ 'l', '.' ] }); - t.equal(s, [ - 'beep 1024', - 'boop 334.212', - 'foo 1006', - 'bar 45.6', - 'baz 123.' - ].join('\n')); -}); diff --git a/node_modules/eslint/node_modules/text-table/test/doubledot.js b/node_modules/eslint/node_modules/text-table/test/doubledot.js deleted file mode 100644 index 659b57c..0000000 --- a/node_modules/eslint/node_modules/text-table/test/doubledot.js +++ /dev/null @@ -1,24 +0,0 @@ -var test = require('tape'); -var table = require('../'); - -test('dot align', function (t) { - t.plan(1); - var s = table([ - [ '0.1.2' ], - [ '11.22.33' ], - [ '5.6.7' ], - [ '1.22222' ], - [ '12345.' ], - [ '5555.' ], - [ '123' ] - ], { align: [ '.' ] }); - t.equal(s, [ - ' 0.1.2', - '11.22.33', - ' 5.6.7', - ' 1.22222', - '12345.', - ' 5555.', - ' 123' - ].join('\n')); -}); diff --git a/node_modules/eslint/node_modules/text-table/test/table.js b/node_modules/eslint/node_modules/text-table/test/table.js deleted file mode 100644 index 9c67014..0000000 --- a/node_modules/eslint/node_modules/text-table/test/table.js +++ /dev/null @@ -1,14 +0,0 @@ -var test = require('tape'); -var table = require('../'); - -test('table', function (t) { - t.plan(1); - var s = table([ - [ 'master', '0123456789abcdef' ], - [ 'staging', 'fedcba9876543210' ] - ]); - t.equal(s, [ - 'master 0123456789abcdef', - 'staging fedcba9876543210' - ].join('\n')); -}); diff --git a/node_modules/eslint/node_modules/user-home/index.js b/node_modules/eslint/node_modules/user-home/index.js deleted file mode 100644 index fdff721..0000000 --- a/node_modules/eslint/node_modules/user-home/index.js +++ /dev/null @@ -1,2 +0,0 @@ -'use strict'; -module.exports = require('os-homedir')(); diff --git a/node_modules/eslint/node_modules/user-home/license b/node_modules/eslint/node_modules/user-home/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/eslint/node_modules/user-home/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/eslint/node_modules/user-home/node_modules/os-homedir/index.js b/node_modules/eslint/node_modules/user-home/node_modules/os-homedir/index.js deleted file mode 100644 index 3306616..0000000 --- a/node_modules/eslint/node_modules/user-home/node_modules/os-homedir/index.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; -var os = require('os'); - -function homedir() { - var env = process.env; - var home = env.HOME; - var user = env.LOGNAME || env.USER || env.LNAME || env.USERNAME; - - if (process.platform === 'win32') { - return env.USERPROFILE || env.HOMEDRIVE + env.HOMEPATH || home || null; - } - - if (process.platform === 'darwin') { - return home || (user ? '/Users/' + user : null); - } - - if (process.platform === 'linux') { - return home || (process.getuid() === 0 ? '/root' : (user ? '/home/' + user : null)); - } - - return home || null; -} - -module.exports = typeof os.homedir === 'function' ? os.homedir : homedir; diff --git a/node_modules/eslint/node_modules/user-home/node_modules/os-homedir/license b/node_modules/eslint/node_modules/user-home/node_modules/os-homedir/license deleted file mode 100644 index 654d0bf..0000000 --- a/node_modules/eslint/node_modules/user-home/node_modules/os-homedir/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (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. diff --git a/node_modules/eslint/node_modules/user-home/node_modules/os-homedir/package.json b/node_modules/eslint/node_modules/user-home/node_modules/os-homedir/package.json deleted file mode 100644 index 37698c4..0000000 --- a/node_modules/eslint/node_modules/user-home/node_modules/os-homedir/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "os-homedir", - "version": "1.0.1", - "description": "io.js 2.3.0 os.homedir() ponyfill", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/os-homedir.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "node test.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "built-in", - "core", - "ponyfill", - "polyfill", - "shim", - "os", - "homedir", - "home", - "dir", - "directory", - "folder", - "user", - "path" - ], - "devDependencies": { - "ava": "0.0.4", - "path-exists": "^1.0.0" - }, - "gitHead": "13ff83fbd13ebe286a6092286b2c634ab4534c5f", - "bugs": { - "url": "https://github.com/sindresorhus/os-homedir/issues" - }, - "homepage": "https://github.com/sindresorhus/os-homedir", - "_id": "os-homedir@1.0.1", - "_shasum": "0d62bdf44b916fd3bbdcf2cab191948fb094f007", - "_from": "os-homedir@>=1.0.0 <2.0.0", - "_npmVersion": "2.11.2", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "0d62bdf44b916fd3bbdcf2cab191948fb094f007", - "tarball": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/user-home/node_modules/os-homedir/readme.md b/node_modules/eslint/node_modules/user-home/node_modules/os-homedir/readme.md deleted file mode 100644 index 4851f10..0000000 --- a/node_modules/eslint/node_modules/user-home/node_modules/os-homedir/readme.md +++ /dev/null @@ -1,33 +0,0 @@ -# os-homedir [![Build Status](https://travis-ci.org/sindresorhus/os-homedir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-homedir) - -> io.js 2.3.0 [`os.homedir()`](https://iojs.org/api/os.html#os_os_homedir) ponyfill - -> Ponyfill: A polyfill that doesn't overwrite the native method - - -## Install - -``` -$ npm install --save os-homedir -``` - - -## Usage - -```js -var osHomedir = require('os-homedir'); - -console.log(osHomedir()); -//=> /Users/sindresorhus -``` - - -## Related - -- [user-home](https://github.com/sindresorhus/user-home) - Same as this module but caches the result -- [home-or-tmp](https://github.com/sindresorhus/home-or-tmp) - Get the user home directory with fallback to the system temp directory - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/eslint/node_modules/user-home/package.json b/node_modules/eslint/node_modules/user-home/package.json deleted file mode 100644 index c1942e1..0000000 --- a/node_modules/eslint/node_modules/user-home/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "user-home", - "version": "2.0.0", - "description": "Get the path to the user home directory", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/user-home.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "node test.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "user", - "home", - "homedir", - "os-homedir", - "dir", - "directory", - "folder", - "path", - "env", - "vars", - "environment", - "variables", - "userprofile" - ], - "dependencies": { - "os-homedir": "^1.0.0" - }, - "devDependencies": { - "ava": "0.0.4", - "path-exists": "^1.0.0" - }, - "gitHead": "23e6d1e2dd553b599c787348f82bd2463225cc80", - "bugs": { - "url": "https://github.com/sindresorhus/user-home/issues" - }, - "homepage": "https://github.com/sindresorhus/user-home", - "_id": "user-home@2.0.0", - "_shasum": "9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f", - "_from": "user-home@>=2.0.0 <3.0.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "0.12.4", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f", - "tarball": "http://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/user-home/readme.md b/node_modules/eslint/node_modules/user-home/readme.md deleted file mode 100644 index 944188c..0000000 --- a/node_modules/eslint/node_modules/user-home/readme.md +++ /dev/null @@ -1,33 +0,0 @@ -# user-home [![Build Status](https://travis-ci.org/sindresorhus/user-home.svg?branch=master)](https://travis-ci.org/sindresorhus/user-home) - -> Get the path to the user home directory - - -## Install - -``` -$ npm install --save user-home -``` - - -## Usage - -```js -var userHome = require('user-home'); - -console.log(userHome); -//=> '/Users/sindresorhus' -``` - -Returns `null` in the unlikely scenario that the home directory can't be found. - - -## Related - -- [user-home-cli](https://github.com/sindresorhus/user-home-cli) - CLI for this module -- [home-or-tmp](https://github.com/sindresorhus/home-or-tmp) - Get the user home directory with fallback to the system temp directory - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/node_modules/eslint/node_modules/xml-escape/.npmignore b/node_modules/eslint/node_modules/xml-escape/.npmignore deleted file mode 100644 index a72b52e..0000000 --- a/node_modules/eslint/node_modules/xml-escape/.npmignore +++ /dev/null @@ -1,15 +0,0 @@ -lib-cov -*.seed -*.log -*.csv -*.dat -*.out -*.pid -*.gz - -pids -logs -results - -npm-debug.log -node_modules diff --git a/node_modules/eslint/node_modules/xml-escape/LICENSE b/node_modules/eslint/node_modules/xml-escape/LICENSE deleted file mode 100644 index bd261ef..0000000 --- a/node_modules/eslint/node_modules/xml-escape/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Michael Hernandez - -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. diff --git a/node_modules/eslint/node_modules/xml-escape/README.md b/node_modules/eslint/node_modules/xml-escape/README.md deleted file mode 100644 index db55ce8..0000000 --- a/node_modules/eslint/node_modules/xml-escape/README.md +++ /dev/null @@ -1,15 +0,0 @@ -xml-escape -========== - -Escape XML in javascript (NodeJS) - - -npm install xml-escape - -// Warning escape is a reserved word, so maybe best to use xmlescape for var name -var xmlescape = require('xml-escape'); - -xmlescape('"hello" \'world\' & false < true > -1') - -// output -// '"hello" 'world' & true < false > -1' \ No newline at end of file diff --git a/node_modules/eslint/node_modules/xml-escape/index.js b/node_modules/eslint/node_modules/xml-escape/index.js deleted file mode 100644 index d26715d..0000000 --- a/node_modules/eslint/node_modules/xml-escape/index.js +++ /dev/null @@ -1,15 +0,0 @@ - - -var escape = module.exports = function escape(string) { - return string.replace(/([&"<>'])/g, function(str, item) { - return escape.map[item]; - }) -} - -var map = escape.map = { - '>': '>' - , '<': '<' - , "'": ''' - , '"': '"' - , '&': '&' -} \ No newline at end of file diff --git a/node_modules/eslint/node_modules/xml-escape/package.json b/node_modules/eslint/node_modules/xml-escape/package.json deleted file mode 100644 index 4641279..0000000 --- a/node_modules/eslint/node_modules/xml-escape/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "xml-escape", - "version": "1.0.0", - "description": "Escape XML ", - "main": "index.js", - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/miketheprogrammer/xml-escape.git" - }, - "keywords": [ - "Escape", - "XML", - "Unesacpe", - "encoding", - "xml-escape" - ], - "author": { - "name": "Michael Hernandez - michael.hernandez1988@gmail.com" - }, - "license": "MIT License", - "bugs": { - "url": "https://github.com/miketheprogrammer/xml-escape/issues" - }, - "homepage": "https://github.com/miketheprogrammer/xml-escape", - "dependencies": {}, - "devDependencies": { - "tape": "~2.4.2" - }, - "_id": "xml-escape@1.0.0", - "dist": { - "shasum": "00963d697b2adf0c185c4e04e73174ba9b288eb2", - "tarball": "http://registry.npmjs.org/xml-escape/-/xml-escape-1.0.0.tgz" - }, - "_from": "xml-escape@>=1.0.0 <1.1.0", - "_npmVersion": "1.3.14", - "_npmUser": { - "name": "mhernandez", - "email": "michael.hernandez1988@gmail.com" - }, - "maintainers": [ - { - "name": "mhernandez", - "email": "michael.hernandez1988@gmail.com" - } - ], - "directories": {}, - "_shasum": "00963d697b2adf0c185c4e04e73174ba9b288eb2", - "_resolved": "https://registry.npmjs.org/xml-escape/-/xml-escape-1.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/eslint/node_modules/xml-escape/test.js b/node_modules/eslint/node_modules/xml-escape/test.js deleted file mode 100644 index 211c3b8..0000000 --- a/node_modules/eslint/node_modules/xml-escape/test.js +++ /dev/null @@ -1,7 +0,0 @@ -var test = require('tape'); -var escape = require('./index'); -test("Characters should be escaped properly", function (t) { - t.plan(1); - - t.equals(escape('" \' < > &'), '" ' < > &'); -}) \ No newline at end of file diff --git a/node_modules/eslint/package.json b/node_modules/eslint/package.json deleted file mode 100644 index 1556b13..0000000 --- a/node_modules/eslint/package.json +++ /dev/null @@ -1,144 +0,0 @@ -{ - "name": "eslint", - "version": "1.10.3", - "author": { - "name": "Nicholas C. Zakas", - "email": "nicholas+npm@nczconsulting.com" - }, - "description": "An AST-based pattern checker for JavaScript.", - "bin": { - "eslint": "./bin/eslint.js" - }, - "main": "./lib/api.js", - "scripts": { - "test": "node Makefile.js test", - "lint": "node Makefile.js lint", - "patch": "node Makefile.js patch", - "minor": "node Makefile.js minor", - "major": "node Makefile.js major", - "docs": "node Makefile.js docs", - "gensite": "node Makefile.js gensite", - "browserify": "node Makefile.js browserify", - "perf": "node Makefile.js perf", - "profile": "beefy tests/bench/bench.js --open -- -t brfs -t ./tests/bench/xform-rules.js -r espree", - "coveralls": "cat ./coverage/lcov.info | coveralls", - "check-commit": "node Makefile.js checkGitCommit" - }, - "files": [ - "LICENSE", - "README.md", - "bin", - "conf", - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/eslint/eslint.git" - }, - "homepage": "http://eslint.org", - "bugs": { - "url": "https://github.com/eslint/eslint/issues/" - }, - "dependencies": { - "chalk": "^1.0.0", - "concat-stream": "^1.4.6", - "debug": "^2.1.1", - "doctrine": "^0.7.1", - "escape-string-regexp": "^1.0.2", - "escope": "^3.3.0", - "espree": "^2.2.4", - "estraverse": "^4.1.1", - "estraverse-fb": "^1.3.1", - "esutils": "^2.0.2", - "file-entry-cache": "^1.1.1", - "glob": "^5.0.14", - "globals": "^8.11.0", - "handlebars": "^4.0.0", - "inquirer": "^0.11.0", - "is-my-json-valid": "^2.10.0", - "is-resolvable": "^1.0.0", - "js-yaml": "3.4.5", - "json-stable-stringify": "^1.0.0", - "lodash.clonedeep": "^3.0.1", - "lodash.merge": "^3.3.2", - "lodash.omit": "^3.1.0", - "minimatch": "^3.0.0", - "mkdirp": "^0.5.0", - "object-assign": "^4.0.1", - "optionator": "^0.6.0", - "path-is-absolute": "^1.0.0", - "path-is-inside": "^1.0.1", - "shelljs": "^0.5.3", - "strip-json-comments": "~1.0.1", - "text-table": "~0.2.0", - "user-home": "^2.0.0", - "xml-escape": "~1.0.0" - }, - "devDependencies": { - "beefy": "^1.0.0", - "brfs": "0.0.9", - "browserify": "^12.0.1", - "chai": "^3.4.0", - "cheerio": "^0.19.0", - "coveralls": "2.11.4", - "dateformat": "^1.0.8", - "ejs": "^2.3.3", - "esprima": "^2.4.1", - "esprima-fb": "^15001.1001.0-dev-harmony-fb", - "gh-got": "^2.2.0", - "istanbul": "^0.4.0", - "jsdoc": "^3.3.0-beta1", - "jsonlint": "^1.6.2", - "leche": "^2.1.1", - "linefix": "^0.1.1", - "load-perf": "^0.2.0", - "markdownlint": "^0.0.8", - "mocha": "^2.1.0", - "mocha-phantomjs": "4.0.1", - "npm-license": "^0.3.1", - "phantomjs": "1.9.18", - "proxyquire": "^1.0.0", - "rewire": "^2.3.4", - "semver": "^5.0.3", - "shelljs-nodecli": "~0.1.0", - "sinon": "1.17.2", - "through": "^2.3.6" - }, - "keywords": [ - "ast", - "lint", - "javascript", - "ecmascript", - "espree" - ], - "license": "MIT", - "engines": { - "node": ">=0.10" - }, - "gitHead": "2436cc6c1816a7890e35dab38e609daee84d7530", - "_id": "eslint@1.10.3", - "_shasum": "fb19a91b13c158082bbca294b17d979bc8353a0a", - "_from": "eslint@>=1.0.0", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "nzakas", - "email": "nicholas@nczconsulting.com" - }, - "maintainers": [ - { - "name": "nzakas", - "email": "nicholas@nczconsulting.com" - }, - { - "name": "ivolodin", - "email": "ivolodin@gmail.com" - } - ], - "dist": { - "shasum": "fb19a91b13c158082bbca294b17d979bc8353a0a", - "tarball": "http://registry.npmjs.org/eslint/-/eslint-1.10.3.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/eslint/-/eslint-1.10.3.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/package.json b/package.json index 3e3c4a9..a567bb4 100644 --- a/package.json +++ b/package.json @@ -7,9 +7,8 @@ "staging": "meteor deploy staging.meteor.com --settings settings-development.json", "production": "meteor deploy production.meteor.com --settings settings-production.json" }, - "devDependencies": { - "eslint": "^1.10.3", - "eslint-config-airbnb": "^5.0.0", - "eslint-plugin-react": "^3.16.1" + "devDependencies": {}, + "dependencies": { + "lodash": "^4.5.1" } } diff --git a/private/email-templates/.gitkeep b/private/email-templates/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/private/email/templates/.gitkeep b/private/email/templates/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/server/accounts-email-templates.js b/server/accounts-email-templates.js deleted file mode 100644 index 1505728..0000000 --- a/server/accounts-email-templates.js +++ /dev/null @@ -1,21 +0,0 @@ -let settings = Meteor.settings.public.application, - name = settings.name, - email = settings.supportEmail, - emailTemplates = Accounts.emailTemplates; - -emailTemplates.siteName = name; -emailTemplates.from = `${ name } <${ email }>`; - -emailTemplates.resetPassword = { - subject() { - return `[${ name }] Reset Your Password`; - }, - text( user, url ) { - let emailAddress = user.emails[0].address, - urlWithoutHash = url.replace( '#/', '' ), - supportEmail = "support@application.com", - emailBody = `A password reset has been requested for the account related to this address (${emailAddress}). To reset the password, visit the following link:\n\n${urlWithoutHash}\n\n If you did not request this reset, please ignore this email. If you feel something is wrong, please contact our support team: ${supportEmail}.`; - - return emailBody; - } -}; diff --git a/server/accounts/email-templates.js b/server/accounts/email-templates.js new file mode 100644 index 0000000..48ce25f --- /dev/null +++ b/server/accounts/email-templates.js @@ -0,0 +1,21 @@ +let settings = Meteor.settings.public.application, + name = settings.name, + email = settings.supportEmail, + emailTemplates = Accounts.emailTemplates; + +emailTemplates.siteName = name; +emailTemplates.from = `${ name } <${ email }>`; + +emailTemplates.resetPassword = { + subject() { + return `[${ name }] Reset Your Password`; + }, + text( user, url ) { + let emailAddress = user.emails[ 0 ].address, + urlWithoutHash = url.replace( '#/', '' ), + supportEmail = 'support@application.com', + emailBody = `A password reset has been requested for the account related to this address (${emailAddress}). To reset the password, visit the following link:\n\n${urlWithoutHash}\n\n If you did not request this reset, please ignore this email. If you feel something is wrong, please contact our support team: ${supportEmail}.`; + + return emailBody; + } +}; diff --git a/server/methods/remove/collection-name.js b/server/methods/remove/collection-name.js index 78ee489..16de84e 100644 --- a/server/methods/remove/collection-name.js +++ b/server/methods/remove/collection-name.js @@ -1,5 +1,5 @@ Meteor.methods({ - removeServerOnly( argument ) { + removeServerOnly( documentId ) { check( documentId, String ); try { diff --git a/server/methods/update/collection-name.js b/server/methods/update/collection-name.js index a5e7cdf..35abd26 100644 --- a/server/methods/update/collection-name.js +++ b/server/methods/update/collection-name.js @@ -3,9 +3,7 @@ Meteor.methods({ check( update, String ); try { - return Documents.update( update._id, { - $set: update - }); + return Documents.update( update._id, { $set: update } ); } catch ( exception ) { throw new Meteor.Error( '500', `${ exception }` ); } diff --git a/server/modules/seed-database.js b/server/modules/seed-database.js index 59a8b14..0c89104 100644 --- a/server/modules/seed-database.js +++ b/server/modules/seed-database.js @@ -1,10 +1,19 @@ -import { Seed } from '../seeder'; +import seed from 'meteor/themeteorchef:seeder'; -export function seedDatabase() { - Seed( 'users', { +let _seedUsers = () => { + seed( 'users', { + environments: [ 'development', 'staging', 'production' ], data: [{ email: 'admin@admin.com', - password: 'password' + password: 'password', + profile: { + name: { first: 'Carl', last: 'Winslow' } + }, + roles: [ 'admin' ] }] }); +}; + +export default function() { + _seedUsers(); } diff --git a/server/modules/set-browser-policies.js b/server/modules/set-browser-policies.js index 7122ad2..287748c 100644 --- a/server/modules/set-browser-policies.js +++ b/server/modules/set-browser-policies.js @@ -1,3 +1,3 @@ -export function setBrowserPolicies() { +export default function() { // e.g. BrowserPolicy.content.allowOriginForAll( '*.website.com' ); } diff --git a/server/modules/startup.js b/server/modules/startup.js deleted file mode 100644 index eca6511..0000000 --- a/server/modules/startup.js +++ /dev/null @@ -1,7 +0,0 @@ -import { setBrowserPolicies } from './set-browser-policies'; -import { seedDatabase } from './seed-database'; - -export function startup() { - setBrowserPolicies(); - seedDatabase(); -} diff --git a/server/publications/index.js b/server/publications/index.js new file mode 100644 index 0000000..f8fa5ee --- /dev/null +++ b/server/publications/index.js @@ -0,0 +1,3 @@ +Meteor.publish( 'index', function() { + return Documents.find(); +}); diff --git a/server/publications/publication.js b/server/publications/publication.js deleted file mode 100644 index 4afc51d..0000000 --- a/server/publications/publication.js +++ /dev/null @@ -1,3 +0,0 @@ -Meteor.publish( 'publication', function() { - return Collection.find( { 'owner': this.userId }, { fields: { 'owner': 1 } } ); -}); diff --git a/server/seeder.js b/server/seeder.js deleted file mode 100644 index c273246..0000000 --- a/server/seeder.js +++ /dev/null @@ -1,93 +0,0 @@ -class Seeder { - constructor( collection, options ) { - if ( !collection || !options ) { - throw new Error( 'Please supply a collection to seed and options for seeding. Usage: Seed( collectionName, options ).' ); - } else { - this.collection = this.getCollection( collection ); - this.options = options; - - if ( typeof this.collection !== 'undefined' ) { - this.seed(); - } else { - throw new Error( `Sorry, couldn't find the collection "${ collection }" to seed!` ); - } - } - } - - getCollection( collection ) { - let collectionName = this.sanitizeCollectionName( collection ); - return collectionName === 'Users' ? Meteor.users : global[ collectionName ]; - } - - sanitizeCollectionName( collection ) { - return collection[ 0 ].toUpperCase() + collection.slice( 1 ); - } - - seed() { - let options = this.options, - data = options.data, - model = options.model; - - if ( data && !model ) { this.sow( data ); } - if ( model && !data ) { this.sow( model ); } - - if ( options.data && options.model ) { - throw new Error( `Please choose to seed from either a data collection or a model. Cannot do both!` ); - } - } - - sow( data ) { - let isDataArray = data instanceof Array, - loopLength = isDataArray ? data.length : this.options.min, - hasData = this.checkForExistingData(), - collectionName = this.collection._name, - isUsers = collectionName === 'users', - environmentAllowed = this.environmentAllowed(); - - if ( !hasData && environmentAllowed ) { - for ( let i = 0; i < loopLength; i++ ) { - let value = isDataArray ? data[ i ] : data( i ); - - if ( isUsers ) { - this.createUser( value ); - } else { - this.collection.insert( value ); - } - } - } - } - - checkForExistingData() { - let existingCount = this.collection.find().count(); - return this.options.min ? existingCount >= this.options.min : existingCount > 0; - } - - environmentAllowed() { - let environments = this.options.environments; - - if ( environments ) { - return environments.indexOf( process.env.NODE_ENV ) > -1; - } else { - return true; - } - } - - createUser( user ) { - let isExistingUser = Meteor.users.findOne( { 'emails.address': user.email } ); - if ( !isExistingUser ) { - let userId = Accounts.createUser({ - email: user.email, - password: user.password, - profile: user.profile || {} - }); - - if ( user.roles && Roles !== 'undefined' ) { - Roles.addUsersToRoles( userId, user.roles ); - } - } - } -} - -export function Seed( collection, options ) { - return new Seeder( collection, options ); -} diff --git a/server/startup.js b/server/startup.js index 2808e80..7555081 100644 --- a/server/startup.js +++ b/server/startup.js @@ -1,3 +1,7 @@ -import { startup } from './modules/startup'; +import setBrowserPolicies from './modules/set-browser-policies'; +import seedDatabase from './modules/seed-database'; -Meteor.startup( () => startup() ); +Meteor.startup( () => { + setBrowserPolicies(); + seedDatabase(); +});