projen 0.80.7 → 0.80.9

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 (187) hide show
  1. package/.jsii +41 -41
  2. package/lib/awscdk/auto-discover.js +5 -5
  3. package/lib/awscdk/awscdk-app-java.js +1 -1
  4. package/lib/awscdk/awscdk-app-py.js +1 -1
  5. package/lib/awscdk/awscdk-app-ts.js +1 -1
  6. package/lib/awscdk/awscdk-construct.js +2 -2
  7. package/lib/awscdk/awscdk-deps-java.js +1 -1
  8. package/lib/awscdk/awscdk-deps-js.js +1 -1
  9. package/lib/awscdk/awscdk-deps-py.js +1 -1
  10. package/lib/awscdk/awscdk-deps.js +1 -1
  11. package/lib/awscdk/cdk-config.js +1 -1
  12. package/lib/awscdk/cdk-tasks.js +1 -1
  13. package/lib/awscdk/integration-test.js +1 -1
  14. package/lib/awscdk/lambda-extension.js +1 -1
  15. package/lib/awscdk/lambda-function.js +2 -2
  16. package/lib/build/build-workflow.js +1 -1
  17. package/lib/cdk/auto-discover-base.js +2 -2
  18. package/lib/cdk/construct-lib.js +1 -1
  19. package/lib/cdk/integration-test-base.js +1 -1
  20. package/lib/cdk/jsii-docgen.js +1 -1
  21. package/lib/cdk/jsii-project.js +1 -1
  22. package/lib/cdk8s/auto-discover.js +2 -2
  23. package/lib/cdk8s/cdk8s-app-py.js +1 -1
  24. package/lib/cdk8s/cdk8s-app-ts.js +1 -1
  25. package/lib/cdk8s/cdk8s-construct.js +1 -1
  26. package/lib/cdk8s/cdk8s-deps-py.js +1 -1
  27. package/lib/cdk8s/cdk8s-deps.js +1 -1
  28. package/lib/cdk8s/integration-test.js +1 -1
  29. package/lib/cdktf/cdktf-construct.js +1 -1
  30. package/lib/circleci/circleci.js +1 -1
  31. package/lib/component.js +1 -1
  32. package/lib/dependencies.js +1 -1
  33. package/lib/dev-env.js +1 -1
  34. package/lib/docker-compose/docker-compose-service.js +1 -1
  35. package/lib/docker-compose/docker-compose.js +1 -1
  36. package/lib/file.js +1 -1
  37. package/lib/gitattributes.js +1 -1
  38. package/lib/github/actions-provider.js +1 -1
  39. package/lib/github/auto-approve.js +1 -1
  40. package/lib/github/auto-merge.js +1 -1
  41. package/lib/github/dependabot.js +1 -1
  42. package/lib/github/github-credentials.js +1 -1
  43. package/lib/github/github-project.js +1 -1
  44. package/lib/github/github.js +1 -1
  45. package/lib/github/mergify.js +1 -1
  46. package/lib/github/pr-template.js +1 -1
  47. package/lib/github/pull-request-lint.js +1 -1
  48. package/lib/github/stale.js +1 -1
  49. package/lib/github/task-workflow-job.js +1 -1
  50. package/lib/github/task-workflow.js +1 -1
  51. package/lib/github/workflow-actions.js +1 -1
  52. package/lib/github/workflow-jobs.js +1 -1
  53. package/lib/github/workflow-steps.js +1 -1
  54. package/lib/github/workflows.js +1 -1
  55. package/lib/gitlab/configuration.js +1 -1
  56. package/lib/gitlab/gitlab-configuration.js +1 -1
  57. package/lib/gitlab/nested-configuration.js +1 -1
  58. package/lib/gitpod.js +1 -1
  59. package/lib/ignore-file.js +1 -1
  60. package/lib/ini.js +1 -1
  61. package/lib/java/java-project.js +1 -1
  62. package/lib/java/junit.js +1 -1
  63. package/lib/java/maven-compile.js +1 -1
  64. package/lib/java/maven-packaging.js +1 -1
  65. package/lib/java/maven-sample.js +1 -1
  66. package/lib/java/pom.js +1 -1
  67. package/lib/java/projenrc.js +1 -1
  68. package/lib/javascript/bundler.js +1 -1
  69. package/lib/javascript/eslint.js +1 -1
  70. package/lib/javascript/jest.js +4 -4
  71. package/lib/javascript/license-checker.js +1 -1
  72. package/lib/javascript/node-package.js +1 -1
  73. package/lib/javascript/node-project.js +1 -1
  74. package/lib/javascript/npm-config.js +1 -1
  75. package/lib/javascript/prettier.js +1 -1
  76. package/lib/javascript/projenrc.js +1 -1
  77. package/lib/javascript/typescript-config.js +2 -2
  78. package/lib/javascript/upgrade-dependencies.js +2 -2
  79. package/lib/javascript/yarnrc.js +1 -1
  80. package/lib/json-patch.js +1 -1
  81. package/lib/json.js +1 -1
  82. package/lib/license.js +1 -1
  83. package/lib/logger.js +1 -1
  84. package/lib/makefile.js +1 -1
  85. package/lib/object-file.js +1 -1
  86. package/lib/project-build.js +1 -1
  87. package/lib/project-tree.js +1 -1
  88. package/lib/project.js +1 -1
  89. package/lib/projects.js +1 -1
  90. package/lib/projenrc-json.js +2 -2
  91. package/lib/projenrc.js +1 -1
  92. package/lib/python/pip.js +1 -1
  93. package/lib/python/poetry.d.ts +3 -7
  94. package/lib/python/poetry.js +21 -43
  95. package/lib/python/projenrc.js +1 -1
  96. package/lib/python/pytest-sample.js +1 -1
  97. package/lib/python/pytest.js +1 -1
  98. package/lib/python/python-project.js +1 -1
  99. package/lib/python/python-sample.js +1 -1
  100. package/lib/python/requirements-file.js +1 -1
  101. package/lib/python/setuppy.js +1 -1
  102. package/lib/python/setuptools.js +1 -1
  103. package/lib/python/venv.js +1 -1
  104. package/lib/readme.js +1 -1
  105. package/lib/release/publisher.js +1 -1
  106. package/lib/release/release-trigger.js +1 -1
  107. package/lib/release/release.js +1 -1
  108. package/lib/renovatebot.js +1 -1
  109. package/lib/sample-file.js +2 -2
  110. package/lib/semver.js +1 -1
  111. package/lib/source-code.js +1 -1
  112. package/lib/task-runtime.js +1 -1
  113. package/lib/task.js +1 -1
  114. package/lib/tasks.js +1 -1
  115. package/lib/testing.js +1 -1
  116. package/lib/textfile.js +1 -1
  117. package/lib/toml.js +8 -10
  118. package/lib/typescript/projenrc-ts.js +1 -1
  119. package/lib/typescript/projenrc.js +1 -1
  120. package/lib/typescript/typescript-typedoc.js +1 -1
  121. package/lib/typescript/typescript.js +6 -6
  122. package/lib/version.js +2 -2
  123. package/lib/vscode/devcontainer.js +1 -1
  124. package/lib/vscode/extensions.js +1 -1
  125. package/lib/vscode/launch-config.js +1 -1
  126. package/lib/vscode/settings.js +1 -1
  127. package/lib/vscode/vscode.js +1 -1
  128. package/lib/web/next.js +3 -3
  129. package/lib/web/postcss.js +1 -1
  130. package/lib/web/react.js +4 -4
  131. package/lib/web/tailwind.js +1 -1
  132. package/lib/xmlfile.js +1 -1
  133. package/lib/yaml.js +1 -1
  134. package/node_modules/@iarna/toml/LICENSE +14 -0
  135. package/node_modules/@iarna/toml/README.md +301 -0
  136. package/node_modules/@iarna/toml/index.d.ts +57 -0
  137. package/node_modules/@iarna/toml/lib/create-date.js +23 -0
  138. package/node_modules/@iarna/toml/lib/create-datetime-float.js +24 -0
  139. package/node_modules/@iarna/toml/lib/create-datetime.js +10 -0
  140. package/node_modules/@iarna/toml/lib/create-time.js +22 -0
  141. package/node_modules/@iarna/toml/lib/format-num.js +6 -0
  142. package/node_modules/@iarna/toml/lib/parser-debug.js +60 -0
  143. package/node_modules/@iarna/toml/lib/parser.js +127 -0
  144. package/node_modules/@iarna/toml/lib/toml-parser.js +1379 -0
  145. package/node_modules/@iarna/toml/package.json +82 -0
  146. package/node_modules/@iarna/toml/parse-async.js +30 -0
  147. package/node_modules/@iarna/toml/parse-pretty-error.js +33 -0
  148. package/node_modules/@iarna/toml/parse-stream.js +80 -0
  149. package/node_modules/@iarna/toml/parse-string.js +18 -0
  150. package/node_modules/@iarna/toml/parse.js +5 -0
  151. package/node_modules/@iarna/toml/stringify.js +296 -0
  152. package/node_modules/@iarna/toml/toml.js +3 -0
  153. package/node_modules/yaml/browser/dist/parse/parser.js +4 -1
  154. package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +19 -10
  155. package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +5 -12
  156. package/node_modules/yaml/dist/parse/parser.js +4 -1
  157. package/node_modules/yaml/dist/stringify/foldFlowLines.js +19 -10
  158. package/node_modules/yaml/dist/stringify/stringifyCollection.js +5 -12
  159. package/node_modules/yaml/package.json +1 -1
  160. package/package.json +8 -8
  161. package/node_modules/json2toml/CHANGELOG.md +0 -128
  162. package/node_modules/json2toml/LICENSE.txt +0 -18
  163. package/node_modules/json2toml/README.md +0 -52
  164. package/node_modules/json2toml/index.d.ts +0 -13
  165. package/node_modules/json2toml/index.js +0 -160
  166. package/node_modules/json2toml/package.json +0 -62
  167. package/node_modules/lodash.isdate/LICENSE +0 -47
  168. package/node_modules/lodash.isdate/README.md +0 -18
  169. package/node_modules/lodash.isdate/index.js +0 -119
  170. package/node_modules/lodash.isdate/package.json +0 -17
  171. package/node_modules/lodash.isempty/LICENSE +0 -47
  172. package/node_modules/lodash.isempty/README.md +0 -18
  173. package/node_modules/lodash.isempty/index.js +0 -582
  174. package/node_modules/lodash.isempty/package.json +0 -17
  175. package/node_modules/lodash.isplainobject/LICENSE +0 -47
  176. package/node_modules/lodash.isplainobject/README.md +0 -18
  177. package/node_modules/lodash.isplainobject/index.js +0 -139
  178. package/node_modules/lodash.isplainobject/package.json +0 -17
  179. package/node_modules/strftime/Changelog.md +0 -286
  180. package/node_modules/strftime/Makefile +0 -15
  181. package/node_modules/strftime/Readme.md +0 -208
  182. package/node_modules/strftime/bower.json +0 -13
  183. package/node_modules/strftime/component.json +0 -16
  184. package/node_modules/strftime/package.json +0 -53
  185. package/node_modules/strftime/strftime-min.js +0 -21
  186. package/node_modules/strftime/strftime.js +0 -854
  187. package/node_modules/strftime/test.js +0 -271
