Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
62b28f3feb | |||
329add7000 | |||
be2082e728 | |||
2f3509aff6 | |||
a866fce716 | |||
dc8a3944d5 | |||
46602bcb44 | |||
343c7dbe8b | |||
3a2d1f67b2 | |||
d59385c339 | |||
42abd689d3 | |||
e49ee755d7 | |||
faa88ab8a8 | |||
5857adf6fe | |||
365511fee3 | |||
c7899742fe | |||
268224529b | |||
0d51d9b4ef | |||
0dd48b4854 |
19
.gitignore
vendored
19
.gitignore
vendored
@ -1,5 +1,20 @@
|
||||
node_modules/
|
||||
.nogit/
|
||||
|
||||
# artifacts
|
||||
coverage/
|
||||
public/
|
||||
pages/
|
||||
.nogit/
|
||||
|
||||
# installs
|
||||
node_modules/
|
||||
|
||||
# caches
|
||||
.yarn/
|
||||
.cache/
|
||||
.rpt2_cache
|
||||
|
||||
# builds
|
||||
dist/
|
||||
dist_*/
|
||||
|
||||
# custom
|
118
.gitlab-ci.yml
118
.gitlab-ci.yml
@ -1,16 +1,19 @@
|
||||
# gitzone standard
|
||||
image: hosttoday/ht-docker-node:npmci
|
||||
# gitzone ci_default
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- .npmci_cache/
|
||||
key: "$CI_BUILD_STAGE"
|
||||
key: '$CI_BUILD_STAGE'
|
||||
|
||||
stages:
|
||||
- security
|
||||
- test
|
||||
- release
|
||||
- metadata
|
||||
- security
|
||||
- test
|
||||
- release
|
||||
- metadata
|
||||
|
||||
before_script:
|
||||
- npm install -g @shipzone/npmci
|
||||
|
||||
# ====================
|
||||
# security stage
|
||||
@ -19,56 +22,62 @@ mirror:
|
||||
stage: security
|
||||
script:
|
||||
- npmci git mirror
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
snyk:
|
||||
auditProductionDependencies:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
stage: security
|
||||
script:
|
||||
- npmci command npm install -g snyk
|
||||
- npmci command npm install --ignore-scripts
|
||||
- npmci command snyk test
|
||||
- npmci npm prepare
|
||||
- npmci command npm install --production --ignore-scripts
|
||||
- npmci command npm config set registry https://registry.npmjs.org
|
||||
- npmci command npm audit --audit-level=high --only=prod --production
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
allow_failure: true
|
||||
|
||||
auditDevDependencies:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
stage: security
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci command npm install --ignore-scripts
|
||||
- npmci command npm config set registry https://registry.npmjs.org
|
||||
- npmci command npm audit --audit-level=high --only=dev
|
||||
tags:
|
||||
- docker
|
||||
allow_failure: true
|
||||
|
||||
# ====================
|
||||
# test stage
|
||||
# ====================
|
||||
testLEGACY:
|
||||
stage: test
|
||||
script:
|
||||
- npmci node install legacy
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
allow_failure: true
|
||||
|
||||
testLTS:
|
||||
stage: test
|
||||
script:
|
||||
- npmci node install lts
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
testSTABLE:
|
||||
testStable:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
testBuild:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci command npm run build
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
|
||||
release:
|
||||
stage: release
|
||||
@ -78,6 +87,7 @@ release:
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
@ -86,20 +96,15 @@ release:
|
||||
# ====================
|
||||
codequality:
|
||||
stage: metadata
|
||||
image: docker:stable
|
||||
allow_failure: true
|
||||
services:
|
||||
- docker:stable-dind
|
||||
only:
|
||||
- tags
|
||||
script:
|
||||
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
|
||||
- docker run
|
||||
--env SOURCE_CODE="$PWD"
|
||||
--volume "$PWD":/code
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock
|
||||
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
|
||||
artifacts:
|
||||
paths: [codeclimate.json]
|
||||
- npmci command npm install -g typescript
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- priv
|
||||
|
||||
@ -110,17 +115,20 @@ trigger:
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
pages:
|
||||
image: hosttoday/ht-docker-node:npmci
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci command npm install -g typedoc typescript
|
||||
- npmci node install lts
|
||||
- npmci command npm install -g @git.zone/tsdoc
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
|
||||
- npmci command tsdoc
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
only:
|
||||
@ -130,13 +138,3 @@ pages:
|
||||
paths:
|
||||
- public
|
||||
allow_failure: true
|
||||
|
||||
windowsCompatibility:
|
||||
image: stefanscherer/node-windows:10-build-tools
|
||||
stage: metadata
|
||||
script:
|
||||
- npm install & npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- windows
|
||||
allow_failure: true
|
||||
|
11
.vscode/launch.json
vendored
Normal file
11
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"command": "npm test",
|
||||
"name": "Run npm test",
|
||||
"request": "launch",
|
||||
"type": "node-terminal"
|
||||
}
|
||||
]
|
||||
}
|
26
.vscode/settings.json
vendored
Normal file
26
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"json.schemas": [
|
||||
{
|
||||
"fileMatch": ["/npmextra.json"],
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"npmci": {
|
||||
"type": "object",
|
||||
"description": "settings for npmci"
|
||||
},
|
||||
"gitzone": {
|
||||
"type": "object",
|
||||
"description": "settings for gitzone",
|
||||
"properties": {
|
||||
"projectType": {
|
||||
"type": "string",
|
||||
"enum": ["website", "element", "service", "npm", "wcc"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -2,5 +2,30 @@
|
||||
"npmci": {
|
||||
"globalNpmTools": [],
|
||||
"npmAccessLevel": "public"
|
||||
},
|
||||
"gitzone": {
|
||||
"projectType": "npm",
|
||||
"module": {
|
||||
"githost": "code.foss.global",
|
||||
"gitscope": "push.rocks",
|
||||
"gitrepo": "smartyaml",
|
||||
"description": "A module for smart handling of YAML data with support for converting between YAML strings and JavaScript objects.",
|
||||
"npmPackagename": "@push.rocks/smartyaml",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"YAML",
|
||||
"JavaScript",
|
||||
"data serialization",
|
||||
"conversion",
|
||||
"js-yaml",
|
||||
"TypeScript",
|
||||
"nodejs",
|
||||
"parsing",
|
||||
"stringify"
|
||||
]
|
||||
}
|
||||
},
|
||||
"tsdoc": {
|
||||
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
||||
}
|
||||
}
|
10065
package-lock.json
generated
10065
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
60
package.json
60
package.json
@ -1,37 +1,59 @@
|
||||
{
|
||||
"name": "@pushrocks/smartyaml",
|
||||
"version": "2.0.3",
|
||||
"name": "@push.rocks/smartyaml",
|
||||
"version": "3.0.4",
|
||||
"private": false,
|
||||
"description": "handle yaml in smart ways",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"description": "A module for smart handling of YAML data with support for converting between YAML strings and JavaScript objects.",
|
||||
"main": "dist_ts/index.js",
|
||||
"typings": "dist_ts/index.d.ts",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"test": "(tstest test/)",
|
||||
"build": "(tsbuild)"
|
||||
"test": "(tstest test/ --web)",
|
||||
"build": "(tsbuild --web --allowimplicitany)"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@gitlab.com/pushrocks/smartyaml.git"
|
||||
"url": "https://code.foss.global/push.rocks/smartyaml.git"
|
||||
},
|
||||
"keywords": [
|
||||
"yaml",
|
||||
"lossless"
|
||||
"YAML",
|
||||
"JavaScript",
|
||||
"data serialization",
|
||||
"conversion",
|
||||
"js-yaml",
|
||||
"TypeScript",
|
||||
"nodejs",
|
||||
"parsing",
|
||||
"stringify"
|
||||
],
|
||||
"author": "Lossless GmbH",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://gitlab.com/pushrocks/smartyaml/issues"
|
||||
},
|
||||
"homepage": "https://gitlab.com/pushrocks/smartyaml#README",
|
||||
"homepage": "https://code.foss.global/push.rocks/smartyaml",
|
||||
"dependencies": {
|
||||
"@types/js-yaml": "^3.11.2",
|
||||
"js-yaml": "^3.8.4"
|
||||
"yaml": "^2.4.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.0.22",
|
||||
"@gitzone/tsrun": "^1.1.12",
|
||||
"@gitzone/tstest": "^1.0.15",
|
||||
"@pushrocks/tapbundle": "^3.0.5",
|
||||
"@types/node": "^10.9.2"
|
||||
}
|
||||
"@git.zone/tsbuild": "^2.1.61",
|
||||
"@git.zone/tsrun": "^1.2.32",
|
||||
"@git.zone/tstest": "^1.0.71",
|
||||
"@push.rocks/tapbundle": "^5.0.3",
|
||||
"@types/node": "^20.12.7"
|
||||
},
|
||||
"browserslist": [
|
||||
"last 1 chrome versions"
|
||||
],
|
||||
"files": [
|
||||
"ts/**/*",
|
||||
"ts_web/**/*",
|
||||
"dist/**/*",
|
||||
"dist_*/**/*",
|
||||
"dist_ts/**/*",
|
||||
"dist_ts_web/**/*",
|
||||
"assets/**/*",
|
||||
"cli.js",
|
||||
"npmextra.json",
|
||||
"readme.md"
|
||||
]
|
||||
}
|
4737
pnpm-lock.yaml
generated
Normal file
4737
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
1
readme.hints.md
Normal file
1
readme.hints.md
Normal file
@ -0,0 +1 @@
|
||||
|
149
readme.md
149
readme.md
@ -1,33 +1,134 @@
|
||||
# smartyaml
|
||||
# @push.rocks/smartyaml
|
||||
Handle YAML in smart ways.
|
||||
|
||||
handle yaml in smart ways
|
||||
## Install
|
||||
To use @push.rocks/smartyaml in your project, you need to install it using npm or yarn. Run the following command in your project directory:
|
||||
|
||||
## Availabililty
|
||||
```bash
|
||||
npm install @push.rocks/smartyaml --save
|
||||
```
|
||||
or if you prefer yarn:
|
||||
```bash
|
||||
yarn add @push.rocks/smartyaml
|
||||
```
|
||||
|
||||
[](https://www.npmjs.com/package/smartyaml)
|
||||
[](https://GitLab.com/pushrocks/smartyaml)
|
||||
[](https://github.com/pushrocks/smartyaml)
|
||||
[](https://pushrocks.gitlab.io/smartyaml/)
|
||||
|
||||
## Status for master
|
||||
|
||||
[](https://GitLab.com/pushrocks/smartyaml/commits/master)
|
||||
[](https://GitLab.com/pushrocks/smartyaml/commits/master)
|
||||
[](https://www.npmjs.com/package/smartyaml)
|
||||
[](https://david-dm.org/pushrocks/smartyaml)
|
||||
[](https://www.bithound.io/github/pushrocks/smartyaml/master/dependencies/npm)
|
||||
[](https://www.bithound.io/github/pushrocks/smartyaml)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](http://standardjs.com/)
|
||||
This will add @push.rocks/smartyaml to your project's dependencies and enable you to start using the library to handle YAML data in a smart way.
|
||||
|
||||
## Usage
|
||||
|
||||
Use TypeScript for best in class instellisense.
|
||||
To utilize @push.rocks/smartyaml in your TypeScript project, simply import the desired functionality from the package. This library streamlines YAML data handling by providing straightforward functions for converting YAML strings to objects and vice versa. Let's dive into how you can leverage these capabilities in your applications.
|
||||
|
||||
For further information read the linked docs at the top of this README.
|
||||
### Basic Conversion: YAML String to JavaScript Object
|
||||
|
||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||
Imagine you're building an application that needs to process configuration files stored in YAML format. With @push.rocks/smartyaml, converting these YAML strings into JavaScript objects for easy manipulation is a breeze.
|
||||
|
||||
[](https://push.rocks)
|
||||
First, here's how you import the function to convert a YAML string to a JavaScript object:
|
||||
|
||||
```typescript
|
||||
import { yamlStringToObject } from '@push.rocks/smartyaml';
|
||||
```
|
||||
|
||||
Assuming you have a YAML string like this:
|
||||
|
||||
```yaml
|
||||
name: John Doe
|
||||
age: 30
|
||||
address:
|
||||
street: 1234 Somewhere Street
|
||||
city: Anytown
|
||||
zip: '12345'
|
||||
```
|
||||
|
||||
You can convert it to a JavaScript object as follows:
|
||||
|
||||
```typescript
|
||||
const yamlExample = `
|
||||
name: John Doe
|
||||
age: 30
|
||||
address:
|
||||
street: 1234 Somewhere Street
|
||||
city: Anytown
|
||||
zip: '12345'
|
||||
`;
|
||||
|
||||
async function convertYamlToObject() {
|
||||
try {
|
||||
const yamlObject = await yamlStringToObject(yamlExample);
|
||||
console.log(yamlObject);
|
||||
/*
|
||||
* Output:
|
||||
* {
|
||||
* name: 'John Doe',
|
||||
* age: 30,
|
||||
* address: { street: '1234 Somewhere Street', city: 'Anytown', zip: '12345' }
|
||||
* }
|
||||
*/
|
||||
} catch (error) {
|
||||
console.error(`Error converting YAML to object: ${error}`);
|
||||
}
|
||||
}
|
||||
|
||||
convertYamlToObject();
|
||||
```
|
||||
|
||||
### Converting JavaScript Objects back into YAML Strings
|
||||
|
||||
Let's say you've now manipulated your configuration data, and you want to save these changes back in a YAML file. @push.rocks/smartyaml provides a handy function for that:
|
||||
|
||||
```typescript
|
||||
import { objectToYamlString } from '@push.rocks/smartyaml';
|
||||
```
|
||||
|
||||
Considering you have a JavaScript object like this:
|
||||
|
||||
```typescript
|
||||
const jsObject = {
|
||||
name: 'John Doe',
|
||||
age: 30,
|
||||
address: {
|
||||
street: '1234 Somewhere Street',
|
||||
city: 'Anytown',
|
||||
zip: '12345'
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
You can convert it to a YAML string as follows:
|
||||
|
||||
```typescript
|
||||
async function convertObjectToYaml() {
|
||||
try {
|
||||
const yamlString = await objectToYamlString(jsObject);
|
||||
console.log(yamlString);
|
||||
/*
|
||||
* Output:
|
||||
* "name: John Doe\nage: 30\naddress:\n street: 1234 Somewhere Street\n city: Anytown\n zip: '12345'\n"
|
||||
*/
|
||||
} catch (error) {
|
||||
console.error(`Error converting object to YAML: ${error}`);
|
||||
}
|
||||
}
|
||||
|
||||
convertObjectToYaml();
|
||||
```
|
||||
|
||||
These simple examples illustrate how @push.rocks/smartyaml greatly simplifies the process of converting between YAML strings and JavaScript objects, making it a valuable tool for managing configuration files or any data stored in YAML format in your TypeScript project.
|
||||
|
||||
## License and Legal Information
|
||||
|
||||
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
|
||||
|
||||
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
|
||||
|
||||
### Trademarks
|
||||
|
||||
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
|
||||
|
||||
### Company Information
|
||||
|
||||
Task Venture Capital GmbH
|
||||
Registered at District court Bremen HRB 35230 HB, Germany
|
||||
|
||||
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
|
||||
|
||||
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import { expect, tap } from '@push.rocks/tapbundle';
|
||||
|
||||
import * as smartyaml from '../ts/index';
|
||||
import * as smartyaml from '../ts/index.js';
|
||||
|
||||
let yamlString = `someKey: someValue
|
||||
someKey2: someValue2
|
||||
@ -8,21 +8,21 @@ someKey2: someValue2
|
||||
|
||||
tap.test('should convert yaml string to object', async () => {
|
||||
let myObject = await smartyaml.yamlStringToObject(yamlString);
|
||||
expect(myObject.someKey).to.equal('someValue');
|
||||
expect(myObject.someKey2).to.equal('someValue2');
|
||||
expect(myObject.someKey).toEqual('someValue');
|
||||
expect(myObject.someKey2).toEqual('someValue2');
|
||||
});
|
||||
|
||||
tap.test('should convert an object to a string', async () => {
|
||||
let myObject = await smartyaml.yamlStringToObject(yamlString);
|
||||
let myString = await smartyaml.objectToYamlString(myObject);
|
||||
expect(myString).to.equal(yamlString);
|
||||
expect(myString).toEqual(yamlString);
|
||||
});
|
||||
|
||||
// test some behaviours
|
||||
tap.test('should allow dots in key', async () => {
|
||||
let testString = `myKey.with.dots: some`;
|
||||
let testObject = await smartyaml.yamlStringToObject(testString);
|
||||
expect(testObject['myKey.with.dots']).to.equal('some');
|
||||
expect(testObject['myKey.with.dots']).toEqual('some');
|
||||
});
|
||||
|
||||
tap.start();
|
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartyaml',
|
||||
version: '3.0.4',
|
||||
description: 'A module for smart handling of YAML data with support for converting between YAML strings and JavaScript objects.'
|
||||
}
|
16
ts/index.ts
16
ts/index.ts
@ -1,15 +1,17 @@
|
||||
import * as plugins from './smartyaml.plugins';
|
||||
import * as plugins from './smartyaml.plugins.js';
|
||||
|
||||
export let yamlStringToObject = async (
|
||||
yamlStringArg,
|
||||
optionsArg: plugins.jsYaml.LoadOptions = {}
|
||||
yamlStringArg: string,
|
||||
): Promise<any> => {
|
||||
return plugins.jsYaml.safeLoad(yamlStringArg);
|
||||
return plugins.yaml.parse(yamlStringArg);
|
||||
};
|
||||
|
||||
export let objectToYamlString = async (
|
||||
objectArg,
|
||||
optionsArg: plugins.jsYaml.DumpOptions = {}
|
||||
objectArg
|
||||
): Promise<string> => {
|
||||
return plugins.jsYaml.safeDump(objectArg);
|
||||
return plugins.yaml.stringify(objectArg);
|
||||
};
|
||||
|
||||
export let getYamlDocFromString = async (stringArg: string) => {
|
||||
return plugins.yaml.parseDocument(stringArg);
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
import * as jsYaml from 'js-yaml';
|
||||
import * as yaml from 'yaml';
|
||||
|
||||
export { jsYaml };
|
||||
export { yaml };
|
||||
|
14
tsconfig.json
Normal file
14
tsconfig.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"experimentalDecorators": true,
|
||||
"useDefineForClassFields": false,
|
||||
"target": "ES2022",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"esModuleInterop": true,
|
||||
"verbatimModuleSyntax": true
|
||||
},
|
||||
"exclude": [
|
||||
"dist_*/**/*.d.ts"
|
||||
]
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"extends": "tslint-config-standard"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user