horae-configure 0.0.4 → 0.0.6

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.
Files changed (2) hide show
  1. package/dist/horae.js +1 -1
  2. package/package.json +2 -2
package/dist/horae.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(global,(()=>(()=>{"use strict";var t,e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{Horae:()=>l}),function(t){t.JSON="json"}(t||(t={}));const r=require("fs");var o=e.n(r),i=function(t){return t.split(".").filter(Boolean)};function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function f(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return c(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,f=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){f=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(f)throw i}}}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,e){if("object"!==a(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!==a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===a(o)?o:String(o)),r)}var o}var l=function(){function e(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.JSON;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Object.defineProperty(this,"config",{enumerable:!0,configurable:!0,writable:!0,value:{name:"config"}}),this.config.name=n,this.config.type=r,this.initialize()}var n,r;return n=e,(r=[{key:"initialize",value:function(){var t="".concat(this.config.name,".").concat(this.config.type);if(o().existsSync(t)){var e=JSON.parse(o().readFileSync("".concat(this.config.name,".").concat(this.config.type),"utf8"));this.config.data=e}else this.config.data={}}},{key:"set",value:function(t,e){var n=i(t),r=Object.assign({},this.config.data);n.reduce((function(t,r){return r===n[n.length-1]?t[r]=e:t[r]||(t[r]={}),t[r]}),r),this.config.data=r}},{key:"get",value:function(t){if(this.config.data){var e,n=this.config.data,r=f(i(t));try{for(r.s();!(e=r.n()).done;){var o=e.value;if(!n.hasOwnProperty(o))return;n=n[o]}}catch(t){r.e(t)}finally{r.f()}return n}}},{key:"has",value:function(t){if(!this.config.data)return!1;var e,n=this.config.data,r=f(i(t));try{for(r.s();!(e=r.n()).done;){var o=e.value;if(!n.hasOwnProperty(o))return!1;n=n[o]}}catch(t){r.e(t)}finally{r.f()}return!0}},{key:"save",value:function(){var t="".concat(this.config.name,".").concat(this.config.type);o().writeFileSync(t,JSON.stringify(this.config.data,null,2))}}])&&u(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e}();return n})()));
1
+ import{createRequire as t}from"module";var n,e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(t,n)=>Object.prototype.hasOwnProperty.call(t,n)},r={};e.d(r,{d:()=>s}),function(t){t.JSON="json"}(n||(n={}));const o=t(import.meta.url)("fs");var i=e.n(o),a=function(t){return t.split(".").filter(Boolean)};function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function f(t,n){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return u(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?u(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==e.return||e.return()}finally{if(c)throw i}}}}function u(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}function l(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,o=function(t,n){if("object"!==c(t)||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!==c(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key),"symbol"===c(o)?o:String(o)),r)}var o}var s=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.JSON;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),Object.defineProperty(this,"config",{enumerable:!0,configurable:!0,writable:!0,value:{name:"config"}}),this.config.name=e,this.config.type=r,this.initialize()}var e,r;return e=t,(r=[{key:"initialize",value:function(){var t="".concat(this.config.name,".").concat(this.config.type);if(i().existsSync(t)){var n=JSON.parse(i().readFileSync("".concat(this.config.name,".").concat(this.config.type),"utf8"));this.config.data=n}else this.config.data={}}},{key:"set",value:function(t,n){var e=a(t),r=Object.assign({},this.config.data);e.reduce((function(t,r){return r===e[e.length-1]?t[r]=n:t[r]||(t[r]={}),t[r]}),r),this.config.data=r}},{key:"get",value:function(t){if(this.config.data){var n,e=this.config.data,r=f(a(t));try{for(r.s();!(n=r.n()).done;){var o=n.value;if(!e.hasOwnProperty(o))return;e=e[o]}}catch(t){r.e(t)}finally{r.f()}return e}}},{key:"has",value:function(t){if(!this.config.data)return!1;var n,e=this.config.data,r=f(a(t));try{for(r.s();!(n=r.n()).done;){var o=n.value;if(!e.hasOwnProperty(o))return!1;e=e[o]}}catch(t){r.e(t)}finally{r.f()}return!0}},{key:"save",value:function(){var t="".concat(this.config.name,".").concat(this.config.type);i().writeFileSync(t,JSON.stringify(this.config.data,null,2))}}])&&l(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),y=r.d;export{y as Horae};
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "horae-configure",
3
3
  "private": false,
4
- "version": "0.0.4",
5
- "type": "commonjs",
4
+ "version": "0.0.6",
5
+ "type": "module",
6
6
  "files": [
7
7
  "dist"
8
8
  ],