mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-30 06:39:37 +02:00
Fix:Include Watcher as lib with no dependencies and fix tiny-readdir bug #610
This commit is contained in:
parent
160dac109d
commit
ec6e70725c
34 changed files with 2187 additions and 281 deletions
24
server/libs/watcher/are-shallow-equal.js
Normal file
24
server/libs/watcher/are-shallow-equal.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
"use strict";
|
||||
/* IMPORT */
|
||||
var isPrimitive = require("./is-primitive");
|
||||
/* ARE SHALLOW EQUAL */
|
||||
var isNaN = Number.isNaN;
|
||||
function areShallowEqual(x, y) {
|
||||
if (x === y)
|
||||
return true;
|
||||
if (isNaN(x))
|
||||
return isNaN(y);
|
||||
if (isPrimitive(x) || isPrimitive(y))
|
||||
return x === y;
|
||||
for (var i in x)
|
||||
if (!(i in y))
|
||||
return false;
|
||||
for (var i in y)
|
||||
if (x[i] !== y[i])
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
/* EXPORT */
|
||||
module.exports = areShallowEqual;
|
||||
module.exports.default = areShallowEqual;
|
||||
Object.defineProperty(module.exports, "__esModule", { value: true });
|
Loading…
Add table
Add a link
Reference in a new issue