@@ -9,7 +9,6 @@ chai.use(require('dirty-chai'))
99const expect = chai . expect
1010const IPLD = require ( 'ipld' )
1111const inMemory = require ( 'ipld-in-memory' )
12- const leftPad = require ( 'left-pad' )
1312const all = require ( 'async-iterator-all' )
1413const last = require ( 'async-iterator-last' )
1514
@@ -133,7 +132,7 @@ describe('builder: directory sharding', () => {
133132 [ Symbol . asyncIterator ] : async function * ( ) {
134133 for ( let i = 0 ; i < maxDirs ; i ++ ) {
135134 yield {
136- path : 'big/' + leftPad ( i . toString ( ) , 4 , '0' ) ,
135+ path : 'big/' + i . toString ( ) . padStart ( 4 , '0' ) ,
137136 content : Buffer . from ( i . toString ( ) )
138137 }
139138 }
@@ -152,7 +151,7 @@ describe('builder: directory sharding', () => {
152151 [ Symbol . asyncIterator ] : async function * ( ) {
153152 for ( let i = 0 ; i < maxDirs ; i ++ ) {
154153 yield {
155- path : 'big/' + leftPad ( i . toString ( ) , 4 , '0' ) ,
154+ path : 'big/' + i . toString ( ) . padStart ( 4 , '0' ) ,
156155 content : Buffer . from ( i . toString ( ) )
157156 }
158157 }
@@ -196,7 +195,7 @@ describe('builder: directory sharding', () => {
196195 }
197196
198197 yield {
199- path : dir . concat ( leftPad ( i . toString ( ) , 4 , '0' ) ) . join ( '/' ) ,
198+ path : dir . concat ( i . toString ( ) . padStart ( 4 , '0' ) ) . join ( '/' ) ,
200199 content : Buffer . from ( i . toString ( ) )
201200 }
202201
@@ -267,7 +266,7 @@ describe('builder: directory sharding', () => {
267266 const pathElements = path . split ( '/' )
268267 expect ( pathElements . length ) . to . equal ( depth + 1 )
269268 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' ) )
271270 expect ( entries [ path ] . content ) . to . equal ( index . toString ( ) )
272271 }
273272 index ++
0 commit comments