added old data
This commit is contained in:
commit
276ef453dc
19
proj1/index.html
Normal file
19
proj1/index.html
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>Document</title>
|
||||||
|
<link rel="stylesheet" href="styleB.css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="flex-container">
|
||||||
|
<div id="a"><p>A</p></div>
|
||||||
|
<div id="b"><p>B</p></div>
|
||||||
|
<div id="c"><p>C</p></div>
|
||||||
|
<div id="d"><p>D</p></div>
|
||||||
|
<div id="e"><p>E</p></div>
|
||||||
|
<div id="f"><p>F</p></div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
40
proj1/styleA.css
Normal file
40
proj1/styleA.css
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
.flex-container {
|
||||||
|
display: flex;
|
||||||
|
height: 100vh;
|
||||||
|
/* width: 100vh; */
|
||||||
|
flex-direction: column;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-container div {
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100px;
|
||||||
|
width: 100px;
|
||||||
|
border-top: 1px solid #687291;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-container div:nth-child(even) {
|
||||||
|
background-color: #eeeff2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-container div:nth-child(odd) {
|
||||||
|
background-color: #dfe1e7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-container div:nth-last-child(1) {
|
||||||
|
background-color: #687291;
|
||||||
|
border: 4px solid #000000;
|
||||||
|
}
|
||||||
|
div p {
|
||||||
|
font-size: 40px;
|
||||||
|
font: Tahoma;
|
||||||
|
text-align: center;
|
||||||
|
/* vertical-align: text-top; */
|
||||||
|
}
|
||||||
|
|
||||||
|
div#f p {
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
vertical-align: -webkit-baseline-middle;
|
||||||
|
}
|
35
proj1/styleB.css
Normal file
35
proj1/styleB.css
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
.flex-container {
|
||||||
|
display: flex;
|
||||||
|
height: 100vh;
|
||||||
|
/* width: 100vh; */
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-container div {
|
||||||
|
height: 150px;
|
||||||
|
width: 100px;
|
||||||
|
min-width: 100px;
|
||||||
|
border-left: 10px dotted #d0d0ff;
|
||||||
|
margin: 10px;
|
||||||
|
background: #eeeff2;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
.flex-container div:hover {
|
||||||
|
background: yellow;
|
||||||
|
color: goldenrod;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-container div:nth-last-child(1) {
|
||||||
|
align-self: end;
|
||||||
|
margin: 0px 0px 0px auto;
|
||||||
|
}
|
||||||
|
div p {
|
||||||
|
font-size: 40px;
|
||||||
|
font: Tahoma;
|
||||||
|
margin: 10px;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
BIN
project2.zip
Normal file
BIN
project2.zip
Normal file
Binary file not shown.
48
project2/.jshintrc
Normal file
48
project2/.jshintrc
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
{
|
||||||
|
|
||||||
|
// Predefined globals whom JSHint will ignore.
|
||||||
|
"browser" : true, // Standard browser globals e.g. `window`, `document`.
|
||||||
|
|
||||||
|
|
||||||
|
// Development.
|
||||||
|
"debug" : false, // Allow debugger statements e.g. browser breakpoints.
|
||||||
|
"devel" : true, // Allow developments statements e.g. `console.log();`.
|
||||||
|
|
||||||
|
|
||||||
|
// ECMAScript 6
|
||||||
|
"esversion": 6,
|
||||||
|
"globalstrict" : true, // Allow global "use strict" (also enables 'strict').
|
||||||
|
"strict": false, // For this project with run with global strict so don't require local
|
||||||
|
|
||||||
|
|
||||||
|
// The Good Parts.
|
||||||
|
"boss" : false, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments.
|
||||||
|
"curly" : true, // Require {} for every new block or scope.
|
||||||
|
"eqeqeq" : true, // Require triple equals i.e. `===`.
|
||||||
|
"eqnull" : false, // Tolerate use of `== null`.
|
||||||
|
"evil" : false, // Tolerate use of `eval`.
|
||||||
|
"expr" : false, // Tolerate `ExpressionStatement` as Programs.
|
||||||
|
"forin" : false, // Tolerate `for in` loops without `hasOwnPrototype`.
|
||||||
|
"immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
|
||||||
|
"latedef" : true, // Prohipit variable use before definition.
|
||||||
|
"loopfunc" : false, // Allow functions to be defined within loops.
|
||||||
|
"noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`.
|
||||||
|
"regexp" : true, // Prohibit `.` and `[^...]` in regular expressions.
|
||||||
|
"regexdash" : false, // Tolerate unescaped last dash i.e. `[-...]`.
|
||||||
|
"scripturl" : true, // Tolerate script-targeted URLs.
|
||||||
|
"supernew" : false, // Tolerate `new function () { ... };` and `new Object;`.
|
||||||
|
"undef" : true, // Require all non-global variables be declared before they are used.
|
||||||
|
|
||||||
|
|
||||||
|
// Personal styling preferences.
|
||||||
|
"newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`.
|
||||||
|
"noempty" : true, // Prohibit use of empty blocks.
|
||||||
|
"nonew" : true, // Prohibit use of constructors for side-effects.
|
||||||
|
"nomen" : true, // Prohibit use of initial or trailing underbars in names.
|
||||||
|
"onevar" : false, // Allow only one `var` statement per function.
|
||||||
|
"plusplus" : false, // Prohibit use of `++` & `--`.
|
||||||
|
"sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
|
||||||
|
"trailing" : true, // Prohibit trailing whitespaces.
|
||||||
|
"white" : false, // Check against strict whitespace and indentation rules.
|
||||||
|
"indent" : 2 // Specify indentation spacing
|
||||||
|
}
|
22
project2/cs142-make-multi-filter.js
Normal file
22
project2/cs142-make-multi-filter.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
"use strict";
|
||||||
|
function cs142MakeMultiFilter(array) {
|
||||||
|
function arrayFilterer(filter, call) {
|
||||||
|
let currentArray = array;
|
||||||
|
if (typeof (filter) !== "function") {
|
||||||
|
return currentArray;
|
||||||
|
}
|
||||||
|
let newarr = [];
|
||||||
|
for (var i = 0; i < currentArray.length; i++) {
|
||||||
|
if (filter(currentArray[i])) {
|
||||||
|
newarr.push(currentArray[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (typeof (call) === "function") {
|
||||||
|
call = call.bind(array);
|
||||||
|
call(newarr);
|
||||||
|
}
|
||||||
|
return arrayFilterer;
|
||||||
|
}
|
||||||
|
return arrayFilterer;
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=cs142-make-multi-filter.js.map
|
1
project2/cs142-make-multi-filter.js.map
Normal file
1
project2/cs142-make-multi-filter.js.map
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"cs142-make-multi-filter.js","sourceRoot":"","sources":["cs142-make-multi-filter.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,SAAS,oBAAoB,CAAC,KAAW;IAEvC,SAAS,aAAa,CAAC,MAAiB,EAAE,IAAe;QAEvD,IAAI,YAAY,GAAG,KAAK,CAAC;QAEzB,IAAI,OAAM,CAAC,MAAM,CAAC,KAAK,UAAU,EAAC;YAC9B,OAAO,YAAY,CAAC;SACvB;QACD,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC5C,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE;gBAC3B,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;aAC9B;SACF;QACD,IAAI,OAAM,CAAC,IAAI,CAAC,KAAK,UAAU,EAAC;YAE9B,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACxB,IAAI,CAAC,MAAM,CAAC,CAAC;SACd;QACD,OAAO,aAAa,CAAC;IACvB,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC"}
|
27
project2/cs142-make-multi-filter.ts
Normal file
27
project2/cs142-make-multi-filter.ts
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
function cs142MakeMultiFilter(array : any) {
|
||||||
|
|
||||||
|
function arrayFilterer(filter : Function, call : Function) {
|
||||||
|
|
||||||
|
let currentArray = array;
|
||||||
|
|
||||||
|
if (typeof(filter) !== "function"){
|
||||||
|
return currentArray;
|
||||||
|
}
|
||||||
|
let newarr = [];
|
||||||
|
for (var i = 0; i < currentArray.length; i++) {
|
||||||
|
if (filter(currentArray[i])) {
|
||||||
|
newarr.push(currentArray[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (typeof(call) === "function"){
|
||||||
|
|
||||||
|
call = call.bind(array);
|
||||||
|
call(newarr);
|
||||||
|
}
|
||||||
|
return arrayFilterer;
|
||||||
|
}
|
||||||
|
return arrayFilterer;
|
||||||
|
}
|
||||||
|
|
18
project2/cs142-template-processor.js
Normal file
18
project2/cs142-template-processor.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
"use strict";
|
||||||
|
class Cs142TemplateProcessor {
|
||||||
|
constructor(template) {
|
||||||
|
this.temp = template;
|
||||||
|
}
|
||||||
|
fillIn(dict) {
|
||||||
|
let filled_template = this.temp;
|
||||||
|
for (var key in dict) {
|
||||||
|
let value = dict[key];
|
||||||
|
let template_key = "{{" + key + "}}";
|
||||||
|
filled_template = filled_template.replace(template_key, value);
|
||||||
|
}
|
||||||
|
var regex = new RegExp("\{\{\w*\}\}");
|
||||||
|
filled_template = filled_template.replace(regex, "");
|
||||||
|
return filled_template;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=cs142-template-processor.js.map
|
1
project2/cs142-template-processor.js.map
Normal file
1
project2/cs142-template-processor.js.map
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"cs142-template-processor.js","sourceRoot":"","sources":["cs142-template-processor.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,MAAM,sBAAsB;IAG1B,YAAY,QAAiB;QAC3B,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,IAAa;QAClB,IAAI,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC;QAChC,KAAK,IAAI,GAAG,IAAI,IAAI,EAAE;YACpB,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;YACtB,IAAI,YAAY,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC;YACrC,eAAe,GAAG,eAAe,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;SAChE;QACD,IAAI,KAAK,GAAG,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC;QACtC,eAAe,GAAG,eAAe,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACrD,OAAO,eAAe,CAAC;IACzB,CAAC;CACF"}
|
20
project2/cs142-template-processor.ts
Normal file
20
project2/cs142-template-processor.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
"use strict";
|
||||||
|
class Cs142TemplateProcessor {
|
||||||
|
temp: string;
|
||||||
|
|
||||||
|
constructor(template : string) {
|
||||||
|
this.temp = template;
|
||||||
|
}
|
||||||
|
|
||||||
|
fillIn(dict : object) {
|
||||||
|
let filled_template = this.temp;
|
||||||
|
for (var key in dict) {
|
||||||
|
let value = dict[key];
|
||||||
|
let template_key = "{{" + key + "}}";
|
||||||
|
filled_template = filled_template.replace(template_key, value);
|
||||||
|
}
|
||||||
|
var regex = new RegExp("\{\{\w*\}\}");
|
||||||
|
filled_template = filled_template.replace(regex, "");
|
||||||
|
return filled_template;
|
||||||
|
}
|
||||||
|
}
|
34
project2/cs142-test-project2.html
Executable file
34
project2/cs142-test-project2.html
Executable file
@ -0,0 +1,34 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||||
|
<head>
|
||||||
|
<title>CS 142 Project 2 Test</title>
|
||||||
|
<script type="text/javascript">
|
||||||
|
//<![CDATA[
|
||||||
|
'use strict';
|
||||||
|
//]]>
|
||||||
|
</script>
|
||||||
|
<script src="./cs142-make-multi-filter.js"></script>
|
||||||
|
<script src="./cs142-template-processor.js"></script>
|
||||||
|
<script src="./cs142-test-project2.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>CS142 Project #2 - JavaScript Calisthenics</h1>
|
||||||
|
<p>You should create two local files for your problem solutions:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Problem #1 - <code>cs142-make-multi-filter.js</code></li>
|
||||||
|
<li>Problem #2 - <code>cs142-template-processor.js</code></li>
|
||||||
|
</ul>
|
||||||
|
<p>Open your browser console log to see any error messages.</p>
|
||||||
|
<p>This document runs the script in <code>cs142-test-project2.js</code> which
|
||||||
|
does some checking of solutions for Problems #1 - #2. Problem #3 requires
|
||||||
|
you to modify that file.</p>
|
||||||
|
<h3>Checking Results:</h3>
|
||||||
|
<ul>
|
||||||
|
<li>Problem #1 - <span id="cs142p1">Not tested</span></li>
|
||||||
|
<li>Problem #2 - <span id="cs142p2">Not tested</span></li>
|
||||||
|
<li>Problem #3 - <span id="cs142p3">Not tested</span></li>
|
||||||
|
</ul>
|
||||||
|
</body>
|
||||||
|
</html>
|
189
project2/cs142-test-project2.js
Normal file
189
project2/cs142-test-project2.js
Normal file
@ -0,0 +1,189 @@
|
|||||||
|
"use strict";
|
||||||
|
/*
|
||||||
|
* This file tests the CS142 Project #2 JavaScript assignment problems. It prints what
|
||||||
|
* it finds to the console log and updates the text being displayed in the window with a
|
||||||
|
* summary of the results.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// We assume these symbols will be globally defined by the user. These var statements
|
||||||
|
// will assign undefined to the symbol if it isn't global already.
|
||||||
|
// These global symbols are needed to test your file and you don't have to worry about them for Problem 3.
|
||||||
|
// var cs142MakeMultiFilter;
|
||||||
|
// var Cs142TemplateProcessor;
|
||||||
|
|
||||||
|
|
||||||
|
var vars = {
|
||||||
|
p1Message: "SUCCESS",
|
||||||
|
p2Message: "SUCCESS",
|
||||||
|
p3Message: "SUCCESS",
|
||||||
|
varDeclared: ["vars.varDeclared", "vars.p1Message", "vars.p2Message", "vars.p3Message"]
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
// ********************* Test cs142filter
|
||||||
|
|
||||||
|
if (typeof cs142MakeMultiFilter !== "function") {
|
||||||
|
console.error(
|
||||||
|
"cs142MakeMultiFilter is not a function",
|
||||||
|
typeof cs142MakeMultiFilter
|
||||||
|
);
|
||||||
|
vars.p1Message = "FAILURE";
|
||||||
|
} else {
|
||||||
|
var arraysAreTheSame = function arraysAreTheSame(a1, a2) {
|
||||||
|
if (!Array.isArray(a1) || !Array.isArray(a2) || a1.length !== a2.length) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for (var i = 0; i < a1.length; i++) {
|
||||||
|
if (a1[i] !== a2[i]) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
var originalArray = [1, 2, 3];
|
||||||
|
var filterFunc = cs142MakeMultiFilter(originalArray);
|
||||||
|
|
||||||
|
var secondArray = [1, 2, 3, 4];
|
||||||
|
var filterFuncTwo = cs142MakeMultiFilter(secondArray);
|
||||||
|
|
||||||
|
if (typeof filterFunc !== "function") {
|
||||||
|
console.error(
|
||||||
|
"cs142MakeMultiFilter does not return a function",
|
||||||
|
filterFunc
|
||||||
|
);
|
||||||
|
vars.p1Message = "FAILURE";
|
||||||
|
} else {
|
||||||
|
var result = filterFunc();
|
||||||
|
if (!arraysAreTheSame([1, 2, 3], result)) {
|
||||||
|
console.error(
|
||||||
|
"filter function with no args does not return the original array",
|
||||||
|
result
|
||||||
|
);
|
||||||
|
vars.p1Message = "FAILURE";
|
||||||
|
}
|
||||||
|
|
||||||
|
var callbackPerformed = false;
|
||||||
|
result = filterFunc(
|
||||||
|
function(item) {
|
||||||
|
return item !== 2;
|
||||||
|
},
|
||||||
|
function(callbackResult) {
|
||||||
|
callbackPerformed = true;
|
||||||
|
if (!arraysAreTheSame([1, 3], callbackResult)) {
|
||||||
|
console.error(
|
||||||
|
"filter function callback does not filter 2 correctly",
|
||||||
|
callbackResult
|
||||||
|
);
|
||||||
|
vars.p1Message = "FAILURE";
|
||||||
|
}
|
||||||
|
if (!arraysAreTheSame([1, 2, 3], this)) {
|
||||||
|
console.error(
|
||||||
|
"filter function callback does not pass original array as this",
|
||||||
|
this
|
||||||
|
);
|
||||||
|
vars.p1Message = "FAILURE";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!callbackPerformed) {
|
||||||
|
console.error("filter function callback not performed");
|
||||||
|
vars.p1Message = "FAILURE";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result !== filterFunc) {
|
||||||
|
console.error("filter function does not return itself", result);
|
||||||
|
vars.p1Message = "FAILURE";
|
||||||
|
}
|
||||||
|
|
||||||
|
result = filterFunc(function(item) {
|
||||||
|
return item !== 3;
|
||||||
|
});
|
||||||
|
if (result !== filterFunc) {
|
||||||
|
console.error("filter function does not return itself 2", result);
|
||||||
|
vars.p1Message = "FAILURE";
|
||||||
|
}
|
||||||
|
|
||||||
|
result = filterFunc();
|
||||||
|
if (!arraysAreTheSame([1], result)) {
|
||||||
|
console.error(
|
||||||
|
"filter function callback does not filter 3 correctly",
|
||||||
|
result
|
||||||
|
);
|
||||||
|
vars.p1Message = "FAILURE";
|
||||||
|
}
|
||||||
|
result = filterFuncTwo(
|
||||||
|
function(item) {
|
||||||
|
return item !== 1;
|
||||||
|
},
|
||||||
|
function(callbackResult) {
|
||||||
|
if (!arraysAreTheSame([2, 3, 4], callbackResult)) {
|
||||||
|
console.error(
|
||||||
|
"second filter does not filter 1 (check for global variable usage)",
|
||||||
|
callbackResult
|
||||||
|
);
|
||||||
|
vars.p1Message = "FAILURE";
|
||||||
|
}
|
||||||
|
if (!arraysAreTheSame([1, 2, 3, 4], this)) {
|
||||||
|
console.error(
|
||||||
|
"filter function callback does not pass original array as this",
|
||||||
|
this
|
||||||
|
);
|
||||||
|
vars.p1Message = "FAILURE";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log("Test cs142MakeMultiFilter:", vars.p1Message);
|
||||||
|
|
||||||
|
// ********************* Test Cs142TemplateProcessor
|
||||||
|
|
||||||
|
if (typeof Cs142TemplateProcessor !== "function") {
|
||||||
|
console.error(
|
||||||
|
"Cs142TemplateProcessor is not a function",
|
||||||
|
Cs142TemplateProcessor
|
||||||
|
);
|
||||||
|
vars.p2Message = "FAILURE";
|
||||||
|
} else {
|
||||||
|
vars.template =
|
||||||
|
"My favorite month is {{month}} but not the day {{day}} or the year {{year}}";
|
||||||
|
vars.dateTemplate = new Cs142TemplateProcessor(vars.template);
|
||||||
|
|
||||||
|
vars.dictionary = { month: "July", day: "1", year: "2016" };
|
||||||
|
vars.str = vars.dateTemplate.fillIn(vars.dictionary);
|
||||||
|
|
||||||
|
if (vars.str !== "My favorite month is July but not the day 1 or the year 2016") {
|
||||||
|
console.error("Cs142TemplateProcessor didn't work");
|
||||||
|
vars.p2Message = "FAILURE";
|
||||||
|
}
|
||||||
|
vars.varDeclared.push("template");
|
||||||
|
vars.varDeclared.push("dateTemplate");
|
||||||
|
vars.varDeclared.push("dictionary");
|
||||||
|
vars.varDeclared.push("str");
|
||||||
|
}
|
||||||
|
console.log("Test Cs142TemplateProcessor:", vars.p2Message);
|
||||||
|
|
||||||
|
// ********************* Test to see if the symbols we defined are in the global address space
|
||||||
|
|
||||||
|
vars.varDeclared.forEach(function(sym) {
|
||||||
|
if (window[sym] !== undefined) {
|
||||||
|
console.error("Found my symbol", sym, "in DOM");
|
||||||
|
vars.p3Message = "FAILURE";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
console.log("Test Problem 3:", vars.p3Message);
|
||||||
|
|
||||||
|
// Store the result back into the global space under the object name cs142Project2Results
|
||||||
|
window.cs142Project2Results = vars;
|
||||||
|
|
||||||
|
|
||||||
|
// Once the browser loads our companion HTML in cs142-test-project2.html we
|
||||||
|
// update it with the results of our testing. This code will make more
|
||||||
|
// sense after the next project.
|
||||||
|
window.onload = function() {
|
||||||
|
document.getElementById("cs142p1").innerHTML = vars.p1Message;
|
||||||
|
document.getElementById("cs142p2").innerHTML = vars.p2Message;
|
||||||
|
document.getElementById("cs142p3").innerHTML = vars.p3Message;
|
||||||
|
};
|
1
project2/node_modules/.bin/jshint
generated
vendored
Symbolic link
1
project2/node_modules/.bin/jshint
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../jshint/bin/jshint
|
1
project2/node_modules/.bin/shjs
generated
vendored
Symbolic link
1
project2/node_modules/.bin/shjs
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../shelljs/bin/shjs
|
1
project2/node_modules/.bin/strip-json-comments
generated
vendored
Symbolic link
1
project2/node_modules/.bin/strip-json-comments
generated
vendored
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../strip-json-comments/cli.js
|
5
project2/node_modules/balanced-match/.npmignore
generated
vendored
Normal file
5
project2/node_modules/balanced-match/.npmignore
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
test
|
||||||
|
.gitignore
|
||||||
|
.travis.yml
|
||||||
|
Makefile
|
||||||
|
example.js
|
21
project2/node_modules/balanced-match/LICENSE.md
generated
vendored
Normal file
21
project2/node_modules/balanced-match/LICENSE.md
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
(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.
|
91
project2/node_modules/balanced-match/README.md
generated
vendored
Normal file
91
project2/node_modules/balanced-match/README.md
generated
vendored
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
# balanced-match
|
||||||
|
|
||||||
|
Match balanced string pairs, like `{` and `}` or `<b>` and `</b>`. Supports regular expressions as well!
|
||||||
|
|
||||||
|
[![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'));
|
||||||
|
console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } 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' }
|
||||||
|
{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: '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', '']` and `{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: `[ <a index>, <b index> ]`.
|
||||||
|
|
||||||
|
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 ]` and `{a}}` will match `[0, 2]`.
|
||||||
|
|
||||||
|
## 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.
|
59
project2/node_modules/balanced-match/index.js
generated
vendored
Normal file
59
project2/node_modules/balanced-match/index.js
generated
vendored
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
'use strict';
|
||||||
|
module.exports = balanced;
|
||||||
|
function balanced(a, b, str) {
|
||||||
|
if (a instanceof RegExp) a = maybeMatch(a, str);
|
||||||
|
if (b instanceof RegExp) b = maybeMatch(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)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function maybeMatch(reg, str) {
|
||||||
|
var m = str.match(reg);
|
||||||
|
return m ? m[0] : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 >= 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;
|
||||||
|
}
|
77
project2/node_modules/balanced-match/package.json
generated
vendored
Normal file
77
project2/node_modules/balanced-match/package.json
generated
vendored
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
{
|
||||||
|
"_from": "balanced-match@^1.0.0",
|
||||||
|
"_id": "balanced-match@1.0.0",
|
||||||
|
"_inBundle": false,
|
||||||
|
"_integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
|
||||||
|
"_location": "/balanced-match",
|
||||||
|
"_phantomChildren": {},
|
||||||
|
"_requested": {
|
||||||
|
"type": "range",
|
||||||
|
"registry": true,
|
||||||
|
"raw": "balanced-match@^1.0.0",
|
||||||
|
"name": "balanced-match",
|
||||||
|
"escapedName": "balanced-match",
|
||||||
|
"rawSpec": "^1.0.0",
|
||||||
|
"saveSpec": null,
|
||||||
|
"fetchSpec": "^1.0.0"
|
||||||
|
},
|
||||||
|
"_requiredBy": [
|
||||||
|
"/brace-expansion"
|
||||||
|
],
|
||||||
|
"_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||||
|
"_shasum": "89b4d199ab2bee49de164ea02b89ce462d71b767",
|
||||||
|
"_spec": "balanced-match@^1.0.0",
|
||||||
|
"_where": "/home/massiveatoms/Desktop/cs142/project2/node_modules/brace-expansion",
|
||||||
|
"author": {
|
||||||
|
"name": "Julian Gruber",
|
||||||
|
"email": "mail@juliangruber.com",
|
||||||
|
"url": "http://juliangruber.com"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/juliangruber/balanced-match/issues"
|
||||||
|
},
|
||||||
|
"bundleDependencies": false,
|
||||||
|
"dependencies": {},
|
||||||
|
"deprecated": false,
|
||||||
|
"description": "Match balanced character pairs, like \"{\" and \"}\"",
|
||||||
|
"devDependencies": {
|
||||||
|
"matcha": "^0.7.0",
|
||||||
|
"tape": "^4.6.0"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/juliangruber/balanced-match",
|
||||||
|
"keywords": [
|
||||||
|
"match",
|
||||||
|
"regexp",
|
||||||
|
"test",
|
||||||
|
"balanced",
|
||||||
|
"parse"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "index.js",
|
||||||
|
"name": "balanced-match",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/juliangruber/balanced-match.git"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"bench": "make bench",
|
||||||
|
"test": "make test"
|
||||||
|
},
|
||||||
|
"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"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"version": "1.0.0"
|
||||||
|
}
|
21
project2/node_modules/brace-expansion/LICENSE
generated
vendored
Normal file
21
project2/node_modules/brace-expansion/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
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.
|
129
project2/node_modules/brace-expansion/README.md
generated
vendored
Normal file
129
project2/node_modules/brace-expansion/README.md
generated
vendored
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
# 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)
|
||||||
|
[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/)
|
||||||
|
|
||||||
|
[![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 separated 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)
|
||||||
|
|
||||||
|
## Sponsors
|
||||||
|
|
||||||
|
This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)!
|
||||||
|
|
||||||
|
Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)!
|
||||||
|
|
||||||
|
## 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.
|
201
project2/node_modules/brace-expansion/index.js
generated
vendored
Normal file
201
project2/node_modules/brace-expansion/index.js
generated
vendored
Normal file
@ -0,0 +1,201 @@
|
|||||||
|
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 [];
|
||||||
|
|
||||||
|
// I don't know why Bash 4.3 does this, but it does.
|
||||||
|
// Anything starting with {} will have the first two bytes preserved
|
||||||
|
// but *only* at the top level, so {},a}b will not expand to anything,
|
||||||
|
// but a{},b}c will be expanded to [a}c,abc].
|
||||||
|
// One could argue that this is a bug in Bash, but since the goal of
|
||||||
|
// this module is to match Bash's rules, we escape a leading {}
|
||||||
|
if (str.substr(0, 2) === '{}') {
|
||||||
|
str = '\\{\\}' + str.substr(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
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 = m.body.indexOf(',') >= 0;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
75
project2/node_modules/brace-expansion/package.json
generated
vendored
Normal file
75
project2/node_modules/brace-expansion/package.json
generated
vendored
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
{
|
||||||
|
"_from": "brace-expansion@^1.1.7",
|
||||||
|
"_id": "brace-expansion@1.1.11",
|
||||||
|
"_inBundle": false,
|
||||||
|
"_integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||||
|
"_location": "/brace-expansion",
|
||||||
|
"_phantomChildren": {},
|
||||||
|
"_requested": {
|
||||||
|
"type": "range",
|
||||||
|
"registry": true,
|
||||||
|
"raw": "brace-expansion@^1.1.7",
|
||||||
|
"name": "brace-expansion",
|
||||||
|
"escapedName": "brace-expansion",
|
||||||
|
"rawSpec": "^1.1.7",
|
||||||
|
"saveSpec": null,
|
||||||
|
"fetchSpec": "^1.1.7"
|
||||||
|
},
|
||||||
|
"_requiredBy": [
|
||||||
|
"/minimatch"
|
||||||
|
],
|
||||||
|
"_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||||
|
"_shasum": "3c7fcbf529d87226f3d2f52b966ff5271eb441dd",
|
||||||
|
"_spec": "brace-expansion@^1.1.7",
|
||||||
|
"_where": "/home/massiveatoms/Desktop/cs142/project2/node_modules/minimatch",
|
||||||
|
"author": {
|
||||||
|
"name": "Julian Gruber",
|
||||||
|
"email": "mail@juliangruber.com",
|
||||||
|
"url": "http://juliangruber.com"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/juliangruber/brace-expansion/issues"
|
||||||
|
},
|
||||||
|
"bundleDependencies": false,
|
||||||
|
"dependencies": {
|
||||||
|
"balanced-match": "^1.0.0",
|
||||||
|
"concat-map": "0.0.1"
|
||||||
|
},
|
||||||
|
"deprecated": false,
|
||||||
|
"description": "Brace expansion as known from sh/bash",
|
||||||
|
"devDependencies": {
|
||||||
|
"matcha": "^0.7.0",
|
||||||
|
"tape": "^4.6.0"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/juliangruber/brace-expansion",
|
||||||
|
"keywords": [],
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "index.js",
|
||||||
|
"name": "brace-expansion",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/juliangruber/brace-expansion.git"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"bench": "matcha test/perf/bench.js",
|
||||||
|
"gentest": "bash test/generate.sh",
|
||||||
|
"test": "tape test/*.js"
|
||||||
|
},
|
||||||
|
"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"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"version": "1.1.11"
|
||||||
|
}
|
1
project2/node_modules/cli/.npmignore
generated
vendored
Normal file
1
project2/node_modules/cli/.npmignore
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
node_modules
|
201
project2/node_modules/cli/README.md
generated
vendored
Normal file
201
project2/node_modules/cli/README.md
generated
vendored
Normal file
@ -0,0 +1,201 @@
|
|||||||
|
**cli is a toolkit for rapidly building command line apps - it includes:**
|
||||||
|
|
||||||
|
- Full featured opts/args parser
|
||||||
|
- Plugin support for adding common options and switches
|
||||||
|
- Helper methods for working with input/output and spawning child processes
|
||||||
|
- Output colored/styled messages, [progress bars](https://github.com/chriso/cli/blob/master/examples/progress.js) or [spinners](https://github.com/chriso/cli/blob/master/examples/spinner.js)
|
||||||
|
- Command [auto-completion](https://github.com/chriso/cli/blob/master/examples/command.js) and [glob support](https://github.com/chriso/cli/blob/master/examples/glob.js)
|
||||||
|
|
||||||
|
Install using `npm install cli` or just bundle [cli.js](https://github.com/chriso/cli/raw/master/cli.js) with your app.
|
||||||
|
|
||||||
|
## Example apps
|
||||||
|
|
||||||
|
### sort.js
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
#!/usr/bin/env node
|
||||||
|
require('cli').withStdinLines(function(lines, newline) {
|
||||||
|
this.output(lines.sort().join(newline));
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
Try it out
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ ./sort.js < input.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
Let's add support for an `-n` switch to use a numeric sort, and a `-r` switch to reverse output - only 5 extra lines of code (!)
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
var cli = require('cli'), options = cli.parse();
|
||||||
|
|
||||||
|
cli.withStdinLines(function(lines, newline) {
|
||||||
|
lines.sort(!options.n ? null : function(a, b) {
|
||||||
|
return parseInt(a) > parseInt(b);
|
||||||
|
});
|
||||||
|
if (options.r) lines.reverse();
|
||||||
|
this.output(lines.join(newline));
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
## Command Line Arguments Parser
|
||||||
|
|
||||||
|
cli takes an object as a map for the arguments you wish to parse.
|
||||||
|
Each property/key in the object is the long version of the argument i.e. --file
|
||||||
|
The array associated with it is the options to apply to that argument.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```javascript
|
||||||
|
cli.parse({
|
||||||
|
file: [ 'f', 'A file to process', 'file', temp.log ], // -f, --file FILE A file to process
|
||||||
|
time: [ 't', 'An access time', 'time', false], // -t, --time TIME An access time
|
||||||
|
work: [ false, 'What kind of work to do', 'string', 'sleep' ] // --work STRING What kind of work to do
|
||||||
|
});
|
||||||
|
```
|
||||||
|
### Explanation of array options
|
||||||
|
|
||||||
|
1. A short name, single letter i.e. -f, or false if no short name is supported for this option
|
||||||
|
2. A description of the option
|
||||||
|
3. The type of object the argument should map too.
|
||||||
|
Below is a list of the return types followed by a description and a list of
|
||||||
|
valid values you can use for this option to get desired type of Object back.
|
||||||
|
- **as-is:** What you enter, is what you get
|
||||||
|
- 'string', 1, true
|
||||||
|
- **int:** Is converted to an Integer wrapped in a Number Object
|
||||||
|
- 'int', 'number', 'num',
|
||||||
|
- 'time', 'seconds', 'secs', 'minutes', 'mins'
|
||||||
|
- 'x', 'n'
|
||||||
|
- **date:** Is converted to a Date Object
|
||||||
|
- 'date', 'datetime', 'date_time'
|
||||||
|
- **float:** Is converted to a Float wrapped in a Number Object
|
||||||
|
- 'float', 'decimal'
|
||||||
|
- **file:** Is converted to a String Object if it is a valid path
|
||||||
|
- 'path', 'file', 'directory', 'dir'
|
||||||
|
- **email:** Converted to a String Object if it is a valid email format
|
||||||
|
- 'email'
|
||||||
|
- **url:** Converted to a String Object if it is a valid URL format
|
||||||
|
- 'url', 'uri', 'domain', 'host'
|
||||||
|
- **ip:** Converted to a String Object if it is a valid IP Address format
|
||||||
|
- 'ip'
|
||||||
|
- **true:** Converted to true if argument is present on command line
|
||||||
|
- 'bool', 'boolean', 'on'
|
||||||
|
- **false:** Converted to false if argument is present on command line
|
||||||
|
- 'false', 'off', false, 0
|
||||||
|
4. A default value for this option if one is not given on the command line
|
||||||
|
|
||||||
|
## Helper methods
|
||||||
|
|
||||||
|
cli has methods that collect stdin (newline is auto-detected as \n or \r\n)
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
cli.withStdin(callback); //callback receives stdin as a string
|
||||||
|
cli.withStdinLines(callback); //callback receives stdin split into an array of lines (lines, newline)
|
||||||
|
```
|
||||||
|
|
||||||
|
cli also has a lower level method for working with input line by line (see [./examples/cat.js](https://github.com/chriso/cli/blob/master/examples/cat.js) for an example).
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
cli.withInput(file, function (line, newline, eof) {
|
||||||
|
if (!eof) {
|
||||||
|
this.output(line + newline);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
*Note: `file` can be omitted if you want to work with stdin*
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
//cli.toType(object); If a Built-in type, returns the name of the type as a lower cased String
|
||||||
|
cli.toType([]); // 'array'
|
||||||
|
cli.toType(new Date()); // 'date'
|
||||||
|
cli.toType(1); // 'integer'
|
||||||
|
cli.toType(1.1); // 'float'
|
||||||
|
cli.toType(Math); // 'math'
|
||||||
|
cli.toType(/a/); // 'regex'
|
||||||
|
cli.toType(JSON); // 'json'
|
||||||
|
```
|
||||||
|
|
||||||
|
To output a progress bar, call
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
cli.progress(progress); //Where 0 <= progress <= 1
|
||||||
|
```
|
||||||
|
|
||||||
|
To spawn a child process, use
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
cli.exec(cmd, callback); //callback receives the output of the process (split into lines)
|
||||||
|
```
|
||||||
|
|
||||||
|
cli also comes bundled with kof's [node-natives](https://github.com/kof/node-natives) (access with cli.native) and creationix' [stack](https://github.com/creationix/stack) (access with cli.createServer)
|
||||||
|
|
||||||
|
## Plugins
|
||||||
|
|
||||||
|
Plugins are a way of adding common opts and can be enabled using
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
cli.enable(plugin1, [plugin2, ...]); //To disable, use the equivalent disable() method
|
||||||
|
```
|
||||||
|
|
||||||
|
**help** - *enabled by default*
|
||||||
|
|
||||||
|
Adds `-h,--help` to output auto-generated usage information
|
||||||
|
|
||||||
|
**version**
|
||||||
|
|
||||||
|
Adds `-v,--version` to output version information for the app. cli will attempt to locate and parse a nearby *package.json*
|
||||||
|
|
||||||
|
To set your own app name and version, use `cli.setApp(app_name, version)`
|
||||||
|
|
||||||
|
**status**
|
||||||
|
|
||||||
|
Adds options to show/hide the stylized status messages that are output to the console when using one of these methods
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
cli.debug(msg); //Only shown when using --debug
|
||||||
|
cli.error(msg);
|
||||||
|
cli.fatal(msg); //Exits the process after outputting msg
|
||||||
|
cli.info(msg);
|
||||||
|
cli.ok(msg);
|
||||||
|
```
|
||||||
|
|
||||||
|
`-k,--no-color` will omit ANSI color escapes from the output
|
||||||
|
|
||||||
|
**glob** - *requires* `npm install glob`
|
||||||
|
|
||||||
|
Enables glob matching of arguments
|
||||||
|
|
||||||
|
**timeout**
|
||||||
|
|
||||||
|
Adds `-t,--timeout N` to exit the process after N seconds with an error
|
||||||
|
|
||||||
|
**catchall**
|
||||||
|
|
||||||
|
Adds `-c,--catch` to catch and output uncaughtExceptions and resume execution
|
||||||
|
|
||||||
|
*Note: Plugins are automatically disabled if an option or switch of the same name is already defined*
|
||||||
|
|
||||||
|
## LICENSE
|
||||||
|
|
||||||
|
(MIT license)
|
||||||
|
|
||||||
|
Copyright (c) 2010 Chris O'Hara <cohara87@gmail.com>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1112
project2/node_modules/cli/cli.js
generated
vendored
Normal file
1112
project2/node_modules/cli/cli.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
17
project2/node_modules/cli/examples/cat.js
generated
vendored
Executable file
17
project2/node_modules/cli/examples/cat.js
generated
vendored
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
var cli = require('cli');
|
||||||
|
|
||||||
|
var output_file = function (file) {
|
||||||
|
cli.withInput(file, function (line, sep, eof) {
|
||||||
|
if (!eof) {
|
||||||
|
cli.output(line + sep);
|
||||||
|
} else if (cli.args.length) {
|
||||||
|
output_file(cli.args.shift());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
if (cli.args.length) {
|
||||||
|
output_file(cli.args.shift());
|
||||||
|
}
|
16
project2/node_modules/cli/examples/command.js
generated
vendored
Executable file
16
project2/node_modules/cli/examples/command.js
generated
vendored
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
var cli = require('cli');
|
||||||
|
|
||||||
|
//The second (optional) argument of cli.parse() is a command list
|
||||||
|
//Type `./command.js --help` for usage info
|
||||||
|
|
||||||
|
//cli enables auto-completion of commands (similiar to npm), e.g. all of
|
||||||
|
//the following are equivalent and result in "Command is: install":
|
||||||
|
// $ ./command.js install
|
||||||
|
// $ ./command.js inst
|
||||||
|
// $ ./command.js i
|
||||||
|
|
||||||
|
cli.parse(null, ['install', 'test', 'edit', 'remove', 'uninstall', 'ls']);
|
||||||
|
|
||||||
|
console.log('Command is: ' + cli.command);
|
54
project2/node_modules/cli/examples/echo.js
generated
vendored
Executable file
54
project2/node_modules/cli/examples/echo.js
generated
vendored
Executable file
@ -0,0 +1,54 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
/* All of the following commands are equivalent and write `foo\tbar foo` to out.txt
|
||||||
|
$ ./echo.js -n -e --output=out.txt "foo\tbar" "foo"
|
||||||
|
$ ./echo.js --newline --escape --output "out.txt" "foo\tbar" "foo"
|
||||||
|
$ ./echo.js -ne --output=out.txt "foo\tbar" "foo"
|
||||||
|
$ ./echo.js -en --output="out.txt" "foo\tbar" "foo"
|
||||||
|
*/
|
||||||
|
|
||||||
|
var cli = require('cli');
|
||||||
|
|
||||||
|
cli.parse({
|
||||||
|
newline: ['n', 'Do not output the trailing newline'],
|
||||||
|
escape: ['e', 'Enable interpretation of backslash escapes'],
|
||||||
|
separator: ['s', 'Separate arguments using this value', 'string', ' '],
|
||||||
|
output: [false, 'Write to FILE rather than the console', 'file']
|
||||||
|
});
|
||||||
|
|
||||||
|
cli.main(function (args, options) {
|
||||||
|
var output = '', i, j, l, output_stream;
|
||||||
|
|
||||||
|
if (this.argc) {
|
||||||
|
if (options.escape) {
|
||||||
|
var replace = {'\\n':'\n','\\r':'\r','\\t':'\t','\\e':'\e','\\v':'\v','\\f':'\f','\\c':'\c','\\b':'\b','\\a':'\a','\\\\':'\\'};
|
||||||
|
var escape = function (str) {
|
||||||
|
str += '';
|
||||||
|
for (j in replace) {
|
||||||
|
str = str.replace(i, replace[i]);
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
for (i = 0, l = this.argc; i < l; i++) {
|
||||||
|
args[i] = escape(args[i]);
|
||||||
|
}
|
||||||
|
options.separator = escape(options.separator);
|
||||||
|
}
|
||||||
|
output += args.join(options.separator);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!options.newline) {
|
||||||
|
output += '\n';
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (options.output) {
|
||||||
|
output_stream = this.native.fs.createWriteStream(options.output)
|
||||||
|
} else {
|
||||||
|
output_stream = process.stdout;
|
||||||
|
}
|
||||||
|
output_stream.write(output);
|
||||||
|
} catch (e) {
|
||||||
|
this.fatal('Could not write to output stream');
|
||||||
|
}
|
||||||
|
});
|
6
project2/node_modules/cli/examples/glob.js
generated
vendored
Executable file
6
project2/node_modules/cli/examples/glob.js
generated
vendored
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
var cli = require('cli').enable('glob');
|
||||||
|
|
||||||
|
//Running `./glob.js *.js` will output a list of .js files in this directory
|
||||||
|
console.log(cli.args);
|
20
project2/node_modules/cli/examples/long_desc.js
generated
vendored
Executable file
20
project2/node_modules/cli/examples/long_desc.js
generated
vendored
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
var cli = require('../');
|
||||||
|
|
||||||
|
//You can (optionally) boost the width of output with:
|
||||||
|
//cli.width = 120;
|
||||||
|
|
||||||
|
//You can also adjust the width of the options/command definitions
|
||||||
|
//cli.option_width = 25;
|
||||||
|
|
||||||
|
var long_desc = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s '
|
||||||
|
+ 'standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make'
|
||||||
|
+ ' a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, '
|
||||||
|
+ 'remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing '
|
||||||
|
+ 'Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions'
|
||||||
|
+ ' of Lorem Ipsum.';
|
||||||
|
|
||||||
|
cli.parse({
|
||||||
|
foo: ['f', long_desc]
|
||||||
|
});
|
11
project2/node_modules/cli/examples/progress.js
generated
vendored
Executable file
11
project2/node_modules/cli/examples/progress.js
generated
vendored
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
var cli = require('cli');
|
||||||
|
|
||||||
|
var i = 0, interval = setInterval(function () {
|
||||||
|
cli.progress(++i / 100);
|
||||||
|
if (i === 100) {
|
||||||
|
clearInterval(interval);
|
||||||
|
cli.ok('Finished!');
|
||||||
|
}
|
||||||
|
}, 50);
|
18
project2/node_modules/cli/examples/sort.js
generated
vendored
Executable file
18
project2/node_modules/cli/examples/sort.js
generated
vendored
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
var cli = require('cli');
|
||||||
|
|
||||||
|
var options = cli.parse({
|
||||||
|
numeric: ['n', 'Compare using a numeric sort'],
|
||||||
|
reverse: ['r', 'Reverse the results']
|
||||||
|
});
|
||||||
|
|
||||||
|
cli.withStdinLines(function (lines, newline) {
|
||||||
|
lines.sort(!options.numeric ? null : function (a, b) {
|
||||||
|
return parseInt(a) > parseInt(b);
|
||||||
|
});
|
||||||
|
if (options.reverse) {
|
||||||
|
lines.reverse();
|
||||||
|
}
|
||||||
|
this.output(lines.join(newline));
|
||||||
|
});
|
9
project2/node_modules/cli/examples/spinner.js
generated
vendored
Executable file
9
project2/node_modules/cli/examples/spinner.js
generated
vendored
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
var cli = require('cli');
|
||||||
|
|
||||||
|
cli.spinner('Working..');
|
||||||
|
|
||||||
|
setTimeout(function () {
|
||||||
|
cli.spinner('Working.. done!', true); //End the spinner
|
||||||
|
}, 3000);
|
1
project2/node_modules/cli/index.js
generated
vendored
Normal file
1
project2/node_modules/cli/index.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
module.exports = require('./cli');
|
70
project2/node_modules/cli/package.json
generated
vendored
Executable file
70
project2/node_modules/cli/package.json
generated
vendored
Executable file
@ -0,0 +1,70 @@
|
|||||||
|
{
|
||||||
|
"_from": "cli@~1.0.0",
|
||||||
|
"_id": "cli@1.0.1",
|
||||||
|
"_inBundle": false,
|
||||||
|
"_integrity": "sha1-IoF1NPJL+klQw01TLUjsvGIbjBQ=",
|
||||||
|
"_location": "/cli",
|
||||||
|
"_phantomChildren": {},
|
||||||
|
"_requested": {
|
||||||
|
"type": "range",
|
||||||
|
"registry": true,
|
||||||
|
"raw": "cli@~1.0.0",
|
||||||
|
"name": "cli",
|
||||||
|
"escapedName": "cli",
|
||||||
|
"rawSpec": "~1.0.0",
|
||||||
|
"saveSpec": null,
|
||||||
|
"fetchSpec": "~1.0.0"
|
||||||
|
},
|
||||||
|
"_requiredBy": [
|
||||||
|
"/jshint"
|
||||||
|
],
|
||||||
|
"_resolved": "https://registry.npmjs.org/cli/-/cli-1.0.1.tgz",
|
||||||
|
"_shasum": "22817534f24bfa4950c34d532d48ecbc621b8c14",
|
||||||
|
"_spec": "cli@~1.0.0",
|
||||||
|
"_where": "/home/massiveatoms/Desktop/cs142/project2/node_modules/jshint",
|
||||||
|
"author": {
|
||||||
|
"name": "Chris O'Hara",
|
||||||
|
"email": "cohara87@gmail.com"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "http://github.com/node-js-libs/cli/issues"
|
||||||
|
},
|
||||||
|
"bundleDependencies": false,
|
||||||
|
"contributors": [
|
||||||
|
{
|
||||||
|
"name": "Douglas Meyer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"exit": "0.1.2",
|
||||||
|
"glob": "^7.1.1"
|
||||||
|
},
|
||||||
|
"deprecated": false,
|
||||||
|
"description": "A tool for rapidly building command line apps",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.2.5"
|
||||||
|
},
|
||||||
|
"homepage": "http://github.com/node-js-libs/cli",
|
||||||
|
"keywords": [
|
||||||
|
"cli",
|
||||||
|
"command line",
|
||||||
|
"opts",
|
||||||
|
"parseopt",
|
||||||
|
"opt",
|
||||||
|
"args",
|
||||||
|
"console",
|
||||||
|
"argsparse",
|
||||||
|
"optparse",
|
||||||
|
"autocomplete",
|
||||||
|
"command",
|
||||||
|
"autocompletion"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "cli.js",
|
||||||
|
"name": "cli",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+ssh://git@github.com/node-js-libs/cli.git"
|
||||||
|
},
|
||||||
|
"version": "1.0.1"
|
||||||
|
}
|
4
project2/node_modules/concat-map/.travis.yml
generated
vendored
Normal file
4
project2/node_modules/concat-map/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
language: node_js
|
||||||
|
node_js:
|
||||||
|
- 0.4
|
||||||
|
- 0.6
|
18
project2/node_modules/concat-map/LICENSE
generated
vendored
Normal file
18
project2/node_modules/concat-map/LICENSE
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
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.
|
62
project2/node_modules/concat-map/README.markdown
generated
vendored
Normal file
62
project2/node_modules/concat-map/README.markdown
generated
vendored
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
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.
|
6
project2/node_modules/concat-map/example/map.js
generated
vendored
Normal file
6
project2/node_modules/concat-map/example/map.js
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
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);
|
13
project2/node_modules/concat-map/index.js
generated
vendored
Normal file
13
project2/node_modules/concat-map/index.js
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
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]';
|
||||||
|
};
|
88
project2/node_modules/concat-map/package.json
generated
vendored
Normal file
88
project2/node_modules/concat-map/package.json
generated
vendored
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
{
|
||||||
|
"_from": "concat-map@0.0.1",
|
||||||
|
"_id": "concat-map@0.0.1",
|
||||||
|
"_inBundle": false,
|
||||||
|
"_integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
|
||||||
|
"_location": "/concat-map",
|
||||||
|
"_phantomChildren": {},
|
||||||
|
"_requested": {
|
||||||
|
"type": "version",
|
||||||
|
"registry": true,
|
||||||
|
"raw": "concat-map@0.0.1",
|
||||||
|
"name": "concat-map",
|
||||||
|
"escapedName": "concat-map",
|
||||||
|
"rawSpec": "0.0.1",
|
||||||
|
"saveSpec": null,
|
||||||
|
"fetchSpec": "0.0.1"
|
||||||
|
},
|
||||||
|
"_requiredBy": [
|
||||||
|
"/brace-expansion"
|
||||||
|
],
|
||||||
|
"_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||||
|
"_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b",
|
||||||
|
"_spec": "concat-map@0.0.1",
|
||||||
|
"_where": "/home/massiveatoms/Desktop/cs142/project2/node_modules/brace-expansion",
|
||||||
|
"author": {
|
||||||
|
"name": "James Halliday",
|
||||||
|
"email": "mail@substack.net",
|
||||||
|
"url": "http://substack.net"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/substack/node-concat-map/issues"
|
||||||
|
},
|
||||||
|
"bundleDependencies": false,
|
||||||
|
"deprecated": false,
|
||||||
|
"description": "concatenative mapdashery",
|
||||||
|
"devDependencies": {
|
||||||
|
"tape": "~2.4.0"
|
||||||
|
},
|
||||||
|
"directories": {
|
||||||
|
"example": "example",
|
||||||
|
"test": "test"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/substack/node-concat-map#readme",
|
||||||
|
"keywords": [
|
||||||
|
"concat",
|
||||||
|
"concatMap",
|
||||||
|
"map",
|
||||||
|
"functional",
|
||||||
|
"higher-order"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "index.js",
|
||||||
|
"name": "concat-map",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/substack/node-concat-map.git"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "tape test/*.js"
|
||||||
|
},
|
||||||
|
"testling": {
|
||||||
|
"files": "test/*.js",
|
||||||
|
"browsers": {
|
||||||
|
"ie": [
|
||||||
|
6,
|
||||||
|
7,
|
||||||
|
8,
|
||||||
|
9
|
||||||
|
],
|
||||||
|
"ff": [
|
||||||
|
3.5,
|
||||||
|
10,
|
||||||
|
15
|
||||||
|
],
|
||||||
|
"chrome": [
|
||||||
|
10,
|
||||||
|
22
|
||||||
|
],
|
||||||
|
"safari": [
|
||||||
|
5.1
|
||||||
|
],
|
||||||
|
"opera": [
|
||||||
|
12
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"version": "0.0.1"
|
||||||
|
}
|
39
project2/node_modules/concat-map/test/map.js
generated
vendored
Normal file
39
project2/node_modules/concat-map/test/map.js
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
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();
|
||||||
|
});
|
14
project2/node_modules/console-browserify/.npmignore
generated
vendored
Normal file
14
project2/node_modules/console-browserify/.npmignore
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
.DS_Store
|
||||||
|
.monitor
|
||||||
|
.*.swp
|
||||||
|
.nodemonignore
|
||||||
|
releases
|
||||||
|
*.log
|
||||||
|
*.err
|
||||||
|
fleet.json
|
||||||
|
public/browserify
|
||||||
|
bin/*.json
|
||||||
|
.bin
|
||||||
|
build
|
||||||
|
compile
|
||||||
|
.lock-wscript
|
14
project2/node_modules/console-browserify/.testem.json
generated
vendored
Normal file
14
project2/node_modules/console-browserify/.testem.json
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"launchers": {
|
||||||
|
"node": {
|
||||||
|
"command": "npm test"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"src_files": [
|
||||||
|
"./**/*.js"
|
||||||
|
],
|
||||||
|
"before_tests": "npm run build",
|
||||||
|
"on_exit": "rm test/static/bundle.js",
|
||||||
|
"test_page": "test/static/index.html",
|
||||||
|
"launch_in_dev": ["node", "phantomjs"]
|
||||||
|
}
|
4
project2/node_modules/console-browserify/.travis.yml
generated
vendored
Normal file
4
project2/node_modules/console-browserify/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
language: node_js
|
||||||
|
node_js:
|
||||||
|
- 0.8
|
||||||
|
- 0.9
|
19
project2/node_modules/console-browserify/LICENCE
generated
vendored
Normal file
19
project2/node_modules/console-browserify/LICENCE
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
Copyright (c) 2012 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.
|
33
project2/node_modules/console-browserify/README.md
generated
vendored
Normal file
33
project2/node_modules/console-browserify/README.md
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# console-browserify
|
||||||
|
|
||||||
|
[![build status][1]][2]
|
||||||
|
|
||||||
|
[![browser support][3]][4]
|
||||||
|
|
||||||
|
|
||||||
|
Emulate console for all the browsers
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```js
|
||||||
|
var console = require("console-browserify")
|
||||||
|
|
||||||
|
console.log("hello world!")
|
||||||
|
```
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
`npm install console-browserify`
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
- Raynos
|
||||||
|
|
||||||
|
## MIT Licenced
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[1]: https://secure.travis-ci.org/Raynos/console-browserify.png
|
||||||
|
[2]: http://travis-ci.org/Raynos/console-browserify
|
||||||
|
[3]: http://ci.testling.com/Raynos/console-browserify.png
|
||||||
|
[4]: http://ci.testling.com/Raynos/console-browserify
|
86
project2/node_modules/console-browserify/index.js
generated
vendored
Normal file
86
project2/node_modules/console-browserify/index.js
generated
vendored
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
/*global window, global*/
|
||||||
|
var util = require("util")
|
||||||
|
var assert = require("assert")
|
||||||
|
var now = require("date-now")
|
||||||
|
|
||||||
|
var slice = Array.prototype.slice
|
||||||
|
var console
|
||||||
|
var times = {}
|
||||||
|
|
||||||
|
if (typeof global !== "undefined" && global.console) {
|
||||||
|
console = global.console
|
||||||
|
} else if (typeof window !== "undefined" && window.console) {
|
||||||
|
console = window.console
|
||||||
|
} else {
|
||||||
|
console = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
var functions = [
|
||||||
|
[log, "log"],
|
||||||
|
[info, "info"],
|
||||||
|
[warn, "warn"],
|
||||||
|
[error, "error"],
|
||||||
|
[time, "time"],
|
||||||
|
[timeEnd, "timeEnd"],
|
||||||
|
[trace, "trace"],
|
||||||
|
[dir, "dir"],
|
||||||
|
[consoleAssert, "assert"]
|
||||||
|
]
|
||||||
|
|
||||||
|
for (var i = 0; i < functions.length; i++) {
|
||||||
|
var tuple = functions[i]
|
||||||
|
var f = tuple[0]
|
||||||
|
var name = tuple[1]
|
||||||
|
|
||||||
|
if (!console[name]) {
|
||||||
|
console[name] = f
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = console
|
||||||
|
|
||||||
|
function log() {}
|
||||||
|
|
||||||
|
function info() {
|
||||||
|
console.log.apply(console, arguments)
|
||||||
|
}
|
||||||
|
|
||||||
|
function warn() {
|
||||||
|
console.log.apply(console, arguments)
|
||||||
|
}
|
||||||
|
|
||||||
|
function error() {
|
||||||
|
console.warn.apply(console, arguments)
|
||||||
|
}
|
||||||
|
|
||||||
|
function time(label) {
|
||||||
|
times[label] = now()
|
||||||
|
}
|
||||||
|
|
||||||
|
function timeEnd(label) {
|
||||||
|
var time = times[label]
|
||||||
|
if (!time) {
|
||||||
|
throw new Error("No such label: " + label)
|
||||||
|
}
|
||||||
|
|
||||||
|
var duration = now() - time
|
||||||
|
console.log(label + ": " + duration + "ms")
|
||||||
|
}
|
||||||
|
|
||||||
|
function trace() {
|
||||||
|
var err = new Error()
|
||||||
|
err.name = "Trace"
|
||||||
|
err.message = util.format.apply(null, arguments)
|
||||||
|
console.error(err.stack)
|
||||||
|
}
|
||||||
|
|
||||||
|
function dir(object) {
|
||||||
|
console.log(util.inspect(object) + "\n")
|
||||||
|
}
|
||||||
|
|
||||||
|
function consoleAssert(expression) {
|
||||||
|
if (!expression) {
|
||||||
|
var arr = slice.call(arguments, 1)
|
||||||
|
assert.ok(false, util.format.apply(null, arr))
|
||||||
|
}
|
||||||
|
}
|
93
project2/node_modules/console-browserify/package.json
generated
vendored
Normal file
93
project2/node_modules/console-browserify/package.json
generated
vendored
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
{
|
||||||
|
"_from": "console-browserify@1.1.x",
|
||||||
|
"_id": "console-browserify@1.1.0",
|
||||||
|
"_inBundle": false,
|
||||||
|
"_integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=",
|
||||||
|
"_location": "/console-browserify",
|
||||||
|
"_phantomChildren": {},
|
||||||
|
"_requested": {
|
||||||
|
"type": "range",
|
||||||
|
"registry": true,
|
||||||
|
"raw": "console-browserify@1.1.x",
|
||||||
|
"name": "console-browserify",
|
||||||
|
"escapedName": "console-browserify",
|
||||||
|
"rawSpec": "1.1.x",
|
||||||
|
"saveSpec": null,
|
||||||
|
"fetchSpec": "1.1.x"
|
||||||
|
},
|
||||||
|
"_requiredBy": [
|
||||||
|
"/jshint"
|
||||||
|
],
|
||||||
|
"_resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz",
|
||||||
|
"_shasum": "f0241c45730a9fc6323b206dbf38edc741d0bb10",
|
||||||
|
"_spec": "console-browserify@1.1.x",
|
||||||
|
"_where": "/home/massiveatoms/Desktop/cs142/project2/node_modules/jshint",
|
||||||
|
"author": {
|
||||||
|
"name": "Raynos",
|
||||||
|
"email": "raynos2@gmail.com"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/Raynos/console-browserify/issues",
|
||||||
|
"email": "raynos2@gmail.com"
|
||||||
|
},
|
||||||
|
"bundleDependencies": false,
|
||||||
|
"contributors": [
|
||||||
|
{
|
||||||
|
"name": "Raynos"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"date-now": "^0.1.4"
|
||||||
|
},
|
||||||
|
"deprecated": false,
|
||||||
|
"description": "Emulate console for all the browsers",
|
||||||
|
"devDependencies": {
|
||||||
|
"jsonify": "0.0.0",
|
||||||
|
"run-browser": "^1.3.0",
|
||||||
|
"tap-dot": "^0.2.1",
|
||||||
|
"tap-spec": "^0.1.8",
|
||||||
|
"tape": "^2.12.3"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/Raynos/console-browserify",
|
||||||
|
"keywords": [],
|
||||||
|
"licenses": [
|
||||||
|
{
|
||||||
|
"type": "MIT",
|
||||||
|
"url": "http://github.com/Raynos/console-browserify/raw/master/LICENSE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"main": "index",
|
||||||
|
"name": "console-browserify",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/Raynos/console-browserify.git"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"browser": "run-browser test/index.js",
|
||||||
|
"build": "browserify test/index.js -o test/static/bundle.js",
|
||||||
|
"cover": "istanbul cover --report none --print detail ./test/index.js",
|
||||||
|
"dot": "node ./test/index.js | tap-dot",
|
||||||
|
"phantom": "run-browser test/index.js -b | tap-spec",
|
||||||
|
"start": "node ./index.js",
|
||||||
|
"test": "node ./test/index.js | tap-spec",
|
||||||
|
"testem": "testem",
|
||||||
|
"view-cover": "istanbul report html && google-chrome ./coverage/index.html"
|
||||||
|
},
|
||||||
|
"testling": {
|
||||||
|
"files": "test/index.js",
|
||||||
|
"browsers": [
|
||||||
|
"ie/8..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",
|
||||||
|
"android-browser/4.2..latest"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"version": "1.1.0"
|
||||||
|
}
|
67
project2/node_modules/console-browserify/test/index.js
generated
vendored
Normal file
67
project2/node_modules/console-browserify/test/index.js
generated
vendored
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
var console = require("../index")
|
||||||
|
var test = require("tape")
|
||||||
|
|
||||||
|
if (typeof window !== "undefined" && !window.JSON) {
|
||||||
|
window.JSON = require("jsonify")
|
||||||
|
}
|
||||||
|
|
||||||
|
test("console has expected methods", function (assert) {
|
||||||
|
assert.ok(console.log)
|
||||||
|
assert.ok(console.info)
|
||||||
|
assert.ok(console.warn)
|
||||||
|
assert.ok(console.dir)
|
||||||
|
assert.ok(console.time, "time")
|
||||||
|
assert.ok(console.timeEnd, "timeEnd")
|
||||||
|
assert.ok(console.trace, "trace")
|
||||||
|
assert.ok(console.assert)
|
||||||
|
|
||||||
|
assert.end()
|
||||||
|
})
|
||||||
|
|
||||||
|
test("invoke console.log", function (assert) {
|
||||||
|
console.log("test-log")
|
||||||
|
|
||||||
|
assert.end()
|
||||||
|
})
|
||||||
|
|
||||||
|
test("invoke console.info", function (assert) {
|
||||||
|
console.info("test-info")
|
||||||
|
|
||||||
|
assert.end()
|
||||||
|
})
|
||||||
|
|
||||||
|
test("invoke console.warn", function (assert) {
|
||||||
|
console.warn("test-warn")
|
||||||
|
|
||||||
|
assert.end()
|
||||||
|
})
|
||||||
|
|
||||||
|
test("invoke console.time", function (assert) {
|
||||||
|
console.time("label")
|
||||||
|
|
||||||
|
assert.end()
|
||||||
|
})
|
||||||
|
|
||||||
|
test("invoke console.trace", function (assert) {
|
||||||
|
console.trace("test-trace")
|
||||||
|
|
||||||
|
assert.end()
|
||||||
|
})
|
||||||
|
|
||||||
|
test("invoke console.assert", function (assert) {
|
||||||
|
console.assert(true)
|
||||||
|
|
||||||
|
assert.end()
|
||||||
|
})
|
||||||
|
|
||||||
|
test("invoke console.dir", function (assert) {
|
||||||
|
console.dir("test-dir")
|
||||||
|
|
||||||
|
assert.end()
|
||||||
|
})
|
||||||
|
|
||||||
|
test("invoke console.timeEnd", function (assert) {
|
||||||
|
console.timeEnd("label")
|
||||||
|
|
||||||
|
assert.end()
|
||||||
|
})
|
12
project2/node_modules/console-browserify/test/static/index.html
generated
vendored
Normal file
12
project2/node_modules/console-browserify/test/static/index.html
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="x-ua-compatible" content="IE=8" >
|
||||||
|
<title>TAPE Example</title>
|
||||||
|
<script src="/testem.js"></script>
|
||||||
|
<script src="test-adapter.js"></script>
|
||||||
|
<script src="bundle.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
</body>
|
||||||
|
</html>
|
53
project2/node_modules/console-browserify/test/static/test-adapter.js
generated
vendored
Normal file
53
project2/node_modules/console-browserify/test/static/test-adapter.js
generated
vendored
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
(function () {
|
||||||
|
var Testem = window.Testem
|
||||||
|
var regex = /^((?:not )?ok) (\d+) (.+)$/
|
||||||
|
|
||||||
|
Testem.useCustomAdapter(tapAdapter)
|
||||||
|
|
||||||
|
function tapAdapter(socket){
|
||||||
|
var results = {
|
||||||
|
failed: 0
|
||||||
|
, passed: 0
|
||||||
|
, total: 0
|
||||||
|
, tests: []
|
||||||
|
}
|
||||||
|
|
||||||
|
socket.emit('tests-start')
|
||||||
|
|
||||||
|
Testem.handleConsoleMessage = function(msg){
|
||||||
|
var m = msg.match(regex)
|
||||||
|
if (m) {
|
||||||
|
var passed = m[1] === 'ok'
|
||||||
|
var test = {
|
||||||
|
passed: passed ? 1 : 0,
|
||||||
|
failed: passed ? 0 : 1,
|
||||||
|
total: 1,
|
||||||
|
id: m[2],
|
||||||
|
name: m[3],
|
||||||
|
items: []
|
||||||
|
}
|
||||||
|
|
||||||
|
if (passed) {
|
||||||
|
results.passed++
|
||||||
|
} else {
|
||||||
|
console.error("failure", m)
|
||||||
|
|
||||||
|
results.failed++
|
||||||
|
}
|
||||||
|
|
||||||
|
results.total++
|
||||||
|
|
||||||
|
// console.log("emitted test", test)
|
||||||
|
socket.emit('test-result', test)
|
||||||
|
results.tests.push(test)
|
||||||
|
} else if (msg === '# ok' || msg.match(/^# tests \d+/)){
|
||||||
|
// console.log("emitted all test")
|
||||||
|
socket.emit('all-test-results', results)
|
||||||
|
}
|
||||||
|
|
||||||
|
// return false if you want to prevent the console message from
|
||||||
|
// going to the console
|
||||||
|
// return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}())
|
19
project2/node_modules/core-util-is/LICENSE
generated
vendored
Normal file
19
project2/node_modules/core-util-is/LICENSE
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
Copyright Node.js contributors. All rights reserved.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to
|
||||||
|
deal in the Software without restriction, including without limitation the
|
||||||
|
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
|
IN THE SOFTWARE.
|
3
project2/node_modules/core-util-is/README.md
generated
vendored
Normal file
3
project2/node_modules/core-util-is/README.md
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# core-util-is
|
||||||
|
|
||||||
|
The `util.is*` functions introduced in Node v0.12.
|
604
project2/node_modules/core-util-is/float.patch
generated
vendored
Normal file
604
project2/node_modules/core-util-is/float.patch
generated
vendored
Normal file
@ -0,0 +1,604 @@
|
|||||||
|
diff --git a/lib/util.js b/lib/util.js
|
||||||
|
index a03e874..9074e8e 100644
|
||||||
|
--- a/lib/util.js
|
||||||
|
+++ b/lib/util.js
|
||||||
|
@@ -19,430 +19,6 @@
|
||||||
|
// 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);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- // 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)) {
|
||||||
|
- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0,
|
||||||
|
- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 .
|
||||||
|
- if (value === 0 && 1 / value < 0)
|
||||||
|
- return ctx.stylize('-0', 'number');
|
||||||
|
- 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) {
|
||||||
|
@@ -522,166 +98,10 @@ function isPrimitive(arg) {
|
||||||
|
exports.isPrimitive = isPrimitive;
|
||||||
|
|
||||||
|
function isBuffer(arg) {
|
||||||
|
- return arg instanceof Buffer;
|
||||||
|
+ return Buffer.isBuffer(arg);
|
||||||
|
}
|
||||||
|
exports.isBuffer = 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 = function(ctor, superCtor) {
|
||||||
|
- ctor.super_ = superCtor;
|
||||||
|
- ctor.prototype = Object.create(superCtor.prototype, {
|
||||||
|
- constructor: {
|
||||||
|
- value: ctor,
|
||||||
|
- enumerable: false,
|
||||||
|
- writable: true,
|
||||||
|
- configurable: true
|
||||||
|
- }
|
||||||
|
- });
|
||||||
|
-};
|
||||||
|
-
|
||||||
|
-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);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-
|
||||||
|
-// Deprecated old stuff.
|
||||||
|
-
|
||||||
|
-exports.p = exports.deprecate(function() {
|
||||||
|
- for (var i = 0, len = arguments.length; i < len; ++i) {
|
||||||
|
- console.error(exports.inspect(arguments[i]));
|
||||||
|
- }
|
||||||
|
-}, 'util.p: Use console.error() instead');
|
||||||
|
-
|
||||||
|
-
|
||||||
|
-exports.exec = exports.deprecate(function() {
|
||||||
|
- return require('child_process').exec.apply(this, arguments);
|
||||||
|
-}, 'util.exec is now called `child_process.exec`.');
|
||||||
|
-
|
||||||
|
-
|
||||||
|
-exports.print = exports.deprecate(function() {
|
||||||
|
- for (var i = 0, len = arguments.length; i < len; ++i) {
|
||||||
|
- process.stdout.write(String(arguments[i]));
|
||||||
|
- }
|
||||||
|
-}, 'util.print: Use console.log instead');
|
||||||
|
-
|
||||||
|
-
|
||||||
|
-exports.puts = exports.deprecate(function() {
|
||||||
|
- for (var i = 0, len = arguments.length; i < len; ++i) {
|
||||||
|
- process.stdout.write(arguments[i] + '\n');
|
||||||
|
- }
|
||||||
|
-}, 'util.puts: Use console.log instead');
|
||||||
|
-
|
||||||
|
-
|
||||||
|
-exports.debug = exports.deprecate(function(x) {
|
||||||
|
- process.stderr.write('DEBUG: ' + x + '\n');
|
||||||
|
-}, 'util.debug: Use console.error instead');
|
||||||
|
-
|
||||||
|
-
|
||||||
|
-exports.error = exports.deprecate(function(x) {
|
||||||
|
- for (var i = 0, len = arguments.length; i < len; ++i) {
|
||||||
|
- process.stderr.write(arguments[i] + '\n');
|
||||||
|
- }
|
||||||
|
-}, 'util.error: Use console.error instead');
|
||||||
|
-
|
||||||
|
-
|
||||||
|
-exports.pump = exports.deprecate(function(readStream, writeStream, callback) {
|
||||||
|
- var callbackCalled = false;
|
||||||
|
-
|
||||||
|
- function call(a, b, c) {
|
||||||
|
- if (callback && !callbackCalled) {
|
||||||
|
- callback(a, b, c);
|
||||||
|
- callbackCalled = true;
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- readStream.addListener('data', function(chunk) {
|
||||||
|
- if (writeStream.write(chunk) === false) readStream.pause();
|
||||||
|
- });
|
||||||
|
-
|
||||||
|
- writeStream.addListener('drain', function() {
|
||||||
|
- readStream.resume();
|
||||||
|
- });
|
||||||
|
-
|
||||||
|
- readStream.addListener('end', function() {
|
||||||
|
- writeStream.end();
|
||||||
|
- });
|
||||||
|
-
|
||||||
|
- readStream.addListener('close', function() {
|
||||||
|
- call();
|
||||||
|
- });
|
||||||
|
-
|
||||||
|
- readStream.addListener('error', function(err) {
|
||||||
|
- writeStream.end();
|
||||||
|
- call(err);
|
||||||
|
- });
|
||||||
|
-
|
||||||
|
- writeStream.addListener('error', function(err) {
|
||||||
|
- readStream.destroy();
|
||||||
|
- call(err);
|
||||||
|
- });
|
||||||
|
-}, 'util.pump(): Use readableStream.pipe() instead');
|
||||||
|
-
|
||||||
|
-
|
||||||
|
-var uv;
|
||||||
|
-exports._errnoException = function(err, syscall) {
|
||||||
|
- if (isUndefined(uv)) uv = process.binding('uv');
|
||||||
|
- var errname = uv.errname(err);
|
||||||
|
- var e = new Error(syscall + ' ' + errname);
|
||||||
|
- e.code = errname;
|
||||||
|
- e.errno = errname;
|
||||||
|
- e.syscall = syscall;
|
||||||
|
- return e;
|
||||||
|
-};
|
||||||
|
+}
|
107
project2/node_modules/core-util-is/lib/util.js
generated
vendored
Normal file
107
project2/node_modules/core-util-is/lib/util.js
generated
vendored
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
// NOTE: These type checking functions intentionally don't use `instanceof`
|
||||||
|
// because it is fragile and can be easily faked with `Object.create()`.
|
||||||
|
|
||||||
|
function isArray(arg) {
|
||||||
|
if (Array.isArray) {
|
||||||
|
return Array.isArray(arg);
|
||||||
|
}
|
||||||
|
return objectToString(arg) === '[object Array]';
|
||||||
|
}
|
||||||
|
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 objectToString(re) === '[object RegExp]';
|
||||||
|
}
|
||||||
|
exports.isRegExp = isRegExp;
|
||||||
|
|
||||||
|
function isObject(arg) {
|
||||||
|
return typeof arg === 'object' && arg !== null;
|
||||||
|
}
|
||||||
|
exports.isObject = isObject;
|
||||||
|
|
||||||
|
function isDate(d) {
|
||||||
|
return objectToString(d) === '[object Date]';
|
||||||
|
}
|
||||||
|
exports.isDate = isDate;
|
||||||
|
|
||||||
|
function isError(e) {
|
||||||
|
return (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 = Buffer.isBuffer;
|
||||||
|
|
||||||
|
function objectToString(o) {
|
||||||
|
return Object.prototype.toString.call(o);
|
||||||
|
}
|
62
project2/node_modules/core-util-is/package.json
generated
vendored
Normal file
62
project2/node_modules/core-util-is/package.json
generated
vendored
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
{
|
||||||
|
"_from": "core-util-is@~1.0.0",
|
||||||
|
"_id": "core-util-is@1.0.2",
|
||||||
|
"_inBundle": false,
|
||||||
|
"_integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
|
||||||
|
"_location": "/core-util-is",
|
||||||
|
"_phantomChildren": {},
|
||||||
|
"_requested": {
|
||||||
|
"type": "range",
|
||||||
|
"registry": true,
|
||||||
|
"raw": "core-util-is@~1.0.0",
|
||||||
|
"name": "core-util-is",
|
||||||
|
"escapedName": "core-util-is",
|
||||||
|
"rawSpec": "~1.0.0",
|
||||||
|
"saveSpec": null,
|
||||||
|
"fetchSpec": "~1.0.0"
|
||||||
|
},
|
||||||
|
"_requiredBy": [
|
||||||
|
"/readable-stream"
|
||||||
|
],
|
||||||
|
"_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
|
||||||
|
"_shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7",
|
||||||
|
"_spec": "core-util-is@~1.0.0",
|
||||||
|
"_where": "/home/massiveatoms/Desktop/cs142/project2/node_modules/readable-stream",
|
||||||
|
"author": {
|
||||||
|
"name": "Isaac Z. Schlueter",
|
||||||
|
"email": "i@izs.me",
|
||||||
|
"url": "http://blog.izs.me/"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/isaacs/core-util-is/issues"
|
||||||
|
},
|
||||||
|
"bundleDependencies": false,
|
||||||
|
"deprecated": false,
|
||||||
|
"description": "The `util.is*` functions introduced in Node v0.12.",
|
||||||
|
"devDependencies": {
|
||||||
|
"tap": "^2.3.0"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/isaacs/core-util-is#readme",
|
||||||
|
"keywords": [
|
||||||
|
"util",
|
||||||
|
"isBuffer",
|
||||||
|
"isArray",
|
||||||
|
"isNumber",
|
||||||
|
"isString",
|
||||||
|
"isRegExp",
|
||||||
|
"isThis",
|
||||||
|
"isThat",
|
||||||
|
"polyfill"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "lib/util.js",
|
||||||
|
"name": "core-util-is",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/isaacs/core-util-is.git"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "tap test.js"
|
||||||
|
},
|
||||||
|
"version": "1.0.2"
|
||||||
|
}
|
68
project2/node_modules/core-util-is/test.js
generated
vendored
Normal file
68
project2/node_modules/core-util-is/test.js
generated
vendored
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
var assert = require('tap');
|
||||||
|
|
||||||
|
var t = require('./lib/util');
|
||||||
|
|
||||||
|
assert.equal(t.isArray([]), true);
|
||||||
|
assert.equal(t.isArray({}), false);
|
||||||
|
|
||||||
|
assert.equal(t.isBoolean(null), false);
|
||||||
|
assert.equal(t.isBoolean(true), true);
|
||||||
|
assert.equal(t.isBoolean(false), true);
|
||||||
|
|
||||||
|
assert.equal(t.isNull(null), true);
|
||||||
|
assert.equal(t.isNull(undefined), false);
|
||||||
|
assert.equal(t.isNull(false), false);
|
||||||
|
assert.equal(t.isNull(), false);
|
||||||
|
|
||||||
|
assert.equal(t.isNullOrUndefined(null), true);
|
||||||
|
assert.equal(t.isNullOrUndefined(undefined), true);
|
||||||
|
assert.equal(t.isNullOrUndefined(false), false);
|
||||||
|
assert.equal(t.isNullOrUndefined(), true);
|
||||||
|
|
||||||
|
assert.equal(t.isNumber(null), false);
|
||||||
|
assert.equal(t.isNumber('1'), false);
|
||||||
|
assert.equal(t.isNumber(1), true);
|
||||||
|
|
||||||
|
assert.equal(t.isString(null), false);
|
||||||
|
assert.equal(t.isString('1'), true);
|
||||||
|
assert.equal(t.isString(1), false);
|
||||||
|
|
||||||
|
assert.equal(t.isSymbol(null), false);
|
||||||
|
assert.equal(t.isSymbol('1'), false);
|
||||||
|
assert.equal(t.isSymbol(1), false);
|
||||||
|
assert.equal(t.isSymbol(Symbol()), true);
|
||||||
|
|
||||||
|
assert.equal(t.isUndefined(null), false);
|
||||||
|
assert.equal(t.isUndefined(undefined), true);
|
||||||
|
assert.equal(t.isUndefined(false), false);
|
||||||
|
assert.equal(t.isUndefined(), true);
|
||||||
|
|
||||||
|
assert.equal(t.isRegExp(null), false);
|
||||||
|
assert.equal(t.isRegExp('1'), false);
|
||||||
|
assert.equal(t.isRegExp(new RegExp()), true);
|
||||||
|
|
||||||
|
assert.equal(t.isObject({}), true);
|
||||||
|
assert.equal(t.isObject([]), true);
|
||||||
|
assert.equal(t.isObject(new RegExp()), true);
|
||||||
|
assert.equal(t.isObject(new Date()), true);
|
||||||
|
|
||||||
|
assert.equal(t.isDate(null), false);
|
||||||
|
assert.equal(t.isDate('1'), false);
|
||||||
|
assert.equal(t.isDate(new Date()), true);
|
||||||
|
|
||||||
|
assert.equal(t.isError(null), false);
|
||||||
|
assert.equal(t.isError({ err: true }), false);
|
||||||
|
assert.equal(t.isError(new Error()), true);
|
||||||
|
|
||||||
|
assert.equal(t.isFunction(null), false);
|
||||||
|
assert.equal(t.isFunction({ }), false);
|
||||||
|
assert.equal(t.isFunction(function() {}), true);
|
||||||
|
|
||||||
|
assert.equal(t.isPrimitive(null), true);
|
||||||
|
assert.equal(t.isPrimitive(''), true);
|
||||||
|
assert.equal(t.isPrimitive(0), true);
|
||||||
|
assert.equal(t.isPrimitive(new Date()), false);
|
||||||
|
|
||||||
|
assert.equal(t.isBuffer(null), false);
|
||||||
|
assert.equal(t.isBuffer({}), false);
|
||||||
|
assert.equal(t.isBuffer(new Buffer(0)), true);
|
14
project2/node_modules/date-now/.npmignore
generated
vendored
Normal file
14
project2/node_modules/date-now/.npmignore
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
.DS_Store
|
||||||
|
.monitor
|
||||||
|
.*.swp
|
||||||
|
.nodemonignore
|
||||||
|
releases
|
||||||
|
*.log
|
||||||
|
*.err
|
||||||
|
fleet.json
|
||||||
|
public/browserify
|
||||||
|
bin/*.json
|
||||||
|
.bin
|
||||||
|
build
|
||||||
|
compile
|
||||||
|
.lock-wscript
|
14
project2/node_modules/date-now/.testem.json
generated
vendored
Normal file
14
project2/node_modules/date-now/.testem.json
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"launchers": {
|
||||||
|
"node": {
|
||||||
|
"command": "npm test"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"src_files": [
|
||||||
|
"./**/*.js"
|
||||||
|
],
|
||||||
|
"before_tests": "npm run build",
|
||||||
|
"on_exit": "rm test/static/bundle.js",
|
||||||
|
"test_page": "test/static/index.html",
|
||||||
|
"launch_in_dev": ["node", "phantomjs"]
|
||||||
|
}
|
4
project2/node_modules/date-now/.travis.yml
generated
vendored
Normal file
4
project2/node_modules/date-now/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
language: node_js
|
||||||
|
node_js:
|
||||||
|
- 0.8
|
||||||
|
- 0.9
|
19
project2/node_modules/date-now/LICENCE
generated
vendored
Normal file
19
project2/node_modules/date-now/LICENCE
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
Copyright (c) 2012 Colingo.
|
||||||
|
|
||||||
|
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.
|
45
project2/node_modules/date-now/README.md
generated
vendored
Normal file
45
project2/node_modules/date-now/README.md
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
# date-now
|
||||||
|
|
||||||
|
[![build status][1]][2]
|
||||||
|
|
||||||
|
[![browser support][3]][4]
|
||||||
|
|
||||||
|
A requirable version of Date.now()
|
||||||
|
|
||||||
|
Use-case is to be able to mock out Date.now() using require interception.
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```js
|
||||||
|
var now = require("date-now")
|
||||||
|
|
||||||
|
var ts = now()
|
||||||
|
var ts2 = Date.now()
|
||||||
|
assert.equal(ts, ts2)
|
||||||
|
```
|
||||||
|
|
||||||
|
## example of seed
|
||||||
|
|
||||||
|
```
|
||||||
|
var now = require("date-now/seed")(timeStampFromServer)
|
||||||
|
|
||||||
|
// ts is in "sync" with the seed value from the server
|
||||||
|
// useful if your users have their local time being a few minutes
|
||||||
|
// out of your server time.
|
||||||
|
var ts = now()
|
||||||
|
```
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
`npm install date-now`
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
- Raynos
|
||||||
|
|
||||||
|
## MIT Licenced
|
||||||
|
|
||||||
|
[1]: https://secure.travis-ci.org/Colingo/date-now.png
|
||||||
|
[2]: http://travis-ci.org/Colingo/date-now
|
||||||
|
[3]: http://ci.testling.com/Colingo/date-now.png
|
||||||
|
[4]: http://ci.testling.com/Colingo/date-now
|
5
project2/node_modules/date-now/index.js
generated
vendored
Normal file
5
project2/node_modules/date-now/index.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
module.exports = now
|
||||||
|
|
||||||
|
function now() {
|
||||||
|
return new Date().getTime()
|
||||||
|
}
|
94
project2/node_modules/date-now/package.json
generated
vendored
Normal file
94
project2/node_modules/date-now/package.json
generated
vendored
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
{
|
||||||
|
"_from": "date-now@^0.1.4",
|
||||||
|
"_id": "date-now@0.1.4",
|
||||||
|
"_inBundle": false,
|
||||||
|
"_integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=",
|
||||||
|
"_location": "/date-now",
|
||||||
|
"_phantomChildren": {},
|
||||||
|
"_requested": {
|
||||||
|
"type": "range",
|
||||||
|
"registry": true,
|
||||||
|
"raw": "date-now@^0.1.4",
|
||||||
|
"name": "date-now",
|
||||||
|
"escapedName": "date-now",
|
||||||
|
"rawSpec": "^0.1.4",
|
||||||
|
"saveSpec": null,
|
||||||
|
"fetchSpec": "^0.1.4"
|
||||||
|
},
|
||||||
|
"_requiredBy": [
|
||||||
|
"/console-browserify"
|
||||||
|
],
|
||||||
|
"_resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz",
|
||||||
|
"_shasum": "eaf439fd4d4848ad74e5cc7dbef200672b9e345b",
|
||||||
|
"_spec": "date-now@^0.1.4",
|
||||||
|
"_where": "/home/massiveatoms/Desktop/cs142/project2/node_modules/console-browserify",
|
||||||
|
"author": {
|
||||||
|
"name": "Raynos",
|
||||||
|
"email": "raynos2@gmail.com"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/Colingo/date-now/issues",
|
||||||
|
"email": "raynos2@gmail.com"
|
||||||
|
},
|
||||||
|
"bundleDependencies": false,
|
||||||
|
"contributors": [
|
||||||
|
{
|
||||||
|
"name": "Artem Shoobovych"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dependencies": {},
|
||||||
|
"deprecated": false,
|
||||||
|
"description": "A requirable version of Date.now()",
|
||||||
|
"devDependencies": {
|
||||||
|
"browserify": "https://github.com/raynos/node-browserify/tarball/master",
|
||||||
|
"tape": "~0.2.2",
|
||||||
|
"testem": "~0.2.52"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/Colingo/date-now",
|
||||||
|
"keywords": [],
|
||||||
|
"licenses": [
|
||||||
|
{
|
||||||
|
"type": "MIT",
|
||||||
|
"url": "http://github.com/Colingo/date-now/raw/master/LICENSE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"main": "index",
|
||||||
|
"name": "date-now",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/Colingo/date-now.git"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"build": "browserify test/index.js -o test/static/bundle.js",
|
||||||
|
"test": "node ./test",
|
||||||
|
"testem": "testem"
|
||||||
|
},
|
||||||
|
"testling": {
|
||||||
|
"files": "test/*.js",
|
||||||
|
"browsers": {
|
||||||
|
"ie": [
|
||||||
|
"8",
|
||||||
|
"9",
|
||||||
|
"10"
|
||||||
|
],
|
||||||
|
"firefox": [
|
||||||
|
"16",
|
||||||
|
"17",
|
||||||
|
"nightly"
|
||||||
|
],
|
||||||
|
"chrome": [
|
||||||
|
"22",
|
||||||
|
"23",
|
||||||
|
"canary"
|
||||||
|
],
|
||||||
|
"opera": [
|
||||||
|
"12",
|
||||||
|
"next"
|
||||||
|
],
|
||||||
|
"safari": [
|
||||||
|
"5.1"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"version": "0.1.4"
|
||||||
|
}
|
16
project2/node_modules/date-now/seed.js
generated
vendored
Normal file
16
project2/node_modules/date-now/seed.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
var now = require("./index")
|
||||||
|
|
||||||
|
module.exports = seeded
|
||||||
|
|
||||||
|
/* Returns a Date.now() like function that's in sync with
|
||||||
|
the seed value
|
||||||
|
*/
|
||||||
|
function seeded(seed) {
|
||||||
|
var current = now()
|
||||||
|
|
||||||
|
return time
|
||||||
|
|
||||||
|
function time() {
|
||||||
|
return seed + (now() - current)
|
||||||
|
}
|
||||||
|
}
|
28
project2/node_modules/date-now/test/index.js
generated
vendored
Normal file
28
project2/node_modules/date-now/test/index.js
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
var test = require("tape")
|
||||||
|
var setTimeout = require("timers").setTimeout
|
||||||
|
|
||||||
|
var now = require("../index")
|
||||||
|
var seeded = require("../seed")
|
||||||
|
|
||||||
|
test("date", function (assert) {
|
||||||
|
var ts = now()
|
||||||
|
var ts2 = Date.now()
|
||||||
|
assert.equal(ts, ts2)
|
||||||
|
assert.end()
|
||||||
|
})
|
||||||
|
|
||||||
|
test("seeded", function (assert) {
|
||||||
|
var time = seeded(40)
|
||||||
|
var ts = time()
|
||||||
|
|
||||||
|
within(assert, time(), 40, 5)
|
||||||
|
setTimeout(function () {
|
||||||
|
within(assert, time(), 90, 10)
|
||||||
|
assert.end()
|
||||||
|
}, 50)
|
||||||
|
})
|
||||||
|
|
||||||
|
function within(assert, a, b, offset) {
|
||||||
|
assert.ok(a + offset > b)
|
||||||
|
assert.ok(a - offset < b)
|
||||||
|
}
|
10
project2/node_modules/date-now/test/static/index.html
generated
vendored
Normal file
10
project2/node_modules/date-now/test/static/index.html
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>TAPE Example</title>
|
||||||
|
<script src="/testem.js"></script>
|
||||||
|
<script src="bundle.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
</body>
|
||||||
|
</html>
|
11
project2/node_modules/dom-serializer/LICENSE
generated
vendored
Normal file
11
project2/node_modules/dom-serializer/LICENSE
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
License
|
||||||
|
|
||||||
|
(The MIT License)
|
||||||
|
|
||||||
|
Copyright (c) 2014 The cheeriojs 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.
|
1
project2/node_modules/dom-serializer/README.md
generated
vendored
Normal file
1
project2/node_modules/dom-serializer/README.md
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
Renders a DOM node or an array of DOM nodes to a string.
|
102
project2/node_modules/dom-serializer/foreignNames.json
generated
vendored
Normal file
102
project2/node_modules/dom-serializer/foreignNames.json
generated
vendored
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
{
|
||||||
|
"elementNames" : {
|
||||||
|
"altglyph" : "altGlyph",
|
||||||
|
"altglyphdef" : "altGlyphDef",
|
||||||
|
"altglyphitem" : "altGlyphItem",
|
||||||
|
"animatecolor" : "animateColor",
|
||||||
|
"animatemotion" : "animateMotion",
|
||||||
|
"animatetransform" : "animateTransform",
|
||||||
|
"clippath" : "clipPath",
|
||||||
|
"feblend" : "feBlend",
|
||||||
|
"fecolormatrix" : "feColorMatrix",
|
||||||
|
"fecomponenttransfer" : "feComponentTransfer",
|
||||||
|
"fecomposite" : "feComposite",
|
||||||
|
"feconvolvematrix" : "feConvolveMatrix",
|
||||||
|
"fediffuselighting" : "feDiffuseLighting",
|
||||||
|
"fedisplacementmap" : "feDisplacementMap",
|
||||||
|
"fedistantlight" : "feDistantLight",
|
||||||
|
"fedropshadow" : "feDropShadow",
|
||||||
|
"feflood" : "feFlood",
|
||||||
|
"fefunca" : "feFuncA",
|
||||||
|
"fefuncb" : "feFuncB",
|
||||||
|
"fefuncg" : "feFuncG",
|
||||||
|
"fefuncr" : "feFuncR",
|
||||||
|
"fegaussianblur" : "feGaussianBlur",
|
||||||
|
"feimage" : "feImage",
|
||||||
|
"femerge" : "feMerge",
|
||||||
|
"femergenode" : "feMergeNode",
|
||||||
|
"femorphology" : "feMorphology",
|
||||||
|
"feoffset" : "feOffset",
|
||||||
|
"fepointlight" : "fePointLight",
|
||||||
|
"fespecularlighting" : "feSpecularLighting",
|
||||||
|
"fespotlight" : "feSpotLight",
|
||||||
|
"fetile" : "feTile",
|
||||||
|
"feturbulence" : "feTurbulence",
|
||||||
|
"foreignobject" : "foreignObject",
|
||||||
|
"glyphref" : "glyphRef",
|
||||||
|
"lineargradient" : "linearGradient",
|
||||||
|
"radialgradient" : "radialGradient",
|
||||||
|
"textpath" : "textPath"
|
||||||
|
},
|
||||||
|
"attributeNames" : {
|
||||||
|
"definitionurl" : "definitionURL",
|
||||||
|
"attributename" : "attributeName",
|
||||||
|
"attributetype" : "attributeType",
|
||||||
|
"basefrequency" : "baseFrequency",
|
||||||
|
"baseprofile" : "baseProfile",
|
||||||
|
"calcmode" : "calcMode",
|
||||||
|
"clippathunits" : "clipPathUnits",
|
||||||
|
"diffuseconstant" : "diffuseConstant",
|
||||||
|
"edgemode" : "edgeMode",
|
||||||
|
"filterunits" : "filterUnits",
|
||||||
|
"glyphref" : "glyphRef",
|
||||||
|
"gradienttransform" : "gradientTransform",
|
||||||
|
"gradientunits" : "gradientUnits",
|
||||||
|
"kernelmatrix" : "kernelMatrix",
|
||||||
|
"kernelunitlength" : "kernelUnitLength",
|
||||||
|
"keypoints" : "keyPoints",
|
||||||
|
"keysplines" : "keySplines",
|
||||||
|
"keytimes" : "keyTimes",
|
||||||
|
"lengthadjust" : "lengthAdjust",
|
||||||
|
"limitingconeangle" : "limitingConeAngle",
|
||||||
|
"markerheight" : "markerHeight",
|
||||||
|
"markerunits" : "markerUnits",
|
||||||
|
"markerwidth" : "markerWidth",
|
||||||
|
"maskcontentunits" : "maskContentUnits",
|
||||||
|
"maskunits" : "maskUnits",
|
||||||
|
"numoctaves" : "numOctaves",
|
||||||
|
"pathlength" : "pathLength",
|
||||||
|
"patterncontentunits" : "patternContentUnits",
|
||||||
|
"patterntransform" : "patternTransform",
|
||||||
|
"patternunits" : "patternUnits",
|
||||||
|
"pointsatx" : "pointsAtX",
|
||||||
|
"pointsaty" : "pointsAtY",
|
||||||
|
"pointsatz" : "pointsAtZ",
|
||||||
|
"preservealpha" : "preserveAlpha",
|
||||||
|
"preserveaspectratio" : "preserveAspectRatio",
|
||||||
|
"primitiveunits" : "primitiveUnits",
|
||||||
|
"refx" : "refX",
|
||||||
|
"refy" : "refY",
|
||||||
|
"repeatcount" : "repeatCount",
|
||||||
|
"repeatdur" : "repeatDur",
|
||||||
|
"requiredextensions" : "requiredExtensions",
|
||||||
|
"requiredfeatures" : "requiredFeatures",
|
||||||
|
"specularconstant" : "specularConstant",
|
||||||
|
"specularexponent" : "specularExponent",
|
||||||
|
"spreadmethod" : "spreadMethod",
|
||||||
|
"startoffset" : "startOffset",
|
||||||
|
"stddeviation" : "stdDeviation",
|
||||||
|
"stitchtiles" : "stitchTiles",
|
||||||
|
"surfacescale" : "surfaceScale",
|
||||||
|
"systemlanguage" : "systemLanguage",
|
||||||
|
"tablevalues" : "tableValues",
|
||||||
|
"targetx" : "targetX",
|
||||||
|
"targety" : "targetY",
|
||||||
|
"textlength" : "textLength",
|
||||||
|
"viewbox" : "viewBox",
|
||||||
|
"viewtarget" : "viewTarget",
|
||||||
|
"xchannelselector" : "xChannelSelector",
|
||||||
|
"ychannelselector" : "yChannelSelector",
|
||||||
|
"zoomandpan" : "zoomAndPan"
|
||||||
|
}
|
||||||
|
}
|
17
project2/node_modules/dom-serializer/index.d.ts
generated
vendored
Normal file
17
project2/node_modules/dom-serializer/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
export interface DomSerializerOptions {
|
||||||
|
xmlMode?: boolean | 'foreign';
|
||||||
|
decodeEntities?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders a DOM node or an array of DOM nodes to a string.
|
||||||
|
*
|
||||||
|
* Can be thought of as the equivalent of the `outerHTML` of the passed node(s).
|
||||||
|
*
|
||||||
|
* @param nodes Nodes to be rendered.
|
||||||
|
* @param options Changes serialization behavior
|
||||||
|
*/
|
||||||
|
export default function render(
|
||||||
|
nodes: {} | {}[],
|
||||||
|
options?: DomSerializerOptions
|
||||||
|
): string;
|
183
project2/node_modules/dom-serializer/index.js
generated
vendored
Normal file
183
project2/node_modules/dom-serializer/index.js
generated
vendored
Normal file
@ -0,0 +1,183 @@
|
|||||||
|
/*
|
||||||
|
Module dependencies
|
||||||
|
*/
|
||||||
|
var ElementType = require('domelementtype');
|
||||||
|
var entities = require('entities');
|
||||||
|
|
||||||
|
/* mixed-case SVG and MathML tags & attributes
|
||||||
|
recognized by the HTML parser, see
|
||||||
|
https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign
|
||||||
|
*/
|
||||||
|
var foreignNames = require('./foreignNames.json');
|
||||||
|
foreignNames.elementNames.__proto__ = null; /* use as a simple dictionary */
|
||||||
|
foreignNames.attributeNames.__proto__ = null;
|
||||||
|
|
||||||
|
var unencodedElements = {
|
||||||
|
__proto__: null,
|
||||||
|
style: true,
|
||||||
|
script: true,
|
||||||
|
xmp: true,
|
||||||
|
iframe: true,
|
||||||
|
noembed: true,
|
||||||
|
noframes: true,
|
||||||
|
plaintext: true,
|
||||||
|
noscript: true
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
Format attributes
|
||||||
|
*/
|
||||||
|
function formatAttrs(attributes, opts) {
|
||||||
|
if (!attributes) return;
|
||||||
|
|
||||||
|
var output = '';
|
||||||
|
var value;
|
||||||
|
|
||||||
|
// Loop through the attributes
|
||||||
|
for (var key in attributes) {
|
||||||
|
value = attributes[key];
|
||||||
|
if (output) {
|
||||||
|
output += ' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (opts.xmlMode === 'foreign') {
|
||||||
|
/* fix up mixed-case attribute names */
|
||||||
|
key = foreignNames.attributeNames[key] || key;
|
||||||
|
}
|
||||||
|
output += key;
|
||||||
|
if ((value !== null && value !== '') || opts.xmlMode) {
|
||||||
|
output +=
|
||||||
|
'="' +
|
||||||
|
(opts.decodeEntities
|
||||||
|
? entities.encodeXML(value)
|
||||||
|
: value.replace(/\"/g, '"')) +
|
||||||
|
'"';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Self-enclosing tags (stolen from node-htmlparser)
|
||||||
|
*/
|
||||||
|
var singleTag = {
|
||||||
|
__proto__: null,
|
||||||
|
area: true,
|
||||||
|
base: true,
|
||||||
|
basefont: true,
|
||||||
|
br: true,
|
||||||
|
col: true,
|
||||||
|
command: true,
|
||||||
|
embed: true,
|
||||||
|
frame: true,
|
||||||
|
hr: true,
|
||||||
|
img: true,
|
||||||
|
input: true,
|
||||||
|
isindex: true,
|
||||||
|
keygen: true,
|
||||||
|
link: true,
|
||||||
|
meta: true,
|
||||||
|
param: true,
|
||||||
|
source: true,
|
||||||
|
track: true,
|
||||||
|
wbr: true
|
||||||
|
};
|
||||||
|
|
||||||
|
var render = (module.exports = function(dom, opts) {
|
||||||
|
if (!Array.isArray(dom) && !dom.cheerio) dom = [dom];
|
||||||
|
opts = opts || {};
|
||||||
|
|
||||||
|
var output = '';
|
||||||
|
|
||||||
|
for (var i = 0; i < dom.length; i++) {
|
||||||
|
var elem = dom[i];
|
||||||
|
|
||||||
|
if (elem.type === 'root') output += render(elem.children, opts);
|
||||||
|
else if (ElementType.isTag(elem)) output += renderTag(elem, opts);
|
||||||
|
else if (elem.type === ElementType.Directive)
|
||||||
|
output += renderDirective(elem);
|
||||||
|
else if (elem.type === ElementType.Comment) output += renderComment(elem);
|
||||||
|
else if (elem.type === ElementType.CDATA) output += renderCdata(elem);
|
||||||
|
else output += renderText(elem, opts);
|
||||||
|
}
|
||||||
|
|
||||||
|
return output;
|
||||||
|
});
|
||||||
|
|
||||||
|
var foreignModeIntegrationPoints = [
|
||||||
|
'mi',
|
||||||
|
'mo',
|
||||||
|
'mn',
|
||||||
|
'ms',
|
||||||
|
'mtext',
|
||||||
|
'annotation-xml',
|
||||||
|
'foreignObject',
|
||||||
|
'desc',
|
||||||
|
'title'
|
||||||
|
];
|
||||||
|
|
||||||
|
function renderTag(elem, opts) {
|
||||||
|
// Handle SVG / MathML in HTML
|
||||||
|
if (opts.xmlMode === 'foreign') {
|
||||||
|
/* fix up mixed-case element names */
|
||||||
|
elem.name = foreignNames.elementNames[elem.name] || elem.name;
|
||||||
|
/* exit foreign mode at integration points */
|
||||||
|
if (
|
||||||
|
elem.parent &&
|
||||||
|
foreignModeIntegrationPoints.indexOf(elem.parent.name) >= 0
|
||||||
|
)
|
||||||
|
opts = Object.assign({}, opts, { xmlMode: false });
|
||||||
|
}
|
||||||
|
if (!opts.xmlMode && ['svg', 'math'].indexOf(elem.name) >= 0) {
|
||||||
|
opts = Object.assign({}, opts, { xmlMode: 'foreign' });
|
||||||
|
}
|
||||||
|
|
||||||
|
var tag = '<' + elem.name;
|
||||||
|
var attribs = formatAttrs(elem.attribs, opts);
|
||||||
|
|
||||||
|
if (attribs) {
|
||||||
|
tag += ' ' + attribs;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (opts.xmlMode && (!elem.children || elem.children.length === 0)) {
|
||||||
|
tag += '/>';
|
||||||
|
} else {
|
||||||
|
tag += '>';
|
||||||
|
if (elem.children) {
|
||||||
|
tag += render(elem.children, opts);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!singleTag[elem.name] || opts.xmlMode) {
|
||||||
|
tag += '</' + elem.name + '>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderDirective(elem) {
|
||||||
|
return '<' + elem.data + '>';
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderText(elem, opts) {
|
||||||
|
var data = elem.data || '';
|
||||||
|
|
||||||
|
// if entities weren't decoded, no need to encode them back
|
||||||
|
if (
|
||||||
|
opts.decodeEntities &&
|
||||||
|
!(elem.parent && elem.parent.name in unencodedElements)
|
||||||
|
) {
|
||||||
|
data = entities.encodeXML(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderCdata(elem) {
|
||||||
|
return '<![CDATA[' + elem.children[0].data + ']]>';
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderComment(elem) {
|
||||||
|
return '<!--' + elem.data + '-->';
|
||||||
|
}
|
11
project2/node_modules/dom-serializer/node_modules/domelementtype/LICENSE
generated
vendored
Normal file
11
project2/node_modules/dom-serializer/node_modules/domelementtype/LICENSE
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
Copyright (c) Felix Böhm
|
||||||
|
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 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 THE COPYRIGHT HOLDER OR CONTRIBUTORS 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,
|
||||||
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
1
project2/node_modules/dom-serializer/node_modules/domelementtype/README.md
generated
vendored
Normal file
1
project2/node_modules/dom-serializer/node_modules/domelementtype/README.md
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
All the types of nodes in htmlparser2's DOM.
|
28
project2/node_modules/dom-serializer/node_modules/domelementtype/lib/index.d.ts
generated
vendored
Normal file
28
project2/node_modules/dom-serializer/node_modules/domelementtype/lib/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/** Types of elements found in the DOM */
|
||||||
|
export declare const enum ElementType {
|
||||||
|
Text = "text",
|
||||||
|
Directive = "directive",
|
||||||
|
Comment = "comment",
|
||||||
|
Script = "script",
|
||||||
|
Style = "style",
|
||||||
|
Tag = "tag",
|
||||||
|
CDATA = "cdata",
|
||||||
|
Doctype = "doctype"
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Tests whether an element is a tag or not.
|
||||||
|
*
|
||||||
|
* @param elem Element to test
|
||||||
|
*/
|
||||||
|
export declare function isTag(elem: {
|
||||||
|
type: ElementType;
|
||||||
|
}): boolean;
|
||||||
|
export declare const Text = ElementType.Text;
|
||||||
|
export declare const Directive = ElementType.Directive;
|
||||||
|
export declare const Comment = ElementType.Comment;
|
||||||
|
export declare const Script = ElementType.Script;
|
||||||
|
export declare const Style = ElementType.Style;
|
||||||
|
export declare const Tag = ElementType.Tag;
|
||||||
|
export declare const CDATA = ElementType.CDATA;
|
||||||
|
export declare const Doctype = ElementType.Doctype;
|
||||||
|
//# sourceMappingURL=index.d.ts.map
|
1
project2/node_modules/dom-serializer/node_modules/domelementtype/lib/index.d.ts.map
generated
vendored
Normal file
1
project2/node_modules/dom-serializer/node_modules/domelementtype/lib/index.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,0BAAkB,WAAW;IACzB,IAAI,SAAS;IACb,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,OAAO,YAAY;CACtB;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GAAG,OAAO,CAM1D;AAGD,eAAO,MAAM,IAAI,mBAAmB,CAAC;AACrC,eAAO,MAAM,SAAS,wBAAwB,CAAC;AAC/C,eAAO,MAAM,OAAO,sBAAsB,CAAC;AAC3C,eAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,eAAO,MAAM,KAAK,oBAAoB,CAAC;AACvC,eAAO,MAAM,GAAG,kBAAkB,CAAC;AACnC,eAAO,MAAM,KAAK,oBAAoB,CAAC;AACvC,eAAO,MAAM,OAAO,sBAAsB,CAAC"}
|
22
project2/node_modules/dom-serializer/node_modules/domelementtype/lib/index.js
generated
vendored
Normal file
22
project2/node_modules/dom-serializer/node_modules/domelementtype/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
/**
|
||||||
|
* Tests whether an element is a tag or not.
|
||||||
|
*
|
||||||
|
* @param elem Element to test
|
||||||
|
*/
|
||||||
|
function isTag(elem) {
|
||||||
|
return (elem.type === "tag" /* Tag */ ||
|
||||||
|
elem.type === "script" /* Script */ ||
|
||||||
|
elem.type === "style" /* Style */);
|
||||||
|
}
|
||||||
|
exports.isTag = isTag;
|
||||||
|
// Exports for backwards compatibility
|
||||||
|
exports.Text = "text" /* Text */; //Text
|
||||||
|
exports.Directive = "directive" /* Directive */; //<? ... ?>
|
||||||
|
exports.Comment = "comment" /* Comment */; //<!-- ... -->
|
||||||
|
exports.Script = "script" /* Script */; //<script> tags
|
||||||
|
exports.Style = "style" /* Style */; //<style> tags
|
||||||
|
exports.Tag = "tag" /* Tag */; //Any tag
|
||||||
|
exports.CDATA = "cdata" /* CDATA */; //<![CDATA[ ... ]]>
|
||||||
|
exports.Doctype = "doctype" /* Doctype */;
|
70
project2/node_modules/dom-serializer/node_modules/domelementtype/package.json
generated
vendored
Normal file
70
project2/node_modules/dom-serializer/node_modules/domelementtype/package.json
generated
vendored
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
{
|
||||||
|
"_from": "domelementtype@^2.0.1",
|
||||||
|
"_id": "domelementtype@2.0.1",
|
||||||
|
"_inBundle": false,
|
||||||
|
"_integrity": "sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ==",
|
||||||
|
"_location": "/dom-serializer/domelementtype",
|
||||||
|
"_phantomChildren": {},
|
||||||
|
"_requested": {
|
||||||
|
"type": "range",
|
||||||
|
"registry": true,
|
||||||
|
"raw": "domelementtype@^2.0.1",
|
||||||
|
"name": "domelementtype",
|
||||||
|
"escapedName": "domelementtype",
|
||||||
|
"rawSpec": "^2.0.1",
|
||||||
|
"saveSpec": null,
|
||||||
|
"fetchSpec": "^2.0.1"
|
||||||
|
},
|
||||||
|
"_requiredBy": [
|
||||||
|
"/dom-serializer"
|
||||||
|
],
|
||||||
|
"_resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.1.tgz",
|
||||||
|
"_shasum": "1f8bdfe91f5a78063274e803b4bdcedf6e94f94d",
|
||||||
|
"_spec": "domelementtype@^2.0.1",
|
||||||
|
"_where": "/home/massiveatoms/Desktop/cs142/project2/node_modules/dom-serializer",
|
||||||
|
"author": {
|
||||||
|
"name": "Felix Boehm",
|
||||||
|
"email": "me@feedic.com"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/fb55/domelementtype/issues"
|
||||||
|
},
|
||||||
|
"bundleDependencies": false,
|
||||||
|
"deprecated": false,
|
||||||
|
"description": "all the types of nodes in htmlparser2's dom",
|
||||||
|
"devDependencies": {
|
||||||
|
"@typescript-eslint/eslint-plugin": "^1.13.0",
|
||||||
|
"@typescript-eslint/parser": "^1.13.0",
|
||||||
|
"eslint": "^6.1.0",
|
||||||
|
"eslint-config-prettier": "^6.0.0",
|
||||||
|
"prettier": "^1.18.2",
|
||||||
|
"typescript": "^3.5.3"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"lib/**/*"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/fb55/domelementtype#readme",
|
||||||
|
"keywords": [
|
||||||
|
"dom",
|
||||||
|
"htmlparser2"
|
||||||
|
],
|
||||||
|
"license": "BSD-2-Clause",
|
||||||
|
"main": "lib/index.js",
|
||||||
|
"name": "domelementtype",
|
||||||
|
"prettier": {
|
||||||
|
"tabWidth": 4
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/fb55/domelementtype.git"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"build": "tsc",
|
||||||
|
"format": "prettier --write **/*.{ts,json,md}",
|
||||||
|
"lint": "eslint **/*.ts",
|
||||||
|
"prepare": "npm run build",
|
||||||
|
"test": "npm run lint && prettier --check **/*.{ts,json,md}"
|
||||||
|
},
|
||||||
|
"types": "lib/index.d.ts",
|
||||||
|
"version": "2.0.1"
|
||||||
|
}
|
11
project2/node_modules/dom-serializer/node_modules/entities/LICENSE
generated
vendored
Normal file
11
project2/node_modules/dom-serializer/node_modules/entities/LICENSE
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
Copyright (c) Felix Böhm
|
||||||
|
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 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 THE COPYRIGHT HOLDER OR CONTRIBUTORS 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,
|
||||||
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
33
project2/node_modules/dom-serializer/node_modules/entities/README.md
generated
vendored
Normal file
33
project2/node_modules/dom-serializer/node_modules/entities/README.md
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# entities [![NPM version](http://img.shields.io/npm/v/entities.svg)](https://npmjs.org/package/entities) [![Downloads](https://img.shields.io/npm/dm/entities.svg)](https://npmjs.org/package/entities) [![Build Status](http://img.shields.io/travis/fb55/entities.svg)](http://travis-ci.org/fb55/entities) [![Coverage](http://img.shields.io/coveralls/fb55/entities.svg)](https://coveralls.io/r/fb55/entities)
|
||||||
|
|
||||||
|
En- & decoder for XML/HTML entities.
|
||||||
|
|
||||||
|
## How to…
|
||||||
|
|
||||||
|
### …install `entities`
|
||||||
|
|
||||||
|
npm i entities
|
||||||
|
|
||||||
|
### …use `entities`
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const entities = require("entities");
|
||||||
|
//encoding
|
||||||
|
entities.escape("&"); // "&#38;"
|
||||||
|
entities.encodeXML("&"); // "&#38;"
|
||||||
|
entities.encodeHTML("&"); // "&#38;"
|
||||||
|
//decoding
|
||||||
|
entities.decodeXML("asdf & ÿ ü '"); // "asdf & ÿ ü '"
|
||||||
|
entities.decodeHTML("asdf & ÿ ü '"); // "asdf & ÿ ü '"
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
License: BSD-2-Clause
|
||||||
|
|
||||||
|
[Get supported entities with the Tidelift Subscription](https://tidelift.com/subscription/pkg/npm-entities?utm_source=npm-entities&utm_medium=referral&utm_campaign=readme)
|
||||||
|
|
||||||
|
## Security contact information
|
||||||
|
|
||||||
|
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security).
|
||||||
|
Tidelift will coordinate the fix and disclosure.
|
7
project2/node_modules/dom-serializer/node_modules/entities/lib/decode.d.ts
generated
vendored
Normal file
7
project2/node_modules/dom-serializer/node_modules/entities/lib/decode.d.ts
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
export declare const decodeXML: (str: string) => string;
|
||||||
|
export declare const decodeHTMLStrict: (str: string) => string;
|
||||||
|
export interface MapType {
|
||||||
|
[key: string]: string;
|
||||||
|
}
|
||||||
|
export declare const decodeHTML: (str: string) => string;
|
||||||
|
//# sourceMappingURL=decode.d.ts.map
|
1
project2/node_modules/dom-serializer/node_modules/entities/lib/decode.d.ts.map
generated
vendored
Normal file
1
project2/node_modules/dom-serializer/node_modules/entities/lib/decode.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../src/decode.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS,yBAA2B,CAAC;AAClD,eAAO,MAAM,gBAAgB,yBAA8B,CAAC;AAE5D,MAAM,WAAW,OAAO;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAeD,eAAO,MAAM,UAAU,yBA4BnB,CAAC"}
|
54
project2/node_modules/dom-serializer/node_modules/entities/lib/decode.js
generated
vendored
Normal file
54
project2/node_modules/dom-serializer/node_modules/entities/lib/decode.js
generated
vendored
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
"use strict";
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
var entities_json_1 = __importDefault(require("./maps/entities.json"));
|
||||||
|
var legacy_json_1 = __importDefault(require("./maps/legacy.json"));
|
||||||
|
var xml_json_1 = __importDefault(require("./maps/xml.json"));
|
||||||
|
var decode_codepoint_1 = __importDefault(require("./decode_codepoint"));
|
||||||
|
exports.decodeXML = getStrictDecoder(xml_json_1.default);
|
||||||
|
exports.decodeHTMLStrict = getStrictDecoder(entities_json_1.default);
|
||||||
|
function getStrictDecoder(map) {
|
||||||
|
var keys = Object.keys(map).join("|");
|
||||||
|
var replace = getReplacer(map);
|
||||||
|
keys += "|#[xX][\\da-fA-F]+|#\\d+";
|
||||||
|
var re = new RegExp("&(?:" + keys + ");", "g");
|
||||||
|
return function (str) { return String(str).replace(re, replace); };
|
||||||
|
}
|
||||||
|
var sorter = function (a, b) { return (a < b ? 1 : -1); };
|
||||||
|
exports.decodeHTML = (function () {
|
||||||
|
var legacy = Object.keys(legacy_json_1.default).sort(sorter);
|
||||||
|
var keys = Object.keys(entities_json_1.default).sort(sorter);
|
||||||
|
for (var i = 0, j = 0; i < keys.length; i++) {
|
||||||
|
if (legacy[j] === keys[i]) {
|
||||||
|
keys[i] += ";?";
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
keys[i] += ";";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var re = new RegExp("&(?:" + keys.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g");
|
||||||
|
var replace = getReplacer(entities_json_1.default);
|
||||||
|
function replacer(str) {
|
||||||
|
if (str.substr(-1) !== ";")
|
||||||
|
str += ";";
|
||||||
|
return replace(str);
|
||||||
|
}
|
||||||
|
//TODO consider creating a merged map
|
||||||
|
return function (str) {
|
||||||
|
return String(str).replace(re, replacer);
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
function getReplacer(map) {
|
||||||
|
return function replace(str) {
|
||||||
|
if (str.charAt(1) === "#") {
|
||||||
|
if (str.charAt(2) === "X" || str.charAt(2) === "x") {
|
||||||
|
return decode_codepoint_1.default(parseInt(str.substr(3), 16));
|
||||||
|
}
|
||||||
|
return decode_codepoint_1.default(parseInt(str.substr(2), 10));
|
||||||
|
}
|
||||||
|
return map[str.slice(1, -1)];
|
||||||
|
};
|
||||||
|
}
|
2
project2/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.d.ts
generated
vendored
Normal file
2
project2/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
export default function decodeCodePoint(codePoint: number): string;
|
||||||
|
//# sourceMappingURL=decode_codepoint.d.ts.map
|
1
project2/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.d.ts.map
generated
vendored
Normal file
1
project2/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"decode_codepoint.d.ts","sourceRoot":"","sources":["../src/decode_codepoint.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,SAAS,EAAE,MAAM,UAoBxD"}
|
25
project2/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js
generated
vendored
Normal file
25
project2/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
"use strict";
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
var decode_json_1 = __importDefault(require("./maps/decode.json"));
|
||||||
|
// modified version of https://github.com/mathiasbynens/he/blob/master/src/he.js#L94-L119
|
||||||
|
function decodeCodePoint(codePoint) {
|
||||||
|
if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) {
|
||||||
|
return "\uFFFD";
|
||||||
|
}
|
||||||
|
if (codePoint in decode_json_1.default) {
|
||||||
|
// @ts-ignore
|
||||||
|
codePoint = decode_json_1.default[codePoint];
|
||||||
|
}
|
||||||
|
var output = "";
|
||||||
|
if (codePoint > 0xffff) {
|
||||||
|
codePoint -= 0x10000;
|
||||||
|
output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800);
|
||||||
|
codePoint = 0xdc00 | (codePoint & 0x3ff);
|
||||||
|
}
|
||||||
|
output += String.fromCharCode(codePoint);
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
exports.default = decodeCodePoint;
|
4
project2/node_modules/dom-serializer/node_modules/entities/lib/encode.d.ts
generated
vendored
Normal file
4
project2/node_modules/dom-serializer/node_modules/entities/lib/encode.d.ts
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
export declare const encodeXML: (data: string) => string;
|
||||||
|
export declare const encodeHTML: (data: string) => string;
|
||||||
|
export declare function escape(data: string): string;
|
||||||
|
//# sourceMappingURL=encode.d.ts.map
|
1
project2/node_modules/dom-serializer/node_modules/entities/lib/encode.d.ts.map
generated
vendored
Normal file
1
project2/node_modules/dom-serializer/node_modules/entities/lib/encode.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"encode.d.ts","sourceRoot":"","sources":["../src/encode.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS,0BAAsC,CAAC;AAO7D,eAAO,MAAM,UAAU,0BAAwC,CAAC;AA4DhE,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,UAKlC"}
|
67
project2/node_modules/dom-serializer/node_modules/entities/lib/encode.js
generated
vendored
Normal file
67
project2/node_modules/dom-serializer/node_modules/entities/lib/encode.js
generated
vendored
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
"use strict";
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
var xml_json_1 = __importDefault(require("./maps/xml.json"));
|
||||||
|
var inverseXML = getInverseObj(xml_json_1.default);
|
||||||
|
var xmlReplacer = getInverseReplacer(inverseXML);
|
||||||
|
exports.encodeXML = getInverse(inverseXML, xmlReplacer);
|
||||||
|
var entities_json_1 = __importDefault(require("./maps/entities.json"));
|
||||||
|
var inverseHTML = getInverseObj(entities_json_1.default);
|
||||||
|
var htmlReplacer = getInverseReplacer(inverseHTML);
|
||||||
|
exports.encodeHTML = getInverse(inverseHTML, htmlReplacer);
|
||||||
|
function getInverseObj(obj) {
|
||||||
|
return Object.keys(obj)
|
||||||
|
.sort()
|
||||||
|
.reduce(function (inverse, name) {
|
||||||
|
inverse[obj[name]] = "&" + name + ";";
|
||||||
|
return inverse;
|
||||||
|
}, {});
|
||||||
|
}
|
||||||
|
function getInverseReplacer(inverse) {
|
||||||
|
var single = [];
|
||||||
|
var multiple = [];
|
||||||
|
Object.keys(inverse).forEach(function (k) {
|
||||||
|
return k.length === 1
|
||||||
|
? // Add value to single array
|
||||||
|
single.push("\\" + k)
|
||||||
|
: // Add value to multiple array
|
||||||
|
multiple.push(k);
|
||||||
|
});
|
||||||
|
//TODO add ranges
|
||||||
|
multiple.unshift("[" + single.join("") + "]");
|
||||||
|
return new RegExp(multiple.join("|"), "g");
|
||||||
|
}
|
||||||
|
var reNonASCII = /[^\0-\x7F]/g;
|
||||||
|
var reAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
||||||
|
function singleCharReplacer(c) {
|
||||||
|
return "&#x" + c
|
||||||
|
.charCodeAt(0)
|
||||||
|
.toString(16)
|
||||||
|
.toUpperCase() + ";";
|
||||||
|
}
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
|
||||||
|
function astralReplacer(c, _) {
|
||||||
|
// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
|
||||||
|
var high = c.charCodeAt(0);
|
||||||
|
var low = c.charCodeAt(1);
|
||||||
|
var codePoint = (high - 0xd800) * 0x400 + low - 0xdc00 + 0x10000;
|
||||||
|
return "&#x" + codePoint.toString(16).toUpperCase() + ";";
|
||||||
|
}
|
||||||
|
function getInverse(inverse, re) {
|
||||||
|
return function (data) {
|
||||||
|
return data
|
||||||
|
.replace(re, function (name) { return inverse[name]; })
|
||||||
|
.replace(reAstralSymbols, astralReplacer)
|
||||||
|
.replace(reNonASCII, singleCharReplacer);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
var reXmlChars = getInverseReplacer(inverseXML);
|
||||||
|
function escape(data) {
|
||||||
|
return data
|
||||||
|
.replace(reXmlChars, singleCharReplacer)
|
||||||
|
.replace(reAstralSymbols, astralReplacer)
|
||||||
|
.replace(reNonASCII, singleCharReplacer);
|
||||||
|
}
|
||||||
|
exports.escape = escape;
|
6
project2/node_modules/dom-serializer/node_modules/entities/lib/index.d.ts
generated
vendored
Normal file
6
project2/node_modules/dom-serializer/node_modules/entities/lib/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
export declare function decode(data: string, level?: number): string;
|
||||||
|
export declare function decodeStrict(data: string, level?: number): string;
|
||||||
|
export declare function encode(data: string, level?: number): string;
|
||||||
|
export { encodeXML, encodeHTML, escape, encodeHTML as encodeHTML4, encodeHTML as encodeHTML5 } from "./encode";
|
||||||
|
export { decodeXML, decodeHTML, decodeHTMLStrict, decodeHTML as decodeHTML4, decodeHTML as decodeHTML5, decodeHTMLStrict as decodeHTML4Strict, decodeHTMLStrict as decodeHTML5Strict, decodeXML as decodeXMLStrict } from "./decode";
|
||||||
|
//# sourceMappingURL=index.d.ts.map
|
1
project2/node_modules/dom-serializer/node_modules/entities/lib/index.d.ts.map
generated
vendored
Normal file
1
project2/node_modules/dom-serializer/node_modules/entities/lib/index.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,OAAO,EACH,SAAS,EACT,UAAU,EACV,MAAM,EAEN,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EAC5B,MAAM,UAAU,CAAC;AAElB,OAAO,EACH,SAAS,EACT,UAAU,EACV,gBAAgB,EAEhB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,gBAAgB,IAAI,iBAAiB,EACrC,gBAAgB,IAAI,iBAAiB,EACrC,SAAS,IAAI,eAAe,EAC/B,MAAM,UAAU,CAAC"}
|
33
project2/node_modules/dom-serializer/node_modules/entities/lib/index.js
generated
vendored
Normal file
33
project2/node_modules/dom-serializer/node_modules/entities/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
var decode_1 = require("./decode");
|
||||||
|
var encode_1 = require("./encode");
|
||||||
|
function decode(data, level) {
|
||||||
|
return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTML)(data);
|
||||||
|
}
|
||||||
|
exports.decode = decode;
|
||||||
|
function decodeStrict(data, level) {
|
||||||
|
return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTMLStrict)(data);
|
||||||
|
}
|
||||||
|
exports.decodeStrict = decodeStrict;
|
||||||
|
function encode(data, level) {
|
||||||
|
return (!level || level <= 0 ? encode_1.encodeXML : encode_1.encodeHTML)(data);
|
||||||
|
}
|
||||||
|
exports.encode = encode;
|
||||||
|
var encode_2 = require("./encode");
|
||||||
|
exports.encodeXML = encode_2.encodeXML;
|
||||||
|
exports.encodeHTML = encode_2.encodeHTML;
|
||||||
|
exports.escape = encode_2.escape;
|
||||||
|
// Legacy aliases
|
||||||
|
exports.encodeHTML4 = encode_2.encodeHTML;
|
||||||
|
exports.encodeHTML5 = encode_2.encodeHTML;
|
||||||
|
var decode_2 = require("./decode");
|
||||||
|
exports.decodeXML = decode_2.decodeXML;
|
||||||
|
exports.decodeHTML = decode_2.decodeHTML;
|
||||||
|
exports.decodeHTMLStrict = decode_2.decodeHTMLStrict;
|
||||||
|
// Legacy aliases
|
||||||
|
exports.decodeHTML4 = decode_2.decodeHTML;
|
||||||
|
exports.decodeHTML5 = decode_2.decodeHTML;
|
||||||
|
exports.decodeHTML4Strict = decode_2.decodeHTMLStrict;
|
||||||
|
exports.decodeHTML5Strict = decode_2.decodeHTMLStrict;
|
||||||
|
exports.decodeXMLStrict = decode_2.decodeXML;
|
1
project2/node_modules/dom-serializer/node_modules/entities/lib/maps/decode.json
generated
vendored
Normal file
1
project2/node_modules/dom-serializer/node_modules/entities/lib/maps/decode.json
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ "0": 65533, "128": 8364, "130": 8218, "131": 402, "132": 8222, "133": 8230, "134": 8224, "135": 8225, "136": 710, "137": 8240, "138": 352, "139": 8249, "140": 338, "142": 381, "145": 8216, "146": 8217, "147": 8220, "148": 8221, "149": 8226, "150": 8211, "151": 8212, "152": 732, "153": 8482, "154": 353, "155": 8250, "156": 339, "158": 382, "159": 376 }
|
1
project2/node_modules/dom-serializer/node_modules/entities/lib/maps/entities.json
generated
vendored
Normal file
1
project2/node_modules/dom-serializer/node_modules/entities/lib/maps/entities.json
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
project2/node_modules/dom-serializer/node_modules/entities/lib/maps/legacy.json
generated
vendored
Normal file
1
project2/node_modules/dom-serializer/node_modules/entities/lib/maps/legacy.json
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ "Aacute": "\u00C1", "aacute": "\u00E1", "Acirc": "\u00C2", "acirc": "\u00E2", "acute": "\u00B4", "AElig": "\u00C6", "aelig": "\u00E6", "Agrave": "\u00C0", "agrave": "\u00E0", "amp": "&", "AMP": "&", "Aring": "\u00C5", "aring": "\u00E5", "Atilde": "\u00C3", "atilde": "\u00E3", "Auml": "\u00C4", "auml": "\u00E4", "brvbar": "\u00A6", "Ccedil": "\u00C7", "ccedil": "\u00E7", "cedil": "\u00B8", "cent": "\u00A2", "copy": "\u00A9", "COPY": "\u00A9", "curren": "\u00A4", "deg": "\u00B0", "divide": "\u00F7", "Eacute": "\u00C9", "eacute": "\u00E9", "Ecirc": "\u00CA", "ecirc": "\u00EA", "Egrave": "\u00C8", "egrave": "\u00E8", "ETH": "\u00D0", "eth": "\u00F0", "Euml": "\u00CB", "euml": "\u00EB", "frac12": "\u00BD", "frac14": "\u00BC", "frac34": "\u00BE", "gt": ">", "GT": ">", "Iacute": "\u00CD", "iacute": "\u00ED", "Icirc": "\u00CE", "icirc": "\u00EE", "iexcl": "\u00A1", "Igrave": "\u00CC", "igrave": "\u00EC", "iquest": "\u00BF", "Iuml": "\u00CF", "iuml": "\u00EF", "laquo": "\u00AB", "lt": "<", "LT": "<", "macr": "\u00AF", "micro": "\u00B5", "middot": "\u00B7", "nbsp": "\u00A0", "not": "\u00AC", "Ntilde": "\u00D1", "ntilde": "\u00F1", "Oacute": "\u00D3", "oacute": "\u00F3", "Ocirc": "\u00D4", "ocirc": "\u00F4", "Ograve": "\u00D2", "ograve": "\u00F2", "ordf": "\u00AA", "ordm": "\u00BA", "Oslash": "\u00D8", "oslash": "\u00F8", "Otilde": "\u00D5", "otilde": "\u00F5", "Ouml": "\u00D6", "ouml": "\u00F6", "para": "\u00B6", "plusmn": "\u00B1", "pound": "\u00A3", "quot": "\"", "QUOT": "\"", "raquo": "\u00BB", "reg": "\u00AE", "REG": "\u00AE", "sect": "\u00A7", "shy": "\u00AD", "sup1": "\u00B9", "sup2": "\u00B2", "sup3": "\u00B3", "szlig": "\u00DF", "THORN": "\u00DE", "thorn": "\u00FE", "times": "\u00D7", "Uacute": "\u00DA", "uacute": "\u00FA", "Ucirc": "\u00DB", "ucirc": "\u00FB", "Ugrave": "\u00D9", "ugrave": "\u00F9", "uml": "\u00A8", "Uuml": "\u00DC", "uuml": "\u00FC", "Yacute": "\u00DD", "yacute": "\u00FD", "yen": "\u00A5", "yuml": "\u00FF" }
|
1
project2/node_modules/dom-serializer/node_modules/entities/lib/maps/xml.json
generated
vendored
Normal file
1
project2/node_modules/dom-serializer/node_modules/entities/lib/maps/xml.json
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ "amp": "&", "apos": "'", "gt": ">", "lt": "<", "quot": "\"" }
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user