@@ -30,7 +30,7 @@ function foldFlowLines(text, indent, mode = 'flow', { indentAtStart, lineWidth =
30
30
  let escStart = -1;
31
31
  let escEnd = -1;
32
32
  if (mode === FOLD_BLOCK) {
33
- i = consumeMoreIndentedLines(text, i);
33
+ i = consumeMoreIndentedLines(text, i, indent.length);
34
34
  if (i !== -1)
35
35
  end = i + endStep;
36
36
  }
@@ -54,8 +54,8 @@ function foldFlowLines(text, indent, mode = 'flow', { indentAtStart, lineWidth =
54
54
  }
55
55
  if (ch === '\n') {
56
56
  if (mode === FOLD_BLOCK)
57
- i = consumeMoreIndentedLines(text, i);
58
- end = i + endStep;
57
+ i = consumeMoreIndentedLines(text, i, indent.length);
58
+ end = i + indent.length + endStep;
59
59
  split = undefined;
60
60
  }
61
61
  else {
@@ -123,15 +123,24 @@ function foldFlowLines(text, indent, mode = 'flow', { indentAtStart, lineWidth =
123
123
  * Presumes `i + 1` is at the start of a line
124
124
  * @returns index of last newline in more-indented block
125
125
  */
126
- function consumeMoreIndentedLines(text, i) {
127
- let ch = text[i + 1];
126
+ function consumeMoreIndentedLines(text, i, indent) {
127
+ let end = i;
128
+ let start = i + 1;
129
+ let ch = text[start];
128
130
  while (ch === ' ' || ch === '\t') {
129
- do {
130
- ch = text[(i += 1)];
131
- } while (ch && ch !== '\n');
132
- ch = text[i + 1];
131
+ if (i < start + indent) {
132
+ ch = text[++i];
133
+ }
134
+ else {
135
+ do {
136
+ ch = text[++i];
137
+ } while (ch && ch !== '\n');
138
+ end = i;
139
+ start = i + 1;
140
+ ch = text[start];
141
+ }
133
142
  }
134
- return i;
143
+ return end;
135
144
  }
136
145
 
137
146
  exports.FOLD_BLOCK = FOLD_BLOCK;
@@ -60,7 +60,7 @@ function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, fl
60
60
  onChompKeep();
61
61
  return str;
62
62
  }
63
- function stringifyFlowCollection({ comment, items }, ctx, { flowChars, itemIndent, onComment }) {
63
+ function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) {
64
64
  const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx;
65
65
  itemIndent += indentStep;
66
66
  const itemCtx = Object.assign({}, ctx, {
@@ -113,10 +113,9 @@ function stringifyFlowCollection({ comment, items }, ctx, { flowChars, itemInden
113
113
  lines.push(str);
114
114
  linesAtValue = lines.length;
115
115
  }
116
- let str;
117
116
  const { start, end } = flowChars;
118
117
  if (lines.length === 0) {
119
- str = start + end;
118
+ return start + end;
120
119
  }
121
120
  else {
122
121
  if (!reqNewline) {
@@ -124,21 +123,15 @@ function stringifyFlowCollection({ comment, items }, ctx, { flowChars, itemInden
124
123
  reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth;
125
124
  }
126
125
  if (reqNewline) {
127
- str = start;
126
+ let str = start;
128
127
  for (const line of lines)
129
128
  str += line ? `\n${indentStep}${indent}${line}` : '\n';
130
- str += `\n${indent}${end}`;
129
+ return `${str}\n${indent}${end}`;
131
130
  }
132
131
  else {
133
- str = `${start}${fcPadding}${lines.join(' ')}${fcPadding}${end}`;
132
+ return `${start}${fcPadding}${lines.join(' ')}${fcPadding}${end}`;
134
133
  }
135
134
  }
136
- if (comment) {
137
- str += stringifyComment.lineComment(str, indent, commentString(comment));
138
- if (onComment)
139
- onComment();
140
- }
141
- return str;
142
135
  }
143
136
  function addCommentBefore({ indent, options: { commentString } }, lines, comment, chompKeep) {
144
137
  if (comment && chompKeep)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yaml",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "license": "ISC",
5
5
  "author": "Eemeli Aro <eemeli@gmail.com>",
6
6
  "repository": "github:eemeli/yaml",
package/package.json CHANGED
@@ -49,7 +49,6 @@
49
49
  "organization": true
50
50
  },
51
51
  "devDependencies": {
52
- "@iarna/toml": "^2.2.5",
53
52
  "@types/conventional-changelog-config-spec": "^2.1.5",
54
53
  "@types/glob": "^7.2.0",
55
54
  "@types/ini": "^1.3.34",
@@ -69,21 +68,23 @@
69
68
  "jest": "^29",
70
69
  "jest-junit": "^15",
71
70
  "jsii": "5.1.x",
72
- "jsii-diff": "^1.94.0",
73
- "jsii-docgen": "^10.3.19",
74
- "jsii-pacmak": "^1.94.0",
71
+ "jsii-diff": "^1.95.0",
72
+ "jsii-docgen": "^10.3.21",
73
+ "jsii-pacmak": "^1.95.0",
75
74
  "jsii-rosetta": "5.1.x",
76
75
  "license-checker": "^25.0.1",
77
76
  "markmac": "^0.1.146",
78
77
  "prettier": "^2.8.8",
79
78
  "standard-version": "^9",
80
79
  "ts-jest": "^29",
80
+ "ts-node": "^10.9.2",
81
81
  "typescript": "5.1.x"
82
82
  },
83
83
  "peerDependencies": {
84
84
  "constructs": "^10.0.0"
85
85
  },
86
86
  "dependencies": {
87
+ "@iarna/toml": "^2.2.5",
87
88
  "case": "^1.6.3",
88
89
  "chalk": "^4.1.2",
89
90
  "comment-json": "4.2.2",
@@ -92,7 +93,6 @@
92
93
  "fast-json-patch": "^3.1.1",
93
94
  "glob": "^8",
94
95
  "ini": "^2.0.0",
95
- "json2toml": "^6.1.0",
96
96
  "semver": "^7.6.0",
97
97
  "shx": "^0.3.4",
98
98
  "xmlbuilder2": "^3.1.1",
@@ -100,6 +100,7 @@
100
100
  "yargs": "^17.7.2"
101
101
  },
102
102
  "bundledDependencies": [
103
+ "@iarna/toml",
103
104
  "case",
104
105
  "chalk",
105
106
  "comment-json",
@@ -107,7 +108,6 @@
107
108
  "fast-json-patch",
108
109
  "glob",
109
110
  "ini",
110
- "json2toml",
111
111
  "semver",
112
112
  "shx",
113
113
  "xmlbuilder2",
@@ -127,7 +127,7 @@
127
127
  },
128
128
  "main": "lib/index.js",
129
129
  "license": "Apache-2.0",
130
- "version": "0.80.7",
130
+ "version": "0.80.9",
131
131
  "jest": {
132
132
  "maxWorkers": "50%",
133
133
  "testMatch": [
@@ -195,5 +195,5 @@
195
195
  "rootDir": "src"
196
196
  }
197
197
  },
198
- "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"node ./projen.js\"."
198
+ "//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"node ./projen.js\"."
199
199
  }
@@ -1,128 +0,0 @@
1
- ## [6.1.0](https://github.com/kenany/json2toml/compare/6.0.0...6.1.0) (2024-02-26)
2
-
3
-
4
- ### Features
5
-
6
- * add TS declaration file ([da04ce2](https://github.com/kenany/json2toml/commit/da04ce2b94083e1c96d04f89b6934cb81e942703))
7
-
8
- ## [6.0.0](https://github.com/kenany/json2toml/compare/5.0.0...6.0.0) (2023-09-20)
9
-
10
-
11
- ### ⚠ BREAKING CHANGES
12
-
13
- * Node.js v16 is no longer supported.
14
-
15
- ### Features
16
-
17
- * drop Node.js v16 ([e6f1c40](https://github.com/kenany/json2toml/commit/e6f1c409f0f052fc66cb9d724361bb99bd195343))
18
-
19
- ## [5.0.0](https://github.com/kenany/json2toml/compare/4.0.2...5.0.0) (2023-06-03)
20
-
21
-
22
- ### ⚠ BREAKING CHANGES
23
-
24
- * Node.js v14 is no longer supported.
25
-
26
- ### Features
27
-
28
- * drop Node.js v14 support ([54fe19a](https://github.com/kenany/json2toml/commit/54fe19a45f852971a946112519362c31c9891381))
29
-
30
-
31
- ### Bug Fixes
32
-
33
- * preserve item sort order ([e2305e7](https://github.com/kenany/json2toml/commit/e2305e7443d6a9405dfb10f70327adb1de84077d))
34
- * throw on `undefined`, `null`, and sparse arrays ([21c9125](https://github.com/kenany/json2toml/commit/21c9125f0b9464911125211c9d89934abf54d8ff))
35
-
36
- ## [4.0.2](https://github.com/KenanY/json2toml/compare/4.0.1...4.0.2) (2023-06-02)
37
-
38
-
39
- ### Bug Fixes
40
-
41
- * **deps:** strftime@0.10.2 ([1bea457](https://github.com/KenanY/json2toml/commit/1bea457c88813bd33e0c819280465029a06395bb))
42
-
43
- ## [4.0.1](https://github.com/KenanY/json2toml/compare/4.0.0...4.0.1) (2022-12-01)
44
-
45
-
46
- ### Bug Fixes
47
-
48
- * **indent:** indent on arrays of objects ([8c71aae](https://github.com/KenanY/json2toml/commit/8c71aae6a25aed0816230cfdb76fb80a5f351a5e)), closes [#159](https://github.com/KenanY/json2toml/issues/159)
49
-
50
- ## [4.0.0](https://github.com/KenanY/json2toml/compare/3.0.1...4.0.0) (2022-11-23)
51
-
52
-
53
- ### ⚠ BREAKING CHANGES
54
-
55
- * Node.js v12 is no longer supported.
56
-
57
- ### Features
58
-
59
- * drop Node.js v12 support ([5d956eb](https://github.com/KenanY/json2toml/commit/5d956ebe6be013df41d50290ac385c7fae3a747e))
60
-
61
- ### [3.0.1](https://github.com/KenanY/json2toml/compare/3.0.0...3.0.1) (2022-01-02)
62
-
63
-
64
- ### Bug Fixes
65
-
66
- * **deps:** strftime@0.10.1 ([b002831](https://github.com/KenanY/json2toml/commit/b002831159e8ee23d7b1a54eb5e23cee5e96ad8a))
67
-
68
- ## [3.0.0](https://github.com/KenanY/json2toml/compare/2.2.1...3.0.0) (2022-01-02)
69
-
70
-
71
- ### ⚠ BREAKING CHANGES
72
-
73
- * **ci:** Node.js v10 is no longer supported.
74
-
75
- ### Features
76
-
77
- * **ci:** drop Node.js v10 support ([ba093d1](https://github.com/KenanY/json2toml/commit/ba093d1a7aaa7edacdd608db16ac9b1abb705fad))
78
-
79
- ### [2.2.1](https://github.com/KenanY/json2toml/compare/2.2.0...2.2.1) (2021-09-06)
80
-
81
-
82
- ### Bug Fixes
83
-
84
- * escape keys ([faddd7e](https://github.com/KenanY/json2toml/commit/faddd7e1ba56470953d5ee485c3262658fd3e520))
85
-
86
- ## [2.2.0](https://github.com/KenanY/json2toml/compare/2.1.0...2.2.0) (2021-06-24)
87
-
88
-
89
- ### Features
90
-
91
- * add support for array of tables ([ddd3a70](https://github.com/KenanY/json2toml/commit/ddd3a702bef4278e43001091169045782919ad4a))
92
-
93
- ## [2.1.0](https://github.com/KenanY/json2toml/compare/2.0.2...2.1.0) (2021-03-03)
94
-
95
-
96
- ### Features
97
-
98
- * add pretty-printing options ([786a664](https://github.com/KenanY/json2toml/commit/786a66458eb5fcb76671735fe6334fd3732d574c))
99
-
100
- ### [2.0.2](https://github.com/KenanY/json2toml/compare/2.0.1...2.0.2) (2020-10-16)
101
-
102
-
103
- ### Bug Fixes
104
-
105
- * **deps:** lodash.foreach@^4.5.0 ([e18881b](https://github.com/KenanY/json2toml/commit/e18881baf4f83d9b0f80bfb7f6afe58150580073))
106
- * **deps:** lodash.isdate@^4.0.1 ([9e71784](https://github.com/KenanY/json2toml/commit/9e717847330d4a81a3e33e08669307dbb620d4e9))
107
- * **deps:** lodash.isempty@^4.4.0 ([e434f86](https://github.com/KenanY/json2toml/commit/e434f868ab2c20862a4a0fb4e3249700126b8aa5))
108
- * **deps:** lodash.isplainobject@^4.0.6 ([3b77e45](https://github.com/KenanY/json2toml/commit/3b77e451a31f41a6fab80bbe4a3bb7c7a658fa40))
109
- * **deps:** lodash.keys@^4.2.0 ([ee76208](https://github.com/KenanY/json2toml/commit/ee76208b735d4171042bd1314d38154963020d62))
110
-
111
- ### [2.0.1](https://github.com/KenanY/json2toml/compare/2.0.0...2.0.1) (2020-08-06)
112
-
113
-
114
- ### Bug Fixes
115
-
116
- * update copyright year to 2020 ([c098e8a](https://github.com/KenanY/json2toml/commit/c098e8ad41ce9c7219b9cb2a6a80b548424a5ba0))
117
-
118
- ## [2.0.0](https://github.com/KenanY/json2toml/compare/1.0.6...2.0.0) (2020-08-06)
119
-
120
-
121
- ### ⚠ BREAKING CHANGES
122
-
123
- * Node.js v10 is now the minimum supported version of
124
- Node.js.
125
-
126
- ### Features
127
-
128
- * remove support for Node.js v6 and v8 ([1a2d938](https://github.com/KenanY/json2toml/commit/1a2d93831b3a3f99e63e5a10b06c7454acd73691))
@@ -1,18 +0,0 @@
1
- Copyright 2013–2024 Kenan Yildirim <https://kenany.me/>
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of
4
- this software and associated documentation files (the "Software"), to deal in
5
- the Software without restriction, including without limitation the rights to
6
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7
- the Software, and to permit persons to whom the Software is furnished to do so,
8
- subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in all
11
- copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,52 +0,0 @@
1
- # json2toml
2
-
3
- Convert JSON to [TOML](https://github.com/mojombo/toml).
4
-
5
- ## Example
6
-
7
- ``` javascript
8
- const json2toml = require('json2toml');
9
-
10
- json2toml({simple: true});
11
- // => 'simple = true\n'
12
-
13
- // Also supports pretty-printing options
14
- json2toml(
15
- {
16
- deeply: {
17
- option: false,
18
- nested: {
19
- option: true
20
- }
21
- }
22
- },
23
- { indent: 2, newlineAfterSection: true }
24
- );
25
- // => [deeply]
26
- // => option = false
27
- // =>
28
- // => [deeply.nested]
29
- // => option = true
30
- ```
31
-
32
- ## Installation
33
-
34
- ``` bash
35
- $ npm install json2toml
36
- ```
37
-
38
- ## API
39
-
40
- ``` javascript
41
- const json2toml = require('json2toml');
42
- ```
43
-
44
- ### json2toml(hash, options = {})
45
-
46
- Converts an _Object_ `hash` to TOML, and returns the result as a _String_.
47
-
48
- - `options.indent`: Number of spaces for indentation.
49
- - `options.newlineAfterSection`: Whether or not to output a newline after the
50
- last pair in a hash if that hash wasn't empty.
51
-
52
- Throws a `TypeError` if `undefined`, `null`, or a sparse array is encountered.
@@ -1,13 +0,0 @@
1
- declare function _exports(hash: object, options?: Options): string;
2
- export = _exports;
3
- export type Options = {
4
- /**
5
- * Number of spaces for indentation.
6
- */
7
- indent?: number | undefined;
8
- /**
9
- * Whether or not to output a newline
10
- * after the last pair in a hash if that hash wasn't empty.
11
- */
12
- newlineAfterSection?: boolean | undefined;
13
- };
@@ -1,160 +0,0 @@
1
- 'use strict';
2
-
3
- const isDate = require('lodash.isdate');
4
- const isEmpty = require('lodash.isempty');
5
- const isPlainObject = require('lodash.isplainobject');
6
- const strftime = require('strftime');
7
-
8
- /**
9
- * @typedef {object} Options
10
- * @property {number} [indent] Number of spaces for indentation.
11
- * @property {boolean} [newlineAfterSection] Whether or not to output a newline
12
- * after the last pair in a hash if that hash wasn't empty.
13
- */
14
-
15
- /**
16
- * @param {unknown} obj
17
- * @returns {string}
18
- */
19
- function format(obj) {
20
- return isDate(obj)
21
- ? strftime('%FT%TZ', obj)
22
- : JSON.stringify(obj);
23
- }
24
-
25
- /**
26
- * @param {readonly [string, unknown][]} simplePairs
27
- * @returns {boolean}
28
- */
29
- function isArrayOfTables(simplePairs) {
30
- return simplePairs.some(function(array) {
31
- const value = array[1];
32
- return Array.isArray(value) && isPlainObject(value[0]);
33
- });
34
- }
35
-
36
- /**
37
- * @param {readonly unknown[]} obj
38
- * @returns {boolean}
39
- */
40
- function isObjectArrayOfTables(obj) {
41
- return Array.isArray(obj) && obj.length === 2 && isPlainObject(obj[1][0]);
42
- }
43
-
44
- /**
45
- * @param {readonly unknown[][]} simplePairs
46
- * @returns {boolean}
47
- */
48
- function isLastObjectArrayOfTables(simplePairs) {
49
- const array = simplePairs[simplePairs.length - 1];
50
- return isObjectArrayOfTables(array);
51
- }
52
-
53
- /**
54
- * @param {string} key
55
- * @returns {string}
56
- */
57
- function escapeKey(key) {
58
- return /^[a-zA-Z0-9-_]*$/.test(key)
59
- ? key
60
- : `"${key}"`;
61
- }
62
-
63
- /**
64
- * @param {object} hash
65
- * @param {Options} options
66
- * @returns {string}
67
- */
68
- module.exports = function(hash, options = {}) {
69
- /**
70
- * @param {object} hash
71
- * @param {string} prefix
72
- * @returns {void}
73
- */
74
- function visit(hash, prefix) {
75
- /** @type {[string, object][]} */
76
- const nestedPairs = [];
77
-
78
- /** @type {[string, unknown][]} */
79
- const simplePairs = [];
80
- const indentStr = ''.padStart(options.indent || 0, ' ');
81
-
82
- Object.keys(hash).forEach((key) => {
83
- // @ts-expect-error
84
- const value = hash[key];
85
-
86
- if (value === undefined) {
87
- throw new TypeError(`Cannot convert \`undefined\` at key "${key}" to TOML.`);
88
- }
89
-
90
- if (value === null) {
91
- throw new TypeError(`Cannot convert \`null\` at key "${key}" to TOML.`);
92
- }
93
-
94
- if (
95
- Array.isArray(value)
96
- && value.length > value.filter(() => true).length
97
- ) {
98
- throw new TypeError(`Cannot convert sparse array at key "${key}" to TOML.`);
99
- }
100
-
101
- (isPlainObject(value) ? nestedPairs : simplePairs).push([key, value]);
102
- });
103
-
104
- if (!isEmpty(prefix) && !isEmpty(simplePairs)
105
- && !isArrayOfTables(simplePairs)) {
106
- toml += '[' + prefix + ']\n';
107
- }
108
-
109
- simplePairs.forEach((array) => {
110
- const key = array[0];
111
- const value = array[1];
112
-
113
- if (isObjectArrayOfTables(array)) {
114
- if (simplePairs.indexOf(array) > 0 && options.newlineAfterSection) {
115
- const lastObj = simplePairs[simplePairs.indexOf(array) - 1];
116
- if (!isObjectArrayOfTables(lastObj)) {
117
- toml += '\n';
118
- }
119
- }
120
-
121
- // @ts-expect-error Asserted to be an array at this point.
122
- value.forEach((obj) => {
123
- if (!isEmpty(prefix)) {
124
- toml += '[[' + prefix + '.' + key + ']]\n';
125
- }
126
- else {
127
- toml += '[[' + key + ']]\n';
128
- }
129
- visit(obj, '');
130
- });
131
- }
132
- else {
133
- toml += indentStr + escapeKey(key) + ' = ' + format(value) + '\n';
134
- }
135
- });
136
-
137
- if (!isEmpty(simplePairs) && !isLastObjectArrayOfTables(simplePairs)
138
- && options.newlineAfterSection) {
139
- toml += '\n';
140
- }
141
-
142
- nestedPairs.forEach((array) => {
143
- const key = array[0];
144
- const value = array[1];
145
-
146
- visit(
147
- value,
148
- isEmpty(prefix)
149
- ? escapeKey(key.toString())
150
- : `${prefix}.${escapeKey(key.toString())}`
151
- );
152
- });
153
- }
154
-
155
- let toml = '';
156
-
157
- visit(hash, '');
158
-
159
- return toml;
160
- };
@@ -1,62 +0,0 @@
1
- {
2
- "name": "json2toml",
3
- "version": "6.1.0",
4
- "description": "JSON to TOML converter",
5
- "keywords": [
6
- "json",
7
- "toml"
8
- ],
9
- "repository": "github:kenany/json2toml",
10
- "license": "MIT",
11
- "author": "Kenan Yildirim <kenan@kenany.me> (https://kenany.me/)",
12
- "main": "index.js",
13
- "types": "index.d.ts",
14
- "files": [
15
- "CHANGELOG.md",
16
- "index.d.ts",
17
- "index.js",
18
- "LICENSE.txt"
19
- ],
20
- "directories": {
21
- "test": "test"
22
- },
23
- "engines": {
24
- "node": "18 || >=20"
25
- },
26
- "scripts": {
27
- "clean": "rimraf --glob test/**/*.d.ts *.d.ts",
28
- "lint": "eslint .",
29
- "release": "semantic-release",
30
- "type-coverage": "type-coverage --at-least 96 --detail --strict",
31
- "prebuild": "npm run clean",
32
- "build": "tsc",
33
- "pretest": "npm run build",
34
- "test": "nyc --reporter html --reporter text tape test/*.js",
35
- "prepack": "npm run build"
36
- },
37
- "dependencies": {
38
- "lodash.isdate": "^4.0.1",
39
- "lodash.isempty": "^4.4.0",
40
- "lodash.isplainobject": "^4.0.6",
41
- "strftime": "^0.10.2"
42
- },
43
- "devDependencies": {
44
- "@kenan/eslint-config": "^11.1.3",
45
- "@semantic-release/changelog": "^6.0.3",
46
- "@semantic-release/git": "^10.0.1",
47
- "@tsconfig/node18": "^18.2.2",
48
- "@types/lodash.isdate": "^4.0.9",
49
- "@types/lodash.isempty": "^4.4.9",
50
- "@types/lodash.isplainobject": "^4.0.9",
51
- "@types/strftime": "^0.9.8",
52
- "@types/tape": "^5.6.4",
53
- "conventional-changelog-conventionalcommits": "^7.0.2",
54
- "eslint": "^8.56.0",
55
- "nyc": "^15.1.0",
56
- "rimraf": "^5.0.5",
57
- "semantic-release": "^23.0.2",
58
- "tape": "^5.7.5",
59
- "type-coverage": "^2.27.1",
60
- "typescript": "^5.3.3"
61
- }
62
- }
@@ -1,47 +0,0 @@
1
- Copyright jQuery Foundation and other contributors <https://jquery.org/>
2
-
3
- Based on Underscore.js, copyright Jeremy Ashkenas,
4
- DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
5
-
6
- This software consists of voluntary contributions made by many
7
- individuals. For exact contribution history, see the revision history
8
- available at https://github.com/lodash/lodash
9
-
10
- The following license applies to all parts of this software except as
11
- documented below:
12
-
13
- ====
14
-
15
- Permission is hereby granted, free of charge, to any person obtaining
16
- a copy of this software and associated documentation files (the
17
- "Software"), to deal in the Software without restriction, including
18
- without limitation the rights to use, copy, modify, merge, publish,
19
- distribute, sublicense, and/or sell copies of the Software, and to
20
- permit persons to whom the Software is furnished to do so, subject to
21
- the following conditions:
22
-
23
- The above copyright notice and this permission notice shall be
24
- included in all copies or substantial portions of the Software.
25
-
26
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
27
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
29
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
30
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
31
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
32
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33
-
34
- ====
35
-
36
- Copyright and related rights for sample code are waived via CC0. Sample
37
- code is defined as all source code displayed within the prose of the
38
- documentation.
39
-
40
- CC0: http://creativecommons.org/publicdomain/zero/1.0/
41
-
42
- ====
43
-
44
- Files located in the node_modules and vendor directories are externally
45
- maintained libraries used by this software which have their own
46
- licenses; we recommend you read them, as their terms may differ from the
47
- terms above.
@@ -1,18 +0,0 @@
1
- # lodash.isdate v4.0.1
2
-
3
- The [lodash](https://lodash.com/) method `_.isDate` exported as a [Node.js](https://nodejs.org/) module.
4
-
5
- ## Installation
6
-
7
- Using npm:
8
- ```bash
9
- $ {sudo -H} npm i -g npm
10
- $ npm i --save lodash.isdate
11
- ```
12
-
13
- In Node.js:
14
- ```js
15
- var isDate = require('lodash.isdate');
16
- ```
17
-
18
- See the [documentation](https://lodash.com/docs#isDate) or [package source](https://github.com/lodash/lodash/blob/4.0.1-npm-packages/lodash.isdate) for more details.