Files
klz-cables.com/.pnpm-store/v10/files/f0/776a8693d6dd8ce961c2ab1c3b0db43435b198f1887097b401bbc6b2c160ad89f2040895173a2097c46fe325719fa44940c34f779c4e1446cd4a0469f5239b
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

62 lines
1.5 KiB
Plaintext

/**
* Used to cache a stats object for the virtual file.
* Extracted from the `mock-fs` package.
*
* @author Tim Schaub http://tschaub.net/
* @author `webpack-virtual-modules` Contributors
* @link https://github.com/tschaub/mock-fs/blob/master/lib/binding.js
* @link https://github.com/tschaub/mock-fs/blob/master/license.md
*/
import constants from 'constants';
export class VirtualStats {
/**
* Create a new stats object.
*
* @param config Stats properties.
*/
public constructor(config) {
for (const key in config) {
if (!Object.prototype.hasOwnProperty.call(config, key)) {
continue;
}
this[key] = config[key];
}
}
/**
* Check if mode indicates property.
*/
private _checkModeProperty(property): boolean {
return ((this as any).mode & constants.S_IFMT) === property;
}
public isDirectory(): boolean {
return this._checkModeProperty(constants.S_IFDIR);
}
public isFile(): boolean {
return this._checkModeProperty(constants.S_IFREG);
}
public isBlockDevice(): boolean {
return this._checkModeProperty(constants.S_IFBLK);
}
public isCharacterDevice(): boolean {
return this._checkModeProperty(constants.S_IFCHR);
}
public isSymbolicLink(): boolean {
return this._checkModeProperty(constants.S_IFLNK);
}
public isFIFO(): boolean {
return this._checkModeProperty(constants.S_IFIFO);
}
public isSocket(): boolean {
return this._checkModeProperty(constants.S_IFSOCK);
}
}