How to use the postman-url-encoder.encode function in postman-url-encoder

To help you get started, we’ve selected a few postman-url-encoder examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github postmanlabs / postman-collection / lib / collection / query-param.js View on Github external
if (value === undefined) {
            return EMPTY;
        }

        if (key === null) {
            key = EMPTY;
        }

        if (value === null) {
            return encode ? urlEncoder.encode(key) : key;
        }

        if (encode) {
            key = urlEncoder.encode(key);
            value = urlEncoder.encode(value);
        }

        return key + EQUALS + value;
    }
});
github postmanlabs / postman-collection / lib / collection / query-param.js View on Github external
value = obj.value;

        if (value === undefined) {
            return EMPTY;
        }

        if (key === null) {
            key = EMPTY;
        }

        if (value === null) {
            return encode ? urlEncoder.encode(key) : key;
        }

        if (encode) {
            key = urlEncoder.encode(key);
            value = urlEncoder.encode(value);
        }

        return key + EQUALS + value;
    }
});
github postmanlabs / postman-collection / lib / collection / query-param.js View on Github external
unparseSingle: function (obj, encode) {
        if (!obj) { return EMPTY; }

        var key = obj.key,
            value = obj.value;

        if (value === undefined) {
            return EMPTY;
        }

        if (key === null) {
            key = EMPTY;
        }

        if (value === null) {
            return encode ? urlEncoder.encode(key) : key;
        }

        if (encode) {
            key = urlEncoder.encode(key);
            value = urlEncoder.encode(value);
        }

        return key + EQUALS + value;
    }
});

postman-url-encoder

Implementation of the WHATWG URL Standard

Apache-2.0
Latest version published 3 years ago

Package Health Score

64 / 100
Full package analysis

Popular postman-url-encoder functions