{"version":3,"file":"symlink.cjs","names":[],"sources":["../../../../../node_modules/mock-fs/lib/symlink.js"],"sourcesContent":["'use strict';\n\nconst util = require('util');\nconst Item = require('./item.js');\nconst constants = require('constants');\n\n/**\n * A directory.\n * @class\n */\nfunction SymbolicLink() {\n  Item.call(this);\n\n  /**\n   * Relative path to source.\n   * @type {string}\n   */\n  this._path = undefined;\n}\nutil.inherits(SymbolicLink, Item);\n\n/**\n * Set the path to the source.\n * @param {string} pathname Path to source.\n */\nSymbolicLink.prototype.setPath = function (pathname) {\n  this._path = pathname;\n};\n\n/**\n * Get the path to the source.\n * @return {string} Path to source.\n */\nSymbolicLink.prototype.getPath = function () {\n  return this._path;\n};\n\n/**\n * Get symbolic link stats.\n * @param {boolean} bigint Use BigInt.\n * @return {object} Stats properties.\n */\nSymbolicLink.prototype.getStats = function (bigint) {\n  const size = this._path.length;\n  const stats = Item.prototype.getStats.call(this, bigint);\n  const convert = bigint ? (v) => BigInt(v) : (v) => v;\n\n  stats[1] = convert(this.getMode() | constants.S_IFLNK); // mode\n  stats[8] = convert(size); // size\n  stats[9] = convert(Math.ceil(size / 512)); // blocks\n\n  return stats;\n};\n\n/**\n * Export the constructor.\n * @type {function()}\n */\nmodule.exports = SymbolicLink;\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;CAEA,MAAM,OAAO,QAAQ,OAAO;CAC5B,MAAM;CACN,MAAM,YAAY,QAAQ,YAAY;;;;;CAMtC,SAAS,eAAe;AACtB,OAAK,KAAK,KAAK;;;;;AAMf,OAAK,QAAQ;;AAEf,MAAK,SAAS,cAAc,KAAK;;;;;AAMjC,cAAa,UAAU,UAAU,SAAU,UAAU;AACnD,OAAK,QAAQ;;;;;;AAOf,cAAa,UAAU,UAAU,WAAY;AAC3C,SAAO,KAAK;;;;;;;AAQd,cAAa,UAAU,WAAW,SAAU,QAAQ;EAClD,MAAM,OAAO,KAAK,MAAM;EACxB,MAAM,QAAQ,KAAK,UAAU,SAAS,KAAK,MAAM,OAAO;EACxD,MAAM,UAAU,UAAU,MAAM,OAAO,EAAE,IAAI,MAAM;AAEnD,QAAM,KAAK,QAAQ,KAAK,SAAS,GAAG,UAAU,QAAQ;AACtD,QAAM,KAAK,QAAQ,KAAK;AACxB,QAAM,KAAK,QAAQ,KAAK,KAAK,OAAO,IAAI,CAAC;AAEzC,SAAO;;;;;;AAOT,QAAO,UAAU"}