buy-vs-rent
Advanced tools
Comparing version 1.1.3 to 1.1.4
@@ -14,4 +14,4 @@ const path = require('path') | ||
filename: '[name].js', | ||
library: 'buyvsrent', // 暴露library | ||
libraryTarget: 'this' | ||
library: 'buyvsrent', // 暴露library的变量名 | ||
libraryTarget: 'umd' // 暴露library的方式 | ||
}, | ||
@@ -18,0 +18,0 @@ |
@@ -1,2 +0,2 @@ | ||
this.buyvsrent=function(t){var o={};function e(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}return e.m=t,e.c=o,e.d=function(t,o,n){e.o(t,o)||Object.defineProperty(t,o,{configurable:!1,enumerable:!0,get:n})},e.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},e.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,"a",o),o},e.o=function(t,o){return Object.prototype.hasOwnProperty.call(t,o)},e.p="",e(e.s=0)}([function(t,o,e){"use strict";var n=function(t){var o=t.loan,e=t.loanRate,n=t.months;return o*e*Math.pow(1+e,n)/(Math.pow(1+e,n)-1)};t.exports=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=t.loan,e=void 0===o?300:o,r=t.loanRate,i=void 0===r?.049:r,a=t.months,u=void 0===a?360:a,c=t.cash,s=void 0===c?100:c,d=t.cashRate,l=void 0===d?.04:d,f=t.rent,v=void 0===f?.4:f,p=t.rentRate,h=void 0===p?.1:p,x=t.inflationRate,b=void 0===x?.05:x,m=s+e;l/=12,h/=12;for(var R=n({loan:e,loanRate:i/=12,months:u}),w=0;w<u;w+=1)s=(s+R-v*(1+h))*(1+l);s=s.toFixed(2);var y=Math.pow(1+b,u/12).toFixed(2),F=(s/y).toFixed(2);return{housePrice:m,cash:s,inflation:y,power:F,msg:(u/12).toFixed()+'年后:<br>买房者获得当年总价"'+m+'万"的一套房子;租房者获得"'+s+'万"现金(购买力相当于当年的"'+F+'万");<br>当年买的房子需要涨至"'+(s/m).toFixed(2)+'倍"持平租房者现金流;<br>由于通货膨胀,物价已经是原来的"'+y+'倍"。'}}}]); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.buyvsrent=t():e.buyvsrent=t()}(window,function(){return function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},o.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,o){"use strict";var n=function(e){var t=e.loan,o=e.loanRate,n=e.months;return t*o*Math.pow(1+o,n)/(Math.pow(1+o,n)-1)};e.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.loan,o=void 0===t?300:t,r=e.loanRate,i=void 0===r?.049:r,a=e.months,u=void 0===a?360:a,c=e.cash,f=void 0===c?100:c,d=e.cashRate,s=void 0===d?.04:d,p=e.rent,l=void 0===p?.4:p,v=e.rentRate,x=void 0===v?.1:v,b=e.inflationRate,h=void 0===b?.05:b,y=f+o;s/=12,x/=12;for(var m=n({loan:o,loanRate:i/=12,months:u}),w=0;w<u;w+=1)f=(f+m-l*(1+x))*(1+s);f=f.toFixed(2);var j=Math.pow(1+h,u/12).toFixed(2),R=(f/j).toFixed(2);return{housePrice:y,cash:f,inflation:j,power:R,msg:(u/12).toFixed()+'年后:<br>买房者获得当年总价"'+y+'万"的一套房子;租房者获得"'+f+'万"现金(购买力相当于当年的"'+R+'万");<br>当年买的房子需要涨至"'+(f/y).toFixed(2)+'倍"持平租房者现金流;<br>由于通货膨胀,物价已经是原来的"'+j+'倍"。'}}}])}); | ||
//# sourceMappingURL=buy-vs-rent.js.map |
@@ -15,3 +15,10 @@ { | ||
"license": "MIT", | ||
"main": "dist/buy-vs-rent.js", | ||
"bugs": { | ||
"url": "https://github.com/realgeoffrey/buy-vs-rent/issues" | ||
}, | ||
"homepage": "https://github.com/realgeoffrey/buy-vs-rent#buy-vs-rent", | ||
"main": "source/buy-vs-rent.js", | ||
"module": "source/buy-vs-rent.js", | ||
"unpkg": "dist/buy-vs-rent.js", | ||
"jsdelivr": "dist/buy-vs-rent.js", | ||
"scripts": { | ||
@@ -34,3 +41,3 @@ "build": "cross-env NODE_ENV=production webpack --config build/webpack.prod.js", | ||
}, | ||
"version": "1.1.3" | ||
"version": "1.1.4" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
30303
233
0
0