projecte_ionic/node_modules/@stencil/core/sys/node/graceful-fs.js
2022-02-09 18:30:03 +01:00

1 line
10 KiB
JavaScript
Executable file

!function(t,e){for(var n in e)t[n]=e[n]}(exports,function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){var r,o,c=n(2),i=n(3),u=n(5),f=n(7),s=n(8);function a(t,e){Object.defineProperty(t,r,{get:function(){return e}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(r=Symbol.for("graceful-fs.queue"),o=Symbol.for("graceful-fs.previous")):(r="___graceful-fs.queue",o="___graceful-fs.previous");var l=function(){};if(s.debuglog?l=s.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(l=function(){var t=s.format.apply(s,arguments);t="GFS4: "+t.split(/\n/).join("\nGFS4: "),console.error(t)}),!c[r]){var p=global[r]||[];a(c,p),c.close=function(t){function e(e,n){return t.call(c,e,(function(t){t||y(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(e,o,{value:t}),e}(c.close),c.closeSync=function(t){function e(e){t.apply(c,arguments),y()}return Object.defineProperty(e,o,{value:t}),e}(c.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){l(c[r]),n(9).equal(c[r].length,0)}))}function h(t){i(t),t.gracefulify=h,t.createReadStream=function(e,n){return new t.ReadStream(e,n)},t.createWriteStream=function(e,n){return new t.WriteStream(e,n)};var e=t.readFile;t.readFile=function(t,n,r){"function"==typeof n&&(r=n,n=null);return function t(n,r,o){return e(n,r,(function(e){!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?("function"==typeof o&&o.apply(this,arguments),y()):d([t,[n,r,o]])}))}(t,n,r)};var n=t.writeFile;t.writeFile=function(t,e,r,o){"function"==typeof r&&(o=r,r=null);return function t(e,r,o,c){return n(e,r,o,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?("function"==typeof c&&c.apply(this,arguments),y()):d([t,[e,r,o,c]])}))}(t,e,r,o)};var r=t.appendFile;r&&(t.appendFile=function(t,e,n,o){"function"==typeof n&&(o=n,n=null);return function t(e,n,o,c){return r(e,n,o,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?("function"==typeof c&&c.apply(this,arguments),y()):d([t,[e,n,o,c]])}))}(t,e,n,o)});var o=t.copyFile;o&&(t.copyFile=function(t,e,n,r){"function"==typeof n&&(r=n,n=0);return o(t,e,n,(function(c){!c||"EMFILE"!==c.code&&"ENFILE"!==c.code?("function"==typeof r&&r.apply(this,arguments),y()):d([o,[t,e,n,r]])}))});var c=t.readdir;function f(e){return c.apply(t,e)}if(t.readdir=function(t,e,n){var r=[t];"function"!=typeof e?r.push(e):n=e;return r.push((function(t,e){e&&e.sort&&e.sort();!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?("function"==typeof n&&n.apply(this,arguments),y()):d([f,[r]])})),f(r)},"v0.8"===process.version.substr(0,4)){var s=u(t);b=s.ReadStream,S=s.WriteStream}var a=t.ReadStream;a&&(b.prototype=Object.create(a.prototype),b.prototype.open=function(){var t=this;O(t.path,t.flags,t.mode,(function(e,n){e?(t.autoClose&&t.destroy(),t.emit("error",e)):(t.fd=n,t.emit("open",n),t.read())}))});var l=t.WriteStream;l&&(S.prototype=Object.create(l.prototype),S.prototype.open=function(){var t=this;O(t.path,t.flags,t.mode,(function(e,n){e?(t.destroy(),t.emit("error",e)):(t.fd=n,t.emit("open",n))}))}),Object.defineProperty(t,"ReadStream",{get:function(){return b},set:function(t){b=t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return S},set:function(t){S=t},enumerable:!0,configurable:!0});var p=b;Object.defineProperty(t,"FileReadStream",{get:function(){return p},set:function(t){p=t},enumerable:!0,configurable:!0});var m=S;function b(t,e){return this instanceof b?(a.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}function S(t,e){return this instanceof S?(l.apply(this,arguments),this):S.apply(Object.create(S.prototype),arguments)}Object.defineProperty(t,"FileWriteStream",{get:function(){return m},set:function(t){m=t},enumerable:!0,configurable:!0});var v=t.open;function O(t,e,n,r){return"function"==typeof n&&(r=n,n=null),function t(e,n,r,o){return v(e,n,r,(function(c,i){!c||"EMFILE"!==c.code&&"ENFILE"!==c.code?("function"==typeof o&&o.apply(this,arguments),y()):d([t,[e,n,r,o]])}))}(t,e,n,r)}return t.open=O,t}function d(t){l("ENQUEUE",t[0].name,t[1]),c[r].push(t)}function y(){var t=c[r].shift();t&&(l("RETRY",t[0].name,t[1]),t[0].apply(null,t[1]))}global[r]||a(global,c[r]),t.exports=h(f(c)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!c.__patched&&(t.exports=h(c),c.__patched=!0)},function(t,e){t.exports=require("fs")},function(t,e,n){var r=n(4),o=process.cwd,c=null,i=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return c||(c=o.call(process)),c};try{process.cwd()}catch(t){}if("function"==typeof process.chdir){var u=process.chdir;process.chdir=function(t){c=null,u.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,u)}t.exports=function(t){r.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(t){t.lchmod=function(e,n,o){t.open(e,r.O_WRONLY|r.O_SYMLINK,n,(function(e,r){e?o&&o(e):t.fchmod(r,n,(function(e){t.close(r,(function(t){o&&o(e||t)}))}))}))},t.lchmodSync=function(e,n){var o,c=t.openSync(e,r.O_WRONLY|r.O_SYMLINK,n),i=!0;try{o=t.fchmodSync(c,n),i=!1}finally{if(i)try{t.closeSync(c)}catch(t){}else t.closeSync(c)}return o}}(t);t.lutimes||function(t){r.hasOwnProperty("O_SYMLINK")?(t.lutimes=function(e,n,o,c){t.open(e,r.O_SYMLINK,(function(e,r){e?c&&c(e):t.futimes(r,n,o,(function(e){t.close(r,(function(t){c&&c(e||t)}))}))}))},t.lutimesSync=function(e,n,o){var c,i=t.openSync(e,r.O_SYMLINK),u=!0;try{c=t.futimesSync(i,n,o),u=!1}finally{if(u)try{t.closeSync(i)}catch(t){}else t.closeSync(i)}return c}):(t.lutimes=function(t,e,n,r){r&&process.nextTick(r)},t.lutimesSync=function(){})}(t);t.chown=c(t.chown),t.fchown=c(t.fchown),t.lchown=c(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=u(t.chownSync),t.fchownSync=u(t.fchownSync),t.lchownSync=u(t.lchownSync),t.chmodSync=o(t.chmodSync),t.fchmodSync=o(t.fchmodSync),t.lchmodSync=o(t.lchmodSync),t.stat=f(t.stat),t.fstat=f(t.fstat),t.lstat=f(t.lstat),t.statSync=s(t.statSync),t.fstatSync=s(t.fstatSync),t.lstatSync=s(t.lstatSync),t.lchmod||(t.lchmod=function(t,e,n){n&&process.nextTick(n)},t.lchmodSync=function(){});t.lchown||(t.lchown=function(t,e,n,r){r&&process.nextTick(r)},t.lchownSync=function(){});"win32"===i&&(t.rename=(e=t.rename,function(n,r,o){var c=Date.now(),i=0;e(n,r,(function u(f){if(f&&("EACCES"===f.code||"EPERM"===f.code)&&Date.now()-c<6e4)return setTimeout((function(){t.stat(r,(function(t,c){t&&"ENOENT"===t.code?e(n,r,u):o(f)}))}),i),void(i<100&&(i+=10));o&&o(f)}))}));var e;function n(e){return e?function(n,r,o){return e.call(t,n,r,(function(t){a(t)&&(t=null),o&&o.apply(this,arguments)}))}:e}function o(e){return e?function(n,r){try{return e.call(t,n,r)}catch(t){if(!a(t))throw t}}:e}function c(e){return e?function(n,r,o,c){return e.call(t,n,r,o,(function(t){a(t)&&(t=null),c&&c.apply(this,arguments)}))}:e}function u(e){return e?function(n,r,o){try{return e.call(t,n,r,o)}catch(t){if(!a(t))throw t}}:e}function f(e){return e?function(n,r,o){function c(t,e){e&&(e.uid<0&&(e.uid+=4294967296),e.gid<0&&(e.gid+=4294967296)),o&&o.apply(this,arguments)}return"function"==typeof r&&(o=r,r=null),r?e.call(t,n,r,c):e.call(t,n,c)}:e}function s(e){return e?function(n,r){var o=r?e.call(t,n,r):e.call(t,n);return o.uid<0&&(o.uid+=4294967296),o.gid<0&&(o.gid+=4294967296),o}:e}function a(t){return!t||("ENOSYS"===t.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==t.code&&"EPERM"!==t.code))}t.read=function(e){function n(n,r,o,c,i,u){var f;if(u&&"function"==typeof u){var s=0;f=function(a,l,p){if(a&&"EAGAIN"===a.code&&s<10)return s++,e.call(t,n,r,o,c,i,f);u.apply(this,arguments)}}return e.call(t,n,r,o,c,i,f)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,e),n}(t.read),t.readSync=(l=t.readSync,function(e,n,r,o,c){for(var i=0;;)try{return l.call(t,e,n,r,o,c)}catch(t){if("EAGAIN"===t.code&&i<10){i++;continue}throw t}});var l}},function(t,e){t.exports=require("constants")},function(t,e,n){var r=n(6).Stream;t.exports=function(t){return{ReadStream:function e(n,o){if(!(this instanceof e))return new e(n,o);r.call(this);var c=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,o=o||{};for(var i=Object.keys(o),u=0,f=i.length;u<f;u++){var s=i[u];this[s]=o[s]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){c._read()}));t.open(this.path,this.flags,this.mode,(function(t,e){if(t)return c.emit("error",t),void(c.readable=!1);c.fd=e,c.emit("open",e),c._read()}))},WriteStream:function e(n,o){if(!(this instanceof e))return new e(n,o);r.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,o=o||{};for(var c=Object.keys(o),i=0,u=c.length;i<u;i++){var f=c[i];this[f]=o[f]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}}},function(t,e){t.exports=require("stream")},function(t,e,n){"use strict";t.exports=function(t){if(null===t||"object"!=typeof t)return t;if(t instanceof Object)var e={__proto__:r(t)};else e=Object.create(null);return Object.getOwnPropertyNames(t).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e};var r=Object.getPrototypeOf||function(t){return t.__proto__}},function(t,e){t.exports=require("util")},function(t,e){t.exports=require("assert")}]));