PageSourceSearch

https://ispringhelpdocs.com/includes/js/api/type-helpers.js

js ispringhelpdocs.com collected 2026-10-04 12:48:55 UTC 962 bytes, 42 lines download raw bytes

1/**
2 * @module confluence/api/type-helpers
3 */
4define('confluence/api/type-helpers', [
5
6], function(
7
8) {
9    'use strict';
10
11    /**
12     * Utility methods for type conversion and checking.
13     *
14     * @exports confluence/api/type-helpers
15     */
16    var TypeHelpers = {};
17
18    /**
19     * Returns a boolean if the passed string is "true" or "false", ignoring case, else returns the original string.
20     * @param value
21     */
22    TypeHelpers.asBooleanOrString = function(value) {
23        var lc = value ? value.toLowerCase() : '';
24
25        if (lc === 'true') {
26            return true;
27        }
28        if (lc === 'false') {
29            return false;
30        }
31
32        return value;
33    };
34
35    return TypeHelpers;
36});
37
38require('confluence/module-exporter').safeRequire('confluence/api/type-helpers', function(TypeHelpers) {
39    'use strict';
40
41    require('confluence/module-exporter').namespace('AJS.asBooleanOrString', TypeHelpers.asBooleanOrString);
42});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.