download
raw
7.98 kB
(()=>{var t={62802(t,e,n){var r=n(39023),i=n(16928),o=n(35317).spawn,s=function(){},u="HKLM",c="HKCU",a="HKCR",f="HKCC",h=[u,c,a,"HKU",f],p="REG_SZ",l="REG_MULTI_SZ",_="REG_EXPAND_SZ",d="REG_DWORD",E="REG_QWORD",v="REG_BINARY",y="REG_NONE",w=[p,l,_,d,E,v,y],R=/(\\[a-zA-Z0-9_\s]+)*/,G=/^(HKEY_LOCAL_MACHINE|HKEY_CURRENT_USER|HKEY_CLASSES_ROOT|HKEY_USERS|HKEY_CURRENT_CONFIG)(.*)$/,g=/^(.*)\s(REG_SZ|REG_MULTI_SZ|REG_EXPAND_SZ|REG_DWORD|REG_QWORD|REG_BINARY|REG_NONE)\s+([^\s].*)$/;function m(t,e){if(!(this instanceof m))return new m(t,e);Error.captureStackTrace(this,m),this.__defineGetter__("name",function(){return m.name}),this.__defineGetter__("message",function(){return t}),this.__defineGetter__("code",function(){return e})}function D(t){var e={stdout:"",stderr:""};return t.stdout.on("data",function(t){e.stdout+=t.toString()}),t.stderr.on("data",function(t){e.stderr+=t.toString()}),e}function x(t,e,n){var i=n.stdout.trim(),o=n.stderr.trim();return new m(r.format("%s command exited with code %d:\n%s\n%s",t,e,i,o),e)}function k(t,e){e&&t.push("/reg:"+function(t){if("x64"==t)return"64";if("x86"==t)return"32";throw new Error("illegal architecture: "+t+" (use x86 or x64)")}(e))}function T(){return"win32"===process.platform?i.join(process.env.windir,"system32","reg.exe"):"REG"}function S(t,e,n,r,i,o,s){if(!(this instanceof S))return new S(t,e,n,r,i,o,s);var u=t,c=e,a=n,f=r,h=i,p=o,l=s;this.__defineGetter__("host",function(){return u}),this.__defineGetter__("hive",function(){return c}),this.__defineGetter__("key",function(){return a}),this.__defineGetter__("name",function(){return f}),this.__defineGetter__("type",function(){return h}),this.__defineGetter__("value",function(){return p}),this.__defineGetter__("arch",function(){return l})}function U(t){if(!(this instanceof U))return new U(t);var e=t||{},n=""+(e.host||""),r=""+(e.hive||u),i=""+(e.key||""),o=e.arch||null;if(this.__defineGetter__("host",function(){return n}),this.__defineGetter__("hive",function(){return r}),this.__defineGetter__("key",function(){return i}),this.__defineGetter__("path",function(){return(0==n.length?"":"\\\\"+n+"\\")+r+i}),this.__defineGetter__("arch",function(){return o}),this.__defineGetter__("parent",function(){var t=i.lastIndexOf("\\");return new U({host:this.host,hive:this.hive,key:-1==t?"":i.substring(0,t),arch:this.arch})}),-1==h.indexOf(r))throw new Error("illegal hive specified.");if(!R.test(i))throw new Error("illegal key specified.");if(o&&"x64"!=o&&"x86"!=o)throw new Error("illegal architecture specified (use x86 or x64)")}r.inherits(m,Error),r.inherits(S,Object),U.HKLM=u,U.HKCU=c,U.HKCR=a,U.HKU="HKU",U.HKCC=f,U.HIVES=h,U.REG_SZ=p,U.REG_MULTI_SZ=l,U.REG_EXPAND_SZ=_,U.REG_DWORD=d,U.REG_QWORD=E,U.REG_BINARY=v,U.REG_NONE=y,U.REG_TYPES=w,U.DEFAULT_VALUE="",U.prototype.values=function(t){if("function"!=typeof t)throw new TypeError("must specify a callback");var e=["QUERY",this.path];k(e,this.arch);var n=o(T(),e,{cwd:void 0,env:process.env,stdio:["ignore","pipe","pipe"]}),r="",i=this,u=null,c=D(n);return n.on("close",function(e){if(!u)if(0!==e)t(x("QUERY",e,c),null);else{for(var n=[],o=[],a=r.split("\n"),f=0,h=0,p=a.length;h<p;h++){var l=a[h].trim();l.length>0&&(s(),0!=f&&n.push(l),++f)}for(h=0,p=n.length;h<p;h++){var _,d,E,v=g.exec(n[h]);v&&(_=v[1].trim(),d=v[2].trim(),E=v[3],o.push(new S(i.host,i.hive,i.key,_,d,E,i.arch)))}t(null,o)}}),n.stdout.on("data",function(t){r+=t.toString()}),n.on("error",function(e){u=e,t(e)}),this},U.prototype.keys=function(t){if("function"!=typeof t)throw new TypeError("must specify a callback");var e=["QUERY",this.path];k(e,this.arch);var n=o(T(),e,{cwd:void 0,env:process.env,stdio:["ignore","pipe","pipe"]}),r="",i=this,u=null,c=D(n);return n.on("close",function(e){u||0!==e&&t(x("QUERY",e,c),null)}),n.stdout.on("data",function(t){r+=t.toString()}),n.stdout.on("end",function(){for(var e=[],n=[],o=r.split("\n"),u=0,c=o.length;u<c;u++){var a=o[u].trim();a.length>0&&(s(),e.push(a))}for(u=0,c=e.length;u<c;u++){var f,h=G.exec(e[u]);h&&(h[1],(f=h[2])&&f!==i.key&&n.push(new U({host:i.host,hive:i.hive,key:f,arch:i.arch})))}t(null,n)}),n.on("error",function(e){u=e,t(e)}),this},U.prototype.get=function(t,e){if("function"!=typeof e)throw new TypeError("must specify a callback");var n=["QUERY",this.path];""==t?n.push("/ve"):n=n.concat(["/v",t]),k(n,this.arch);var r=o(T(),n,{cwd:void 0,env:process.env,stdio:["ignore","pipe","pipe"]}),i="",u=this,c=null,a=D(r);return r.on("close",function(t){if(!c)if(0!==t)e(x("QUERY",t,a),null);else{for(var n=[],r=null,o=i.split("\n"),f=0,h=0,p=o.length;h<p;h++){var l=o[h].trim();l.length>0&&(s(),0!=f&&n.push(l),++f)}var _,d,E,v=n[n.length-1]||"",y=g.exec(v);y&&(_=y[1].trim(),d=y[2].trim(),E=y[3],r=new S(u.host,u.hive,u.key,_,d,E,u.arch)),e(null,r)}}),r.stdout.on("data",function(t){i+=t.toString()}),r.on("error",function(t){c=t,e(t)}),this},U.prototype.set=function(t,e,n,r){if("function"!=typeof r)throw new TypeError("must specify a callback");if(-1==w.indexOf(e))throw Error("illegal type specified.");var i=["ADD",this.path];""==t?i.push("/ve"):i=i.concat(["/v",t]),k(i=i.concat(["/t",e,"/d",n,"/f"]),this.arch);var s=o(T(),i,{cwd:void 0,env:process.env,stdio:["ignore","pipe","pipe"]}),u=null,c=D(s);return s.on("close",function(t){u||r(0!==t?x("ADD",t,c):null)}),s.stdout.on("data",function(t){}),s.on("error",function(t){u=t,r(t)}),this},U.prototype.remove=function(t,e){if("function"!=typeof e)throw new TypeError("must specify a callback");var n=t?["DELETE",this.path,"/f","/v",t]:["DELETE",this.path,"/f","/ve"];k(n,this.arch);var r=o(T(),n,{cwd:void 0,env:process.env,stdio:["ignore","pipe","pipe"]}),i=null,s=D(r);return r.on("close",function(t){i||(0!==t?e(x("DELETE",t,s),null):e(null))}),r.stdout.on("data",function(t){}),r.on("error",function(t){i=t,e(t)}),this},U.prototype.clear=function(t){if("function"!=typeof t)throw new TypeError("must specify a callback");var e=["DELETE",this.path,"/f","/va"];k(e,this.arch);var n=o(T(),e,{cwd:void 0,env:process.env,stdio:["ignore","pipe","pipe"]}),r=null,i=D(n);return n.on("close",function(e){r||(0!==e?t(x("DELETE",e,i),null):t(null))}),n.stdout.on("data",function(t){}),n.on("error",function(e){r=e,t(e)}),this},U.prototype.erase=U.prototype.clear,U.prototype.destroy=function(t){if("function"!=typeof t)throw new TypeError("must specify a callback");var e=["DELETE",this.path,"/f"];k(e,this.arch);var n=o(T(),e,{cwd:void 0,env:process.env,stdio:["ignore","pipe","pipe"]}),r=null,i=D(n);return n.on("close",function(e){r||(0!==e?t(x("DELETE",e,i),null):t(null))}),n.stdout.on("data",function(t){}),n.on("error",function(e){r=e,t(e)}),this},U.prototype.create=function(t){if("function"!=typeof t)throw new TypeError("must specify a callback");var e=["ADD",this.path,"/f"];k(e,this.arch);var n=o(T(),e,{cwd:void 0,env:process.env,stdio:["ignore","pipe","pipe"]}),r=null,i=D(n);return n.on("close",function(e){r||(0!==e?t(x("ADD",e,i),null):t(null))}),n.stdout.on("data",function(t){}),n.on("error",function(e){r=e,t(e)}),this},U.prototype.keyExists=function(t){return this.values(function(e,n){if(e)return 1==e.code?t(null,!1):t(e);t(null,!0)}),this},U.prototype.valueExists=function(t,e){return this.get(t,function(t,n){if(t)return 1==t.code?e(null,!1):e(t);e(null,!0)}),this},t.exports=U},35317(t){"use strict";t.exports=require("child_process")},16928(t){"use strict";t.exports=require("path")},39023(t){"use strict";t.exports=require("util")},28167(t){"use strict";t.exports=require("worker_threads")}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}var r={};(()=>{"use strict";var t=r;Object.defineProperty(t,"__esModule",{value:!0});const e=n(28167);new(n(62802))(e.workerData).keys((t,n)=>{if(!e.parentPort)throw new Error("Not in a worker thread");const r=n.map(t=>({hive:t.hive,arch:t.arch,key:t.key}));e.parentPort.postMessage({err:t,res:r})})})(),module.exports=r})();
//# sourceMappingURL=registryKeys.worker.js.map

Xet Storage Details

Size:
7.98 kB
·
Xet hash:
32828013d8f0e0a30dab8f6e39104e952fb176bc4e3cd6f55ddac655dc53e404

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.