Please enable JavaScript to use RhodeCode Enterprise
Commit Description:
utf8mb4
Commit Description:
utf8mb4
"use strict" ;
var toPosInt = require ( "../../number/to-pos-integer" )
, callable = require ( "../../object/valid-callable" )
, defineLength = require ( "../_define-length" )
, slice = Array . prototype . slice
, apply = Function . prototype . apply
, curry ;
curry = function self ( fn , length , preArgs ) {
return defineLength (
function () {
var args = preArgs
? preArgs . concat ( slice . call ( arguments , 0 , length - preArgs . length ))
: slice . call ( arguments , 0 , length );
return args . length === length ? apply . call ( fn , this , args ) : self ( fn , length , args );
},
preArgs ? length - preArgs . length : length
);
};
module . exports = function ( /* Length*/ ) {
var length = arguments [ 0 ];
return curry ( callable ( this ), isNaN ( length ) ? toPosInt ( this . length ) : toPosInt ( length ));
};
Site-wide shortcuts
/
Use quick search box
g h
Goto home page
g g
Goto my private gists page
g G
Goto my public gists page
n r
New repository page
n g
New gist page
Repositories
g s
Goto summary page
g c
Goto changelog page
g f
Goto files page
g F
Goto files page with file search activated
g p
Goto pull requests page
g o
Goto repository settings
g O
Goto repository permissions settings