🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@oclif/plugin-command-snapshot

Package Overview
Dependencies
Maintainers
5
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oclif/plugin-command-snapshot - npm Package Compare versions

Comparing version
2.1.1
to
2.1.2
+7
-0
CHANGELOG.md

@@ -5,2 +5,9 @@ # Changelog

### [2.1.2](https://github.com/oclif/plugin-command-snapshot/compare/v2.1.1...v2.1.2) (2021-06-07)
### Bug Fixes
* disallow void return type ([4655cfd](https://github.com/oclif/plugin-command-snapshot/commit/4655cfd86eb1429c6b0a8b036bb22e43336b6e09))
### [2.1.1](https://github.com/oclif/plugin-command-snapshot/compare/v2.1.0...v2.1.1) (2021-06-04)

@@ -7,0 +14,0 @@

+5
-5

@@ -64,3 +64,2 @@ "use strict";

}
this.validateReturnType(returnType);
const commandId = this.determineCommandId(contents);

@@ -70,12 +69,13 @@ if (!commandId) {

}
this.validateReturnType(returnType, commandId);
return { returnType, commandId };
}
validateReturnType(returnType) {
const notAllowed = ['any', 'unknown'];
validateReturnType(returnType, commandId) {
const notAllowed = ['any', 'unknown', 'void'];
const vaugeTypes = ['JsonMap', 'JsonCollection', 'AnyJson'];
if (notAllowed.includes(returnType)) {
throw new Error(`${returnType} is not allowed. Please use a more specific type.`);
throw new Error(`${returnType} (from ${commandId}) is not allowed. Please use a more specific type.`);
}
else if (vaugeTypes.includes(returnType)) {
throw new Error(`${returnType} is too vauge. Please use a more specific type.`);
throw new Error(`${returnType} (from ${commandId}) is too vauge. Please use a more specific type.`);
}

@@ -82,0 +82,0 @@ }

@@ -1,1 +0,1 @@

{"version":"2.1.1","commands":{"schema:compare":{"id":"schema:compare","pluginName":"@oclif/plugin-command-snapshot","pluginType":"core","aliases":[],"flags":{"filepath":{"name":"filepath","type":"option","description":"path of the generated snapshot file","default":"./schemas"}},"args":[]},"schema:generate":{"id":"schema:generate","pluginName":"@oclif/plugin-command-snapshot","pluginType":"core","aliases":[],"flags":{"filepath":{"name":"filepath","type":"option","description":"directory to save the generated schema files; can use \"{version}\" to insert the current CLI/plugin version","default":"./schemas"},"singlefile":{"name":"singlefile","type":"boolean","description":"put generated schema into a single file","allowNo":false}},"args":[]},"snapshot:compare":{"id":"snapshot:compare","pluginName":"@oclif/plugin-command-snapshot","pluginType":"core","aliases":[],"flags":{"filepath":{"name":"filepath","type":"option","description":"path of the generated snapshot file","default":"./command-snapshot.json"}},"args":[]},"snapshot:generate":{"id":"snapshot:generate","pluginName":"@oclif/plugin-command-snapshot","pluginType":"core","aliases":[],"flags":{"filepath":{"name":"filepath","type":"option","description":"path to save the generated snapshot file; can use \"{version}\" to replace the current CLI/plugin version","default":"./command-snapshot.json"}},"args":[]}}}
{"version":"2.1.2","commands":{"schema:compare":{"id":"schema:compare","pluginName":"@oclif/plugin-command-snapshot","pluginType":"core","aliases":[],"flags":{"filepath":{"name":"filepath","type":"option","description":"path of the generated snapshot file","default":"./schemas"}},"args":[]},"schema:generate":{"id":"schema:generate","pluginName":"@oclif/plugin-command-snapshot","pluginType":"core","aliases":[],"flags":{"filepath":{"name":"filepath","type":"option","description":"directory to save the generated schema files; can use \"{version}\" to insert the current CLI/plugin version","default":"./schemas"},"singlefile":{"name":"singlefile","type":"boolean","description":"put generated schema into a single file","allowNo":false}},"args":[]},"snapshot:compare":{"id":"snapshot:compare","pluginName":"@oclif/plugin-command-snapshot","pluginType":"core","aliases":[],"flags":{"filepath":{"name":"filepath","type":"option","description":"path of the generated snapshot file","default":"./command-snapshot.json"}},"args":[]},"snapshot:generate":{"id":"snapshot:generate","pluginName":"@oclif/plugin-command-snapshot","pluginType":"core","aliases":[],"flags":{"filepath":{"name":"filepath","type":"option","description":"path to save the generated snapshot file; can use \"{version}\" to replace the current CLI/plugin version","default":"./command-snapshot.json"}},"args":[]}}}
{
"name": "@oclif/plugin-command-snapshot",
"description": "generates and compares OCLIF plugins snapshot files",
"version": "2.1.1",
"version": "2.1.2",
"author": "Ramyasri @nramyasri-sf",

@@ -6,0 +6,0 @@ "bugs": "https://github.com/oclif/plugin-command-snapshot/issues",