File tree Expand file tree Collapse file tree 1 file changed +4
-29
lines changed Expand file tree Collapse file tree 1 file changed +4
-29
lines changed Original file line number Diff line number Diff line change @@ -81,36 +81,11 @@ function limitToFilter(){
81
81
limit = int ( limit ) ;
82
82
}
83
83
84
- if ( isString ( input ) ) {
85
- //NaN check on limit
86
- if ( limit ) {
87
- return limit >= 0 ? input . slice ( 0 , limit ) : input . slice ( limit , input . length ) ;
88
- } else {
89
- return "" ;
90
- }
91
- }
92
-
93
- var out = [ ] ,
94
- i , n ;
95
-
96
- // if abs(limit) exceeds maximum length, trim it
97
- if ( limit > input . length )
98
- limit = input . length ;
99
- else if ( limit < - input . length )
100
- limit = - input . length ;
101
-
102
- if ( limit > 0 ) {
103
- i = 0 ;
104
- n = limit ;
84
+ //NaN check on limit
85
+ if ( limit ) {
86
+ return limit > 0 ? input . slice ( 0 , limit ) : input . slice ( limit ) ;
105
87
} else {
106
- i = input . length + limit ;
107
- n = input . length ;
88
+ return isString ( input ) ? "" : [ ] ;
108
89
}
109
-
110
- for ( ; i < n ; i ++ ) {
111
- out . push ( input [ i ] ) ;
112
- }
113
-
114
- return out ;
115
90
} ;
116
91
}
You can’t perform that action at this time.
0 commit comments