Merge pull request #64 from saul-jb/refactor/packages

refactor: Remove unused packages.
This commit is contained in:
Haad 2023-04-07 07:38:28 +03:00 committed by GitHub
commit 9fd01ff530
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1721 additions and 4249 deletions

5955
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -22,10 +22,8 @@
"@libp2p/crypto": "^1.0.12",
"it-pipe": "^2.0.5",
"level": "^8.0.0",
"logplease": "^1.2.15",
"lru": "^3.1.0",
"multiformats": "^11.0.1",
"p-map": "^5.5.0",
"p-queue": "^7.3.4",
"timeout-abort-controller": "^3.0.0",
"uint8arrays": "^4.0.3"
@ -35,7 +33,6 @@
"assert": "^2.0.0",
"babel-loader": "^9.1.2",
"c8": "^7.13.0",
"cpy-cli": "^4.2.0",
"cross-env": "^7.0.3",
"fs-extra": "^11.1.0",
"ipfs-core": "^0.18.0",
@ -43,9 +40,7 @@
"mocha": "^10.2.0",
"mocha-headless-chrome": "^4.0.0",
"open-cli": "^7.1.0",
"p-map-series": "^3.0.0",
"path-browserify": "^1.0.1",
"remark-cli": "^11.0.0",
"rimraf": "^4.1.3",
"standard": "^17.0.0",
"webpack": "^5.75.0",

View File

@ -4,7 +4,6 @@ import Clock from './clock.js'
import Heads from './heads.js'
import ConflictResolution from './conflict-resolution.js'
import MemoryStorage from '../storage/memory.js'
import pMap from 'p-map'
const { LastWriteWins, NoZeroes } = ConflictResolution
@ -289,14 +288,15 @@ const Log = async (identity, { logId, logHeads, access, entryStorage, headsStora
// filter out traversed and fetched hashes
toFetch = [...toFetch, ...next, ...refs].filter(notIndexed)
// Function to fetch an entry and making sure it's not a duplicate (check the hash indices)
const fetchEntries = async (hash) => {
const fetchEntries = (hash) => {
if (!traversed[hash] && !fetched[hash]) {
fetched[hash] = true
return get(hash)
}
}
// Fetch the next/reference entries
const nexts = await pMap(toFetch, fetchEntries)
const nexts = await Promise.all(toFetch.map(fetchEntries))
// Add the next and refs fields from the fetched entries to the next round
toFetch = nexts
.filter(e => e != null)

View File

@ -1,5 +1,4 @@
import { deepStrictEqual, strictEqual } from 'assert'
import mapSeries from 'p-map-series'
import rmrf from 'rimraf'
import { copy } from 'fs-extra'
import * as IPFS from 'ipfs-core'
@ -103,8 +102,7 @@ describe('Events Database', function () {
const first = arr => arr[0]
beforeEach(async () => {
hashes = []
hashes = await mapSeries([0, 1, 2, 3, 4], (i) => db.add('hello' + i))
hashes = await Promise.all([0, 1, 2, 3, 4].map(i => db.add('hello' + i)))
})
describe('amount', () => {