instance-transfer
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -1,1 +0,1 @@ | ||
(function(a,b){if("function"==typeof define&&define.amd)define(["exports","./parse","./stringify","./utils"],b);else if("undefined"!=typeof exports)b(exports,require("./parse"),require("./stringify"),require("./utils"));else{var c={exports:{}};b(c.exports,a.parse,a.stringify,a.utils),a.index=c.exports}})(this,function(a,b,c,d){"use strict";function e(a){try{d.hashBy("name",a.classes)}catch(a){var f=a.message;if(f.includes("Has no id for group"))throw new Error("");if(f.includes("Duplicate id"))throw new Error("")}var e=b.default(a),g=c.default(a);return{parse:e,stringify:g}}Object.defineProperty(a,"__esModule",{value:!0}),a.create=e,a.getClassName=function(a){return d.getClassName(a)},a.default=e}); | ||
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=1)}([function(e,t,r){"use strict";function n(e,t){var r=t;return e.split(".").forEach(function(e){r=r&&r[e]||null}),r}Object.defineProperty(t,"__esModule",{value:!0}),t.hashBy=function(e,t){var r=Object.create(null);return t.forEach(function(t){var n=t[e];if(null==n)throw new Error("Has no id for group "+e+"!");if(r[n])throw new Error("Duplicate id "+n+"!");r[n]=t}),r},t.getFindConstructorFactory=function(e){return function(r){var n=t.getClassName(r);return e[n]||null}},t.getClassName=function(e){var t=e.name&&["",e.name]||e.toString().match(/function ([^\(]+)/);return t&&t[1]||"anonymous"},t.getContainerLike=function(e){return Array.isArray(e)?[]:Object.create(null)},t.get=n,t.set=function(e,t,r){var o,a,u;if(e.split(".").length>1?(o=e.split(".").slice(0,-1).join("."),a=e.replace(o+".",""),u=n(o,r)):(a=e,u=r),null==u)throw new Error("Can't set data with path "+e+"!");u[a]=t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2),o=r(3),a=r(0);function u(e){try{a.hashBy("name",e.classes)}catch(e){var t=e.message;if(t.includes("Has no id for group"))throw new Error("");if(t.includes("Duplicate id"))throw new Error("")}return{parse:n.default(e),stringify:o.default(e)}}t.create=u,t.getClassName=function(e){return a.getClassName(e)},t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);t.default=function(e){var t=n.hashBy("name",e.classes);return function(r){var o=e.jsonParse?e.jsonParse(r):JSON.parse(r),a=o.content;return o.meta.forEach(function(e){var r=t[e.name];if(r.parse){var o=r.parse(n.get(e.path,a));n.set(e.path,o,a)}}),a}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0);t.default=function(e){var t=n.hashBy("name",e.classes),r=n.getFindConstructorFactory(t);return function(t){var o={meta:[],content:n.getContainerLike(t)},a=function(e,t,u){Object.keys(e).forEach(function(i){var c=e[i],f=""+u+(u?".":"")+i;switch(typeof c){case"object":if(!c){t[i]=c;break}var s=r(c.constructor);if(s&&s.stringify){o.meta.push({path:f,name:s.name}),t[i]=s.stringify(c);break}if(c.toJSON){t[i]=c.toJSON();break}t[i]=n.getContainerLike(c),a(c,t[i],f);break;default:t[i]=c}})};return a(t,o.content,""),e.jsonStringify?e.jsonStringify(o):JSON.stringify(o)}}}]); |
{ | ||
"name": "instance-transfer", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"dependencies": {}, | ||
"scripts": { | ||
"build": "rm -rf ./dist && node_modules/.bin/tsc -p ./ && node_modules/.bin/babel ./dist/index.js -o ./dist/instance-transfer.min.js", | ||
"prepare": "npm run test && npm run build", | ||
"build": "node_modules/.bin/webpack", | ||
"prepare": "npm test && npm run build", | ||
"test": "node_modules/.bin/jest", | ||
"postversion": "npm publish", | ||
"prepublish": "npm run test", | ||
"preversion": "npm publish", | ||
"prepublish": "npm test", | ||
"postpublish": "git push" | ||
@@ -39,9 +39,9 @@ }, | ||
"@types/jest": "^23.3.1", | ||
"babel-cli": "^6.26.0", | ||
"babel-plugin-transform-es2015-modules-umd": "^6.24.1", | ||
"babel-preset-minify": "^0.3.0", | ||
"jest": "^23.5.0", | ||
"ts-jest": "^23.1.3", | ||
"typescript": "^3.0.1" | ||
"ts-loader": "^4.5.0", | ||
"typescript": "^3.0.1", | ||
"webpack": "^4.16.5", | ||
"webpack-cli": "^3.1.0" | ||
} | ||
} |
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
2
9960
7
162