mirror of
https://kevinblog.sytes.net/Code/Jibo-Revival-Group/RoboCommander.git
synced 2026-06-15 14:36:04 +00:00
Initial commit
This commit is contained in:
21
node_modules/shallowequal/LICENSE
generated
vendored
Normal file
21
node_modules/shallowequal/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017 Alberto Leal <mailforalberto@gmail.com> (github.com/dashed)
|
||||
|
||||
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.
|
||||
46
node_modules/shallowequal/index.js
generated
vendored
Normal file
46
node_modules/shallowequal/index.js
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
//
|
||||
|
||||
module.exports = function shallowEqual(objA, objB, compare, compareContext) {
|
||||
var ret = compare ? compare.call(compareContext, objA, objB) : void 0;
|
||||
|
||||
if (ret !== void 0) {
|
||||
return !!ret;
|
||||
}
|
||||
|
||||
if (objA === objB) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (typeof objA !== "object" || !objA || typeof objB !== "object" || !objB) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var keysA = Object.keys(objA);
|
||||
var keysB = Object.keys(objB);
|
||||
|
||||
if (keysA.length !== keysB.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
|
||||
|
||||
// Test for A's keys different from B.
|
||||
for (var idx = 0; idx < keysA.length; idx++) {
|
||||
var key = keysA[idx];
|
||||
|
||||
if (!bHasOwnProperty(key)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var valueA = objA[key];
|
||||
var valueB = objB[key];
|
||||
|
||||
ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;
|
||||
|
||||
if (ret === false || (ret === void 0 && valueA !== valueB)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
8
node_modules/shallowequal/index.js.flow
generated
vendored
Normal file
8
node_modules/shallowequal/index.js.flow
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
// @flow
|
||||
|
||||
declare module.exports: <T, U>(
|
||||
objA?: ?T,
|
||||
objB?: ?U,
|
||||
compare?: ?(objValue: any, otherValue: any, key?: string) => boolean | void,
|
||||
compareContext?: ?any
|
||||
) => boolean;
|
||||
51
node_modules/shallowequal/index.original.js
generated
vendored
Normal file
51
node_modules/shallowequal/index.original.js
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
// @flow
|
||||
|
||||
module.exports = function shallowEqual<T, U>(
|
||||
objA?: ?T,
|
||||
objB?: ?U,
|
||||
compare?: ?(objValue: any, otherValue: any, key?: string) => boolean | void,
|
||||
compareContext?: ?any
|
||||
): boolean {
|
||||
var ret = compare ? compare.call(compareContext, objA, objB) : void 0;
|
||||
|
||||
if (ret !== void 0) {
|
||||
return !!ret;
|
||||
}
|
||||
|
||||
if (objA === objB) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (typeof objA !== "object" || !objA || typeof objB !== "object" || !objB) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var keysA = Object.keys(objA);
|
||||
var keysB = Object.keys(objB);
|
||||
|
||||
if (keysA.length !== keysB.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
|
||||
|
||||
// Test for A's keys different from B.
|
||||
for (var idx = 0; idx < keysA.length; idx++) {
|
||||
var key = keysA[idx];
|
||||
|
||||
if (!bHasOwnProperty(key)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var valueA = objA[key];
|
||||
var valueB = objB[key];
|
||||
|
||||
ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;
|
||||
|
||||
if (ret === false || (ret === void 0 && valueA !== valueB)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
37
node_modules/shallowequal/package.json
generated
vendored
Normal file
37
node_modules/shallowequal/package.json
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "shallowequal",
|
||||
"version": "1.1.0",
|
||||
"description": "Like lodash isEqualWith but for shallow equal.",
|
||||
"main": "index.js",
|
||||
"lint-staged": {
|
||||
"*.{js,json,css,js.flow}": [
|
||||
"prettier --write",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"author": {
|
||||
"name": "Alberto Leal",
|
||||
"email": "mailforalberto@gmail.com",
|
||||
"url": "github.com/dashed"
|
||||
},
|
||||
"repository": "dashed/shallowequal",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.js.flow",
|
||||
"index.original.js"
|
||||
],
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^8.0.0",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"babel-register": "^6.24.1",
|
||||
"chai": "^4.0.0",
|
||||
"eslint": "^4.7.1",
|
||||
"flow-bin": "^0.75.0",
|
||||
"flow-remove-types": "^1.2.3",
|
||||
"husky": "^0.14.3",
|
||||
"lint-staged": "^6.0.0",
|
||||
"mocha": "^5.0.0",
|
||||
"prettier": "^1.9.2"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user