homey-lib
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -60,3 +60,3 @@ 'use strict'; | ||
if( !VALIDATION_LEVELS.includes(level) ) | ||
throw new Error('Invalid validation level'); | ||
throw new Error(`Invalid validation level. Allowed levels are: ${VALIDATION_LEVELS}`); | ||
@@ -82,2 +82,5 @@ const levelPublish = ( level === 'publish' ); | ||
if( !App.isValidId(appJson.id) ) | ||
throw new Error('Invalid id'); | ||
// validate `appJson.version` | ||
@@ -360,2 +363,10 @@ if( !semver.valid(appJson.version) ) | ||
static isValidId( appId ) { | ||
if( typeof appId !== 'string' ) return false; | ||
if( appId.length < 1 ) return false; | ||
if( appId.split('.').length < 2 ) return false; | ||
if( !(/^[a-zA-Z0-9_.-]*$/g).test(appId) ) return false; | ||
return true; | ||
} | ||
static getJSONSchema() { | ||
@@ -362,0 +373,0 @@ return require( path.join(__dirname, '..', '..', 'assets', 'app', 'schema.json' ) ); |
{ | ||
"name": "homey-lib", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Shared Library for Homey", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
123172
2466
0