mirror of
https://kevinblog.sytes.net/Code/Jibo-Revival-Group/RoboCommander.git
synced 2026-06-15 12:06:04 +00:00
Initial commit
This commit is contained in:
20
node_modules/espurify/MIT-LICENSE.txt
generated
vendored
Normal file
20
node_modules/espurify/MIT-LICENSE.txt
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
Copyright (c) 2014-2018 Takuto Wada, https://github.com/estools/espurify
|
||||
|
||||
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.
|
||||
1612
node_modules/espurify/build/espurify.js
generated
vendored
Normal file
1612
node_modules/espurify/build/espurify.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
22
node_modules/espurify/index.js
generated
vendored
Normal file
22
node_modules/espurify/index.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* espurify - Clone new AST without extra properties
|
||||
*
|
||||
* https://github.com/estools/espurify
|
||||
*
|
||||
* Copyright (c) 2014-2018 Takuto Wada
|
||||
* Licensed under the MIT license.
|
||||
* https://github.com/estools/espurify/blob/master/MIT-LICENSE.txt
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var createWhitelist = require('./lib/create-whitelist');
|
||||
var cloneWithWhitelist = require('./lib/clone-ast');
|
||||
|
||||
function createCloneFunction (options) {
|
||||
return cloneWithWhitelist(createWhitelist(options));
|
||||
}
|
||||
|
||||
var espurify = createCloneFunction();
|
||||
espurify.customize = createCloneFunction;
|
||||
espurify.cloneWithWhitelist = cloneWithWhitelist;
|
||||
module.exports = espurify;
|
||||
68
node_modules/espurify/lib/ast-properties.js
generated
vendored
Normal file
68
node_modules/espurify/lib/ast-properties.js
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
module.exports = {
|
||||
ArrayExpression: ['type', 'elements'],
|
||||
ArrayPattern: ['type', 'elements'],
|
||||
ArrowFunctionExpression: ['type', 'id', 'params', 'body', 'generator', 'expression', 'async'],
|
||||
AssignmentExpression: ['type', 'operator', 'left', 'right'],
|
||||
AssignmentPattern: ['type', 'left', 'right'],
|
||||
AwaitExpression: ['type', 'argument'],
|
||||
BinaryExpression: ['type', 'operator', 'left', 'right'],
|
||||
BlockStatement: ['type', 'body'],
|
||||
BreakStatement: ['type', 'label'],
|
||||
CallExpression: ['type', 'callee', 'arguments'],
|
||||
CatchClause: ['type', 'param', 'guard', 'body'],
|
||||
ClassBody: ['type', 'body'],
|
||||
ClassDeclaration: ['type', 'id', 'superClass', 'body'],
|
||||
ClassExpression: ['type', 'id', 'superClass', 'body'],
|
||||
ConditionalExpression: ['type', 'test', 'consequent', 'alternate'],
|
||||
ContinueStatement: ['type', 'label'],
|
||||
DebuggerStatement: ['type'],
|
||||
DoWhileStatement: ['type', 'body', 'test'],
|
||||
EmptyStatement: ['type'],
|
||||
ExportAllDeclaration: ['type', 'source'],
|
||||
ExportDefaultDeclaration: ['type', 'declaration'],
|
||||
ExportNamedDeclaration: ['type', 'declaration', 'specifiers', 'source'],
|
||||
ExportSpecifier: ['type', 'exported', 'local'],
|
||||
ExpressionStatement: ['type', 'expression'],
|
||||
ForInStatement: ['type', 'left', 'right', 'body'],
|
||||
ForOfStatement: ['type', 'left', 'right', 'body', 'await'],
|
||||
ForStatement: ['type', 'init', 'test', 'update', 'body'],
|
||||
FunctionDeclaration: ['type', 'id', 'params', 'body', 'generator', 'async'],
|
||||
FunctionExpression: ['type', 'id', 'params', 'body', 'generator', 'async'],
|
||||
Identifier: ['type', 'name'],
|
||||
IfStatement: ['type', 'test', 'consequent', 'alternate'],
|
||||
ImportDeclaration: ['type', 'specifiers', 'source'],
|
||||
ImportDefaultSpecifier: ['type', 'local'],
|
||||
ImportNamespaceSpecifier: ['type', 'local'],
|
||||
ImportSpecifier: ['type', 'imported', 'local'],
|
||||
LabeledStatement: ['type', 'label', 'body'],
|
||||
Literal: ['type', 'value', 'regex'],
|
||||
LogicalExpression: ['type', 'operator', 'left', 'right'],
|
||||
MemberExpression: ['type', 'object', 'property', 'computed'],
|
||||
MetaProperty: ['type', 'meta', 'property'],
|
||||
MethodDefinition: ['type', 'key', 'value', 'kind', 'computed', 'static'],
|
||||
NewExpression: ['type', 'callee', 'arguments'],
|
||||
ObjectExpression: ['type', 'properties'],
|
||||
ObjectPattern: ['type', 'properties'],
|
||||
Program: ['type', 'body', 'sourceType'],
|
||||
Property: ['type', 'key', 'value', 'kind', 'method', 'shorthand', 'computed'],
|
||||
RestElement: ['type', 'argument'],
|
||||
ReturnStatement: ['type', 'argument'],
|
||||
SequenceExpression: ['type', 'expressions'],
|
||||
SpreadElement: ['type', 'argument'],
|
||||
Super: ['type'],
|
||||
SwitchCase: ['type', 'test', 'consequent'],
|
||||
SwitchStatement: ['type', 'discriminant', 'cases', 'lexical'],
|
||||
TaggedTemplateExpression: ['type', 'tag', 'quasi'],
|
||||
TemplateElement: ['type', 'tail', 'value'],
|
||||
TemplateLiteral: ['type', 'quasis', 'expressions'],
|
||||
ThisExpression: ['type'],
|
||||
ThrowStatement: ['type', 'argument'],
|
||||
TryStatement: ['type', 'block', 'handler', 'finalizer'],
|
||||
UnaryExpression: ['type', 'operator', 'prefix', 'argument'],
|
||||
UpdateExpression: ['type', 'operator', 'argument', 'prefix'],
|
||||
VariableDeclaration: ['type', 'declarations', 'kind'],
|
||||
VariableDeclarator: ['type', 'id', 'init'],
|
||||
WhileStatement: ['type', 'test', 'body'],
|
||||
WithStatement: ['type', 'object', 'body'],
|
||||
YieldExpression: ['type', 'argument', 'delegate']
|
||||
};
|
||||
84
node_modules/espurify/lib/clone-ast.js
generated
vendored
Normal file
84
node_modules/espurify/lib/clone-ast.js
generated
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
'use strict';
|
||||
|
||||
var isArray = require('core-js/library/fn/array/is-array');
|
||||
var objectKeys = require('core-js/library/fn/object/keys');
|
||||
var indexOf = require('core-js/library/fn/array/index-of');
|
||||
var Map = require('core-js/library/fn/map');
|
||||
var reduce = require('core-js/library/fn/array/reduce');
|
||||
|
||||
module.exports = function cloneWithWhitelist (astWhiteList) {
|
||||
var whitelist = reduce(objectKeys(astWhiteList), function (props, key) {
|
||||
var propNames = astWhiteList[key];
|
||||
var prepend = (indexOf(propNames, 'type') === -1) ? ['type'] : [];
|
||||
props[key] = prepend.concat(propNames || []);
|
||||
return props;
|
||||
}, {});
|
||||
|
||||
function cloneNodeOrObject (obj, seen) {
|
||||
var props = obj.type ? whitelist[obj.type] : null;
|
||||
if (props) {
|
||||
return cloneNode(obj, props, seen);
|
||||
} else {
|
||||
return cloneObject(obj, seen);
|
||||
}
|
||||
}
|
||||
|
||||
function cloneArray (ary, seen) {
|
||||
var i = ary.length;
|
||||
var clone = [];
|
||||
while (i--) {
|
||||
clone[i] = cloneOf(ary[i], seen);
|
||||
}
|
||||
return clone;
|
||||
}
|
||||
|
||||
function cloneNode (node, props, seen) {
|
||||
var i, len, key;
|
||||
var clone = {};
|
||||
for (i = 0, len = props.length; i < len; i += 1) {
|
||||
key = props[i];
|
||||
if (node.hasOwnProperty(key)) {
|
||||
clone[key] = cloneOf(node[key], seen);
|
||||
}
|
||||
}
|
||||
return clone;
|
||||
}
|
||||
|
||||
function cloneObject (obj, seen) {
|
||||
var props = objectKeys(obj);
|
||||
var i, len, key, value;
|
||||
var clone = {};
|
||||
for (i = 0, len = props.length; i < len; i += 1) {
|
||||
key = props[i];
|
||||
value = obj[key];
|
||||
if (seen.has(value)) {
|
||||
continue;
|
||||
}
|
||||
clone[key] = cloneOf(value, seen);
|
||||
}
|
||||
return clone;
|
||||
}
|
||||
|
||||
function cloneOf (val, seen) {
|
||||
if (typeof val === 'object' && val !== null) {
|
||||
seen.set(val, true);
|
||||
if (val instanceof RegExp) {
|
||||
return new RegExp(val);
|
||||
} else if (isArray(val)) {
|
||||
return cloneArray(val, seen);
|
||||
} else {
|
||||
return cloneNodeOrObject(val, seen);
|
||||
}
|
||||
} else {
|
||||
return val;
|
||||
}
|
||||
}
|
||||
|
||||
function cloneRoot (obj) {
|
||||
var seen = new Map();
|
||||
seen.set(obj, true);
|
||||
return cloneNodeOrObject(obj, seen);
|
||||
}
|
||||
|
||||
return cloneRoot;
|
||||
};
|
||||
17
node_modules/espurify/lib/create-whitelist.js
generated
vendored
Normal file
17
node_modules/espurify/lib/create-whitelist.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
'use strict';
|
||||
|
||||
var defaultProps = require('./ast-properties');
|
||||
var objectKeys = require('core-js/library/fn/object/keys');
|
||||
var assign = require('core-js/library/fn/object/assign');
|
||||
|
||||
module.exports = function createWhitelist (options) {
|
||||
var opts = assign({}, options);
|
||||
var typeName, i, len;
|
||||
var keys = objectKeys(defaultProps);
|
||||
var result = {};
|
||||
for (i = 0, len = keys.length; i < len; i += 1) {
|
||||
typeName = keys[i];
|
||||
result[typeName] = defaultProps[typeName].concat(opts.extra || []);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
55
node_modules/espurify/package.json
generated
vendored
Normal file
55
node_modules/espurify/package.json
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"name": "espurify",
|
||||
"description": "Clone new AST without extra properties",
|
||||
"version": "1.8.1",
|
||||
"author": {
|
||||
"name": "Takuto Wada",
|
||||
"email": "takuto.wada@gmail.com",
|
||||
"url": "https://github.com/twada"
|
||||
},
|
||||
"dependencies": {
|
||||
"core-js": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"acorn": "^5.0.0",
|
||||
"babel-types": "^6.3.20",
|
||||
"babylon": "^6.3.20",
|
||||
"browserify": "^13.0.0",
|
||||
"derequire": "^2.0.2",
|
||||
"dereserve": "^1.0.0",
|
||||
"esprima": "^4.0.0",
|
||||
"estraverse": "^4.1.0",
|
||||
"licensify": "^3.1.0",
|
||||
"mocha": "^5.0.0",
|
||||
"semistandard": "^12.0.0",
|
||||
"snazzy": "^7.0.0"
|
||||
},
|
||||
"files": [
|
||||
"CHANGELOG.md",
|
||||
"MIT-LICENSE.txt",
|
||||
"README.md",
|
||||
"index.js",
|
||||
"lib",
|
||||
"build/espurify.js",
|
||||
"package.json"
|
||||
],
|
||||
"homepage": "https://github.com/estools/espurify",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/estools/espurify.git"
|
||||
},
|
||||
"semistandard": {
|
||||
"ignore": [
|
||||
"/build/",
|
||||
"/bench/",
|
||||
"**/*.jsx"
|
||||
],
|
||||
"globals": [
|
||||
"describe",
|
||||
"beforeEach",
|
||||
"it"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user