Please enable JavaScript to use RhodeCode Enterprise
Commit Description:
utf8mb4
Commit Description:
utf8mb4
// Stack grow safe implementation
"use strict" ;
var ensureValue = require ( "../../object/valid-value" )
, isArray = Array . isArray
, objHasOwnProperty = Object . prototype . hasOwnProperty ;
module . exports = function () {
var input = ensureValue ( this ), index = 0 , remaining , remainingIndexes , length , i , result = [];
// Jslint: ignore
main : while ( input ) {
length = input . length ;
for ( i = index ; i < length ; ++ i ) {
if ( ! objHasOwnProperty . call ( input , i )) continue ;
if ( isArray ( input [ i ])) {
if ( i < length - 1 ) {
// eslint-disable-next-line max-depth
if ( ! remaining ) {
remaining = [];
remainingIndexes = [];
}
remaining . push ( input );
remainingIndexes . push ( i + 1 );
}
input = input [ i ];
index = 0 ;
continue main ;
}
result . push ( input [ i ]);
}
if ( remaining ) {
input = remaining . pop ();
index = remainingIndexes . pop ();
} else {
input = null ;
}
}
return result ;
};
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