{"version":3,"sources":["jsdelivr-header.js","/npm/@northpool/snappy@6.3.8/snappy.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACLA,MAAM,KAAO,QAAQ,QACf,OAAS,QAAQ,qBACjB,aAAe,OAAO,KAAK,KAAK,KAAK,UAAW,mBAChD,QAAU,QAAQ,cAGxB,IAAI,OAAS,QAAQ,UAuErB,SAAS,eAAgB,GACvB,OAAQ,GAAiC,kBAAlB,EAAK,SAA0B,EAAO,CAAC,UAAU,EAC1E,CAhEA,QAAQ,SAAW,SAAU,EAAO,GAClC,GAAyB,iBAAZ,IAAwB,OAAO,SAAS,GACnD,OAAO,EAAS,IAAI,MAAM,uCAG5B,QAAQ,SAAS,EAAO,EAC1B,EAMA,QAAQ,aAAe,SAAU,GAG/B,OAFA,OAA0B,iBAAZ,GAAwB,OAAO,SAAS,GAAQ,sCAEvD,QAAQ,aAAa,EAC9B,EAOA,QAAQ,kBAAoB,QAAQ,kBAKpC,QAAQ,sBAAwB,QAAQ,sBASxC,QAAQ,WAAa,SAAU,EAAY,EAAM,GAK/C,GAJK,IACH,EAAW,IAGR,OAAO,SAAS,GACnB,OAAO,EAAS,IAAI,MAAM,2BAG5B,QAAQ,WAAW,EAAY,eAAe,GAAO,EACvD,EAME,QAAQ,eAAiB,SAAU,EAAY,GAG/C,OAFA,OAAO,OAAO,SAAS,GAAa,0BAE7B,QAAQ,eAAe,EAAY,eAAe,GAC3D","file":"/npm/@northpool/snappy@6.3.8/snappy.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@northpool/snappy@6.3.8/snappy.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","// @ts-check\r\nconst path = require(\"path\");\r\nconst binary = require('node-pre-gyp-http')\r\nconst binding_path = binary.find(path.join(__dirname, './package.json'))\r\nconst binding = require(binding_path)\r\n\r\n\r\nvar assert = require('assert');\r\n\r\n/**\r\n * Compress asyncronous.\r\n * If input isn't a string or buffer, automatically convert to buffer by using\r\n * JSON.stringify.\r\n * @param {string|Buffer} input\r\n * @param {(err: Error|null, buffer?: Buffer) => void} callback\r\n */\r\nexports.compress = function (input, callback) {\r\n  if (!(typeof (input) === 'string' || Buffer.isBuffer(input))) {\r\n    return callback(new Error('input must be a String or a Buffer'));\r\n  }\r\n\r\n  binding.compress(input, callback);\r\n};\r\n\r\n/**\r\n * @param {string|Buffer} input\r\n * @returns {Buffer}\r\n */\r\nexports.compressSync = function (input) {\r\n  assert(typeof (input) === 'string' || Buffer.isBuffer(input), 'input must be a String or a Buffer');\r\n\r\n  return binding.compressSync(input);\r\n};\r\n\r\n/**\r\n * Asyncronous decide if a buffer is compressed in a correct way.\r\n *\r\n * @type {(buffer: Buffer,  callback: (err: Error|null, isValid?: boolean) => void) => void}\r\n */\r\nexports.isValidCompressed = binding.isValidCompressed;\r\n\r\n/**\r\n * @type {(buffer: Buffer) => boolean}\r\n */\r\nexports.isValidCompressedSync = binding.isValidCompressedSync;\r\n\r\n/**\r\n * Asyncronous uncompress previously compressed data.\r\n *\r\n * @param {Buffer} compressed\r\n * @param {any} opts\r\n * @param {(err: Error, uncompressed?:(string|Buffer)) => void} callback\r\n */\r\nexports.uncompress = function (compressed, opts, callback) {\r\n  if (!callback) {\r\n    callback = opts;\r\n  }\r\n\r\n  if (!Buffer.isBuffer(compressed)) {\r\n    return callback(new Error('input must be a Buffer'));\r\n  }\r\n\r\n  binding.uncompress(compressed, uncompressOpts(opts), callback);\r\n};\r\n\r\n/**\r\n * @param {Buffer} compressed\r\n * @param {any} opts\r\n * @return {string|Buffer}\r\n*/exports.uncompressSync = function (compressed, opts) {\r\n  assert(Buffer.isBuffer(compressed), 'input must be a Buffer');\r\n\r\n  return binding.uncompressSync(compressed, uncompressOpts(opts));\r\n};\r\n\r\n/**\r\n * @param {any} opts\r\n */\r\nfunction uncompressOpts (opts) {\r\n  return (opts && typeof opts.asBuffer === 'boolean') ? opts : {asBuffer: true};\r\n}\r\n"]}