mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-12-02 06:48:06 +00:00
Revised test data
Testing against the output of cook.rb isn't satisfactory because of the bugs in it; instead we're now going to test against the tiddlywiki.com build products
This commit is contained in:
15
test/tiddlywiki.2.6.5/source/tiddlywiki/js/Numbers.js
Executable file
15
test/tiddlywiki.2.6.5/source/tiddlywiki/js/Numbers.js
Executable file
@@ -0,0 +1,15 @@
|
||||
//--
|
||||
//-- Augmented methods for the JavaScript Number() object
|
||||
//--
|
||||
|
||||
// Clamp a number to a range
|
||||
Number.prototype.clamp = function(min,max)
|
||||
{
|
||||
var c = this;
|
||||
if(c < min)
|
||||
c = min;
|
||||
if(c > max)
|
||||
c = max;
|
||||
return Number(c);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user