lottie-helper 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- "use strict";function t(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return e};var e={},r=Object.prototype,o=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,i=Object.create(o.prototype),a=new k(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=L(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=f(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h={};function p(){}function d(){}function v(){}var y={};s(y,a,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(_([])));g&&g!==r&&o.call(g,a)&&(y=g);var w=v.prototype=p.prototype=Object.create(y);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(i,a,c,u){var s=f(t[i],t,a);if("throw"!==s.type){var l=s.arg,h=l.value;return h&&"object"==n(h)&&o.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,c,u)}),(function(t){r("throw",t,c,u)})):e.resolve(h).then((function(t){l.value=t,c(l)}),(function(t){return r("throw",t,c,u)}))}u(s.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}}function L(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,L(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=f(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function _(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(o.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:O}}function O(){return{value:void 0,done:!0}}return d.prototype=v,s(w,"constructor",v),s(v,"constructor",d),d.displayName=s(v,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s(t,u,"GeneratorFunction")),t.prototype=Object.create(w),t},e.awrap=function(t){return{__await:t}},x(b.prototype),s(b.prototype,c,(function(){return this})),e.AsyncIterator=b,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new b(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(w),s(w,u,"Generator"),s(w,a,(function(){return this})),s(w,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=_,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:_(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function e(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function r(t){return function(){var r=this,n=arguments;return new Promise((function(o,i){var a=t.apply(r,n);function c(t){e(a,o,i,c,u,"next",t)}function u(t){e(a,o,i,c,u,"throw",t)}c(void 0)}))}}function n(t){return n="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},n(t)}var o=require("minimist"),i=require("cheerio"),a=require("fs"),c=require("path"),u=require("axios");function s(t){return t&&"object"===n(t)&&"default"in t?t:{default:t}}var l=s(o),f=s(i),h=s(a),p=s(c),d=s(u),v=function(){var e=r(t().mark((function e(){var r,n=arguments;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.length>0&&void 0!==n[0]?n[0]:"index.html",t.prev=1,console.log("loadHTML running..."),t.abrupt("return",new Promise((function(t,e){var n=p.default.join(process.cwd(),r);h.default.readFile(n,"utf-8",(function(r,n){if(r)return e(r);t(n)}))})));case 6:t.prev=6,t.t0=t.catch(1),Promise.reject(t.t0);case 9:case"end":return t.stop()}}),e,null,[[1,6]])})));return function(){return e.apply(this,arguments)}}(),y=function(){var e=r(t().mark((function e(r,n){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,console.log("writeHTML running..."),t.abrupt("return",new Promise((function(t,e){var o=p.default.join(process.cwd(),r);h.default.writeFile(o,n,"utf-8",(function(r){if(r)return e(r);t("write done")}))})));case 5:t.prev=5,t.t0=t.catch(0),Promise.reject(t.t0);case 8:case"end":return t.stop()}}),e,null,[[0,5]])})));return function(t,r){return e.apply(this,arguments)}}(),m=function(){var e=r(t().mark((function e(r){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,console.log("loadJs running..."),t.abrupt("return",new Promise((function(t,e){var n=t(__dirname,"..");h.default.readFile("".concat(n,"/dist/").concat(r),"utf-8",(function(r,n){if(r)return e(r);t(n)}))})));case 5:t.prev=5,t.t0=t.catch(0),Promise.reject(t.t0);case 8:case"end":return t.stop()}}),e,null,[[0,5]])})));return function(t){return e.apply(this,arguments)}}(),g=l.default(process.argv.slice(2));console.log("pickJson:"),console.dir(g);var w=g.userJsonURL;console.log("userJsonURL:",w);var x="undefined"!==w&&w;r(t().mark((function e(){var r,n,o,i,a,c,u,s,l,h,p;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="it fuckin empty jsonResult.",n=x||"https://callbackhell.xyz/lottie-json/lottie-2.json",console.log("finaly JSON-URL: ".concat(n)),t.prev=3,t.next=6,d.default(n);case 6:return o=t.sent,i=o.status,a=o.data,200===i&&(r=JSON.stringify(a)),c="index.html",t.next=13,v(c);case 13:return u=t.sent,s=f.default.load(u),t.next=17,m("controller.min.js");case 17:return l=t.sent,s("body").prepend('<script type="text/javascript">'.concat(l,"<\/script>")),s("body").prepend('<script type="text/javascript">window.animateJson='.concat(r,"<\/script>")),s("body").prepend('<div id="lottie-wrapper"><div id="lottie"></div></div>'),s("head").append("<style>#lottie-wrapper {position: absolute;left: 0;top: 0;width: 100%;height: 100%;background: #fff;background-size: cover;z-index: 999999 !important;transition: all 1s;overflow: hidden;}#lottie {position: absolute;left: 50%;top: 50%;width: 50%;transform: translate(-50%, -50%);}</style>"),s("head").append('<script src="https://cdnjs.cloudflare.com/ajax/libs/lottie-web/5.9.6/lottie.min.js"><\/script>'),h=s.html(),t.next=26,y(c,h);case 26:p=t.sent,console.log(p),t.next=34;break;case 30:t.prev=30,t.t0=t.catch(3),console.log(t.t0),console.log("get jsonURL error, please check you jsonURL.");case 34:case"end":return t.stop()}}),e,null,[[3,30]])})))();
1
+ "use strict";function t(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return e};var e={},r=Object.prototype,o=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,i=Object.create(o.prototype),a=new k(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=L(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=f(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h={};function p(){}function d(){}function v(){}var y={};s(y,a,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(_([])));g&&g!==r&&o.call(g,a)&&(y=g);var w=v.prototype=p.prototype=Object.create(y);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(i,a,c,u){var s=f(t[i],t,a);if("throw"!==s.type){var l=s.arg,h=l.value;return h&&"object"==n(h)&&o.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,c,u)}),(function(t){r("throw",t,c,u)})):e.resolve(h).then((function(t){l.value=t,c(l)}),(function(t){return r("throw",t,c,u)}))}u(s.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}}function L(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,L(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=f(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function _(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(o.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:O}}function O(){return{value:void 0,done:!0}}return d.prototype=v,s(w,"constructor",v),s(v,"constructor",d),d.displayName=s(v,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s(t,u,"GeneratorFunction")),t.prototype=Object.create(w),t},e.awrap=function(t){return{__await:t}},x(b.prototype),s(b.prototype,c,(function(){return this})),e.AsyncIterator=b,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new b(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(w),s(w,u,"Generator"),s(w,a,(function(){return this})),s(w,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=_,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:_(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function e(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function r(t){return function(){var r=this,n=arguments;return new Promise((function(o,i){var a=t.apply(r,n);function c(t){e(a,o,i,c,u,"next",t)}function u(t){e(a,o,i,c,u,"throw",t)}c(void 0)}))}}function n(t){return n="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},n(t)}var o=require("minimist"),i=require("cheerio"),a=require("fs"),c=require("path"),u=require("axios");function s(t){return t&&"object"===n(t)&&"default"in t?t:{default:t}}var l=s(o),f=s(i),h=s(a),p=s(c),d=s(u),v=function(){var e=r(t().mark((function e(){var r,n=arguments;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.length>0&&void 0!==n[0]?n[0]:"index.html",t.prev=1,console.log("loadHTML running..."),t.abrupt("return",new Promise((function(t,e){var n=p.default.join(process.cwd(),r);h.default.readFile(n,"utf-8",(function(r,n){if(r)return e(r);t(n)}))})));case 6:t.prev=6,t.t0=t.catch(1),Promise.reject(t.t0);case 9:case"end":return t.stop()}}),e,null,[[1,6]])})));return function(){return e.apply(this,arguments)}}(),y=function(){var e=r(t().mark((function e(r,n){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,console.log("writeHTML running..."),t.abrupt("return",new Promise((function(t,e){var o=p.default.join(process.cwd(),r);h.default.writeFile(o,n,"utf-8",(function(r){if(r)return e(r);t("write done")}))})));case 5:t.prev=5,t.t0=t.catch(0),Promise.reject(t.t0);case 8:case"end":return t.stop()}}),e,null,[[0,5]])})));return function(t,r){return e.apply(this,arguments)}}(),m=function(){var e=r(t().mark((function e(r){return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,console.log("loadJs running..."),t.abrupt("return",new Promise((function(t,e){h.default.readFile("./".concat(r),"utf-8",(function(r,n){if(r)return e(r);t(n)}))})));case 5:t.prev=5,t.t0=t.catch(0),Promise.reject(t.t0);case 8:case"end":return t.stop()}}),e,null,[[0,5]])})));return function(t){return e.apply(this,arguments)}}(),g=l.default(process.argv.slice(2));console.log("pickJson:"),console.dir(g);var w=g.userJsonURL;console.log("userJsonURL:",w);var x="undefined"!==w&&w;r(t().mark((function e(){var r,n,o,i,a,c,u,s,l,h,p;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="it fuckin empty jsonResult.",n=x||"https://callbackhell.xyz/lottie-json/lottie-2.json",console.log("finaly JSON-URL: ".concat(n)),t.prev=3,t.next=6,d.default(n);case 6:return o=t.sent,i=o.status,a=o.data,200===i&&(r=JSON.stringify(a)),c="index.html",t.next=13,v(c);case 13:return u=t.sent,s=f.default.load(u),t.next=17,m("controller.min.js");case 17:return l=t.sent,s("body").prepend('<script type="text/javascript">'.concat(l,"<\/script>")),s("body").prepend('<script type="text/javascript">window.animateJson='.concat(r,"<\/script>")),s("body").prepend('<div id="lottie-wrapper"><div id="lottie"></div></div>'),s("head").append("<style>#lottie-wrapper {position: absolute;left: 0;top: 0;width: 100%;height: 100%;background: #fff;background-size: cover;z-index: 999999 !important;transition: all 1s;overflow: hidden;}#lottie {position: absolute;left: 50%;top: 50%;width: 50%;transform: translate(-50%, -50%);}</style>"),s("head").append('<script src="https://cdnjs.cloudflare.com/ajax/libs/lottie-web/5.9.6/lottie.min.js"><\/script>'),h=s.html(),t.next=26,y(c,h);case 26:p=t.sent,console.log(p),t.next=34;break;case 30:t.prev=30,t.t0=t.catch(3),console.log(t.t0),console.log("get jsonURL error, please check you jsonURL.");case 34:case"end":return t.stop()}}),e,null,[[3,30]])})))();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lottie-helper",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "lottie-helper",
5
5
  "main": "./src/index.js",
6
6
  "bin": {
package/src/loadJson.js CHANGED
@@ -74,8 +74,7 @@ export const loadJs = async (fileName) => {
74
74
  try {
75
75
  console.log("loadJs running...");
76
76
  return new Promise((resolve, reject) => {
77
- const mainPath = resolve(__dirname, "..");
78
- fs.readFile(`${mainPath}/dist/${fileName}`, "utf-8", (err, data) => {
77
+ fs.readFile(`./${fileName}`, "utf-8", (err, data) => {
79
78
  if (err) return reject(err);
80
79
  resolve(data);
81
80
  });