mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-07-19 11:22:09 +08:00
feat: temperature config (#256)
This commit is contained in:
@@ -13,6 +13,7 @@ export * from './is-mobile'
|
||||
export * from './is-safari'
|
||||
export * from './limited-fetch'
|
||||
export * from './open-url'
|
||||
export * from './parse-float-with-clamp'
|
||||
export * from './parse-int-with-clamp'
|
||||
export * from './set-element-position-in-viewport'
|
||||
export * from './stream-async-iterable'
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
export function parseFloatWithClamp(value, defaultValue, min, max) {
|
||||
value = parseFloat(value)
|
||||
|
||||
if (isNaN(value)) value = defaultValue
|
||||
else if (value > max) value = max
|
||||
else if (value < min) value = min
|
||||
|
||||
return value
|
||||
}
|
||||
Reference in New Issue
Block a user