@@ -20,7 +20,7 @@ import { pattern, val } from "./hof";
2020 */
2121export function maxLength ( max , str ) {
2222 if ( str . length <= max ) return str ;
23- return str . substr ( 0 , max - 3 ) + "..." ;
23+ return str . substring ( 0 , max - 3 ) + "..." ;
2424}
2525/**
2626 * Returns a string, with spaces added to the end, up to a desired str length
@@ -46,7 +46,7 @@ export function functionToString(fn) {
4646 const toStr = namedFunctionMatch ? namedFunctionMatch [ 1 ] : fnStr ;
4747 const fnName = fn [ "name" ] || "" ;
4848 if ( fnName && toStr . match ( / f u n c t i o n \( / ) ) {
49- return "function " + fnName + toStr . substr ( 9 ) ;
49+ return "function " + fnName + toStr . substring ( 9 ) ;
5050 }
5151 return toStr ;
5252}
@@ -97,7 +97,7 @@ export const beforeAfterSubstr = (char) => (str) => {
9797 if ( ! str ) return [ "" , "" ] ;
9898 const idx = str . indexOf ( char ) ;
9999 if ( idx === - 1 ) return [ str , "" ] ;
100- return [ str . substr ( 0 , idx ) , str . substr ( idx + 1 ) ] ;
100+ return [ str . substring ( 0 , idx ) , str . substring ( idx + 1 ) ] ;
101101} ;
102102export const hostRegex = new RegExp ( "^(?:[a-z]+:)?//[^/]+/" ) ;
103103export const stripLastPathElement = ( str ) => str . replace ( / \/ [ ^ / ] * $ / , "" ) ;
0 commit comments