-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
41 lines (41 loc) · 1.28 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
export default function factory() {
return {
name: 'stream-faker',
transform(context) {
if (context.url.match(/string-to-stream/)) {
return {
body: `export default function() {}`,
}
}
if (context.url.match(/@graphy\/core.data.factory/)) {
return {
body: `export default {}`,
}
}
if (context.url.match(/node_modules\/into-stream\/index.js$/)) {
return {
body: `export { default } from '@rdfjs-elements/testing/into-stream/index.js';`,
}
}
if (
context.url.match(/node_modules\/readable-stream\/readable.js$/) ||
context.url.match(/node_modules\/readable-stream\/lib\/ours\/index.js$/)
) {
return {
body: `export * from '@rdfjs-elements/testing/stream/index.js';
export { default } from '@rdfjs-elements/testing/stream/index.js';`,
}
}
if (context.url.match(/node_modules\/.+\/sink-map\/index.js$/)) {
return {
body: `
import { FakeSinkMap } from '@rdfjs-elements/testing/sink-map/index.js';
export { FakeSinkMap as SinkMap } from '@rdfjs-elements/testing/sink-map/index.js';
export default FakeSinkMap;
`,
}
}
return context
},
}
}