1
hao
2025-03-27 e610e1c17f62b423a717fadaaa7b139d02857793
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"use strict";
 
Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.default = optionsFromStrings;
 
// Convert string to integers/booleans where it should be
 
function optionsFromStrings(options) {
    var intOptions = ["width", "height", "textMargin", "fontSize", "margin", "marginTop", "marginBottom", "marginLeft", "marginRight"];
 
    for (var intOption in intOptions) {
        if (intOptions.hasOwnProperty(intOption)) {
            intOption = intOptions[intOption];
            if (typeof options[intOption] === "string") {
                options[intOption] = parseInt(options[intOption], 10);
            }
        }
    }
 
    if (typeof options["displayValue"] === "string") {
        options["displayValue"] = options["displayValue"] != "false";
    }
 
    return options;
}