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(
279
279
280
280
let relaxedVersionPrefix = '' ;
281
281
if ( version . startsWith ( '~' ) || version . startsWith ( '^' ) ) {
282
- relaxedVersionPrefix = version . substr ( 0 , 1 ) ;
282
+ relaxedVersionPrefix = version . slice ( 0 , 1 ) ;
283
283
}
284
284
const depVersionLatest = relaxedVersionPrefix + depsLatestVersion [ j ] ;
285
285
@@ -337,7 +337,7 @@ export function updateTFJSDependencyVersions(
337
337
338
338
let relaxedVersionPrefix = '' ;
339
339
if ( version . startsWith ( '~' ) || version . startsWith ( '^' ) ) {
340
- relaxedVersionPrefix = version . substr ( 0 , 1 ) ;
340
+ relaxedVersionPrefix = version . slice ( 0 , 1 ) ;
341
341
}
342
342
const versionLatest = relaxedVersionPrefix + newVersion ;
343
343
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ const fs = require('fs');
22
22
23
23
let dirName = process . argv [ 2 ] ;
24
24
if ( dirName . endsWith ( '/' ) ) {
25
- dirName = dirName . substr ( 0 , dirName . length - 1 ) ;
25
+ dirName = dirName . slice ( 0 , - 1 ) ;
26
26
}
27
27
const packageJsonFile = dirName + '/package.json' ;
28
28
if ( ! fs . existsSync ( packageJsonFile ) ) {
Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ export class OperationMapper {
191
191
category : mapper . category ,
192
192
inputNames :
193
193
( node . input ||
194
- [ ] ) . map ( input => input . startsWith ( '^' ) ? input . substr ( 1 ) : input ) ,
194
+ [ ] ) . map ( input => input . startsWith ( '^' ) ? input . slice ( 1 ) : input ) ,
195
195
inputs : [ ] ,
196
196
children : [ ] ,
197
197
inputParams : { } ,
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export class FileDataSource extends DataSource {
46
46
if ( isLocalPath ( this . input ) && env ( ) . get ( 'IS_NODE' ) ) {
47
47
// tslint:disable-next-line:no-require-imports
48
48
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 ) ) ;
50
50
}
51
51
// TODO(kangyizhang): Add LocalFileChunkIterator to split local streaming
52
52
// with file in browser.
Original file line number Diff line number Diff line change 20
20
// input.
21
21
// tslint:disable-next-line:no-any
22
22
export 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://' ;
24
24
}
Original file line number Diff line number Diff line change @@ -1232,7 +1232,7 @@ export abstract class Layer extends serialization.Serializable {
1232
1232
// TODO(cais): Restore the following and use `providedWeights`, instead
1233
1233
// of `weights` in the error message, once the deeplearn.js bug is
1234
1234
// 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);
1236
1236
throw new ValueError (
1237
1237
`You called setWeights(weights) on layer "${ this . name } " ` +
1238
1238
`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') {
40
40
41
41
// Some windows machines contain a trailing " char:
42
42
if ( targetDir != undefined && targetDir . endsWith ( '"' ) ) {
43
- targetDir = targetDir . substr ( 0 , targetDir . length - 1 ) ;
43
+ targetDir = targetDir . slice ( 0 , - 1 ) ;
44
44
}
45
45
46
46
// Setup dest binary paths:
You can’t perform that action at this time.
0 commit comments