Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
e49ee755d7 | |||
faa88ab8a8 | |||
5857adf6fe | |||
365511fee3 | |||
c7899742fe | |||
268224529b |
@ -12,6 +12,9 @@ stages:
|
||||
- release
|
||||
- metadata
|
||||
|
||||
before_script:
|
||||
- npm install -g @shipzone/npmci
|
||||
|
||||
# ====================
|
||||
# security stage
|
||||
# ====================
|
||||
@ -36,6 +39,7 @@ auditProductionDependencies:
|
||||
- npmci command npm audit --audit-level=high --only=prod --production
|
||||
tags:
|
||||
- docker
|
||||
allow_failure: true
|
||||
|
||||
auditDevDependencies:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
@ -96,10 +100,9 @@ codequality:
|
||||
only:
|
||||
- tags
|
||||
script:
|
||||
- npmci command npm install -g tslint typescript
|
||||
- npmci command npm install -g typescript
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
|
24
.vscode/launch.json
vendored
24
.vscode/launch.json
vendored
@ -2,28 +2,10 @@
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "current file",
|
||||
"type": "node",
|
||||
"command": "npm test",
|
||||
"name": "Run npm test",
|
||||
"request": "launch",
|
||||
"args": [
|
||||
"${relativeFile}"
|
||||
],
|
||||
"runtimeArgs": ["-r", "@gitzone/tsrun"],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"protocol": "inspector",
|
||||
"internalConsoleOptions": "openOnSessionStart"
|
||||
},
|
||||
{
|
||||
"name": "test.ts",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"args": [
|
||||
"test/test.ts"
|
||||
],
|
||||
"runtimeArgs": ["-r", "@gitzone/tsrun"],
|
||||
"cwd": "${workspaceRoot}",
|
||||
"protocol": "inspector",
|
||||
"internalConsoleOptions": "openOnSessionStart"
|
||||
"type": "node-terminal"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
"githost": "gitlab.com",
|
||||
"gitscope": "pushrocks",
|
||||
"gitrepo": "smartyaml",
|
||||
"shortDescription": "handle yaml in smart ways",
|
||||
"description": "handle yaml in smart ways",
|
||||
"npmPackagename": "@pushrocks/smartyaml",
|
||||
"license": "MIT"
|
||||
}
|
||||
|
16378
package-lock.json
generated
16378
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
17
package.json
17
package.json
@ -1,10 +1,11 @@
|
||||
{
|
||||
"name": "@pushrocks/smartyaml",
|
||||
"version": "2.0.4",
|
||||
"version": "3.0.1",
|
||||
"private": false,
|
||||
"description": "handle yaml in smart ways",
|
||||
"main": "dist_ts/index.js",
|
||||
"typings": "dist_ts/index.d.ts",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"test": "(tstest test/ --web)",
|
||||
"build": "(tsbuild --web)"
|
||||
@ -24,15 +25,15 @@
|
||||
},
|
||||
"homepage": "https://gitlab.com/pushrocks/smartyaml#README",
|
||||
"dependencies": {
|
||||
"@types/js-yaml": "^3.12.5",
|
||||
"js-yaml": "^3.14.0"
|
||||
"@types/js-yaml": "^4.0.5",
|
||||
"js-yaml": "^4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.25",
|
||||
"@gitzone/tsrun": "^1.2.12",
|
||||
"@gitzone/tstest": "^1.0.52",
|
||||
"@pushrocks/tapbundle": "^3.2.9",
|
||||
"@types/node": "^14.14.3"
|
||||
"@gitzone/tsbuild": "^2.1.61",
|
||||
"@gitzone/tsrun": "^1.2.32",
|
||||
"@gitzone/tstest": "^1.0.71",
|
||||
"@pushrocks/tapbundle": "^5.0.3",
|
||||
"@types/node": "^17.0.35"
|
||||
},
|
||||
"browserslist": [
|
||||
"last 1 chrome versions"
|
||||
|
@ -27,14 +27,6 @@ Platform support | [
|
||||
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||
|
||||
[](https://push.rocks)
|
||||
|
||||
|
||||
## Contribution
|
||||
|
||||
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { expect, tap } from '@pushrocks/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: '@pushrocks/smartyaml',
|
||||
version: '3.0.1',
|
||||
description: 'handle yaml in smart ways'
|
||||
}
|
@ -1,15 +1,15 @@
|
||||
import * as plugins from './smartyaml.plugins';
|
||||
import * as plugins from './smartyaml.plugins.js';
|
||||
|
||||
export let yamlStringToObject = async (
|
||||
yamlStringArg,
|
||||
optionsArg: plugins.jsYaml.LoadOptions = {}
|
||||
): Promise<any> => {
|
||||
return plugins.jsYaml.safeLoad(yamlStringArg);
|
||||
return plugins.jsYaml.load(yamlStringArg);
|
||||
};
|
||||
|
||||
export let objectToYamlString = async (
|
||||
objectArg,
|
||||
optionsArg: plugins.jsYaml.DumpOptions = {}
|
||||
): Promise<string> => {
|
||||
return plugins.jsYaml.safeDump(objectArg);
|
||||
return plugins.jsYaml.dump(objectArg);
|
||||
};
|
||||
|
17
tslint.json
17
tslint.json
@ -1,17 +0,0 @@
|
||||
{
|
||||
"extends": ["tslint:latest", "tslint-config-prettier"],
|
||||
"rules": {
|
||||
"semicolon": [true, "always"],
|
||||
"no-console": false,
|
||||
"ordered-imports": false,
|
||||
"object-literal-sort-keys": false,
|
||||
"member-ordering": {
|
||||
"options":{
|
||||
"order": [
|
||||
"static-method"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"defaultSeverity": "warning"
|
||||
}
|
Reference in New Issue
Block a user