1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = void 0;
|
7 | const extensions = [`jpeg`, `jpg`, `png`, `webp`, `tif`, `tiff`, `gif`, `mp4`, `webm`, `ogv`].reduce((acc, v) => {
|
8 | acc[v] = v;
|
9 | return acc;
|
10 | }, {});
|
11 |
|
12 | var _default = ({
|
13 | node,
|
14 | actions,
|
15 | createNodeId
|
16 | }) => {
|
17 | const {
|
18 | createNode,
|
19 | createParentChildLink
|
20 | } = actions;
|
21 |
|
22 | if (!extensions[node.extension]) {
|
23 | return;
|
24 | }
|
25 |
|
26 | const imageNode = {
|
27 | id: createNodeId(`${node.id} >> ImageCloudinary`),
|
28 | children: [],
|
29 | parent: node.id,
|
30 | internal: {
|
31 | contentDigest: `${node.internal.contentDigest}`,
|
32 | type: `ImageCloudinary`
|
33 | }
|
34 | };
|
35 | createNode(imageNode);
|
36 | createParentChildLink({
|
37 | parent: node,
|
38 | child: imageNode
|
39 | });
|
40 | return;
|
41 | };
|
42 |
|
43 | exports.default = _default; |
\ | No newline at end of file |