test-filesystem 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -0
- package/README.md +163 -0
- package/browser/test-fs.js +2856 -0
- package/browser/test-fs.min.js +1 -0
- package/dist/cjs/functions/circularObject.js +54 -0
- package/dist/cjs/functions/circularObject.min.js +1 -0
- package/dist/cjs/functions/countMatches.js +17 -0
- package/dist/cjs/functions/countMatches.min.js +1 -0
- package/dist/cjs/functions/deepReferenceObject.js +24 -0
- package/dist/cjs/functions/deepReferenceObject.min.js +1 -0
- package/dist/cjs/functions/domItem.js +37 -0
- package/dist/cjs/functions/domItem.min.js +1 -0
- package/dist/cjs/functions/jsonDom.js +24 -0
- package/dist/cjs/functions/jsonDom.min.js +1 -0
- package/dist/cjs/functions/linkedList.js +27 -0
- package/dist/cjs/functions/linkedList.min.js +1 -0
- package/dist/cjs/functions/logObject.js +24 -0
- package/dist/cjs/functions/logObject.min.js +1 -0
- package/dist/cjs/functions/multiReferenceObject.js +24 -0
- package/dist/cjs/functions/multiReferenceObject.min.js +1 -0
- package/dist/cjs/functions/nodeTree.js +32 -0
- package/dist/cjs/functions/nodeTree.min.js +1 -0
- package/dist/cjs/functions/removeDirectory.js +19 -0
- package/dist/cjs/functions/removeDirectory.min.js +1 -0
- package/dist/cjs/functions/setUp.js +87 -0
- package/dist/cjs/functions/setUp.min.js +1 -0
- package/dist/cjs/main.js +58 -0
- package/dist/cjs/main.min.js +1 -0
- package/dist/mjs/functions/circularObject.d.ts +14 -0
- package/dist/mjs/functions/circularObject.min.mjs +1 -0
- package/dist/mjs/functions/circularObject.mjs +33 -0
- package/dist/mjs/functions/countMatches.d.ts +10 -0
- package/dist/mjs/functions/countMatches.min.mjs +1 -0
- package/dist/mjs/functions/countMatches.mjs +10 -0
- package/dist/mjs/functions/deepReferenceObject.d.ts +18 -0
- package/dist/mjs/functions/deepReferenceObject.min.mjs +1 -0
- package/dist/mjs/functions/deepReferenceObject.mjs +24 -0
- package/dist/mjs/functions/domItem.d.ts +24 -0
- package/dist/mjs/functions/domItem.min.mjs +1 -0
- package/dist/mjs/functions/domItem.mjs +30 -0
- package/dist/mjs/functions/jsonDom.d.ts +8 -0
- package/dist/mjs/functions/jsonDom.min.mjs +1 -0
- package/dist/mjs/functions/jsonDom.mjs +15 -0
- package/dist/mjs/functions/linkedList.d.ts +12 -0
- package/dist/mjs/functions/linkedList.min.mjs +1 -0
- package/dist/mjs/functions/linkedList.mjs +9 -0
- package/dist/mjs/functions/logObject.d.ts +11 -0
- package/dist/mjs/functions/logObject.min.mjs +1 -0
- package/dist/mjs/functions/logObject.mjs +17 -0
- package/dist/mjs/functions/multiReferenceObject.d.ts +18 -0
- package/dist/mjs/functions/multiReferenceObject.min.mjs +1 -0
- package/dist/mjs/functions/multiReferenceObject.mjs +24 -0
- package/dist/mjs/functions/nodeTree.d.ts +12 -0
- package/dist/mjs/functions/nodeTree.min.mjs +1 -0
- package/dist/mjs/functions/nodeTree.mjs +10 -0
- package/dist/mjs/functions/removeDirectory.d.ts +9 -0
- package/dist/mjs/functions/removeDirectory.min.mjs +1 -0
- package/dist/mjs/functions/removeDirectory.mjs +12 -0
- package/dist/mjs/functions/setUp.d.ts +30 -0
- package/dist/mjs/functions/setUp.min.mjs +1 -0
- package/dist/mjs/functions/setUp.mjs +56 -0
- package/dist/mjs/main.d.ts +93 -0
- package/dist/mjs/main.min.mjs +1 -0
- package/dist/mjs/main.mjs +50 -0
- package/gulpfile.js +221 -0
- package/package.json +58 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function t(e,r,n){function o(a,u){if(!r[a]){if(!e[a]){var c="function"==typeof require&&require;if(!u&&c)return c(a,!0);if(i)return i(a,!0);var f=new Error("Cannot find module '"+a+"'");throw f.code="MODULE_NOT_FOUND",f}var l=r[a]={exports:{}};e[a][0].call(l.exports,(function(t){return o(e[a][1][t]||t)}),l,l.exports,t,e,r,n)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;a<n.length;a++)o(n[a]);return o}({1:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.circularObject=void 0;const n=r.circularObject={name:"root",parent:null,body:null,head:null,children:[]};n.children=[{name:"body",parent:null,children:[]},{name:"head",parent:null,children:[]}],n.body=n.children[0],n.head=n.children[1],n.body.parent=n,n.head.parent=n,n.body.children=[{name:"body child one",parent:null,children:[]},{name:"body child two",parent:null,children:[]}],n.body.children[0].parent=n.body,n.body.children[1].parent=n.body,n.head.children=[{name:"head child one",parent:null,children:[]},{name:"head child two",parent:null,children:[]}],n.head.children[0].parent=n.head,n.head.children[1].parent=n.head;r.default=n},{}],2:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.countMatches=void 0;const n=(t,e)=>t.split(e).length-1;r.countMatches=n;r.default=n},{}],3:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.deepReferenceObject=void 0;const n=r.deepReferenceObject={object1:{name:"someName",object2:{age:12,array1:["someString","anotherString"]},array2:[89,32]},title:"Some Title",item:45};r.default=n},{}],4:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.domItem=r.default=void 0;const n=r.domItem=[{attributes:{className:"row",style:{}},axis:"y",children:[{attributes:{style:{}},axis:"x",children:[],element:{},eventListeners:{},hasShip:!1,isHit:!1,parentItem:{},point:{},tagName:"div"}],element:null,eventListeners:{},parentItem:{},tagName:"div"}];r.default=n},{}],5:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.jsonDom=r.default=void 0;const n=r.jsonDom={tagName:"div",attributes:{style:{},className:"column"},element:null,eventListeners:{},parentItem:{},children:[],axis:"x"};r.default=n},{}],6:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.linkedList=r.default=void 0;const n=r.linkedList={name:"one",prev:null,next:null};n.next={name:"two",prev:n,next:null},n.next.next={name:"three",prev:n.next,next:null};r.default=n},{}],7:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.logObject=r.default=void 0;const n=(e,r="logging",n="log")=>{const o="string"===n?(t,e)=>`'${t}' | `+JSON.stringify(e):console[n];return o(r,void 0===t||"string"===n?e:t("util").inspect(e,!1,null,!0))};r.logObject=n;r.default=n},{util:38}],8:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.multiReferenceObject=r.default=void 0;const n=r.multiReferenceObject={object1:{name:"someName"},object2:{age:12},array1:["someString","anotherString"],array2:[89,32],title:"Some Title",item:45};r.default=n},{}],9:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.nodeTree=r.default=void 0;const n=r.nodeTree={name:"one",parent:null,children:[]};n.children[0]={name:"child one",parent:n,children:[]},n.children[1]={name:"child two",parent:n,children:[]},n.children[0].children[0]={name:"grandchild one",parent:n.children[0],children:[]};r.default=n},{}],10:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.removeDirectory=r.default=void 0;var n=t("fs");const o=t=>new Promise(((e,r)=>(0,n.access)(t,n.constants.F_OK,(o=>o?e(t):(0,n.rm)(t,{recursive:!0},(n=>n?r(n):e(t)))))));r.removeDirectory=o;r.default=o},{fs:14}],11:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.setUp=r.setDefaults=r.default=r.createTempDir=r.beforeEach=r.afterEach=void 0;var n,o=t("fs"),i=(n=t("./removeDirectory"))&&n.__esModule?n:{default:n};var a=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))};let u="test-temp/",c=`${u}src`;const f=()=>(0,i.default)(u);r.afterEach=f;const l=(t=!0)=>a(void 0,void 0,void 0,(function*(){return t?(0,i.default)(u).then((t=>l((0,o.existsSync)(t)))).catch((t=>console.error("Error: ",t))):(0,o.mkdirSync)(c,{recursive:!0})}));r.createTempDir=l;const s=()=>l();r.beforeEach=s;const p=(t=null)=>{t&&(u=t,c=`${u}src`)};r.setDefaults=p;const y=r.setUp={afterEach:f,beforeEach:s,createTempDir:l,setDefaults:p};r.default=y},{"./removeDirectory":10,fs:14}],12:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.testFsBrowser=r.testFs=r.default=void 0;var n=d(t("./functions/circularObject")),o=d(t("./functions/countMatches")),i=d(t("./functions/deepReferenceObject")),a=d(t("./functions/domItem")),u=d(t("./functions/jsonDom")),c=d(t("./functions/linkedList")),f=d(t("./functions/logObject")),l=d(t("./functions/multiReferenceObject")),s=d(t("./functions/nodeTree")),p=d(t("./functions/removeDirectory")),y=d(t("./functions/setUp"));function d(t){return t&&t.__esModule?t:{default:t}}const g=r.testFs={circularObject:n.default,countMatches:o.default,deepReferenceObject:i.default,domItem:a.default,jsonDom:u.default,linkedList:c.default,logObject:f.default,multiReferenceObject:l.default,nodeTree:s.default,removeDirectory:p.default,setUp:y.default};r.default=g;const b=r.testFsBrowser={circularObject:n.default,countMatches:o.default,deepReferenceObject:i.default,domItem:a.default,jsonDom:u.default,linkedList:c.default,logObject:f.default,multiReferenceObject:l.default,nodeTree:s.default};"undefined"!=typeof window&&(window.testFs=b)},{"./functions/circularObject":1,"./functions/countMatches":2,"./functions/deepReferenceObject":3,"./functions/domItem":4,"./functions/jsonDom":5,"./functions/linkedList":6,"./functions/logObject":7,"./functions/multiReferenceObject":8,"./functions/nodeTree":9,"./functions/removeDirectory":10,"./functions/setUp":11}],13:[function(t,e,r){(function(t){(function(){"use strict";var r=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],n="undefined"==typeof globalThis?t:globalThis;e.exports=function(){for(var t=[],e=0;e<r.length;e++)"function"==typeof n[r[e]]&&(t[t.length]=r[e]);return t}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],14:[function(t,e,r){},{}],15:[function(t,e,r){"use strict";var n=t("get-intrinsic"),o=t("./"),i=o(n("String.prototype.indexOf"));e.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o(r):r}},{"./":16,"get-intrinsic":21}],16:[function(t,e,r){"use strict";var n=t("function-bind"),o=t("get-intrinsic"),i=t("set-function-length"),a=o("%TypeError%"),u=o("%Function.prototype.apply%"),c=o("%Function.prototype.call%"),f=o("%Reflect.apply%",!0)||n.call(c,u),l=o("%Object.defineProperty%",!0),s=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(t){l=null}e.exports=function(t){if("function"!=typeof t)throw new a("a function is required");var e=f(n,c,arguments);return i(e,1+s(0,t.length-(arguments.length-1)),!0)};var p=function(){return f(n,u,arguments)};l?l(e.exports,"apply",{value:p}):e.exports.apply=p},{"function-bind":20,"get-intrinsic":21,"set-function-length":35}],17:[function(t,e,r){"use strict";var n=t("has-property-descriptors")(),o=t("get-intrinsic"),i=n&&o("%Object.defineProperty%",!0);if(i)try{i({},"a",{value:1})}catch(t){i=!1}var a=o("%SyntaxError%"),u=o("%TypeError%"),c=t("gopd");e.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new u("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new u("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new u("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new u("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new u("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new u("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],s=!!c&&c(t,e);if(i)i(t,e,{configurable:null===f&&s?s.configurable:!f,enumerable:null===n&&s?s.enumerable:!n,value:r,writable:null===o&&s?s.writable:!o});else{if(!l&&(n||o||f))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},{"get-intrinsic":21,gopd:22,"has-property-descriptors":23}],18:[function(t,e,r){"use strict";var n=t("is-callable"),o=Object.prototype.toString,i=Object.prototype.hasOwnProperty;e.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=r),"[object Array]"===o.call(t)?function(t,e,r){for(var n=0,o=t.length;n<o;n++)i.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,a):"string"==typeof t?function(t,e,r){for(var n=0,o=t.length;n<o;n++)null==r?e(t.charAt(n),n,t):e.call(r,t.charAt(n),n,t)}(t,e,a):function(t,e,r){for(var n in t)i.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,a)}},{"is-callable":31}],19:[function(t,e,r){"use strict";var n=Object.prototype.toString,o=Math.max,i=function(t,e){for(var r=[],n=0;n<t.length;n+=1)r[n]=t[n];for(var o=0;o<e.length;o+=1)r[o+t.length]=e[o];return r};e.exports=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==n.apply(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var r,a=function(t,e){for(var r=[],n=e||0,o=0;n<t.length;n+=1,o+=1)r[o]=t[n];return r}(arguments,1),u=o(0,e.length-a.length),c=[],f=0;f<u;f++)c[f]="$"+f;if(r=Function("binder","return function ("+function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=e);return r}(c,",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof r){var n=e.apply(this,i(a,arguments));return Object(n)===n?n:this}return e.apply(t,i(a,arguments))})),e.prototype){var l=function(){};l.prototype=e.prototype,r.prototype=new l,l.prototype=null}return r}},{}],20:[function(t,e,r){"use strict";var n=t("./implementation");e.exports=Function.prototype.bind||n},{"./implementation":19}],21:[function(t,e,r){"use strict";var n,o=SyntaxError,i=Function,a=TypeError,u=function(t){try{return i('"use strict"; return ('+t+").constructor;")()}catch(t){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(t){c=null}var f=function(){throw new a},l=c?function(){try{return f}catch(t){try{return c(arguments,"callee").get}catch(t){return f}}}():f,s=t("has-symbols")(),p=t("has-proto")(),y=Object.getPrototypeOf||(p?function(t){return t.__proto__}:null),d={},g="undefined"!=typeof Uint8Array&&y?y(Uint8Array):n,b={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":s&&y?y([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":d,"%AsyncGenerator%":d,"%AsyncGeneratorFunction%":d,"%AsyncIteratorPrototype%":d,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":d,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":s&&y?y(y([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&s&&y?y((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&s&&y?y((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":s&&y?y(""[Symbol.iterator]()):n,"%Symbol%":s?Symbol:n,"%SyntaxError%":o,"%ThrowTypeError%":l,"%TypedArray%":g,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(y)try{null.error}catch(t){var h=y(y(t));b["%Error.prototype%"]=h}var m=function t(e){var r;if("%AsyncFunction%"===e)r=u("async function () {}");else if("%GeneratorFunction%"===e)r=u("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=u("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&y&&(r=y(o.prototype))}return b[e]=r,r},v={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},w=t("function-bind"),A=t("hasown"),j=w.call(Function.call,Array.prototype.concat),O=w.call(Function.apply,Array.prototype.splice),S=w.call(Function.call,String.prototype.replace),P=w.call(Function.call,String.prototype.slice),x=w.call(Function.call,RegExp.prototype.exec),E=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,F=/\\(\\)?/g,I=function(t,e){var r,n=t;if(A(v,n)&&(n="%"+(r=v[n])[0]+"%"),A(b,n)){var i=b[n];if(i===d&&(i=m(n)),void 0===i&&!e)throw new a("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new o("intrinsic "+t+" does not exist!")};e.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new a('"allowMissing" argument must be a boolean');if(null===x(/^%?[^%]*%?$/,t))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=P(t,0,1),r=P(t,-1);if("%"===e&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return S(t,E,(function(t,e,r,o){n[n.length]=r?S(o,F,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=I("%"+n+"%",e),u=i.name,f=i.value,l=!1,s=i.alias;s&&(n=s[0],O(r,j([0,1],s)));for(var p=1,y=!0;p<r.length;p+=1){var d=r[p],g=P(d,0,1),h=P(d,-1);if(('"'===g||"'"===g||"`"===g||'"'===h||"'"===h||"`"===h)&&g!==h)throw new o("property names with quotes must have matching quotes");if("constructor"!==d&&y||(l=!0),A(b,u="%"+(n+="."+d)+"%"))f=b[u];else if(null!=f){if(!(d in f)){if(!e)throw new a("base intrinsic for "+t+" exists, but the property is not available.");return}if(c&&p+1>=r.length){var m=c(f,d);f=(y=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:f[d]}else y=A(f,d),f=f[d];y&&!l&&(b[u]=f)}}return f}},{"function-bind":20,"has-proto":24,"has-symbols":25,hasown:28}],22:[function(t,e,r){"use strict";var n=t("get-intrinsic")("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}e.exports=n},{"get-intrinsic":21}],23:[function(t,e,r){"use strict";var n=t("get-intrinsic")("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},e.exports=o},{"get-intrinsic":21}],24:[function(t,e,r){"use strict";var n={foo:{}},o=Object;e.exports=function(){return{__proto__:n}.foo===n.foo&&!({__proto__:null}instanceof o)}},{}],25:[function(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=t("./shams");e.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&o())))}},{"./shams":26}],26:[function(t,e,r){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},{}],27:[function(t,e,r){"use strict";var n=t("has-symbols/shams");e.exports=function(){return n()&&!!Symbol.toStringTag}},{"has-symbols/shams":26}],28:[function(t,e,r){"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=t("function-bind");e.exports=i.call(n,o)},{"function-bind":20}],29:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},{}],30:[function(t,e,r){"use strict";var n=t("has-tostringtag/shams")(),o=t("call-bind/callBound")("Object.prototype.toString"),i=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===o(t)},a=function(t){return!!i(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==o(t)&&"[object Function]"===o(t.callee)},u=function(){return i(arguments)}();i.isLegacyArguments=a,e.exports=u?i:a},{"call-bind/callBound":15,"has-tostringtag/shams":27}],31:[function(t,e,r){"use strict";var n,o,i=Function.prototype.toString,a="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof a&&"function"==typeof Object.defineProperty)try{n=Object.defineProperty({},"length",{get:function(){throw o}}),o={},a((function(){throw 42}),null,n)}catch(t){t!==o&&(a=null)}else a=null;var u=/^\s*class\b/,c=function(t){try{var e=i.call(t);return u.test(e)}catch(t){return!1}},f=function(t){try{return!c(t)&&(i.call(t),!0)}catch(t){return!1}},l=Object.prototype.toString,s="function"==typeof Symbol&&!!Symbol.toStringTag,p=!(0 in[,]),y=function(){return!1};if("object"==typeof document){var d=document.all;l.call(d)===l.call(document.all)&&(y=function(t){if((p||!t)&&(void 0===t||"object"==typeof t))try{var e=l.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}e.exports=a?function(t){if(y(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{a(t,null,n)}catch(t){if(t!==o)return!1}return!c(t)&&f(t)}:function(t){if(y(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(s)return f(t);if(c(t))return!1;var e=l.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&f(t)}},{}],32:[function(t,e,r){"use strict";var n,o=Object.prototype.toString,i=Function.prototype.toString,a=/^\s*(?:function)?\*/,u=t("has-tostringtag/shams")(),c=Object.getPrototypeOf;e.exports=function(t){if("function"!=typeof t)return!1;if(a.test(i.call(t)))return!0;if(!u)return"[object GeneratorFunction]"===o.call(t);if(!c)return!1;if(void 0===n){var e=function(){if(!u)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&c(e)}return c(t)===n}},{"has-tostringtag/shams":27}],33:[function(t,e,r){"use strict";var n=t("which-typed-array");e.exports=function(t){return!!n(t)}},{"which-typed-array":39}],34:[function(t,e,r){var n,o,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(t){if(n===setTimeout)return setTimeout(t,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(t){n=a}try{o="function"==typeof clearTimeout?clearTimeout:u}catch(t){o=u}}();var f,l=[],s=!1,p=-1;function y(){s&&f&&(s=!1,f.length?l=f.concat(l):p=-1,l.length&&d())}function d(){if(!s){var t=c(y);s=!0;for(var e=l.length;e;){for(f=l,l=[];++p<e;)f&&f[p].run();p=-1,e=l.length}f=null,s=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===u||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{return o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function g(t,e){this.fun=t,this.array=e}function b(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];l.push(new g(t,e)),1!==l.length||s||c(d)},g.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=b,i.addListener=b,i.once=b,i.off=b,i.removeListener=b,i.removeAllListeners=b,i.emit=b,i.prependListener=b,i.prependOnceListener=b,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],35:[function(t,e,r){"use strict";var n=t("get-intrinsic"),o=t("define-data-property"),i=t("has-property-descriptors")(),a=t("gopd"),u=n("%TypeError%"),c=n("%Math.floor%");e.exports=function(t,e){if("function"!=typeof t)throw new u("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new u("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,f=!0;if("length"in t&&a){var l=a(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(f=!1)}return(n||f||!r)&&(i?o(t,"length",e,!0,!0):o(t,"length",e)),t}},{"define-data-property":17,"get-intrinsic":21,gopd:22,"has-property-descriptors":23}],36:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],37:[function(t,e,r){"use strict";var n=t("is-arguments"),o=t("is-generator-function"),i=t("which-typed-array"),a=t("is-typed-array");function u(t){return t.call.bind(t)}var c="undefined"!=typeof BigInt,f="undefined"!=typeof Symbol,l=u(Object.prototype.toString),s=u(Number.prototype.valueOf),p=u(String.prototype.valueOf),y=u(Boolean.prototype.valueOf);if(c)var d=u(BigInt.prototype.valueOf);if(f)var g=u(Symbol.prototype.valueOf);function b(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function h(t){return"[object Map]"===l(t)}function m(t){return"[object Set]"===l(t)}function v(t){return"[object WeakMap]"===l(t)}function w(t){return"[object WeakSet]"===l(t)}function A(t){return"[object ArrayBuffer]"===l(t)}function j(t){return"undefined"!=typeof ArrayBuffer&&(A.working?A(t):t instanceof ArrayBuffer)}function O(t){return"[object DataView]"===l(t)}function S(t){return"undefined"!=typeof DataView&&(O.working?O(t):t instanceof DataView)}r.isArgumentsObject=n,r.isGeneratorFunction=o,r.isTypedArray=a,r.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},r.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):a(t)||S(t)},r.isUint8Array=function(t){return"Uint8Array"===i(t)},r.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===i(t)},r.isUint16Array=function(t){return"Uint16Array"===i(t)},r.isUint32Array=function(t){return"Uint32Array"===i(t)},r.isInt8Array=function(t){return"Int8Array"===i(t)},r.isInt16Array=function(t){return"Int16Array"===i(t)},r.isInt32Array=function(t){return"Int32Array"===i(t)},r.isFloat32Array=function(t){return"Float32Array"===i(t)},r.isFloat64Array=function(t){return"Float64Array"===i(t)},r.isBigInt64Array=function(t){return"BigInt64Array"===i(t)},r.isBigUint64Array=function(t){return"BigUint64Array"===i(t)},h.working="undefined"!=typeof Map&&h(new Map),r.isMap=function(t){return"undefined"!=typeof Map&&(h.working?h(t):t instanceof Map)},m.working="undefined"!=typeof Set&&m(new Set),r.isSet=function(t){return"undefined"!=typeof Set&&(m.working?m(t):t instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),r.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(v.working?v(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),r.isWeakSet=function(t){return w(t)},A.working="undefined"!=typeof ArrayBuffer&&A(new ArrayBuffer),r.isArrayBuffer=j,O.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&O(new DataView(new ArrayBuffer(1),0,1)),r.isDataView=S;var P="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function x(t){return"[object SharedArrayBuffer]"===l(t)}function E(t){return void 0!==P&&(void 0===x.working&&(x.working=x(new P)),x.working?x(t):t instanceof P)}function F(t){return b(t,s)}function I(t){return b(t,p)}function T(t){return b(t,y)}function U(t){return c&&b(t,d)}function _(t){return f&&b(t,g)}r.isSharedArrayBuffer=E,r.isAsyncFunction=function(t){return"[object AsyncFunction]"===l(t)},r.isMapIterator=function(t){return"[object Map Iterator]"===l(t)},r.isSetIterator=function(t){return"[object Set Iterator]"===l(t)},r.isGeneratorObject=function(t){return"[object Generator]"===l(t)},r.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===l(t)},r.isNumberObject=F,r.isStringObject=I,r.isBooleanObject=T,r.isBigIntObject=U,r.isSymbolObject=_,r.isBoxedPrimitive=function(t){return F(t)||I(t)||T(t)||U(t)||_(t)},r.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(j(t)||E(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(r,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},{"is-arguments":30,"is-generator-function":32,"is-typed-array":33,"which-typed-array":39}],38:[function(t,e,r){(function(e){(function(){var n=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},o=/%[sdj%]/g;r.format=function(t){if(!m(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(c(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,i=n.length,a=String(t).replace(o,(function(t){if("%%"===t)return"%";if(r>=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),u=n[r];r<i;u=n[++r])b(u)||!A(u)?a+=" "+u:a+=" "+c(u);return a},r.deprecate=function(t,n){if(void 0!==e&&!0===e.noDeprecation)return t;if(void 0===e)return function(){return r.deprecate(t,n).apply(this,arguments)};var o=!1;return function(){if(!o){if(e.throwDeprecation)throw new Error(n);e.traceDeprecation?console.trace(n):console.error(n),o=!0}return t.apply(this,arguments)}};var i={},a=/^$/;if(e.env.NODE_DEBUG){var u=e.env.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+u+"$","i")}function c(t,e){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(e)?n.showHidden=e:e&&r._extend(n,e),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=f),s(n,t,n.depth)}function f(t,e){var r=c.styles[e];return r?"["+c.colors[r][0]+"m"+t+"["+c.colors[r][1]+"m":t}function l(t,e){return t}function s(t,e,n){if(t.customInspect&&e&&S(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var o=e.inspect(n,t);return m(o)||(o=s(t,o,n)),o}var i=function(t,e){if(v(e))return t.stylize("undefined","undefined");if(m(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(h(e))return t.stylize(""+e,"number");if(g(e))return t.stylize(""+e,"boolean");if(b(e))return t.stylize("null","null")}(t,e);if(i)return i;var a=Object.keys(e),u=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(e)),O(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return p(e);if(0===a.length){if(S(e)){var c=e.name?": "+e.name:"";return t.stylize("[Function"+c+"]","special")}if(w(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(j(e))return t.stylize(Date.prototype.toString.call(e),"date");if(O(e))return p(e)}var f,l="",A=!1,P=["{","}"];(d(e)&&(A=!0,P=["[","]"]),S(e))&&(l=" [Function"+(e.name?": "+e.name:"")+"]");return w(e)&&(l=" "+RegExp.prototype.toString.call(e)),j(e)&&(l=" "+Date.prototype.toUTCString.call(e)),O(e)&&(l=" "+p(e)),0!==a.length||A&&0!=e.length?n<0?w(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),f=A?function(t,e,r,n,o){for(var i=[],a=0,u=e.length;a<u;++a)F(e,String(a))?i.push(y(t,e,r,n,String(a),!0)):i.push("");return o.forEach((function(o){o.match(/^\d+$/)||i.push(y(t,e,r,n,o,!0))})),i}(t,e,n,u,a):a.map((function(r){return y(t,e,n,u,r,A)})),t.seen.pop(),function(t,e,r){var n=t.reduce((function(t,e){return e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(n>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(f,l,P)):P[0]+l+P[1]}function p(t){return"["+Error.prototype.toString.call(t)+"]"}function y(t,e,r,n,o,i){var a,u,c;if((c=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]}).get?u=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(u=t.stylize("[Setter]","special")),F(n,o)||(a="["+o+"]"),u||(t.seen.indexOf(c.value)<0?(u=b(r)?s(t,c.value,null):s(t,c.value,r-1)).indexOf("\n")>-1&&(u=i?u.split("\n").map((function(t){return" "+t})).join("\n").slice(2):"\n"+u.split("\n").map((function(t){return" "+t})).join("\n")):u=t.stylize("[Circular]","special")),v(a)){if(i&&o.match(/^\d+$/))return u;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+u}function d(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function b(t){return null===t}function h(t){return"number"==typeof t}function m(t){return"string"==typeof t}function v(t){return void 0===t}function w(t){return A(t)&&"[object RegExp]"===P(t)}function A(t){return"object"==typeof t&&null!==t}function j(t){return A(t)&&"[object Date]"===P(t)}function O(t){return A(t)&&("[object Error]"===P(t)||t instanceof Error)}function S(t){return"function"==typeof t}function P(t){return Object.prototype.toString.call(t)}function x(t){return t<10?"0"+t.toString(10):t.toString(10)}r.debuglog=function(t){if(t=t.toUpperCase(),!i[t])if(a.test(t)){var n=e.pid;i[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else i[t]=function(){};return i[t]},r.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.types=t("./support/types"),r.isArray=d,r.isBoolean=g,r.isNull=b,r.isNullOrUndefined=function(t){return null==t},r.isNumber=h,r.isString=m,r.isSymbol=function(t){return"symbol"==typeof t},r.isUndefined=v,r.isRegExp=w,r.types.isRegExp=w,r.isObject=A,r.isDate=j,r.types.isDate=j,r.isError=O,r.types.isNativeError=O,r.isFunction=S,r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},r.isBuffer=t("./support/isBuffer");var E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function F(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.log=function(){var t,e;console.log("%s - %s",(t=new Date,e=[x(t.getHours()),x(t.getMinutes()),x(t.getSeconds())].join(":"),[t.getDate(),E[t.getMonth()],e].join(" ")),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!A(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var I="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function T(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}r.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(I&&t[I]){var e;if("function"!=typeof(e=t[I]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,I,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,o)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),I&&Object.defineProperty(e,I,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,n(t))},r.promisify.custom=I,r.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var o=r.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return o.apply(i,arguments)};t.apply(this,r).then((function(t){e.nextTick(a.bind(null,null,t))}),(function(t){e.nextTick(T.bind(null,t,a))}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(t)),Object.defineProperties(r,n(t)),r}}).call(this)}).call(this,t("_process"))},{"./support/isBuffer":36,"./support/types":37,_process:34,inherits:29}],39:[function(t,e,r){(function(r){(function(){"use strict";var n=t("for-each"),o=t("available-typed-arrays"),i=t("call-bind"),a=t("call-bind/callBound"),u=t("gopd"),c=a("Object.prototype.toString"),f=t("has-tostringtag/shams")(),l="undefined"==typeof globalThis?r:globalThis,s=o(),p=a("String.prototype.slice"),y=Object.getPrototypeOf,d=a("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return-1},g={__proto__:null};n(s,f&&u&&y?function(t){var e=new l[t];if(Symbol.toStringTag in e){var r=y(e),n=u(r,Symbol.toStringTag);if(!n){var o=y(r);n=u(o,Symbol.toStringTag)}g["$"+t]=i(n.get)}}:function(t){var e=new l[t],r=e.slice||e.set;r&&(g["$"+t]=i(r))});e.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!f){var e=p(c(t),8,-1);return d(s,e)>-1?e:"Object"===e&&function(t){var e=!1;return n(g,(function(r,n){if(!e)try{r(t),e=p(n,1)}catch(t){}})),e}(t)}return u?function(t){var e=!1;return n(g,(function(r,n){if(!e)try{"$"+r(t)===n&&(e=p(n,1))}catch(t){}})),e}(t):null}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"available-typed-arrays":13,"call-bind":16,"call-bind/callBound":15,"for-each":18,gopd:22,"has-tostringtag/shams":27}]},{},[12]);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.default = exports.circularObject = void 0
|
|
7
|
+
/**
|
|
8
|
+
* Multilayered node tree-like structure with parent references
|
|
9
|
+
* @memberOf module:test-fs
|
|
10
|
+
* @type {Object.<string, string|Object|Array>}
|
|
11
|
+
*/
|
|
12
|
+
const circularObject = exports.circularObject = {
|
|
13
|
+
name: 'root',
|
|
14
|
+
parent: null,
|
|
15
|
+
body: null,
|
|
16
|
+
head: null,
|
|
17
|
+
children: []
|
|
18
|
+
}
|
|
19
|
+
circularObject.children = [{
|
|
20
|
+
name: 'body',
|
|
21
|
+
parent: null,
|
|
22
|
+
children: []
|
|
23
|
+
}, {
|
|
24
|
+
name: 'head',
|
|
25
|
+
parent: null,
|
|
26
|
+
children: []
|
|
27
|
+
}]
|
|
28
|
+
circularObject.body = circularObject.children[0]
|
|
29
|
+
circularObject.head = circularObject.children[1]
|
|
30
|
+
circularObject.body.parent = circularObject
|
|
31
|
+
circularObject.head.parent = circularObject
|
|
32
|
+
circularObject.body.children = [{
|
|
33
|
+
name: 'body child one',
|
|
34
|
+
parent: null,
|
|
35
|
+
children: []
|
|
36
|
+
}, {
|
|
37
|
+
name: 'body child two',
|
|
38
|
+
parent: null,
|
|
39
|
+
children: []
|
|
40
|
+
}]
|
|
41
|
+
circularObject.body.children[0].parent = circularObject.body
|
|
42
|
+
circularObject.body.children[1].parent = circularObject.body
|
|
43
|
+
circularObject.head.children = [{
|
|
44
|
+
name: 'head child one',
|
|
45
|
+
parent: null,
|
|
46
|
+
children: []
|
|
47
|
+
}, {
|
|
48
|
+
name: 'head child two',
|
|
49
|
+
parent: null,
|
|
50
|
+
children: []
|
|
51
|
+
}]
|
|
52
|
+
circularObject.head.children[0].parent = circularObject.head
|
|
53
|
+
circularObject.head.children[1].parent = circularObject.head
|
|
54
|
+
var _default = exports.default = circularObject
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.circularObject=void 0;const circularObject=exports.circularObject={name:"root",parent:null,body:null,head:null,children:[]};circularObject.children=[{name:"body",parent:null,children:[]},{name:"head",parent:null,children:[]}],circularObject.body=circularObject.children[0],circularObject.head=circularObject.children[1],circularObject.body.parent=circularObject,circularObject.head.parent=circularObject,circularObject.body.children=[{name:"body child one",parent:null,children:[]},{name:"body child two",parent:null,children:[]}],circularObject.body.children[0].parent=circularObject.body,circularObject.body.children[1].parent=circularObject.body,circularObject.head.children=[{name:"head child one",parent:null,children:[]},{name:"head child two",parent:null,children:[]}],circularObject.head.children[0].parent=circularObject.head,circularObject.head.children[1].parent=circularObject.head;var _default=exports.default=circularObject;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.default = exports.countMatches = void 0
|
|
7
|
+
/**
|
|
8
|
+
* Simple way to count string occurrences for testing.
|
|
9
|
+
* @function
|
|
10
|
+
* @memberOf module:test-fs
|
|
11
|
+
* @param {string} content
|
|
12
|
+
* @param {string} search
|
|
13
|
+
* @returns {number}
|
|
14
|
+
*/
|
|
15
|
+
const countMatches = (content, search) => content.split(search).length - 1
|
|
16
|
+
exports.countMatches = countMatches
|
|
17
|
+
var _default = exports.default = countMatches
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.countMatches=void 0;const countMatches=(t,e)=>t.split(e).length-1;exports.countMatches=countMatches;var _default=exports.default=countMatches;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.default = exports.deepReferenceObject = void 0
|
|
7
|
+
/**
|
|
8
|
+
* Sample object with deep references.
|
|
9
|
+
* @memberOf module:test-fs
|
|
10
|
+
* @type {Object.<string, string|number|Object>}
|
|
11
|
+
*/
|
|
12
|
+
const deepReferenceObject = exports.deepReferenceObject = {
|
|
13
|
+
object1: {
|
|
14
|
+
name: 'someName',
|
|
15
|
+
object2: {
|
|
16
|
+
age: 12,
|
|
17
|
+
array1: ['someString', 'anotherString']
|
|
18
|
+
},
|
|
19
|
+
array2: [89, 32]
|
|
20
|
+
},
|
|
21
|
+
title: 'Some Title',
|
|
22
|
+
item: 45
|
|
23
|
+
}
|
|
24
|
+
var _default = exports.default = deepReferenceObject
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.deepReferenceObject=void 0;const deepReferenceObject=exports.deepReferenceObject={object1:{name:"someName",object2:{age:12,array1:["someString","anotherString"]},array2:[89,32]},title:"Some Title",item:45};var _default=exports.default=deepReferenceObject;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.domItem = exports.default = void 0
|
|
7
|
+
/**
|
|
8
|
+
* Sample of domItem child with nested child and optional details
|
|
9
|
+
* @memberOf module:test-fs
|
|
10
|
+
* @type {Object.<string, string|number|Array|Object>}
|
|
11
|
+
*/
|
|
12
|
+
const domItem = exports.domItem = [{
|
|
13
|
+
attributes: {
|
|
14
|
+
className: 'row',
|
|
15
|
+
style: {}
|
|
16
|
+
},
|
|
17
|
+
axis: 'y',
|
|
18
|
+
children: [{
|
|
19
|
+
attributes: {
|
|
20
|
+
style: {}
|
|
21
|
+
},
|
|
22
|
+
axis: 'x',
|
|
23
|
+
children: [],
|
|
24
|
+
element: {},
|
|
25
|
+
eventListeners: {},
|
|
26
|
+
hasShip: false,
|
|
27
|
+
isHit: false,
|
|
28
|
+
parentItem: {},
|
|
29
|
+
point: {},
|
|
30
|
+
tagName: 'div'
|
|
31
|
+
}],
|
|
32
|
+
element: null,
|
|
33
|
+
eventListeners: {},
|
|
34
|
+
parentItem: {},
|
|
35
|
+
tagName: 'div'
|
|
36
|
+
}]
|
|
37
|
+
var _default = exports.default = domItem
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.domItem=exports.default=void 0;const domItem=exports.domItem=[{attributes:{className:"row",style:{}},axis:"y",children:[{attributes:{style:{}},axis:"x",children:[],element:{},eventListeners:{},hasShip:!1,isHit:!1,parentItem:{},point:{},tagName:"div"}],element:null,eventListeners:{},parentItem:{},tagName:"div"}];var _default=exports.default=domItem;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.jsonDom = exports.default = void 0
|
|
7
|
+
/**
|
|
8
|
+
* Sample of jsonDom object containing an empty nested array and objects
|
|
9
|
+
* @memberOf module:test-fs
|
|
10
|
+
* @type {Object.<string, string|number|Array|Object>}
|
|
11
|
+
*/
|
|
12
|
+
const jsonDom = exports.jsonDom = {
|
|
13
|
+
tagName: 'div',
|
|
14
|
+
attributes: {
|
|
15
|
+
style: {},
|
|
16
|
+
className: 'column'
|
|
17
|
+
},
|
|
18
|
+
element: null,
|
|
19
|
+
eventListeners: {},
|
|
20
|
+
parentItem: {},
|
|
21
|
+
children: [],
|
|
22
|
+
axis: 'x'
|
|
23
|
+
}
|
|
24
|
+
var _default = exports.default = jsonDom
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.jsonDom=exports.default=void 0;const jsonDom=exports.jsonDom={tagName:"div",attributes:{style:{},className:"column"},element:null,eventListeners:{},parentItem:{},children:[],axis:"x"};var _default=exports.default=jsonDom;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.linkedList = exports.default = void 0
|
|
7
|
+
/**
|
|
8
|
+
* Sample LinkedList for testing circular references.
|
|
9
|
+
* @memberOf module:test-fs
|
|
10
|
+
* @type {Object.<string, string|Object>}
|
|
11
|
+
*/
|
|
12
|
+
const linkedList = exports.linkedList = {
|
|
13
|
+
name: 'one',
|
|
14
|
+
prev: null,
|
|
15
|
+
next: null
|
|
16
|
+
}
|
|
17
|
+
linkedList.next = {
|
|
18
|
+
name: 'two',
|
|
19
|
+
prev: linkedList,
|
|
20
|
+
next: null
|
|
21
|
+
}
|
|
22
|
+
linkedList.next.next = {
|
|
23
|
+
name: 'three',
|
|
24
|
+
prev: linkedList.next,
|
|
25
|
+
next: null
|
|
26
|
+
}
|
|
27
|
+
var _default = exports.default = linkedList
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.linkedList=exports.default=void 0;const linkedList=exports.linkedList={name:"one",prev:null,next:null};linkedList.next={name:"two",prev:linkedList,next:null},linkedList.next.next={name:"three",prev:linkedList.next,next:null};var _default=exports.default=linkedList;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.logObject = exports.default = void 0
|
|
7
|
+
/**
|
|
8
|
+
* Log out an object in a nicely formatted way.
|
|
9
|
+
* @function
|
|
10
|
+
* @memberOf module:test-fs
|
|
11
|
+
* @param {Object} object
|
|
12
|
+
* @param {string} [label=logging]
|
|
13
|
+
* @param {string} [outputType=log]
|
|
14
|
+
* @returns {string|undefined}
|
|
15
|
+
*/
|
|
16
|
+
const logObject = (object, label = 'logging', outputType = 'log') => {
|
|
17
|
+
const logger = outputType === 'string' ? (label, object) => `'${label}' | ` + JSON.stringify(object) : console[outputType]
|
|
18
|
+
if (typeof require === 'undefined' || outputType === 'string') {
|
|
19
|
+
return logger(label, object)
|
|
20
|
+
}
|
|
21
|
+
return logger(label, require('util').inspect(object, false, null, true))
|
|
22
|
+
}
|
|
23
|
+
exports.logObject = logObject
|
|
24
|
+
var _default = exports.default = logObject
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.logObject=exports.default=void 0;const logObject=(e,t="logging",o="log")=>{const r="string"===o?(e,t)=>`'${e}' | `+JSON.stringify(t):console[o];return"undefined"==typeof require||"string"===o?r(t,e):r(t,require("util").inspect(e,!1,null,!0))};exports.logObject=logObject;var _default=exports.default=logObject;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.multiReferenceObject = exports.default = void 0
|
|
7
|
+
/**
|
|
8
|
+
* Sample of an object containing multiple references.
|
|
9
|
+
* @memberOf module:test-fs
|
|
10
|
+
* @type {Object.<string, string|number|Object>}
|
|
11
|
+
*/
|
|
12
|
+
const multiReferenceObject = exports.multiReferenceObject = {
|
|
13
|
+
object1: {
|
|
14
|
+
name: 'someName'
|
|
15
|
+
},
|
|
16
|
+
object2: {
|
|
17
|
+
age: 12
|
|
18
|
+
},
|
|
19
|
+
array1: ['someString', 'anotherString'],
|
|
20
|
+
array2: [89, 32],
|
|
21
|
+
title: 'Some Title',
|
|
22
|
+
item: 45
|
|
23
|
+
}
|
|
24
|
+
var _default = exports.default = multiReferenceObject
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.multiReferenceObject=exports.default=void 0;const multiReferenceObject=exports.multiReferenceObject={object1:{name:"someName"},object2:{age:12},array1:["someString","anotherString"],array2:[89,32],title:"Some Title",item:45};var _default=exports.default=multiReferenceObject;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.nodeTree = exports.default = void 0
|
|
7
|
+
/**
|
|
8
|
+
* Sample NodeTree for testing circular references and arrays.
|
|
9
|
+
* @memberOf module:test-fs
|
|
10
|
+
* @type {Object.<string, string|Object|Array>}
|
|
11
|
+
*/
|
|
12
|
+
const nodeTree = exports.nodeTree = {
|
|
13
|
+
name: 'one',
|
|
14
|
+
parent: null,
|
|
15
|
+
children: []
|
|
16
|
+
}
|
|
17
|
+
nodeTree.children[0] = {
|
|
18
|
+
name: 'child one',
|
|
19
|
+
parent: nodeTree,
|
|
20
|
+
children: []
|
|
21
|
+
}
|
|
22
|
+
nodeTree.children[1] = {
|
|
23
|
+
name: 'child two',
|
|
24
|
+
parent: nodeTree,
|
|
25
|
+
children: []
|
|
26
|
+
}
|
|
27
|
+
nodeTree.children[0].children[0] = {
|
|
28
|
+
name: 'grandchild one',
|
|
29
|
+
parent: nodeTree.children[0],
|
|
30
|
+
children: []
|
|
31
|
+
}
|
|
32
|
+
var _default = exports.default = nodeTree
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.nodeTree=exports.default=void 0;const nodeTree=exports.nodeTree={name:"one",parent:null,children:[]};nodeTree.children[0]={name:"child one",parent:nodeTree,children:[]},nodeTree.children[1]={name:"child two",parent:nodeTree,children:[]},nodeTree.children[0].children[0]={name:"grandchild one",parent:nodeTree.children[0],children:[]};var _default=exports.default=nodeTree;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.removeDirectory = exports.default = void 0
|
|
7
|
+
var _fs = require('fs')
|
|
8
|
+
/**
|
|
9
|
+
* Return a promise to be completed once the specified directory is deleted.
|
|
10
|
+
* @function
|
|
11
|
+
* @memberOf module:test-fs
|
|
12
|
+
* @param {string} dirPath
|
|
13
|
+
* @returns {Promise<*>}
|
|
14
|
+
*/
|
|
15
|
+
const removeDirectory = dirPath => new Promise((resolve, reject) => (0, _fs.access)(dirPath, _fs.constants.F_OK, removed => removed ? resolve(dirPath) : (0, _fs.rm)(dirPath, {
|
|
16
|
+
recursive: true
|
|
17
|
+
}, error => error ? reject(error) : resolve(dirPath))))
|
|
18
|
+
exports.removeDirectory = removeDirectory
|
|
19
|
+
var _default = exports.default = removeDirectory
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.removeDirectory=exports.default=void 0;var _fs=require("fs");const removeDirectory=e=>new Promise(((r,o)=>(0,_fs.access)(e,_fs.constants.F_OK,(s=>s?r(e):(0,_fs.rm)(e,{recursive:!0},(s=>s?o(s):r(e)))))));exports.removeDirectory=removeDirectory;var _default=exports.default=removeDirectory;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.setUp = exports.setDefaults = exports.default = exports.createTempDir = exports.beforeEach = exports.afterEach = void 0
|
|
7
|
+
var _fs = require('fs')
|
|
8
|
+
var _removeDirectory = _interopRequireDefault(require('./removeDirectory'))
|
|
9
|
+
function _interopRequireDefault (obj) { return obj && obj.__esModule ? obj : { default: obj } }
|
|
10
|
+
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
11
|
+
function adopt (value) {
|
|
12
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
13
|
+
resolve(value)
|
|
14
|
+
})
|
|
15
|
+
}
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled (value) {
|
|
18
|
+
try {
|
|
19
|
+
step(generator.next(value))
|
|
20
|
+
} catch (e) {
|
|
21
|
+
reject(e)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function rejected (value) {
|
|
25
|
+
try {
|
|
26
|
+
step(generator.throw(value))
|
|
27
|
+
} catch (e) {
|
|
28
|
+
reject(e)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function step (result) {
|
|
32
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected)
|
|
33
|
+
}
|
|
34
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next())
|
|
35
|
+
})
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Import the configurations and override some of them to direct to the temp directory.
|
|
39
|
+
|
|
40
|
+
let tempDir = 'test-temp/'
|
|
41
|
+
let srcPath = `${tempDir}src`
|
|
42
|
+
/**
|
|
43
|
+
* In the Jest.afterEach function call this one to clean up and remove the temp directory.
|
|
44
|
+
* @function
|
|
45
|
+
* @memberOf module:test-fs
|
|
46
|
+
* @returns {Promise<*>}
|
|
47
|
+
*/
|
|
48
|
+
const afterEach = () => (0, _removeDirectory.default)(tempDir)
|
|
49
|
+
/**
|
|
50
|
+
* Ensure that the del has completed, recursively attempt to delete and recreate
|
|
51
|
+
* @function
|
|
52
|
+
* @memberOf module:test-fs
|
|
53
|
+
* @param {boolean} [exists=true]
|
|
54
|
+
* @returns {Promise<*|void>}
|
|
55
|
+
*/
|
|
56
|
+
exports.afterEach = afterEach
|
|
57
|
+
const createTempDir = (exists = true) => __awaiter(void 0, void 0, void 0, function * () {
|
|
58
|
+
if (exists) {
|
|
59
|
+
return (0, _removeDirectory.default)(tempDir).then(removedDir => createTempDir((0, _fs.existsSync)(removedDir))).catch(error => console.error('Error: ', error))
|
|
60
|
+
}
|
|
61
|
+
return (0, _fs.mkdirSync)(srcPath, {
|
|
62
|
+
recursive: true
|
|
63
|
+
})
|
|
64
|
+
})
|
|
65
|
+
/**
|
|
66
|
+
* In the Jest.beforeEach function call this one to set up the temp directory.
|
|
67
|
+
* @function
|
|
68
|
+
* @memberOf module:test-fs
|
|
69
|
+
* @returns {Promise<*|void>}
|
|
70
|
+
*/
|
|
71
|
+
exports.createTempDir = createTempDir
|
|
72
|
+
const beforeEach = () => createTempDir()
|
|
73
|
+
exports.beforeEach = beforeEach
|
|
74
|
+
const setDefaults = (dirPath = null) => {
|
|
75
|
+
if (dirPath) {
|
|
76
|
+
tempDir = dirPath
|
|
77
|
+
srcPath = `${tempDir}src`
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.setDefaults = setDefaults
|
|
81
|
+
const setUp = exports.setUp = {
|
|
82
|
+
afterEach,
|
|
83
|
+
beforeEach,
|
|
84
|
+
createTempDir,
|
|
85
|
+
setDefaults
|
|
86
|
+
}
|
|
87
|
+
var _default = exports.default = setUp
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.setUp=exports.setDefaults=exports.default=exports.createTempDir=exports.beforeEach=exports.afterEach=void 0;var _fs=require("fs"),_removeDirectory=_interopRequireDefault(require("./removeDirectory"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var __awaiter=function(e,t,r,a){return new(r||(r=Promise))((function(o,c){function s(e){try{f(a.next(e))}catch(e){c(e)}}function i(e){try{f(a.throw(e))}catch(e){c(e)}}function f(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,i)}f((a=a.apply(e,t||[])).next())}))};let tempDir="test-temp/",srcPath=`${tempDir}src`;const afterEach=()=>(0,_removeDirectory.default)(tempDir);exports.afterEach=afterEach;const createTempDir=(e=!0)=>__awaiter(void 0,void 0,void 0,(function*(){return e?(0,_removeDirectory.default)(tempDir).then((e=>createTempDir((0,_fs.existsSync)(e)))).catch((e=>console.error("Error: ",e))):(0,_fs.mkdirSync)(srcPath,{recursive:!0})}));exports.createTempDir=createTempDir;const beforeEach=()=>createTempDir();exports.beforeEach=beforeEach;const setDefaults=(e=null)=>{e&&(tempDir=e,srcPath=`${tempDir}src`)};exports.setDefaults=setDefaults;const setUp=exports.setUp={afterEach:afterEach,beforeEach:beforeEach,createTempDir:createTempDir,setDefaults:setDefaults};var _default=exports.default=setUp;
|
package/dist/cjs/main.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true
|
|
5
|
+
})
|
|
6
|
+
exports.testFsBrowser = exports.testFs = exports.default = void 0
|
|
7
|
+
var _circularObject = _interopRequireDefault(require('./functions/circularObject'))
|
|
8
|
+
var _countMatches = _interopRequireDefault(require('./functions/countMatches'))
|
|
9
|
+
var _deepReferenceObject = _interopRequireDefault(require('./functions/deepReferenceObject'))
|
|
10
|
+
var _domItem = _interopRequireDefault(require('./functions/domItem'))
|
|
11
|
+
var _jsonDom = _interopRequireDefault(require('./functions/jsonDom'))
|
|
12
|
+
var _linkedList = _interopRequireDefault(require('./functions/linkedList'))
|
|
13
|
+
var _logObject = _interopRequireDefault(require('./functions/logObject'))
|
|
14
|
+
var _multiReferenceObject = _interopRequireDefault(require('./functions/multiReferenceObject'))
|
|
15
|
+
var _nodeTree = _interopRequireDefault(require('./functions/nodeTree'))
|
|
16
|
+
var _removeDirectory = _interopRequireDefault(require('./functions/removeDirectory'))
|
|
17
|
+
var _setUp = _interopRequireDefault(require('./functions/setUp'))
|
|
18
|
+
function _interopRequireDefault (obj) { return obj && obj.__esModule ? obj : { default: obj } }
|
|
19
|
+
/**
|
|
20
|
+
* An assortment of objects that can be used in tests and some functions to help debug and write tests.
|
|
21
|
+
* @file
|
|
22
|
+
* @author Joshua Heagle <joshuaheagle@gmail.com>
|
|
23
|
+
* @version 1.0.0
|
|
24
|
+
* @module test-fs
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
const testFs = exports.testFs = {
|
|
28
|
+
circularObject: _circularObject.default,
|
|
29
|
+
countMatches: _countMatches.default,
|
|
30
|
+
deepReferenceObject: _deepReferenceObject.default,
|
|
31
|
+
domItem: _domItem.default,
|
|
32
|
+
jsonDom: _jsonDom.default,
|
|
33
|
+
linkedList: _linkedList.default,
|
|
34
|
+
logObject: _logObject.default,
|
|
35
|
+
multiReferenceObject: _multiReferenceObject.default,
|
|
36
|
+
nodeTree: _nodeTree.default,
|
|
37
|
+
removeDirectory: _removeDirectory.default,
|
|
38
|
+
setUp: _setUp.default
|
|
39
|
+
}
|
|
40
|
+
var _default = exports.default = testFs
|
|
41
|
+
const testFsBrowser = exports.testFsBrowser = {
|
|
42
|
+
circularObject: _circularObject.default,
|
|
43
|
+
countMatches: _countMatches.default,
|
|
44
|
+
deepReferenceObject: _deepReferenceObject.default,
|
|
45
|
+
domItem: _domItem.default,
|
|
46
|
+
jsonDom: _jsonDom.default,
|
|
47
|
+
linkedList: _linkedList.default,
|
|
48
|
+
logObject: _logObject.default,
|
|
49
|
+
multiReferenceObject: _multiReferenceObject.default,
|
|
50
|
+
nodeTree: _nodeTree.default
|
|
51
|
+
}
|
|
52
|
+
if (void 0) {
|
|
53
|
+
// @ts-ignore
|
|
54
|
+
(void 0).testFs = testFsBrowser
|
|
55
|
+
} else if (typeof window !== 'undefined') {
|
|
56
|
+
// @ts-ignore
|
|
57
|
+
window.testFs = testFsBrowser
|
|
58
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.testFsBrowser=exports.testFs=exports.default=void 0;var _circularObject=_interopRequireDefault(require("./functions/circularObject")),_countMatches=_interopRequireDefault(require("./functions/countMatches")),_deepReferenceObject=_interopRequireDefault(require("./functions/deepReferenceObject")),_domItem=_interopRequireDefault(require("./functions/domItem")),_jsonDom=_interopRequireDefault(require("./functions/jsonDom")),_linkedList=_interopRequireDefault(require("./functions/linkedList")),_logObject=_interopRequireDefault(require("./functions/logObject")),_multiReferenceObject=_interopRequireDefault(require("./functions/multiReferenceObject")),_nodeTree=_interopRequireDefault(require("./functions/nodeTree")),_removeDirectory=_interopRequireDefault(require("./functions/removeDirectory")),_setUp=_interopRequireDefault(require("./functions/setUp"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let testFs=exports.testFs={circularObject:_circularObject.default,countMatches:_countMatches.default,deepReferenceObject:_deepReferenceObject.default,domItem:_domItem.default,jsonDom:_jsonDom.default,linkedList:_linkedList.default,logObject:_logObject.default,multiReferenceObject:_multiReferenceObject.default,nodeTree:_nodeTree.default,removeDirectory:_removeDirectory.default,setUp:_setUp.default};var _default=exports.default=testFs;let testFsBrowser=exports.testFsBrowser={circularObject:_circularObject.default,countMatches:_countMatches.default,deepReferenceObject:_deepReferenceObject.default,domItem:_domItem.default,jsonDom:_jsonDom.default,linkedList:_linkedList.default,logObject:_logObject.default,multiReferenceObject:_multiReferenceObject.default,nodeTree:_nodeTree.default};"undefined"!=typeof window&&(window.testFs=testFsBrowser);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsonDomItem } from './domItem';
|
|
2
|
+
/**
|
|
3
|
+
* Multilayered node tree-like structure with parent references
|
|
4
|
+
* @memberOf module:test-fs
|
|
5
|
+
* @type {Object.<string, string|Object|Array>}
|
|
6
|
+
*/
|
|
7
|
+
export declare const circularObject: {
|
|
8
|
+
name: string;
|
|
9
|
+
parent: null;
|
|
10
|
+
body: jsonDomItem | null;
|
|
11
|
+
head: jsonDomItem | null;
|
|
12
|
+
children: jsonDomItem[] | [];
|
|
13
|
+
};
|
|
14
|
+
export default circularObject;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const circularObject={name:"root",parent:null,body:null,head:null,children:[]};circularObject.children=[{name:"body",parent:null,children:[]},{name:"head",parent:null,children:[]}],circularObject.body=circularObject.children[0],circularObject.head=circularObject.children[1],circularObject.body.parent=circularObject,circularObject.head.parent=circularObject,circularObject.body.children=[{name:"body child one",parent:null,children:[]},{name:"body child two",parent:null,children:[]}],circularObject.body.children[0].parent=circularObject.body,circularObject.body.children[1].parent=circularObject.body,circularObject.head.children=[{name:"head child one",parent:null,children:[]},{name:"head child two",parent:null,children:[]}],circularObject.head.children[0].parent=circularObject.head,circularObject.head.children[1].parent=circularObject.head;export default circularObject;
|