Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

buy-vs-rent

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buy-vs-rent - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

.babelrc

4

dist/buy-vs-rent.js

@@ -1,2 +0,2 @@

/*! Made by realgeoffrey */
var buyvsrent=function(n){function F(B){if(Q[B])return Q[B].exports;var U=Q[B]={i:B,l:!1,exports:{}};return n[B].call(U.exports,U,U.exports,F),U.l=!0,U.exports}var Q={};return F.m=n,F.c=Q,F.d=function(n,Q,B){F.o(n,Q)||Object.defineProperty(n,Q,{configurable:!1,enumerable:!0,get:B})},F.n=function(n){var Q=n&&n.__esModule?function(){return n.default}:function(){return n};return F.d(Q,"a",Q),Q},F.o=function(n,F){return Object.prototype.hasOwnProperty.call(n,F)},F.p="",F(F.s=0)}([function(module,exports,__webpack_require__){"use strict";eval('\n\nvar tools = {\n /**\n * 等额本息,每月还款数额\n * @param {Number} loan - 贷款量\n * @param {Number} loanRate - 贷款月利率\n * @param {Number} months - 还贷时间\n * @returns {Number} 每月还款数额\n */\n funcA: function funcA(_ref) {\n var loan = _ref.loan,\n loanRate = _ref.loanRate,\n months = _ref.months;\n\n // 月还款额 = 本金 * 月利率 * Math.pow(1 + 月利率, 还款总月数) / (Math.pow(1 + 月利率, 还款总月数) - 1)\n return loan * loanRate * Math.pow(1 + loanRate, months) / (Math.pow(1 + loanRate, months) - 1);\n },\n\n\n /**\n * 等额本金,每月还款数额的数组\n * @param {Number} loan - 贷款量\n * @param {Number} loanRate - 贷款月利率\n * @param {Number} months - 还贷时间\n * @returns {Array} 每月还款数额的数组\n */\n funcB: function funcB(_ref2) {\n var loan = _ref2.loan,\n loanRate = _ref2.loanRate,\n months = _ref2.months;\n\n var returnArr = [];\n var capital = loan / months; // 每月还的本金\n\n for (var month = 0; month < months; month += 1) {\n // 月还款额 = 本金 / 还款总月数 + 剩余本金 * 月利率\n returnArr.push(capital + (loan - capital * month) * loanRate);\n }\n\n return returnArr;\n }\n};\n\n/**\n * 方法描述(月)\n * @param {Number} [loan = 300] - 贷款量(万)\n * @param {Number} [loanRate = 0.049] - 贷款年利率\n * @param {Number} [months = 12 * 30,] - 还贷时间(月)\n * @param {Number} [cash = 100] - 现金量(万)\n * @param {Number} [cashRate = 0.04] - 现金年投资回报率\n * @param {Number} [rent = 0.4] - 租房租金(万)\n * @param {Number} [rentRate = 0.1] - 租房租金年涨幅率\n * @param {Number} [inflationRate = 0.05] - 年通货膨胀率\n */\nmodule.exports = function () {\n var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref3$loan = _ref3.loan,\n loan = _ref3$loan === undefined ? 300 : _ref3$loan,\n _ref3$loanRate = _ref3.loanRate,\n loanRate = _ref3$loanRate === undefined ? 0.049 : _ref3$loanRate,\n _ref3$months = _ref3.months,\n months = _ref3$months === undefined ? 12 * 30 : _ref3$months,\n _ref3$cash = _ref3.cash,\n cash = _ref3$cash === undefined ? 100 : _ref3$cash,\n _ref3$cashRate = _ref3.cashRate,\n cashRate = _ref3$cashRate === undefined ? 0.04 : _ref3$cashRate,\n _ref3$rent = _ref3.rent,\n rent = _ref3$rent === undefined ? 0.4 : _ref3$rent,\n _ref3$rentRate = _ref3.rentRate,\n rentRate = _ref3$rentRate === undefined ? 0.1 : _ref3$rentRate,\n _ref3$inflationRate = _ref3.inflationRate,\n inflationRate = _ref3$inflationRate === undefined ? 0.05 : _ref3$inflationRate;\n\n // 买房的价格\n var housePrice = cash + loan;\n\n // 租房的现金\n loanRate = loanRate / 12; // 贷款月利率\n cashRate = cashRate / 12; // 现金月投资回报率\n rentRate = rentRate / 12; // 租房租金月涨幅率\n var loanPay = tools.funcA({ loan: loan, loanRate: loanRate, months: months }); // 等额本息,每月还款数额\n for (var month = 0; month < months; month += 1) {\n // 未买房获得的现金收益\n cash = (cash + loanPay - rent * (1 + rentRate)) * (1 + cashRate);\n }\n cash = cash.toFixed(2);\n\n // 通货膨胀和购买力\n var inflation = Math.pow(1 + inflationRate, months / 12).toFixed(2); // 还完款之后的通货膨胀倍数\n var power = (cash / inflation).toFixed(2); // 购买力\n\n return {\n housePrice: housePrice,\n cash: cash,\n inflation: inflation,\n power: power,\n msg: (months / 12).toFixed() + "\\u5E74\\u540E\\uFF1A<br>\\u4E70\\u623F\\u8005\\u83B7\\u5F97\\u5F53\\u5E74\\u603B\\u4EF7\\"" + housePrice + "\\u4E07\\"\\u7684\\u4E00\\u5957\\u623F\\u5B50\\uFF1B\\u79DF\\u623F\\u8005\\u83B7\\u5F97\\"" + cash + "\\u4E07\\"\\u73B0\\u91D1\\uFF08\\u8D2D\\u4E70\\u529B\\u76F8\\u5F53\\u4E8E\\u5F53\\u5E74\\u7684\\"" + power + "\\u4E07\\"\\uFF09\\uFF1B<br>\\u5F53\\u5E74\\u4E70\\u7684\\u623F\\u5B50\\u9700\\u8981\\u6DA8\\u81F3\\"" + (cash / housePrice).toFixed(2) + "\\u500D\\"\\u6301\\u5E73\\u79DF\\u623F\\u8005\\u73B0\\u91D1\\u6D41\\uFF1B<br>\\u7531\\u4E8E\\u901A\\u8D27\\u81A8\\u80C0\\uFF0C\\u7269\\u4EF7\\u5DF2\\u7ECF\\u662F\\u539F\\u6765\\u7684\\"" + inflation + "\\u500D\\"\\u3002"\n };\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9zcmMvaW5kZXguanM/OTU1MiJdLCJuYW1lcyI6WyJ0b29scyIsImZ1bmNBIiwibG9hbiIsImxvYW5SYXRlIiwibW9udGhzIiwiTWF0aCIsInBvdyIsImZ1bmNCIiwicmV0dXJuQXJyIiwiY2FwaXRhbCIsIm1vbnRoIiwicHVzaCIsIm1vZHVsZSIsImV4cG9ydHMiLCJjYXNoIiwiY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enn+aIv+iAheiOt+W+l1wiJHtjYXNofeS4h1wi546w6YeR77yI6LSt5Lmw5Yqb55u45b2T5LqO5b2T5bm055qEXCIke3Bvd2VyfeS4h1wi77yJ77ybPGJyPuW9k+W5tOS5sOeahOaIv+WtkOmcgOimgea2qOiHs1wiJHsoY2FzaCAvIGhvdXNlUHJpY2UpLnRvRml4ZWQoMil95YCNXCLmjIHlubPnp5/miL/ogIXnjrDph5HmtYHvvJs8YnI+55Sx5LqO6YCa6LSn6Iao6IOA77yM54mp5Lu35bey57uP5piv5Y6f5p2l55qEXCIke2luZmxhdGlvbn3lgI1cIuOAgmBcbiAgfVxufVxuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIC4vc3JjL2luZGV4LmpzIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///0\n')}]);
var 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,a=void 0===r?.049:r,i=t.months,u=void 0===i?360:i,c=t.cash,d=void 0===c?100:c,l=t.cashRate,s=void 0===l?.04:l,v=t.rent,f=void 0===v?.4:v,p=t.rentRate,h=void 0===p?.1:p,x=t.inflationRate,b=void 0===x?.05:x,m=d+e;s/=12,h/=12;for(var R=n({loan:e,loanRate:a/=12,months:u}),w=0;w<u;w+=1)d=(d+R-f*(1+h))*(1+s);d=d.toFixed(2);var y=Math.pow(1+b,u/12).toFixed(2),F=(d/y).toFixed(2);return{housePrice:m,cash:d,inflation:y,power:F,msg:(u/12).toFixed()+'年后:<br>买房者获得当年总价"'+m+'万"的一套房子;租房者获得"'+d+'万"现金(购买力相当于当年的"'+F+'万");<br>当年买的房子需要涨至"'+(d/m).toFixed(2)+'倍"持平租房者现金流;<br>由于通货膨胀,物价已经是原来的"'+y+'倍"。'}}}]);
//# sourceMappingURL=buy-vs-rent.js.map

@@ -15,4 +15,21 @@ {

"license": "MIT",
"main": "index.js",
"version": "1.0.4"
"main": "source/index.js",
"scripts": {
"build": "cross-env NODE_ENV=production webpack --config build/webpack.prod.js",
"dev": "cross-env NODE_ENV=development webpack-dev-server --config build/webpack.dev.js"
},
"dependencies": {},
"devDependencies": {
"babel-core": "6",
"babel-loader": "7",
"babel-preset-env": "1",
"clean-webpack-plugin": "0",
"cross-env": "5",
"html-webpack-plugin": "3",
"webpack": "4",
"webpack-cli": "2",
"webpack-dev-server": "3",
"webpack-merge": "4"
},
"version": "1.0.5"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc