Skip to content

Commit

Permalink
Fix data validation for "contextId" parameter in example scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
bryaningl3 committed Oct 25, 2023
1 parent 5be70d2 commit 91a7e11
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion example/node/example1.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if (typeof(userId) !== 'string' || userId.length === 0) {
process.exit();
}

if (typeof(userId) !== 'string' || userId.length === 0) {
if (typeof(contextId) !== 'string' || contextId.length === 0) {
console.error('A context identifier must be specified. Usage example: "node example1.js user-123 barchart"');
process.exit();
}
Expand Down
4 changes: 2 additions & 2 deletions example/node/example2.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ if (typeof(userId) !== 'string' || userId.length === 0) {
process.exit();
}

if (typeof(userId) !== 'string' || userId.length === 0) {
console.error('A context identifier must be specified. Usage example: "node example2.js user-123 barchart"');
if (typeof(contextId) !== 'string' || contextId.length === 0) {
console.error('A context identifier must be specified. Usage example: "node example1.js user-123 barchart"');
process.exit();
}

Expand Down
4 changes: 2 additions & 2 deletions example/node/example3.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ if (typeof(userId) !== 'string' || userId.length === 0) {
process.exit();
}

if (typeof(userId) !== 'string' || userId.length === 0) {
console.error('A context identifier must be specified. Usage example: "node example3.js user-123 barchart"');
if (typeof(contextId) !== 'string' || contextId.length === 0) {
console.error('A context identifier must be specified. Usage example: "node example1.js user-123 barchart"');
process.exit();
}

Expand Down
4 changes: 2 additions & 2 deletions example/node/example4.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ if (typeof(userId) !== 'string' || userId.length === 0) {
process.exit();
}

if (typeof(userId) !== 'string' || userId.length === 0) {
console.error('A context identifier must be specified. Usage example: "node example4.js user-123 barchart"');
if (typeof(contextId) !== 'string' || contextId.length === 0) {
console.error('A context identifier must be specified. Usage example: "node example1.js user-123 barchart"');
process.exit();
}

Expand Down
4 changes: 2 additions & 2 deletions example/node/example5.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ if (typeof(userId) !== 'string' || userId.length === 0) {
process.exit();
}

if (typeof(userId) !== 'string' || userId.length === 0) {
console.error('A context identifier must be specified. Usage example: "node example5.js user-123 barchart"');
if (typeof(contextId) !== 'string' || contextId.length === 0) {
console.error('A context identifier must be specified. Usage example: "node example1.js user-123 barchart"');
process.exit();
}

Expand Down
4 changes: 2 additions & 2 deletions example/node/example6.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ if (typeof(userId) !== 'string' || userId.length === 0) {
process.exit();
}

if (typeof(userId) !== 'string' || userId.length === 0) {
console.error('A context identifier must be specified. Usage example: "node example6.js user-123 barchart"');
if (typeof(contextId) !== 'string' || contextId.length === 0) {
console.error('A context identifier must be specified. Usage example: "node example1.js user-123 barchart"');
process.exit();
}

Expand Down
4 changes: 2 additions & 2 deletions example/node/example7.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ if (typeof(userId) !== 'string' || userId.length === 0) {
process.exit();
}

if (typeof(userId) !== 'string' || userId.length === 0) {
console.error('A context identifier must be specified. Usage example: "node example7.js user-123 barchart"');
if (typeof(contextId) !== 'string' || contextId.length === 0) {
console.error('A context identifier must be specified. Usage example: "node example1.js user-123 barchart"');
process.exit();
}

Expand Down

0 comments on commit 91a7e11

Please sign in to comment.