Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:处理小数位数为0时导致栈溢出的问题 #437

Open
wants to merge 1 commit into
base: refactoring
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/mock/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ module.exports = {
var dmin = decimal && decimal[1] && parseInt(decimal[1], 10) // || 0,
var dmax = decimal && decimal[2] && parseInt(decimal[2], 10) // || 0,
// int || dmin-dmax || 0
var dcount = decimal ? !decimal[2] && parseInt(decimal[1], 10) || Random.integer(dmin, dmax) : undefined
// var dcount = decimal ? !decimal[2] && parseInt(decimal[1], 10) || Random.integer(dmin, dmax) : undefined
var dcount = decimal ? !decimal[2] && decimal[1] ? parseInt(decimal[1], 10) : Random.integer(dmin, dmax) : undefined

var result = {
// 1 name, 2 inc, 3 range, 4 decimal
Expand Down