tvkitchen / appliances

A one stop shop for official TV Kitchen Appliances
GNU Lesser General Public License v3.0
3 stars 0 forks source link

Add isValidPayload to AbstractAppliance #42

Closed slifty closed 4 years ago

slifty commented 4 years ago

Issue #41

Description

This PR adds an isValidPayload method to AbstractAppliance which ensures that the payload is a valid type for the appliance.

It uses an assertion here (thus triggering an error) because submitting a payload of an invalid type for validation is likely a signal of a more serious problem.

Due Diligence Checklist

Steps to Test

  1. yarn test

Deploy Notes

None

Related Issues

Resolves #41

slifty commented 4 years ago

This really does warrant a review (just because it's an addition to an abstract class) but I'm going to press on in the name of speeeeeeeeeeed.