UNPKG

use-wizard

Version:

A dead-easy-to-use light-weight react hook to handle multi-paths wizards (and simple wizards too) and navigate into them.

17 lines 719 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getWizardIndex = void 0; var isTypeLinearS_1 = require("../types/typeGuards/isTypeLinearS"); var getWizardIndex = function (args) { return function () { if (!isTypeLinearS_1.isTypeLinearS(args.options)) { console.log('Wizard warning: method getWizardIndex does not work with this type of wizard'); return -1; } if (typeof args.step !== "string") { console.log('Wizard warning: method getWizardLength does not work with this type of step'); return -1; } return args.options.indexOf(args.step); }; }; exports.getWizardIndex = getWizardIndex; //# sourceMappingURL=getWizardIndex.js.map