mirror-drive
Advanced tools
Comparing version 1.0.3 to 1.0.4
10
index.js
@@ -1,2 +0,2 @@ | ||
const deepEqual = require('deep-equal') | ||
const sameData = require('same-data') | ||
const streamEquals = require('binary-stream-equals') | ||
@@ -17,2 +17,4 @@ | ||
this.count = { files: 0, add: 0, remove: 0, change: 0 } | ||
this.bytesRemoved = 0 | ||
this.bytesAdded = 0 | ||
this.iterator = this._mirror() | ||
@@ -41,2 +43,3 @@ } | ||
this.count.remove++ | ||
this.bytesRemoved += blobLength(dstEntry) | ||
yield { op: 'remove', key, bytesRemoved: blobLength(dstEntry), bytesAdded: 0 } | ||
@@ -58,5 +61,8 @@ | ||
this.count.change++ | ||
this.bytesRemoved += blobLength(dstEntry) | ||
this.bytesAdded += blobLength(srcEntry) | ||
yield { op: 'change', key, bytesRemoved: blobLength(dstEntry), bytesAdded: blobLength(srcEntry) } | ||
} else { | ||
this.count.add++ | ||
this.bytesAdded += blobLength(srcEntry) | ||
yield { op: 'add', key, bytesRemoved: 0, bytesAdded: blobLength(srcEntry) } | ||
@@ -138,5 +144,5 @@ } | ||
const noMetadata = !srcMetadata && !dstMetadata | ||
const identicalMetadata = !!(srcMetadata && dstMetadata && deepEqual(srcMetadata, dstMetadata)) | ||
const identicalMetadata = !!(srcMetadata && dstMetadata && sameData(srcMetadata, dstMetadata)) | ||
return noMetadata || identicalMetadata | ||
} |
{ | ||
"name": "mirror-drive", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Mirror a hyperdrive or localdrive into another one", | ||
@@ -33,4 +33,4 @@ "main": "index.js", | ||
"binary-stream-equals": "^1.0.0", | ||
"deep-equal": "^2.0.5" | ||
"same-data": "^1.0.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7338
113
+ Addedsame-data@^1.0.0
+ Addedsame-data@1.0.0(transitive)
- Removeddeep-equal@^2.0.5
- Removedarray-buffer-byte-length@1.0.1(transitive)
- Removedavailable-typed-arrays@1.0.7(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removeddeep-equal@2.2.3(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddefine-properties@1.2.1(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedes-get-iterator@1.1.3(transitive)
- Removedfor-each@0.3.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedfunctions-have-names@1.2.3(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedgopd@1.0.1(transitive)
- Removedhas-bigints@1.0.2(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedinternal-slot@1.0.7(transitive)
- Removedis-arguments@1.1.1(transitive)
- Removedis-array-buffer@3.0.4(transitive)
- Removedis-bigint@1.0.4(transitive)
- Removedis-boolean-object@1.1.2(transitive)
- Removedis-callable@1.2.7(transitive)
- Removedis-date-object@1.0.5(transitive)
- Removedis-map@2.0.3(transitive)
- Removedis-number-object@1.0.7(transitive)
- Removedis-regex@1.1.4(transitive)
- Removedis-set@2.0.3(transitive)
- Removedis-shared-array-buffer@1.0.3(transitive)
- Removedis-string@1.0.7(transitive)
- Removedis-symbol@1.0.4(transitive)
- Removedis-weakmap@2.0.2(transitive)
- Removedis-weakset@2.0.3(transitive)
- Removedisarray@2.0.5(transitive)
- Removedobject-inspect@1.13.3(transitive)
- Removedobject-is@1.1.6(transitive)
- Removedobject-keys@1.1.1(transitive)
- Removedobject.assign@4.1.5(transitive)
- Removedpossible-typed-array-names@1.0.0(transitive)
- Removedregexp.prototype.flags@1.5.3(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedset-function-name@2.0.2(transitive)
- Removedside-channel@1.0.6(transitive)
- Removedstop-iteration-iterator@1.0.0(transitive)
- Removedwhich-boxed-primitive@1.0.2(transitive)
- Removedwhich-collection@1.0.2(transitive)
- Removedwhich-typed-array@1.1.15(transitive)