File tree Expand file tree Collapse file tree 7 files changed +8
-8
lines changed
tfjs-converter/src/operations Expand file tree Collapse file tree 7 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -279,7 +279,7 @@ export async function updateDependency(
279279
280280 let relaxedVersionPrefix = '' ;
281281 if ( version . startsWith ( '~' ) || version . startsWith ( '^' ) ) {
282- relaxedVersionPrefix = version . substr ( 0 , 1 ) ;
282+ relaxedVersionPrefix = version . slice ( 0 , 1 ) ;
283283 }
284284 const depVersionLatest = relaxedVersionPrefix + depsLatestVersion [ j ] ;
285285
@@ -337,7 +337,7 @@ export function updateTFJSDependencyVersions(
337337
338338 let relaxedVersionPrefix = '' ;
339339 if ( version . startsWith ( '~' ) || version . startsWith ( '^' ) ) {
340- relaxedVersionPrefix = version . substr ( 0 , 1 ) ;
340+ relaxedVersionPrefix = version . slice ( 0 , 1 ) ;
341341 }
342342 const versionLatest = relaxedVersionPrefix + newVersion ;
343343
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ const fs = require('fs');
2222
2323let dirName = process . argv [ 2 ] ;
2424if ( dirName . endsWith ( '/' ) ) {
25- dirName = dirName . substr ( 0 , dirName . length - 1 ) ;
25+ dirName = dirName . slice ( 0 , - 1 ) ;
2626}
2727const packageJsonFile = dirName + '/package.json' ;
2828if ( ! fs . existsSync ( packageJsonFile ) ) {
Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ export class OperationMapper {
191191 category : mapper . category ,
192192 inputNames :
193193 ( node . input ||
194- [ ] ) . map ( input => input . startsWith ( '^' ) ? input . substr ( 1 ) : input ) ,
194+ [ ] ) . map ( input => input . startsWith ( '^' ) ? input . slice ( 1 ) : input ) ,
195195 inputs : [ ] ,
196196 children : [ ] ,
197197 inputParams : { } ,
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export class FileDataSource extends DataSource {
4646 if ( isLocalPath ( this . input ) && env ( ) . get ( 'IS_NODE' ) ) {
4747 // tslint:disable-next-line:no-require-imports
4848 const fs = require ( 'fs' ) ;
49- this . input = fs . readFileSync ( ( this . input as string ) . substr ( 7 ) ) ;
49+ this . input = fs . readFileSync ( ( this . input as string ) . slice ( 7 ) ) ;
5050 }
5151 // TODO(kangyizhang): Add LocalFileChunkIterator to split local streaming
5252 // with file in browser.
Original file line number Diff line number Diff line change 2020// input.
2121// tslint:disable-next-line:no-any
2222export function isLocalPath ( source : any ) : boolean {
23- return ( typeof source === 'string' ) && source . substr ( 0 , 7 ) === 'file://' ;
23+ return ( typeof source === 'string' ) && source . slice ( 0 , 7 ) === 'file://' ;
2424}
Original file line number Diff line number Diff line change @@ -1232,7 +1232,7 @@ export abstract class Layer extends serialization.Serializable {
12321232 // TODO(cais): Restore the following and use `providedWeights`, instead
12331233 // of `weights` in the error message, once the deeplearn.js bug is
12341234 // fixed: https://github.com/PAIR-code/deeplearnjs/issues/498 const
1235- // providedWeights = JSON.stringify(weights).substr (0, 50);
1235+ // providedWeights = JSON.stringify(weights).slice (0, 50);
12361236 throw new ValueError (
12371237 `You called setWeights(weights) on layer "${ this . name } " ` +
12381238 `with a weight list of length ${ weights . length } , ` +
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ if (os.platform() !== 'win32') {
4040
4141// Some windows machines contain a trailing " char:
4242if ( targetDir != undefined && targetDir . endsWith ( '"' ) ) {
43- targetDir = targetDir . substr ( 0 , targetDir . length - 1 ) ;
43+ targetDir = targetDir . slice ( 0 , - 1 ) ;
4444}
4545
4646// Setup dest binary paths:
You can’t perform that action at this time.
0 commit comments