Validate the type of the 'version' option for transform-runtime.

This commit is contained in:
Logan Smyth
2018-09-03 18:44:10 -07:00
parent dd985c3be3
commit 9232e8b405

View File

@@ -72,6 +72,9 @@ export default declare((api, options, dirname) => {
`but got ${JSON.stringify(corejsVersion)}.`,
);
}
if (typeof runtimeVersion !== "string") {
throw new Error(`The 'version' option must be a version string.`);
}
function has(obj, key) {
return Object.prototype.hasOwnProperty.call(obj, key);