UNPKG

@iotize/cli

Version:
18 lines 734 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const gpio_1 = require("@iotize/device-client.js/gpio"); const clime_1 = require("clime"); function createGPIOModeOption(defaultvalue, required = false) { return { description: 'GPIO mode', required, validator: (v) => { if (!(v in gpio_1.GPIOMode)) { throw new clime_1.ExpectedError(`Unexpected mode. Should be one of the following: ${Object.values(gpio_1.GPIOMode).filter((value) => isNaN(parseInt(value, 10))).join(', ')}`); } }, default: defaultvalue }; } exports.createGPIOModeOption = createGPIOModeOption; //# sourceMappingURL=gpio-options.js.map