buy-vs-rent
Advanced tools
Comparing version 1.2.3 to 1.2.4
@@ -0,0 +0,0 @@ module.exports = { |
@@ -0,0 +0,0 @@ const path = require('path') |
@@ -0,0 +0,0 @@ const path = require('path') |
const path = require('path') | ||
const merge = require('webpack-merge') // 合并配置 | ||
const base = require('./webpack.base') | ||
const CleanWebpackPlugin = require('clean-webpack-plugin') // 清理文件(夹) | ||
const { CleanWebpackPlugin } = require('clean-webpack-plugin') // 清理文件(夹) | ||
@@ -19,3 +19,3 @@ module.exports = merge(base, { | ||
plugins: [ | ||
new CleanWebpackPlugin(['dist'], { root: path.resolve(__dirname, '..') }) | ||
new CleanWebpackPlugin() | ||
], | ||
@@ -22,0 +22,0 @@ |
@@ -1,2 +0,2 @@ | ||
!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,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},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){var o=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,n=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,l=void 0===d?.04:d,p=e.rent,s=void 0===p?.4:p,v=e.rentRate,b=void 0===v?.1:v,y=e.inflationRate,x=void 0===y?.05:y,m=f+n;l/=12,b/=12;for(var h=o({loan:n,loanRate:i/=12,months:u}),j=0;j<u;j+=1)f=(f+h-s*(1+b))*(1+l);f=f.toFixed(2);var g=Math.pow(1+x,u/12).toFixed(2),w=(f/g).toFixed(2);return{housePrice:m,cash:f,inflation:g,power:w,msg:"".concat((u/12).toFixed(),'年后:<br>买房者获得当年总价"').concat(m,'万"的一套房子;租房者获得"').concat(f,'万"现金(购买力相当于当年的"').concat(w,'万");<br>当年买的房子需要涨至"').concat((f/m).toFixed(2),'倍"持平租房者现金流;<br>由于通货膨胀,物价已经是原来的"').concat(g,'倍"。')}}}])}); | ||
!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,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},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){var o=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,n=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,l=void 0===d?.04:d,p=e.rent,s=void 0===p?.4:p,v=e.rentRate,b=void 0===v?.1:v,y=e.inflationRate,x=void 0===y?.05:y,m=f+n;l/=12,b/=12;for(var h=o({loan:n,loanRate:i/=12,months:u}),j=0;j<u;j+=1)f=(f+h-s*(1+b))*(1+l);f=f.toFixed(2);var g=Math.pow(1+x,u/12).toFixed(2),w=(f/g).toFixed(2);return{housePrice:m,cash:f,inflation:g,power:w,msg:"".concat((u/12).toFixed(),'年后:<br>买房者获得当年总价"').concat(m,'万"的一套房子;租房者获得"').concat(f,'万"现金(购买力相当于当年的"').concat(w,'万");<br>当年买的房子需要涨至"').concat((f/m).toFixed(2),'倍"持平租房者现金流;<br>由于通货膨胀,物价已经是原来的"').concat(g,'倍"。')}}}])})); | ||
//# sourceMappingURL=buy-vs-rent.js.map |
@@ -32,4 +32,4 @@ { | ||
"babel-loader": "8", | ||
"clean-webpack-plugin": "0", | ||
"cross-env": "5", | ||
"clean-webpack-plugin": "3", | ||
"cross-env": "7", | ||
"html-webpack-plugin": "3", | ||
@@ -41,3 +41,3 @@ "webpack": "4", | ||
}, | ||
"version": "1.2.3" | ||
"version": "1.2.4" | ||
} |
@@ -8,5 +8,4 @@ # buy-vs-rent | ||
### 安装 | ||
1. Node.js安装 | ||
1. node安装 | ||
```bash | ||
@@ -18,7 +17,7 @@ npm install buy-vs-rent | ||
```html | ||
<sciprt src="//unpkg.com/buy-vs-rent"></sciprt> | ||
<script src="//unpkg.com/buy-vs-rent"></script> | ||
``` | ||
### 使用 | ||
1. node | ||
1. Node.js | ||
@@ -43,3 +42,3 @@ ```javascript | ||
```html | ||
<sciprt src="//unpkg.com/buy-vs-rent"></sciprt> | ||
<script src="//unpkg.com/buy-vs-rent"></script> | ||
<script> | ||
@@ -46,0 +45,0 @@ var obj = window.buyvsrent({ |
@@ -0,0 +0,0 @@ const tools = { |
@@ -0,0 +0,0 @@ /** |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
33284
105