mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
db/API.js: almost removed optional argument handling
The HTTP API doesn't ever omit arguments, it always passes `undefined` for a parameter that wasn't supplied in the request. The functions that were simplified are: - getRevisionChangeset() - getText() - getHTML() - saveRevision() The only function still supporting optional arguments is getPadSafe(), which is only called from this module.
This commit is contained in:
parent
26f3f1bcd0
commit
169a06793d
1 changed files with 0 additions and 27 deletions
|
@ -126,13 +126,6 @@ Example returns:
|
|||
*/
|
||||
exports.getRevisionChangeset = function(padID, rev, callback)
|
||||
{
|
||||
// check if rev is set
|
||||
if (typeof rev === "function")
|
||||
{
|
||||
callback = rev;
|
||||
rev = undefined;
|
||||
}
|
||||
|
||||
// check if rev is a number
|
||||
if (rev !== undefined && typeof rev !== "number")
|
||||
{
|
||||
|
@ -206,13 +199,6 @@ Example returns:
|
|||
*/
|
||||
exports.getText = function(padID, rev, callback)
|
||||
{
|
||||
//check if rev is set
|
||||
if(typeof rev == "function")
|
||||
{
|
||||
callback = rev;
|
||||
rev = undefined;
|
||||
}
|
||||
|
||||
//check if rev is a number
|
||||
if(rev !== undefined && typeof rev != "number")
|
||||
{
|
||||
|
@ -347,12 +333,6 @@ Example returns:
|
|||
*/
|
||||
exports.getHTML = function(padID, rev, callback)
|
||||
{
|
||||
if(typeof rev == "function")
|
||||
{
|
||||
callback = rev;
|
||||
rev = undefined;
|
||||
}
|
||||
|
||||
if (rev !== undefined && typeof rev != "number")
|
||||
{
|
||||
if (isNaN(parseInt(rev)))
|
||||
|
@ -623,13 +603,6 @@ Example returns:
|
|||
*/
|
||||
exports.saveRevision = function(padID, rev, callback)
|
||||
{
|
||||
//check if rev is set
|
||||
if(typeof rev == "function")
|
||||
{
|
||||
callback = rev;
|
||||
rev = undefined;
|
||||
}
|
||||
|
||||
//check if rev is a number
|
||||
if(rev !== undefined && typeof rev != "number")
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue