This commit is contained in:
2025-05-12 05:38:44 +09:00
parent dced21c3f8
commit 6d78bfa46e
8120 changed files with 1161564 additions and 0 deletions

1
book/node_modules/array-difference/.npmignore generated vendored Normal file
View File

@ -0,0 +1 @@
node_modules/

22
book/node_modules/array-difference/LICENSE-MIT generated vendored Normal file
View File

@ -0,0 +1,22 @@
Copyright (c) 2013 Mike Pennisi
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.

9
book/node_modules/array-difference/Makefile generated vendored Normal file
View File

@ -0,0 +1,9 @@
all: test
.PHONY: fetch-deps
fetch-deps:
npm install
.PHONY: test
test: fetch-deps
./node_modules/.bin/tape test/*.js

18
book/node_modules/array-difference/README.md generated vendored Normal file
View File

@ -0,0 +1,18 @@
# Difference
Utility method to compute the difference between two arrays.
## Installation
$ npm install array-difference
## Usage
var array1 = [1, 2, 3];
var array2 = [2, 3, 4];
difference(array1, array2); // yeilds [1, 4]
## License
Copyright (c) 2013 [Mike Pennisi](https://github.com/jugglinmike)
Licensed under the MIT Expat license.

46
book/node_modules/array-difference/difference.js generated vendored Normal file
View File

@ -0,0 +1,46 @@
(function(global) {
var indexOf = Array.prototype.indexOf || function(elem) {
var idx, len;
if (this == null) {
throw new TypeError("indexOf called on null or undefined");
}
for (idx = 0, len = this.length; idx < len; ++idx) {
if (this[idx] === elem) {
return idx;
}
}
return -1;
};
function difference(a, b) {
var idx, len;
var res = [];
for (idx = 0, len = a.length; idx < len; ++idx) {
if (indexOf.call(b, a[idx]) === -1) {
res.push(a[idx]);
}
}
for (idx = 0, len = b.length; idx < len; ++idx) {
if (indexOf.call(a, b[idx]) === -1) {
res.push(b[idx]);
}
}
return res;
}
if (typeof module === "object" && module.exports) {
module.exports = difference;
} else if (typeof define === "function" && define.amd) {
define(function() {
return difference;
});
} else {
global.difference = difference;
}
}(this));

9
book/node_modules/array-difference/index.html generated vendored Normal file
View File

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<script src="mike.js"></script>
</head>
<body>
</body>
</html>

2316
book/node_modules/array-difference/mike.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

30
book/node_modules/array-difference/package.json generated vendored Normal file
View File

@ -0,0 +1,30 @@
{
"name": "array-difference",
"version": "0.0.1",
"description": "Utility method for finding the difference between arrays",
"main": "difference.js",
"scripts": {
"test": "make test"
},
"repository": "git@github.com:jugglinmike/array-difference.git",
"keywords": [
"utility",
"array"
],
"author": "Mike Pennisi",
"license": "MIT Expat",
"devDependencies": {
"tape": "~1.0.4"
},
"testling": {
"files": "test/*.js",
"browsers": [
"ie/6..latest",
"chrome/20..latest",
"firefox/15..latest",
"safari/5.0.5..latest",
"opera/11..latest",
"iphone/6"
]
}
}

8
book/node_modules/array-difference/test/index.js generated vendored Normal file
View File

@ -0,0 +1,8 @@
var difference = require("../");
var test = require("tape");
test("difference", function(t) {
var result = difference([3, 1, 2, 4], [5, 4, 3, 6]);
t.deepEqual(result, [1, 2, 5, 6]);
t.end();
});

3
book/node_modules/array-difference/useit.js generated vendored Normal file
View File

@ -0,0 +1,3 @@
var difference = require("./");
console.log(difference);