my-idlers/node_modules/envinfo/dist/envinfo.js

1 line
132 KiB
JavaScript
Raw Normal View History

module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=78)}([function(e,t){e.exports=require("path")},function(e,t,n){"use strict";n(22),n(101),n(21),n(103),n(114),n(16),n(27),n(74),n(116),n(2);var r=n(0),o=n(5),i=n(17),s=n(49),a=n(76),c=n(45),u=n(121),l=function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).unify,n=void 0!==t&&t;return new Promise(function(t){s.exec(e,{stdio:[0,"pipe","ignore"]},function(e,r,o){var i="";i=n?r.toString()+o.toString():r.toString(),t((e?"":i).trim())})})},f=function(e){var t=Object.values(Array.prototype.slice.call(arguments).slice(1));(process.env.ENVINFO_DEBUG||"").toLowerCase()===e&&console.log(e,JSON.stringify(t))},p=function(e){return new Promise(function(t){o.readFile(e,"utf8",function(e,n){return t(n||null)})})},h=function(e){return p(e).then(function(e){return e?JSON.parse(e):null})},d=/\d+\.[\d+|.]+/g,m=function(e){f("trace","findDarwinApplication",e);var t=`mdfind "kMDItemCFBundleIdentifier=='${e}'"`;return f("trace",t),l(t).then(function(e){return e.replace(/(\s)/g,"\\ ")})},g=function(e,t){var n=(t||["CFBundleShortVersionString"]).map(function(e){return"-c Print:"+e});return["/usr/libexec/PlistBuddy"].concat(n).concat([e]).join(" ")},v=function(e,t){for(var n=[],r=null;null!==(r=e.exec(t));)n.push(r);return n};e.exports={run:l,log:f,fileExists:function(e){return new Promise(function(t){o.stat(e,function(n){return t(n?null:e)})})},readFile:p,requireJson:h,versionRegex:d,findDarwinApplication:m,generatePlistBuddyCommand:g,matchAll:v,parseSDKManagerOutput:function(e){var t=e.split("Available")[0];return{apiLevels:v(u.androidAPILevels,t).map(function(e){return e[1]}),buildTools:v(u.androidBuildTools,t).map(function(e){return e[1]}),systemImages:v(u.androidSystemImages,t).map(function(e){return e[1].split("|").map(function(e){return e.trim()})}).map(function(e){return e[0].split(";")[0]+" | "+e[2].split(" System Image")[0]})}},isLinux:"linux"===process.platform,isMacOS:"darwin"===process.platform,NA:"N/A",NotFound:"Not Found",isWindows:process.platform.startsWith("win"),isObject:function(e){return"object"==typeof e&&!Array.isArray(e)},noop:function(e){return e},pipe:function(e){return function(t){return e.reduce(function(e,t){return t(e)},t)}},browserBundleIdentifiers:{"Brave Browser":"com.brave.Browser",Chrome:"com.google.Chrome","Chrome Canary":"com.google.Chrome.canary",Firefox:"org.mozilla.firefox","Firefox Developer Edition":"org.mozilla.firefoxdeveloperedition","Firefox Nightly":"org.mozilla.nightly","Microsoft Edge":"com.microsoft.edgemac",Safari:"com.apple.Safari","Safari Technology Preview":"com.apple.SafariTechnologyPreview"},ideBundleIdentifiers:{Atom:"com.github.atom",IntelliJ:"com.jetbrains.intellij",PhpStorm:"com.jetbrains.PhpStorm","Sublime Text":"com.sublimetext.3",WebStorm:"com.jetbrains.WebStorm"},runSync:function(e){return(s.execSync(e,{stdio:[0,"pipe","ignore"]}).toString()||"").trim()},which:function(e){return new Promise(function(t){return a(e,function(e,n){return t(n)})})},getDarwinApplicationVersion:function(e){var t;return f("trace","getDarwinApplicationVersion",e),t="darwin"!==process.platform?"N/A":m(e).then(function(e){return l(g(r.join(e,"Contents","Info.plist"),["CFBundleSh