projen 0.80.6 → 0.80.7
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/.jsii +41 -41
- package/lib/awscdk/auto-discover.js +5 -5
- package/lib/awscdk/awscdk-app-java.js +1 -1
- package/lib/awscdk/awscdk-app-py.js +1 -1
- package/lib/awscdk/awscdk-app-ts.js +1 -1
- package/lib/awscdk/awscdk-construct.js +2 -2
- package/lib/awscdk/awscdk-deps-java.js +1 -1
- package/lib/awscdk/awscdk-deps-js.js +1 -1
- package/lib/awscdk/awscdk-deps-py.js +1 -1
- package/lib/awscdk/awscdk-deps.js +1 -1
- package/lib/awscdk/cdk-config.js +1 -1
- package/lib/awscdk/cdk-tasks.js +1 -1
- package/lib/awscdk/integration-test.js +1 -1
- package/lib/awscdk/lambda-extension.js +1 -1
- package/lib/awscdk/lambda-function.js +2 -2
- package/lib/build/build-workflow.js +1 -1
- package/lib/cdk/auto-discover-base.js +2 -2
- package/lib/cdk/construct-lib.js +1 -1
- package/lib/cdk/integration-test-base.js +1 -1
- package/lib/cdk/jsii-docgen.js +1 -1
- package/lib/cdk/jsii-project.js +1 -1
- package/lib/cdk8s/auto-discover.js +2 -2
- package/lib/cdk8s/cdk8s-app-py.js +1 -1
- package/lib/cdk8s/cdk8s-app-ts.js +1 -1
- package/lib/cdk8s/cdk8s-construct.js +1 -1
- package/lib/cdk8s/cdk8s-deps-py.js +1 -1
- package/lib/cdk8s/cdk8s-deps.js +1 -1
- package/lib/cdk8s/integration-test.js +1 -1
- package/lib/cdktf/cdktf-construct.js +1 -1
- package/lib/circleci/circleci.js +1 -1
- package/lib/component.js +1 -1
- package/lib/dependencies.js +1 -1
- package/lib/dev-env.js +1 -1
- package/lib/docker-compose/docker-compose-service.js +1 -1
- package/lib/docker-compose/docker-compose.js +1 -1
- package/lib/file.js +1 -1
- package/lib/gitattributes.js +1 -1
- package/lib/github/actions-provider.js +1 -1
- package/lib/github/auto-approve.js +1 -1
- package/lib/github/auto-merge.js +1 -1
- package/lib/github/dependabot.js +1 -1
- package/lib/github/github-credentials.js +1 -1
- package/lib/github/github-project.js +1 -1
- package/lib/github/github.js +1 -1
- package/lib/github/mergify.js +1 -1
- package/lib/github/pr-template.js +1 -1
- package/lib/github/pull-request-lint.js +1 -1
- package/lib/github/stale.js +1 -1
- package/lib/github/task-workflow-job.js +1 -1
- package/lib/github/task-workflow.js +1 -1
- package/lib/github/workflow-actions.js +1 -1
- package/lib/github/workflow-jobs.js +1 -1
- package/lib/github/workflow-steps.js +1 -1
- package/lib/github/workflows.js +1 -1
- package/lib/gitlab/configuration.js +1 -1
- package/lib/gitlab/gitlab-configuration.js +1 -1
- package/lib/gitlab/nested-configuration.js +1 -1
- package/lib/gitpod.js +1 -1
- package/lib/ignore-file.js +1 -1
- package/lib/ini.js +1 -1
- package/lib/java/java-project.js +1 -1
- package/lib/java/junit.js +1 -1
- package/lib/java/maven-compile.js +1 -1
- package/lib/java/maven-packaging.js +1 -1
- package/lib/java/maven-sample.js +1 -1
- package/lib/java/pom.js +1 -1
- package/lib/java/projenrc.js +1 -1
- package/lib/javascript/bundler.js +1 -1
- package/lib/javascript/eslint.js +1 -1
- package/lib/javascript/jest.js +4 -4
- package/lib/javascript/license-checker.js +1 -1
- package/lib/javascript/node-package.js +1 -1
- package/lib/javascript/node-project.js +1 -1
- package/lib/javascript/npm-config.js +1 -1
- package/lib/javascript/prettier.js +1 -1
- package/lib/javascript/projenrc.js +1 -1
- package/lib/javascript/typescript-config.js +2 -2
- package/lib/javascript/upgrade-dependencies.js +2 -2
- package/lib/javascript/yarnrc.js +1 -1
- package/lib/json-patch.js +1 -1
- package/lib/json.js +1 -1
- package/lib/license.js +1 -1
- package/lib/logger.js +1 -1
- package/lib/makefile.js +1 -1
- package/lib/object-file.js +1 -1
- package/lib/project-build.js +1 -1
- package/lib/project-tree.js +1 -1
- package/lib/project.js +1 -1
- package/lib/projects.js +1 -1
- package/lib/projenrc-json.js +2 -2
- package/lib/projenrc.js +1 -1
- package/lib/python/pip.js +1 -1
- package/lib/python/poetry.d.ts +7 -3
- package/lib/python/poetry.js +43 -21
- package/lib/python/projenrc.js +1 -1
- package/lib/python/pytest-sample.js +1 -1
- package/lib/python/pytest.js +1 -1
- package/lib/python/python-project.js +1 -1
- package/lib/python/python-sample.js +1 -1
- package/lib/python/requirements-file.js +1 -1
- package/lib/python/setuppy.js +1 -1
- package/lib/python/setuptools.js +1 -1
- package/lib/python/venv.js +1 -1
- package/lib/readme.js +1 -1
- package/lib/release/publisher.js +1 -1
- package/lib/release/release-trigger.js +1 -1
- package/lib/release/release.js +1 -1
- package/lib/renovatebot.js +1 -1
- package/lib/sample-file.js +2 -2
- package/lib/semver.js +1 -1
- package/lib/source-code.js +1 -1
- package/lib/task-runtime.js +1 -1
- package/lib/task.js +1 -1
- package/lib/tasks.js +1 -1
- package/lib/testing.js +1 -1
- package/lib/textfile.js +1 -1
- package/lib/toml.js +10 -8
- package/lib/typescript/projenrc-ts.js +1 -1
- package/lib/typescript/projenrc.js +1 -1
- package/lib/typescript/typescript-typedoc.js +1 -1
- package/lib/typescript/typescript.js +6 -6
- package/lib/version.js +2 -2
- package/lib/vscode/devcontainer.js +1 -1
- package/lib/vscode/extensions.js +1 -1
- package/lib/vscode/launch-config.js +1 -1
- package/lib/vscode/settings.js +1 -1
- package/lib/vscode/vscode.js +1 -1
- package/lib/web/next.js +3 -3
- package/lib/web/postcss.js +1 -1
- package/lib/web/react.js +4 -4
- package/lib/web/tailwind.js +1 -1
- package/lib/xmlfile.js +1 -1
- package/lib/yaml.js +1 -1
- package/node_modules/json2toml/CHANGELOG.md +128 -0
- package/node_modules/json2toml/LICENSE.txt +18 -0
- package/node_modules/json2toml/README.md +52 -0
- package/node_modules/json2toml/index.d.ts +13 -0
- package/node_modules/json2toml/index.js +160 -0
- package/node_modules/json2toml/package.json +62 -0
- package/node_modules/lodash.isdate/LICENSE +47 -0
- package/node_modules/lodash.isdate/README.md +18 -0
- package/node_modules/lodash.isdate/index.js +119 -0
- package/node_modules/lodash.isdate/package.json +17 -0
- package/node_modules/lodash.isempty/LICENSE +47 -0
- package/node_modules/lodash.isempty/README.md +18 -0
- package/node_modules/lodash.isempty/index.js +582 -0
- package/node_modules/lodash.isempty/package.json +17 -0
- package/node_modules/lodash.isplainobject/LICENSE +47 -0
- package/node_modules/lodash.isplainobject/README.md +18 -0
- package/node_modules/lodash.isplainobject/index.js +139 -0
- package/node_modules/lodash.isplainobject/package.json +17 -0
- package/node_modules/strftime/Changelog.md +286 -0
- package/node_modules/strftime/Makefile +15 -0
- package/node_modules/strftime/Readme.md +208 -0
- package/node_modules/strftime/bower.json +13 -0
- package/node_modules/strftime/component.json +16 -0
- package/node_modules/strftime/package.json +53 -0
- package/node_modules/strftime/strftime-min.js +21 -0
- package/node_modules/strftime/strftime.js +854 -0
- package/node_modules/strftime/test.js +271 -0
- package/package.json +4 -3
- package/node_modules/@iarna/toml/LICENSE +0 -14
- package/node_modules/@iarna/toml/README.md +0 -301
- package/node_modules/@iarna/toml/index.d.ts +0 -57
- package/node_modules/@iarna/toml/lib/create-date.js +0 -23
- package/node_modules/@iarna/toml/lib/create-datetime-float.js +0 -24
- package/node_modules/@iarna/toml/lib/create-datetime.js +0 -10
- package/node_modules/@iarna/toml/lib/create-time.js +0 -22
- package/node_modules/@iarna/toml/lib/format-num.js +0 -6
- package/node_modules/@iarna/toml/lib/parser-debug.js +0 -60
- package/node_modules/@iarna/toml/lib/parser.js +0 -127
- package/node_modules/@iarna/toml/lib/toml-parser.js +0 -1379
- package/node_modules/@iarna/toml/package.json +0 -82
- package/node_modules/@iarna/toml/parse-async.js +0 -30
- package/node_modules/@iarna/toml/parse-pretty-error.js +0 -33
- package/node_modules/@iarna/toml/parse-stream.js +0 -80
- package/node_modules/@iarna/toml/parse-string.js +0 -18
- package/node_modules/@iarna/toml/parse.js +0 -5
- package/node_modules/@iarna/toml/stringify.js +0 -296
- package/node_modules/@iarna/toml/toml.js +0 -3
|
@@ -0,0 +1,128 @@
|
|
|
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))
|
|
@@ -0,0 +1,18 @@
|
|
|
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.
|
|
@@ -0,0 +1,52 @@
|
|
|
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.
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,160 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
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.
|
|
@@ -0,0 +1,18 @@
|
|
|
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.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* lodash (Custom Build) <https://lodash.com/>
|
|
3
|
+
* Build: `lodash modularize exports="npm" -o ./`
|
|
4
|
+
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
|
5
|
+
* Released under MIT license <https://lodash.com/license>
|
|
6
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
7
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** `Object#toString` result references. */
|
|
11
|
+
var dateTag = '[object Date]';
|
|
12
|
+
|
|
13
|
+
/** Detect free variable `global` from Node.js. */
|
|
14
|
+
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
|
15
|
+
|
|
16
|
+
/** Detect free variable `exports`. */
|
|
17
|
+
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
|
|
18
|
+
|
|
19
|
+
/** Detect free variable `module`. */
|
|
20
|
+
var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
|
|
21
|
+
|
|
22
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
|
23
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
24
|
+
|
|
25
|
+
/** Detect free variable `process` from Node.js. */
|
|
26
|
+
var freeProcess = moduleExports && freeGlobal.process;
|
|
27
|
+
|
|
28
|
+
/** Used to access faster Node.js helpers. */
|
|
29
|
+
var nodeUtil = (function() {
|
|
30
|
+
try {
|
|
31
|
+
return freeProcess && freeProcess.binding('util');
|
|
32
|
+
} catch (e) {}
|
|
33
|
+
}());
|
|
34
|
+
|
|
35
|
+
/* Node.js helper references. */
|
|
36
|
+
var nodeIsDate = nodeUtil && nodeUtil.isDate;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The base implementation of `_.unary` without support for storing metadata.
|
|
40
|
+
*
|
|
41
|
+
* @private
|
|
42
|
+
* @param {Function} func The function to cap arguments for.
|
|
43
|
+
* @returns {Function} Returns the new capped function.
|
|
44
|
+
*/
|
|
45
|
+
function baseUnary(func) {
|
|
46
|
+
return function(value) {
|
|
47
|
+
return func(value);
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Used for built-in method references. */
|
|
52
|
+
var objectProto = Object.prototype;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Used to resolve the
|
|
56
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
|
57
|
+
* of values.
|
|
58
|
+
*/
|
|
59
|
+
var objectToString = objectProto.toString;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The base implementation of `_.isDate` without Node.js optimizations.
|
|
63
|
+
*
|
|
64
|
+
* @private
|
|
65
|
+
* @param {*} value The value to check.
|
|
66
|
+
* @returns {boolean} Returns `true` if `value` is a date object, else `false`.
|
|
67
|
+
*/
|
|
68
|
+
function baseIsDate(value) {
|
|
69
|
+
return isObjectLike(value) && objectToString.call(value) == dateTag;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Checks if `value` is classified as a `Date` object.
|
|
74
|
+
*
|
|
75
|
+
* @static
|
|
76
|
+
* @memberOf _
|
|
77
|
+
* @since 0.1.0
|
|
78
|
+
* @category Lang
|
|
79
|
+
* @param {*} value The value to check.
|
|
80
|
+
* @returns {boolean} Returns `true` if `value` is a date object, else `false`.
|
|
81
|
+
* @example
|
|
82
|
+
*
|
|
83
|
+
* _.isDate(new Date);
|
|
84
|
+
* // => true
|
|
85
|
+
*
|
|
86
|
+
* _.isDate('Mon April 23 2012');
|
|
87
|
+
* // => false
|
|
88
|
+
*/
|
|
89
|
+
var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
93
|
+
* and has a `typeof` result of "object".
|
|
94
|
+
*
|
|
95
|
+
* @static
|
|
96
|
+
* @memberOf _
|
|
97
|
+
* @since 4.0.0
|
|
98
|
+
* @category Lang
|
|
99
|
+
* @param {*} value The value to check.
|
|
100
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
101
|
+
* @example
|
|
102
|
+
*
|
|
103
|
+
* _.isObjectLike({});
|
|
104
|
+
* // => true
|
|
105
|
+
*
|
|
106
|
+
* _.isObjectLike([1, 2, 3]);
|
|
107
|
+
* // => true
|
|
108
|
+
*
|
|
109
|
+
* _.isObjectLike(_.noop);
|
|
110
|
+
* // => false
|
|
111
|
+
*
|
|
112
|
+
* _.isObjectLike(null);
|
|
113
|
+
* // => false
|
|
114
|
+
*/
|
|
115
|
+
function isObjectLike(value) {
|
|
116
|
+
return !!value && typeof value == 'object';
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
module.exports = isDate;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "lodash.isdate",
|
|
3
|
+
"version": "4.0.1",
|
|
4
|
+
"description": "The lodash method `_.isDate` exported as a module.",
|
|
5
|
+
"homepage": "https://lodash.com/",
|
|
6
|
+
"icon": "https://lodash.com/icon.svg",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"keywords": "lodash-modularized, isdate",
|
|
9
|
+
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
|
10
|
+
"contributors": [
|
|
11
|
+
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
|
12
|
+
"Blaine Bublitz <blaine.bublitz@gmail.com> (https://github.com/phated)",
|
|
13
|
+
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
|
|
14
|
+
],
|
|
15
|
+
"repository": "lodash/lodash",
|
|
16
|
+
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }
|
|
17
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
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.
|