Refactor imports: use file extension, improve tree shaking, update tests

This commit is contained in:
Alex Gleason
2023-05-12 11:00:14 -05:00
committed by fiatjaf_
parent 9f896479d0
commit 08885ab8da
42 changed files with 244 additions and 212 deletions

View File

@@ -1,4 +1,4 @@
import {nip10} from '.'
import {parse} from './nip10.ts'
describe('parse NIP10-referenced events', () => {
test('legacy + a lot of events', () => {
@@ -47,7 +47,7 @@ describe('parse NIP10-referenced events', () => {
]
}
expect(nip10.parse(event)).toEqual({
expect(parse(event)).toEqual({
mentions: [
{
id: 'bbd72f0ae14374aa8fb166b483cfcf99b57d7f4cf1600ccbf17c350040834631',
@@ -128,7 +128,7 @@ describe('parse NIP10-referenced events', () => {
]
}
expect(nip10.parse(event)).toEqual({
expect(parse(event)).toEqual({
mentions: [
{
id: 'bbd72f0ae14374aa8fb166b483cfcf99b57d7f4cf1600ccbf17c350040834631',
@@ -189,7 +189,7 @@ describe('parse NIP10-referenced events', () => {
]
}
expect(nip10.parse(event)).toEqual({
expect(parse(event)).toEqual({
mentions: [],
profiles: [
{
@@ -233,7 +233,7 @@ describe('parse NIP10-referenced events', () => {
]
}
expect(nip10.parse(event)).toEqual({
expect(parse(event)).toEqual({
mentions: [],
profiles: [
{
@@ -302,7 +302,7 @@ describe('parse NIP10-referenced events', () => {
]
}
expect(nip10.parse(event)).toEqual({
expect(parse(event)).toEqual({
mentions: [],
profiles: [
{