@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.
Files changed (43) hide show
  1. package/dist/JBrowse1Connection/configSchema.d.ts +32 -1
  2. package/dist/JBrowse1Connection/jb1ConfigParse.js +1 -1
  3. package/dist/JBrowse1Connection/jb1ConfigParse.js.map +1 -1
  4. package/dist/JBrowse1Connection/jb1ToJb2.js +2 -2
  5. package/dist/JBrowse1Connection/jb1ToJb2.js.map +1 -1
  6. package/dist/JBrowse1Connection/model.d.ts +39 -2
  7. package/dist/JBrowse1Connection/model.js +40 -18
  8. package/dist/JBrowse1Connection/model.js.map +1 -1
  9. package/dist/JBrowse1Connection/util.d.ts +1 -0
  10. package/dist/JBrowse1Connection/util.js +4 -6
  11. package/dist/JBrowse1Connection/util.js.map +1 -1
  12. package/dist/JBrowse1TextSearchAdapter/JBrowse1TextSearchAdapter.d.ts +2 -2
  13. package/dist/JBrowse1TextSearchAdapter/JBrowse1TextSearchAdapter.js.map +1 -1
  14. package/dist/JBrowse1TextSearchAdapter/configSchema.d.ts +29 -1
  15. package/dist/NCListAdapter/NCListFeature.js +1 -2
  16. package/dist/NCListAdapter/NCListFeature.js.map +1 -1
  17. package/dist/NCListAdapter/configSchema.d.ts +20 -1
  18. package/esm/JBrowse1Connection/configSchema.d.ts +32 -1
  19. package/esm/JBrowse1Connection/jb1ConfigParse.js +1 -1
  20. package/esm/JBrowse1Connection/jb1ConfigParse.js.map +1 -1
  21. package/esm/JBrowse1Connection/jb1ToJb2.js +2 -2
  22. package/esm/JBrowse1Connection/jb1ToJb2.js.map +1 -1
  23. package/esm/JBrowse1Connection/model.d.ts +39 -2
  24. package/esm/JBrowse1Connection/model.js +18 -19
  25. package/esm/JBrowse1Connection/model.js.map +1 -1
  26. package/esm/JBrowse1Connection/util.d.ts +1 -0
  27. package/esm/JBrowse1Connection/util.js +4 -6
  28. package/esm/JBrowse1Connection/util.js.map +1 -1
  29. package/esm/JBrowse1TextSearchAdapter/JBrowse1TextSearchAdapter.d.ts +2 -2
  30. package/esm/JBrowse1TextSearchAdapter/JBrowse1TextSearchAdapter.js.map +1 -1
  31. package/esm/JBrowse1TextSearchAdapter/configSchema.d.ts +29 -1
  32. package/esm/NCListAdapter/NCListFeature.js +1 -2
  33. package/esm/NCListAdapter/NCListFeature.js.map +1 -1
  34. package/esm/NCListAdapter/configSchema.d.ts +20 -1
  35. package/package.json +2 -2
  36. package/src/JBrowse1Connection/jb1ConfigParse.ts +1 -1
  37. package/src/JBrowse1Connection/jb1ToJb2.ts +2 -2
  38. package/src/JBrowse1Connection/model.tsx +42 -50
  39. package/src/JBrowse1Connection/util.ts +4 -6
  40. package/src/JBrowse1TextSearchAdapter/HttpMap.test.ts +36 -51
  41. package/src/JBrowse1TextSearchAdapter/JBrowse1TextSearchAdapter.test.ts +7 -9
  42. package/src/JBrowse1TextSearchAdapter/JBrowse1TextSearchAdapter.ts +2 -2
  43. 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: string) {
9
+ function mockFetch(url: RequestInfo | URL) {
10
10
  let response = {}
11
- if (url.includes('names/meta.json')) {
11
+ if (`${url}`.includes('names/meta.json')) {
12
12
  response = meta
13
13
  }
14
- if (url.includes('names/0.json')) {
14
+ if (`${url}`.includes('names/0.json')) {
15
15
  response = first
16
16
  }
17
- if (url.includes('names/f.json')) {
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
- .replace(/\\/g, '\\\\')
25
+ .replaceAll('\\', '\\\\')
26
26
 
27
27
  test('search upper case', async () => {
28
28
  const spy = jest.spyOn(global, 'fetch')
29
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
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
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
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
- BaseArgs,
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: BaseArgs) {
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
- const mapped = jb1ToJb2[t] || t
38
- return mapped
37
+ return jb1ToJb2[t] || t
39
38
  }
40
39
 
41
40
  // eslint-disable-next-line @typescript-eslint/no-explicit-any