@@ -40,8 +40,9 @@ export default class Str {
4040 * // ["good", "bad", "crazy"]
4141 * ```
4242 */
43- toLowerCase ( options : { inplace : boolean } = { inplace : false } ) : Series | void {
44- const { inplace = false } = options ;
43+ toLowerCase ( options ?: { inplace ?: boolean } ) : Series
44+ toLowerCase ( options ?: { inplace ?: boolean } ) : Series | void {
45+ const { inplace } = { inplace : false , ...options }
4546 const newArr : Array < string | number > = [ ] ;
4647 this . values . map ( ( val ) => {
4748 if ( isNaN ( val as number ) && typeof val != "string" ) {
@@ -76,8 +77,9 @@ export default class Str {
7677 * // ["GOOD", "BAD", "CRAZY"]
7778 * ```
7879 */
79- toUpperCase ( options : { inplace : boolean } = { inplace : false } ) : Series | void {
80- const { inplace = false } = options ;
80+ toUpperCase ( options ?: { inplace ?: boolean } ) : Series
81+ toUpperCase ( options ?: { inplace ?: boolean } ) : Series | void {
82+ const { inplace } = { inplace : false , ...options }
8183 const newArr : Array < string | number > = [ ] ;
8284 this . values . map ( ( val ) => {
8385 if ( isNaN ( val as number ) && typeof val != "string" ) {
@@ -111,8 +113,9 @@ export default class Str {
111113 * // ["Good", "Bad", "Crazy"]
112114 * ```
113115 */
114- capitalize ( options : { inplace : boolean } = { inplace : false } ) : Series | void {
115- const { inplace = false } = options ;
116+ capitalize ( options ?: { inplace ?: boolean } ) : Series
117+ capitalize ( options ?: { inplace ?: boolean } ) : Series | void {
118+ const { inplace } = { inplace : false , ...options }
116119 const newArr : Array < string | number > = [ ] ;
117120 this . values . map ( ( val ) => {
118121 if ( isNaN ( val as number ) && typeof val != "string" ) {
@@ -151,8 +154,9 @@ export default class Str {
151154 * // ["o", "a", "r"]
152155 * ```
153156 */
154- charAt ( index = 0 , options : { inplace : boolean } = { inplace : false } ) : Series | void {
155- const { inplace = false } = options ;
157+ charAt ( index : number , options ?: { inplace ?: boolean } ) : Series
158+ charAt ( index = 0 , options ?: { inplace ?: boolean } ) : Series | void {
159+ const { inplace } = { inplace : false , ...options }
156160 const newArr : Array < string | number > = [ ] ;
157161 this . values . map ( ( val ) => {
158162 if ( isNaN ( val as number ) && typeof val != "string" ) {
@@ -186,8 +190,9 @@ export default class Str {
186190 * // ["Good_new", "bad_new", "crazy_new"
187191 * ```
188192 */
189- concat ( other : Array < string > | string , position = 1 , options : { inplace : boolean } = { inplace : false } ) : Series | void {
190- const { inplace = false } = options ;
193+ concat ( other : Array < string > | string , position : number , options ?: { inplace ?: boolean } ) : Series
194+ concat ( other : Array < string > | string , position = 1 , options ?: { inplace ?: boolean } ) : Series | void {
195+ const { inplace } = { inplace : false , ...options }
191196 const newArr : Array < string | number > = [ ] ;
192197
193198 if ( Array . isArray ( other ) ) {
@@ -246,8 +251,9 @@ export default class Str {
246251 * // [true, false, false]
247252 * ```
248253 */
249- startsWith ( str = "" , options : { inplace : boolean } = { inplace : false } ) : Series | void {
250- const { inplace = false } = options ;
254+ startsWith ( str : string , options ?: { inplace ?: boolean } ) : Series
255+ startsWith ( str = "" , options ?: { inplace ?: boolean } ) : Series | void {
256+ const { inplace } = { inplace : false , ...options }
251257 const newArr : Array < boolean | number > = [ ] ;
252258 this . values . forEach ( ( val ) => {
253259 if ( isNaN ( val as number ) && typeof val != "string" ) {
@@ -280,8 +286,9 @@ export default class Str {
280286 * // [true, true, false]
281287 * ```
282288 */
283- endsWith ( str = "" , options : { inplace : boolean } = { inplace : false } ) : Series | void {
284- const { inplace = false } = options ;
289+ endsWith ( str : string , options ?: { inplace ?: boolean } ) : Series
290+ endsWith ( str = "" , options ?: { inplace ?: boolean } ) : Series | void {
291+ const { inplace } = { inplace : false , ...options }
285292 const newArr : Array < boolean | number > = [ ] ;
286293 this . values . map ( ( val ) => {
287294 if ( isNaN ( val as number ) && typeof val != "string" ) {
@@ -314,8 +321,9 @@ export default class Str {
314321 * // [true, true, false]
315322 * ```
316323 */
317- includes ( str = "" , options : { inplace : boolean } = { inplace : false } ) : Series | void {
318- const { inplace = false } = options ;
324+ includes ( str : string , options ?: { inplace ?: boolean } ) : Series
325+ includes ( str = "" , options ?: { inplace ?: boolean } ) : Series | void {
326+ const { inplace } = { inplace : false , ...options }
319327 const newArr : Array < boolean | number > = [ ] ;
320328 this . values . map ( ( val ) => {
321329 if ( isNaN ( val as number ) && typeof val != "string" ) {
@@ -348,8 +356,9 @@ export default class Str {
348356 * // [3, 2, -1]
349357 * ```
350358 */
351- indexOf ( str = "" , options : { inplace : boolean } = { inplace : false } ) : Series | void {
352- const { inplace = false } = options ;
359+ indexOf ( str : string , options ?: { inplace ?: boolean } ) : Series
360+ indexOf ( str = "" , options ?: { inplace ?: boolean } ) : Series | void {
361+ const { inplace } = { inplace : false , ...options }
353362 const newArr : Array < number > = [ ] ;
354363 this . values . map ( ( val ) => {
355364 if ( isNaN ( val as number ) && typeof val != "string" ) {
@@ -382,8 +391,9 @@ export default class Str {
382391 * // [3, 2, -1]
383392 * ```
384393 */
385- lastIndexOf ( str = "" , options : { inplace : boolean } = { inplace : false } ) : Series | void {
386- const { inplace = false } = options ;
394+ lastIndexOf ( str : string , options ?: { inplace ?: boolean } ) : Series
395+ lastIndexOf ( str = "" , options ?: { inplace ?: boolean } ) : Series | void {
396+ const { inplace } = { inplace : false , ...options }
387397 const newArr : Array < string | number > = [ ] ;
388398 this . values . map ( ( val ) => {
389399 if ( isNaN ( val as number ) && typeof val != "string" ) {
@@ -418,8 +428,9 @@ export default class Str {
418428 * // ["Goo7", "o77", "crazy"]
419429 * ```
420430 */
421- replace ( searchValue = "" , replaceValue = "" , options : { inplace : boolean } = { inplace : false } ) : Series | void {
422- const { inplace = false } = options ;
431+ replace ( searchValue : string , replaceValue : string , options ?: { inplace ?: boolean } ) : Series
432+ replace ( searchValue = "" , replaceValue = "" , options ?: { inplace ?: boolean } ) : Series | void {
433+ const { inplace } = { inplace : false , ...options }
423434 const newArr : Array < string | number > = [ ] ;
424435 this . values . map ( ( val ) => {
425436 if ( isNaN ( val as number ) && typeof val != "string" ) {
@@ -452,8 +463,9 @@ export default class Str {
452463 * // ["GoodGood", "oddodd", "crazycrazy"]
453464 * ```
454465 */
455- repeat ( num = 1 , options : { inplace : boolean } = { inplace : false } ) : Series | void {
456- const { inplace = false } = options ;
466+ repeat ( num : number , options ?: { inplace ?: boolean } ) : Series
467+ repeat ( num = 1 , options ?: { inplace ?: boolean } ) : Series | void {
468+ const { inplace } = { inplace : false , ...options }
457469 const newArr : Array < string | number > = [ ] ;
458470 this . values . map ( ( val ) => {
459471 if ( isNaN ( val as number ) && typeof val != "string" ) {
@@ -486,8 +498,9 @@ export default class Str {
486498 * console.log(newSf.values)
487499 * ```
488500 */
489- search ( str = "" , options : { inplace : boolean } = { inplace : false } ) : Series | void {
490- const { inplace = false } = options ;
501+ search ( str : string , options ?: { inplace ?: boolean } ) : Series
502+ search ( str = "" , options ?: { inplace ?: boolean } ) : Series | void {
503+ const { inplace } = { inplace : false , ...options }
491504 const newArr : Array < string | number > = [ ] ;
492505 this . values . map ( ( val ) => {
493506 if ( isNaN ( val as number ) && typeof val != "string" ) {
@@ -521,8 +534,9 @@ export default class Str {
521534 * // ["G", "o", "c"]
522535 * ```
523536 */
524- slice ( startIndex = 0 , endIndex = 1 , options : { inplace : boolean } = { inplace : false } ) : Series | void {
525- const { inplace = false } = options ;
537+ slice ( startIndex : number , endIndex : number , options ?: { inplace ?: boolean } ) : Series
538+ slice ( startIndex = 0 , endIndex = 1 , options ?: { inplace ?: boolean } ) : Series | void {
539+ const { inplace } = { inplace : false , ...options }
526540 const newArr : Array < string | number > = [ ] ;
527541 this . values . map ( ( val ) => {
528542 if ( isNaN ( val as number ) && typeof val != "string" ) {
@@ -554,8 +568,9 @@ export default class Str {
554568 * console.log(newSf.values)
555569 * ```
556570 */
557- split ( splitVal = " " , options : { inplace : boolean } = { inplace : false } ) : Series | void {
558- const { inplace = false } = options ;
571+ split ( splitVal : string , options ?: { inplace ?: boolean } ) : Series
572+ split ( splitVal = " " , options ?: { inplace ?: boolean } ) : Series | void {
573+ const { inplace } = { inplace : false , ...options }
559574 const newArr : Array < string | number > = [ ] ;
560575 this . values . map ( ( val ) => {
561576 if ( isNaN ( val as number ) && typeof val != "string" ) {
@@ -587,8 +602,9 @@ export default class Str {
587602 * const newSf = sf.str.substr(d)
588603 * ```
589604 */
590- substr ( startIndex = 0 , num = 1 , options : { inplace : boolean } = { inplace : false } ) : Series | void {
591- const { inplace = false } = options ;
605+ substr ( startIndex : number , num : number , options ?: { inplace ?: boolean } ) : Series
606+ substr ( startIndex = 0 , num = 1 , options ?: { inplace ?: boolean } ) : Series | void {
607+ const { inplace } = { inplace : false , ...options }
592608 const newArr : Array < string | number > = [ ] ;
593609 this . values . map ( ( val ) => {
594610 if ( isNaN ( val as number ) && typeof val != "string" ) {
@@ -620,8 +636,9 @@ export default class Str {
620636 * const newSf = sf.str.substring(d)
621637 * ```
622638 */
623- substring ( startIndex = 0 , endIndex = 1 , options : { inplace : boolean } = { inplace : false } ) : Series | void {
624- const { inplace = false } = options ;
639+ substring ( startIndex : number , endIndex : number , options ?: { inplace ?: boolean } ) : Series
640+ substring ( startIndex = 0 , endIndex = 1 , options ?: { inplace ?: boolean } ) : Series | void {
641+ const { inplace } = { inplace : false , ...options }
625642 const newArr : Array < string | number > = [ ] ;
626643 this . values . map ( ( val ) => {
627644 if ( isNaN ( val as number ) && typeof val != "string" ) {
@@ -652,8 +669,9 @@ export default class Str {
652669 * ["Good", "odd", "grade"]
653670 * ```
654671 */
655- trim ( options : { inplace : boolean } = { inplace : false } ) : Series | void {
656- const { inplace = false } = options ;
672+ trim ( options ?: { inplace ?: boolean } ) : Series
673+ trim ( options ?: { inplace ?: boolean } ) : Series | void {
674+ const { inplace } = { inplace : false , ...options }
657675 const newArr : Array < string | number > = [ ] ;
658676 this . values . map ( ( val ) => {
659677 if ( isNaN ( val as number ) && typeof val != "string" ) {
@@ -686,8 +704,9 @@ export default class Str {
686704 * // ["Good_new", "odd_new", "grade_new"]
687705 * ```
688706 */
689- join ( valToJoin = "" , joinChar = " " , options : { inplace : boolean } = { inplace : false } ) : Series | void {
690- const { inplace = false } = options ;
707+ join ( valToJoin : string , joinChar : string , options ?: { inplace ?: boolean } ) : Series
708+ join ( valToJoin = "" , joinChar = " " , options ?: { inplace ?: boolean } ) : Series | void {
709+ const { inplace } = { inplace : false , ...options }
691710 const newArr : Array < string | number > = [ ] ;
692711 this . values . map ( ( val ) => {
693712 if ( isNaN ( val as number ) && typeof val != "string" ) {
@@ -721,8 +740,9 @@ export default class Str {
721740 * // [4,3,5]
722741 * ```
723742 */
724- len ( options : { inplace : boolean } = { inplace : false } ) : Series | void {
725- const { inplace = false } = options ;
743+ len ( options ?: { inplace ?: boolean } ) : Series
744+ len ( options ?: { inplace ?: boolean } ) : Series | void {
745+ const { inplace } = { inplace : false , ...options }
726746 const newArr : Array < string | number > = [ ] ;
727747 this . values . map ( ( val ) => {
728748 if ( isNaN ( val as number ) && typeof val != "string" ) {
0 commit comments