@@ -9,7 +9,6 @@ chai.use(require('dirty-chai'))
9
9
const expect = chai . expect
10
10
const IPLD = require ( 'ipld' )
11
11
const inMemory = require ( 'ipld-in-memory' )
12
- const leftPad = require ( 'left-pad' )
13
12
const all = require ( 'async-iterator-all' )
14
13
const last = require ( 'async-iterator-last' )
15
14
@@ -133,7 +132,7 @@ describe('builder: directory sharding', () => {
133
132
[ Symbol . asyncIterator ] : async function * ( ) {
134
133
for ( let i = 0 ; i < maxDirs ; i ++ ) {
135
134
yield {
136
- path : 'big/' + leftPad ( i . toString ( ) , 4 , '0' ) ,
135
+ path : 'big/' + i . toString ( ) . padStart ( 4 , '0' ) ,
137
136
content : Buffer . from ( i . toString ( ) )
138
137
}
139
138
}
@@ -152,7 +151,7 @@ describe('builder: directory sharding', () => {
152
151
[ Symbol . asyncIterator ] : async function * ( ) {
153
152
for ( let i = 0 ; i < maxDirs ; i ++ ) {
154
153
yield {
155
- path : 'big/' + leftPad ( i . toString ( ) , 4 , '0' ) ,
154
+ path : 'big/' + i . toString ( ) . padStart ( 4 , '0' ) ,
156
155
content : Buffer . from ( i . toString ( ) )
157
156
}
158
157
}
@@ -196,7 +195,7 @@ describe('builder: directory sharding', () => {
196
195
}
197
196
198
197
yield {
199
- path : dir . concat ( leftPad ( i . toString ( ) , 4 , '0' ) ) . join ( '/' ) ,
198
+ path : dir . concat ( i . toString ( ) . padStart ( 4 , '0' ) ) . join ( '/' ) ,
200
199
content : Buffer . from ( i . toString ( ) )
201
200
}
202
201
@@ -267,7 +266,7 @@ describe('builder: directory sharding', () => {
267
266
const pathElements = path . split ( '/' )
268
267
expect ( pathElements . length ) . to . equal ( depth + 1 )
269
268
const lastElement = pathElements [ pathElements . length - 1 ]
270
- expect ( lastElement ) . to . equal ( leftPad ( index . toString ( ) , 4 , '0' ) )
269
+ expect ( lastElement ) . to . equal ( index . toString ( ) . padStart ( 4 , '0' ) )
271
270
expect ( entries [ path ] . content ) . to . equal ( index . toString ( ) )
272
271
}
273
272
index ++
0 commit comments