@jbrowse/plugin-legacy-jbrowse 2.4.2 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/JBrowse1Connection/configSchema.d.ts +32 -1
- package/dist/JBrowse1Connection/jb1ConfigParse.js +1 -1
- package/dist/JBrowse1Connection/jb1ConfigParse.js.map +1 -1
- package/dist/JBrowse1Connection/jb1ToJb2.js +2 -2
- package/dist/JBrowse1Connection/jb1ToJb2.js.map +1 -1
- package/dist/JBrowse1Connection/model.d.ts +39 -2
- package/dist/JBrowse1Connection/model.js +40 -18
- package/dist/JBrowse1Connection/model.js.map +1 -1
- package/dist/JBrowse1Connection/util.d.ts +1 -0
- package/dist/JBrowse1Connection/util.js +4 -6
- package/dist/JBrowse1Connection/util.js.map +1 -1
- package/dist/JBrowse1TextSearchAdapter/JBrowse1TextSearchAdapter.d.ts +2 -2
- package/dist/JBrowse1TextSearchAdapter/JBrowse1TextSearchAdapter.js.map +1 -1
- package/dist/JBrowse1TextSearchAdapter/configSchema.d.ts +29 -1
- package/dist/NCListAdapter/NCListFeature.js +1 -2
- package/dist/NCListAdapter/NCListFeature.js.map +1 -1
- package/dist/NCListAdapter/configSchema.d.ts +20 -1
- package/esm/JBrowse1Connection/configSchema.d.ts +32 -1
- package/esm/JBrowse1Connection/jb1ConfigParse.js +1 -1
- package/esm/JBrowse1Connection/jb1ConfigParse.js.map +1 -1
- package/esm/JBrowse1Connection/jb1ToJb2.js +2 -2
- package/esm/JBrowse1Connection/jb1ToJb2.js.map +1 -1
- package/esm/JBrowse1Connection/model.d.ts +39 -2
- package/esm/JBrowse1Connection/model.js +18 -19
- package/esm/JBrowse1Connection/model.js.map +1 -1
- package/esm/JBrowse1Connection/util.d.ts +1 -0
- package/esm/JBrowse1Connection/util.js +4 -6
- package/esm/JBrowse1Connection/util.js.map +1 -1
- package/esm/JBrowse1TextSearchAdapter/JBrowse1TextSearchAdapter.d.ts +2 -2
- package/esm/JBrowse1TextSearchAdapter/JBrowse1TextSearchAdapter.js.map +1 -1
- package/esm/JBrowse1TextSearchAdapter/configSchema.d.ts +29 -1
- package/esm/NCListAdapter/NCListFeature.js +1 -2
- package/esm/NCListAdapter/NCListFeature.js.map +1 -1
- package/esm/NCListAdapter/configSchema.d.ts +20 -1
- package/package.json +2 -2
- package/src/JBrowse1Connection/jb1ConfigParse.ts +1 -1
- package/src/JBrowse1Connection/jb1ToJb2.ts +2 -2
- package/src/JBrowse1Connection/model.tsx +42 -50
- package/src/JBrowse1Connection/util.ts +4 -6
- package/src/JBrowse1TextSearchAdapter/HttpMap.test.ts +36 -51
- package/src/JBrowse1TextSearchAdapter/JBrowse1TextSearchAdapter.test.ts +7 -9
- package/src/JBrowse1TextSearchAdapter/JBrowse1TextSearchAdapter.ts +2 -2
- package/src/NCListAdapter/NCListFeature.ts +1 -2
|
@@ -6,15 +6,15 @@ import last from '../../test_data/names/f.json'
|
|
|
6
6
|
import Adapter from './JBrowse1TextSearchAdapter'
|
|
7
7
|
import configSchema from './configSchema'
|
|
8
8
|
|
|
9
|
-
function mockFetch(url:
|
|
9
|
+
function mockFetch(url: RequestInfo | URL) {
|
|
10
10
|
let response = {}
|
|
11
|
-
if (url
|
|
11
|
+
if (`${url}`.includes('names/meta.json')) {
|
|
12
12
|
response = meta
|
|
13
13
|
}
|
|
14
|
-
if (url
|
|
14
|
+
if (`${url}`.includes('names/0.json')) {
|
|
15
15
|
response = first
|
|
16
16
|
}
|
|
17
|
-
if (url
|
|
17
|
+
if (`${url}`.includes('names/f.json')) {
|
|
18
18
|
response = last
|
|
19
19
|
}
|
|
20
20
|
return Promise.resolve(new Response(JSON.stringify(response)))
|
|
@@ -22,12 +22,11 @@ function mockFetch(url: string) {
|
|
|
22
22
|
|
|
23
23
|
const rootTemplate = path
|
|
24
24
|
.join(__dirname, '..', '..', '..', '..', 'test_data', 'names')
|
|
25
|
-
.
|
|
25
|
+
.replaceAll('\\', '\\\\')
|
|
26
26
|
|
|
27
27
|
test('search upper case', async () => {
|
|
28
28
|
const spy = jest.spyOn(global, 'fetch')
|
|
29
|
-
|
|
30
|
-
spy.mockImplementation(mockFetch as any)
|
|
29
|
+
spy.mockImplementation(mockFetch)
|
|
31
30
|
|
|
32
31
|
const adapter = new Adapter(
|
|
33
32
|
configSchema.create({
|
|
@@ -65,8 +64,7 @@ test('search upper case', async () => {
|
|
|
65
64
|
|
|
66
65
|
test('search lower case', async () => {
|
|
67
66
|
const spy = jest.spyOn(global, 'fetch')
|
|
68
|
-
|
|
69
|
-
spy.mockImplementation(mockFetch as any)
|
|
67
|
+
spy.mockImplementation(mockFetch)
|
|
70
68
|
|
|
71
69
|
const adapter = new Adapter(
|
|
72
70
|
configSchema.create({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseTextSearchAdapter,
|
|
3
|
-
|
|
3
|
+
BaseTextSearchArgs,
|
|
4
4
|
BaseAdapter,
|
|
5
5
|
} from '@jbrowse/core/data_adapters/BaseAdapter'
|
|
6
6
|
import BaseResult from '@jbrowse/core/TextSearch/BaseResults'
|
|
@@ -57,7 +57,7 @@ export default class JBrowse1TextSearchAdapter
|
|
|
57
57
|
return this.httpMap.getBucket(query)
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
async searchIndex(args:
|
|
60
|
+
async searchIndex(args: BaseTextSearchArgs) {
|
|
61
61
|
const { searchType, queryString } = args
|
|
62
62
|
const tracks = this.tracksNames || (await this.httpMap.getTrackNames())
|
|
63
63
|
const str = queryString.toLowerCase()
|
|
@@ -34,8 +34,7 @@ export default class NCListFeature implements Feature {
|
|
|
34
34
|
jb1TagToJb2Tag(tag: string): string {
|
|
35
35
|
const t = tag.toLowerCase()
|
|
36
36
|
// @ts-expect-error
|
|
37
|
-
|
|
38
|
-
return mapped
|
|
37
|
+
return jb1ToJb2[t] || t
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|