@@ -84,7 +84,7 @@ class Key {
84
84
*
85
85
*/
86
86
static withNamespaces ( list /* : Array<string> */ ) /* : Key */ {
87
- return new Key ( list . join ( pathSepS ) )
87
+ return new _Key ( list . join ( pathSepS ) )
88
88
}
89
89
90
90
/**
@@ -98,7 +98,7 @@ class Key {
98
98
*
99
99
*/
100
100
static random ( ) /* : Key */ {
101
- return new Key ( uuid ( ) . replace ( / - / g, '' ) )
101
+ return new _Key ( uuid ( ) . replace ( / - / g, '' ) )
102
102
}
103
103
104
104
/**
@@ -237,7 +237,7 @@ class Key {
237
237
* // => Key('/Comedy/MontyPython/Actor:JohnCleese')
238
238
*/
239
239
instance ( s /* : string */ ) /* : Key */ {
240
- return new Key ( this . toString ( ) + ':' + s )
240
+ return new _Key ( this . toString ( ) + ':' + s )
241
241
}
242
242
243
243
/**
@@ -256,7 +256,7 @@ class Key {
256
256
p += pathSepS
257
257
}
258
258
p += this . type ( )
259
- return new Key ( p )
259
+ return new _Key ( p )
260
260
}
261
261
262
262
/**
@@ -272,10 +272,10 @@ class Key {
272
272
parent ( ) /* : Key */ {
273
273
const list = this . list ( )
274
274
if ( list . length === 1 ) {
275
- return new Key ( pathSepS )
275
+ return new _Key ( pathSepS )
276
276
}
277
277
278
- return new Key ( list . slice ( 0 , - 1 ) . join ( pathSepS ) )
278
+ return new _Key ( list . slice ( 0 , - 1 ) . join ( pathSepS ) )
279
279
}
280
280
281
281
/**
@@ -296,7 +296,7 @@ class Key {
296
296
return this
297
297
}
298
298
299
- return new Key ( this . toString ( ) + key . toString ( ) , false )
299
+ return new _Key ( this . toString ( ) + key . toString ( ) , false )
300
300
}
301
301
302
302
/**
@@ -373,4 +373,6 @@ function namespaceValue (ns /* : string */) /* : string */ {
373
373
return parts [ parts . length - 1 ]
374
374
}
375
375
376
- module . exports = withIs ( Key , { className : 'Key' , symbolName : '@ipfs/interface-datastore/key' } )
376
+ const _Key = withIs ( Key , { className : 'Key' , symbolName : '@ipfs/interface-datastore/key' } )
377
+
378
+ module . exports = _Key
0 commit comments