Closed AnsonT closed 7 years ago
Thanks for the PR! Can you give me an example URL that was failing the parse? I want to have a test that reproduces the error.
import DatArchive from 'node-dat-archive'
import Injest from 'injestdb'
import tempy from 'tempy'
async function test() {
const a = await DatArchive.create({localPath: tempy.directory()})
const dir = tempy.directory()
const db = new Injest(dir, {DatArchive})
db.schema({
version: 1,
posts: {
primaryKey: 'id',
index: ['id'],
validator: record => (record)
}
})
try {
await db.open()
await db.addArchive(a)
await db.posts.add(a, { id: '1', text: '123' })
await db.posts.add(a, { id: '2', text: 'abc' })
const post = await db.posts.get(a, '1')
console.log(post)
}
catch (e) {
console.log(e)
}
}
test()
That runs fine to me, and of course I just realized: what version of node are you on? I think the URL API I'm using is a new addition.
Yeah the new API is v7+. I'll go ahead and merge, only ~20kb more.
Published 2.4.6
Sorry, you are right, it’s the node version. I upgraded to 8.6.0 and URL function accepts dat://.
Thanks,
Anson
From: Paul Frazee notifications@github.com Reply-To: beakerbrowser/ingestdb reply@reply.github.com Date: Thursday, September 28, 2017 at 8:19 AM To: beakerbrowser/ingestdb ingestdb@noreply.github.com Cc: Anson Tsao tsaoa@acm.org, Author author@noreply.github.com Subject: Re: [beakerbrowser/ingestdb] Replaced node's 'url' module with 'url-parse' to support 'dat://' in node.js (#3)
That runs fine to me, and of course I just realized: what version of node are you on? I think the URL API I'm using is a new addition.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Fixes: https://github.com/beakerbrowser/ingestdb/issues/2