@@ -20,7 +20,7 @@ string.js - Copyright (C) 2012-2014, JP Richardson <
[email protected] >
20
20
! ( function ( ) {
21
21
"use strict" ;
22
22
23
- var VERSION = '3.1.0 ' ;
23
+ var VERSION = '3.1.1 ' ;
24
24
25
25
var ENTITIES = { } ;
26
26
@@ -81,11 +81,11 @@ string.js - Copyright (C) 2012-2014, JP Richardson <
[email protected] >
81
81
var s = this . s ;
82
82
var startPos = s . indexOf ( left ) ;
83
83
var endPos = s . indexOf ( right , startPos + left . length ) ;
84
- if ( endPos == - 1 && right != null )
84
+ if ( endPos == - 1 && right != null )
85
85
return new this . constructor ( '' )
86
86
else if ( endPos == - 1 && right == null )
87
87
return new this . constructor ( s . substring ( startPos + left . length ) )
88
- else
88
+ else
89
89
return new this . constructor ( s . slice ( startPos + left . length , endPos ) ) ;
90
90
} ,
91
91
@@ -161,7 +161,7 @@ string.js - Copyright (C) 2012-2014, JP Richardson <
[email protected] >
161
161
. replace ( / & ( [ ^ ; \W ] + ; ? ) / g, function ( m , e ) {
162
162
var ee = e . replace ( / ; $ / , '' ) ;
163
163
var target = ENTITIES [ e ] || ( e . match ( / ; $ / ) && ENTITIES [ ee ] ) ;
164
-
164
+
165
165
if ( typeof target === 'number' ) {
166
166
return String . fromCharCode ( target ) ;
167
167
}
@@ -246,7 +246,7 @@ string.js - Copyright (C) 2012-2014, JP Richardson <
[email protected] >
246
246
return this . right ( - N ) ;
247
247
}
248
248
} ,
249
-
249
+
250
250
lines : function ( ) { //convert windows newlines to unix newlines then convert to an Array of lines
251
251
return this . replaceAll ( '\r\n' , '\n' ) . s . split ( '\n' ) ;
252
252
} ,
@@ -490,9 +490,9 @@ string.js - Copyright (C) 2012-2014, JP Richardson <
[email protected] >
490
490
491
491
trim : function ( ) {
492
492
var s ;
493
- if ( typeof __nsp . trim === 'undefined' )
493
+ if ( typeof __nsp . trim === 'undefined' )
494
494
s = this . s . replace ( / ( ^ \s * | \s * $ ) / g, '' )
495
- else
495
+ else
496
496
s = this . s . trim ( )
497
497
return new this . constructor ( s ) ;
498
498
} ,
@@ -576,19 +576,19 @@ string.js - Copyright (C) 2012-2014, JP Richardson <
[email protected] >
576
576
var shouldQualify = hasVal ( qualifier )
577
577
if ( typeof dataArray [ i ] == 'number' )
578
578
shouldQualify &= encloseNumbers ;
579
-
579
+
580
580
if ( shouldQualify )
581
581
buildString . push ( qualifier ) ;
582
-
582
+
583
583
if ( dataArray [ i ] !== null && dataArray [ i ] !== undefined ) {
584
584
var d = new S ( dataArray [ i ] ) . replaceAll ( qualifier , rep ) . s ;
585
585
buildString . push ( d ) ;
586
- } else
586
+ } else
587
587
buildString . push ( '' )
588
588
589
589
if ( shouldQualify )
590
590
buildString . push ( qualifier ) ;
591
-
591
+
592
592
if ( delim )
593
593
buildString . push ( delim ) ;
594
594
}
@@ -717,7 +717,8 @@ string.js - Copyright (C) 2012-2014, JP Richardson <
[email protected] >
717
717
var name = names [ i ] ;
718
718
var func = __nsp [ name ] ;
719
719
try {
720
- var type = typeof func . apply ( 'teststring' , [ ] ) ;
720
+ // #127: pass extra parameter to keep shelljs happy
721
+ var type = typeof func . apply ( 'test' , [ 'string' ] ) ;
721
722
retObj [ name ] = type ;
722
723
} catch ( e ) { }
723
724
}
0 commit comments