@itwin/frontend-devtools
Version:
Debug menu and supporting UI widgets
25 lines • 1.02 kB
JavaScript
;
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseToggle = parseToggle;
/** @packageDocumentation
* @module Utilities
*/
/** Parses a string case-insensitively returning true for "ON", false for "OFF" undefined for "TOGGLE" or undefined, and the input string for anything else
* Used by various tools which take such arguments.
* @beta
*/
function parseToggle(arg) {
if (undefined === arg)
return undefined;
switch (arg.toLowerCase()) {
case "on": return true;
case "off": return false;
case "toggle": return undefined;
default: return arg;
}
}
//# sourceMappingURL=parseToggle.js.map