File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,34 +97,11 @@ function limitToFilter() {
9797 limit = int ( limit ) ;
9898 }
9999
100- if ( isString ( input ) ) {
101- //NaN check on limit
102- if ( limit ) {
103- return limit >= 0 ? input . slice ( 0 , limit ) : input . slice ( limit , input . length ) ;
104- } else {
105- return "" ;
106- }
107- }
108-
109- var i , n ;
110-
111- // if abs(limit) exceeds maximum length, trim it
112- if ( limit > input . length )
113- limit = input . length ;
114- else if ( limit < - input . length )
115- limit = - input . length ;
116-
117- if ( limit > 0 ) {
118- i = 0 ;
119- n = limit ;
100+ //NaN check on limit
101+ if ( limit ) {
102+ return limit > 0 ? input . slice ( 0 , limit ) : input . slice ( limit ) ;
120103 } else {
121- // zero and NaN check on limit - return empty array
122- if ( ! limit ) return [ ] ;
123-
124- i = input . length + limit ;
125- n = input . length ;
104+ return isString ( input ) ? "" : [ ] ;
126105 }
127-
128- return input . slice ( i , n ) ;
129106 } ;
130107}
You can’t perform that action at this time.
0 commit comments