-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: only named exports are used, deep imports/requires are not possible
- Loading branch information
1 parent
0658ccc
commit 8d673ba
Showing
77 changed files
with
1,143 additions
and
1,108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 9 additions & 19 deletions
28
packages/ipfs-repo-migrations/migrations/migration-9/utils.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,21 @@ | ||
'use strict' | ||
|
||
const { Key } = require('interface-datastore') | ||
const { base32 } = require('multiformats/bases/base32') | ||
const { CID } = require('multiformats') | ||
import { Key } from 'interface-datastore/key' | ||
import { base32 } from 'multiformats/bases/base32' | ||
import { CID } from 'multiformats/cid' | ||
|
||
const PIN_DS_KEY = new Key('/local/pins') | ||
const DEFAULT_FANOUT = 256 | ||
const MAX_ITEMS = 8192 | ||
const EMPTY_KEY = CID.parse('QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n') | ||
export const PIN_DS_KEY = new Key('/local/pins') | ||
export const DEFAULT_FANOUT = 256 | ||
export const MAX_ITEMS = 8192 | ||
export const EMPTY_KEY = CID.parse('QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n') | ||
|
||
const PinTypes = { | ||
export const PinTypes = { | ||
direct: 'direct', | ||
recursive: 'recursive' | ||
} | ||
|
||
/** | ||
* @param {import('multiformats').CID} cid | ||
*/ | ||
function cidToKey (cid) { | ||
export function cidToKey (cid) { | ||
return new Key(`/${base32.encode(cid.multihash.bytes).toUpperCase().substring(1)}`) | ||
} | ||
|
||
module.exports = { | ||
PIN_DS_KEY, | ||
DEFAULT_FANOUT, | ||
MAX_ITEMS, | ||
EMPTY_KEY, | ||
PinTypes, | ||
cidToKey | ||
} |
Oops, something went wrong.