mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-30 05:55:48 +08:00
Second Update from Tue 24 Mar
This commit is contained in:
35
Libraries/vendor/react/core/clamp.js
vendored
Normal file
35
Libraries/vendor/react/core/clamp.js
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* @generated SignedSource<<ec51291ea6059cf23faa74f8644d17b1>>
|
||||
*
|
||||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
* !! This file is a check-in of a static_upstream project! !!
|
||||
* !! !!
|
||||
* !! You should not modify this file directly. Instead: !!
|
||||
* !! 1) Use `fjs use-upstream` to temporarily replace this with !!
|
||||
* !! the latest version from upstream. !!
|
||||
* !! 2) Make your changes, test them, etc. !!
|
||||
* !! 3) Use `fjs push-upstream` to copy your changes back to !!
|
||||
* !! static_upstream. !!
|
||||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
*
|
||||
* @providesModule clamp
|
||||
* @typechecks
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {number} value
|
||||
* @param {number} min
|
||||
* @param {number} max
|
||||
* @return {number}
|
||||
*/
|
||||
function clamp(min, value, max) {
|
||||
if (value < min) {
|
||||
return min;
|
||||
}
|
||||
if (value > max) {
|
||||
return max;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
module.exports = clamp;
|
||||
Reference in New Issue
Block a user