wireit
Version:
Upgrade your npm scripts to make them smarter and more efficient
31 lines • 1.15 kB
JavaScript
/**
* @license
* Copyright 2022 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
export function computeManifestEntry(stats) {
return {
t: stats.isFile()
? 'f'
: stats.isDirectory()
? 'd'
: stats.isSymbolicLink()
? 'l'
: stats.isBlockDevice()
? 'b'
: stats.isCharacterDevice()
? 'c'
: stats.isFIFO()
? 'p'
: stats.isSocket()
? 's'
: '?',
// Don't include timestamp or size for directories, because they can change
// when a child is added or removed. If we are tracking the child, then it
// will have its own entry. If we are not tracking the child, then we don't
// want it to affect the manifest.
m: stats.isDirectory() ? undefined : stats.mtimeMs,
s: stats.isDirectory() ? undefined : stats.size,
};
}
//# sourceMappingURL=manifest.js.map