New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

yaml-validator-typescript

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yaml-validator-typescript - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

2

package.json

@@ -5,3 +5,3 @@ {

"homepage": "https://github.com/Milihhard/yaml-validator-typescript#readme",
"version": "1.1.1",
"version": "1.1.2",
"keywords": [

@@ -8,0 +8,0 @@ "yaml",

@@ -21,2 +21,35 @@ # yaml-validator-typescript

## Define your modele
You can set you model as you want. You just need to have properties initialized
If you don't want some property to be tested, you can implement `Yaml`
```javascript
class TestOnlyKeys implements Yaml {
keysToTest: (keyof TestOnlyKeys)[] = ['key1', 'key2'];
key1: string = '';
key2: number = 0;
keyNotToTest: boolean = false;
}
```
> Here only `key1` and `key2` are tested
> You can also set some properties optionals:
```javascript
class Optional implements Yaml {
keysToTest: string[] = ['valueToHave', 'valueOptional', 'arrayOptional'];
optionals: Set<string> = new Set(['valueOptional', 'arrayOptional']);
valueToHave: string = '';
valueOptional: string = '';
arrayOptional: {valueYouNeed1: string, valueYouNeed2: boolean}[] = [
{valueYouNeed1: '', valueYouNeed2: true},
];
}
```
> Here `valueOptional` and `arrayOptional` are optionals
> But if `arrayOptional` is defined, he has to be right
### As a command

@@ -23,0 +56,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc