Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
Merge 43fbc74 into 094a974
Browse files Browse the repository at this point in the history
  • Loading branch information
imurchie committed Dec 18, 2019
2 parents 094a974 + 43fbc74 commit 77bbb83
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import fs from './fs';
import semver from 'semver';
import { quote as shellQuote } from 'shell-quote';


const W3C_WEB_ELEMENT_IDENTIFIER = 'element-6066-11e4-a52e-4f735466cecf';

export function hasContent (val) {
Expand Down Expand Up @@ -257,9 +258,17 @@ async function isSameDestination (path1, path2, ...pathN) {
if (areAllItemsEqual(allPaths)) {
return true;
}
return areAllItemsEqual(await B.map(allPaths, async (x) => (await fs.stat(x, {
bigint: true
})).ino));

// Node 10.5.0 introduced bigint support in stat, which allows for more precision
// however below that the options get interpreted as the callback
// TODO: remove when Node 10 is no longer supported
let mapCb = async (x) => await fs.stat(x, {
bigint: true,
}).ino;
if (semver.lt(process.version, '10.5.0')) {
mapCb = async (x) => await fs.stat(x).ino;
}
return areAllItemsEqual(await B.map(allPaths, mapCb));
}

/**
Expand Down

0 comments on commit 77bbb83

Please sign in to comment.