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,GACjD,CACA,MAAO,GAEL,OAAO,IACT,CAGA,IAAK,IAAgD,IAAlC,EAAW,QAAQ,KAAK,KACzC,OAAO,KAIT,IAAI,EAAU,OAAO,eAAgB,CAAE,IAAK,KAAK,QAAQ,KACzD,IAAK,EACH,OAAO,KAGT,IAEE,OAAO,QAAQ,GAAS,SAAW,IACrC,CACA,MAAO,GACL,OAAO,IACT,CACF","file":"/npm/local-version@0.2.2/lib/local-version.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/local-version@0.2.2/lib/local-version.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/*\n * local-version\n * https://github.com/JamesMGreene/node-local-version\n *\n * Copyright (c) 2014 James M. Greene\n * Licensed under the MIT license.\n */\n\n'use strict';\n\n// Node core modules\nvar path = require('path');\n\n// Node userland modules\nvar callsite = require('callsite');\nvar resolve = require('resolve');\nvar findup = require('findup-sync');\n\n\nfunction asyncBail(cb, msg) {\n  process.nextTick(function() {\n    cb(new Error(msg), null);\n  });\n  return;\n}\n\n// API Export\nvar version =\nmodule.exports =\nfunction version(moduleId, cb) {\n  // Verify arguments\n  if (typeof cb !== 'function') {\n    throw new Error('Callback was not a function');\n  }\n  if (typeof moduleId !== 'string') {\n    return asyncBail(cb, 'Module ID was not a string: ' + moduleId);\n  }\n  if (!moduleId) {\n    return asyncBail(cb, 'Module ID was an empty string');\n  }\n\n  // Verify the module is not a built-in one\n  if (resolve.isCore(moduleId)) {\n    return asyncBail(cb, 'Module ID corresponds to a built-in Node core module: ' + moduleId);\n  }\n\n  // Get the module's `main` path\n  var caller__dirname;\n  try {\n    var stack = callsite(),\n        caller__filename = stack[1].getFileName();\n    caller__dirname = path.dirname(caller__filename);\n  }\n  catch (e) {\n    caller__dirname = null;\n  }\n\n  if (!caller__dirname) {\n    return asyncBail(cb, 'Could not establish calling context');\n  }\n\n  // Finally, a real asynchronous action:\n  resolve(moduleId, { basedir: caller__dirname }, function(err, modulePath) {\n    // Verify the module's `main` path was found\n    var pkgPath;\n    if (!err && modulePath && modulePath.indexOf(path.sep) !== -1 &&\n        // Find the closest \"package.json\" file to `main`\n        (pkgPath = findup('package.json', { cwd: path.dirname(modulePath) }))\n    ) {\n      try {\n        var pkg = require(pkgPath);\n        // Return the version\n        if (pkg.version) {\n          cb(null, pkg.version);\n        }\n        else {\n          cb(new Error('Found the module but it did not have a version'), null);\n        }\n      }\n      catch (e) {\n        cb(new Error('Failed to load the module \"package.json\"'), null);\n      }\n    }\n    else {\n      cb(new Error('Module could not be found: ' + moduleId), null); \n    }\n  });\n};\n\nversion.sync = function versionSync(moduleId) {\n  // Verify arguments\n  if (typeof moduleId !== 'string' || !moduleId || resolve.isCore(moduleId)) {\n    return null;\n  }\n\n  // Get the module's `main` path\n  var modulePath;\n  try {\n    var stack = callsite(),\n        caller__filename = stack[1].getFileName(),\n        caller__dirname = path.dirname(caller__filename);\n    modulePath = resolve.sync(moduleId, { basedir: caller__dirname });\n  }\n  catch (e) {\n    //throw new Error('Module could not be found: \"' + moduleId + '\"');\n    return null;\n  }\n\n  // Verify the module path was found\n  if (!modulePath || modulePath.indexOf(path.sep) === -1) {\n    return null;\n  }\n\n  // Find the closest \"package.json\" file to `main`\n  var pkgPath = findup('package.json', { cwd: path.dirname(modulePath) });\n  if (!pkgPath) {\n    return null;\n  }\n\n  try {\n    // Return the version\n    return require(pkgPath).version || null;\n  }\n  catch (e) {\n    return null;\n  }\n};\n"]}