gatsby-transformer-json 4.2.0 → 4.4.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.3.0](https://github.com/gatsbyjs/gatsby/commits/gatsby-transformer-json@4.3.0/packages/gatsby-transformer-json) (2021-12-01)
7
+
8
+ [🧾 Release notes](https://www.gatsbyjs.com/docs/reference/release-notes/v4.3)
9
+
10
+ #### Bug Fixes
11
+
12
+ - Fix high memory consumption Fix [#34084](https://github.com/gatsbyjs/gatsby/issues/34084) ([2a94a48](https://github.com/gatsbyjs/gatsby/commit/2a94a48966c8baa2137252e178ba86b40006343d))
13
+
14
+ ## [4.2.0](https://github.com/gatsbyjs/gatsby/commits/gatsby-transformer-json@4.2.0/packages/gatsby-transformer-json) (2021-11-16)
15
+
16
+ [🧾 Release notes](https://www.gatsbyjs.com/docs/reference/release-notes/v4.2)
17
+
18
+ **Note:** Version bump only for package gatsby-transformer-json
19
+
6
20
  ## [4.1.0](https://github.com/gatsbyjs/gatsby/commits/gatsby-transformer-json@4.1.0/packages/gatsby-transformer-json) (2021-11-02)
7
21
 
8
22
  [🧾 Release notes](https://www.gatsbyjs.com/docs/reference/release-notes/v4.1)
package/gatsby-node.js CHANGED
@@ -46,7 +46,7 @@ async function onCreateNode({
46
46
  }
47
47
  }
48
48
 
49
- function transformObject(obj, id, type) {
49
+ async function transformObject(obj, id, type) {
50
50
  const jsonNode = { ...obj,
51
51
  id,
52
52
  children: [],
@@ -61,7 +61,7 @@ async function onCreateNode({
61
61
  jsonNode[`jsonId`] = obj.id;
62
62
  }
63
63
 
64
- createNode(jsonNode);
64
+ await createNode(jsonNode);
65
65
  createParentChildLink({
66
66
  parent: node,
67
67
  child: jsonNode
@@ -83,15 +83,16 @@ async function onCreateNode({
83
83
  }
84
84
 
85
85
  if (_.isArray(parsedContent)) {
86
- parsedContent.forEach((obj, i) => {
87
- transformObject(obj, createNodeId(`${node.id} [${i}] >>> JSON`), getType({
86
+ for (let i = 0, l = parsedContent.length; i < l; i++) {
87
+ const obj = parsedContent[i];
88
+ await transformObject(obj, createNodeId(`${node.id} [${i}] >>> JSON`), getType({
88
89
  node,
89
90
  object: obj,
90
91
  isArray: true
91
92
  }));
92
- });
93
+ }
93
94
  } else if (_.isPlainObject(parsedContent)) {
94
- transformObject(parsedContent, createNodeId(`${node.id} >>> JSON`), getType({
95
+ await transformObject(parsedContent, createNodeId(`${node.id} >>> JSON`), getType({
95
96
  node,
96
97
  object: parsedContent,
97
98
  isArray: false
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gatsby-transformer-json",
3
3
  "description": "Gatsby transformer plugin for JSON files",
4
- "version": "4.2.0",
4
+ "version": "4.4.0",
5
5
  "author": "Kyle Mathews <mathews.kyle@gmail.com>",
6
6
  "bugs": {
7
7
  "url": "https://github.com/gatsbyjs/gatsby/issues"
@@ -13,7 +13,7 @@
13
13
  "devDependencies": {
14
14
  "@babel/cli": "^7.15.4",
15
15
  "@babel/core": "^7.15.5",
16
- "babel-preset-gatsby-package": "^2.2.0",
16
+ "babel-preset-gatsby-package": "^2.4.0",
17
17
  "cross-env": "^7.0.3"
18
18
  },
19
19
  "homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-transformer-json#readme",
@@ -39,5 +39,5 @@
39
39
  "engines": {
40
40
  "node": ">=14.15.0"
41
41
  },
42
- "gitHead": "7ca9785a31b34ae3fcd1e1765c4851d313de3cec"
42
+ "gitHead": "c09587abec36640b8d236455bc28bd430c7e112e"
43
43
  }