0.8.0 • Published 12 years ago

ql.io-mutable-uri v0.8.0

Weekly downloads
52
License
-
Repository
github
Last release
12 years ago

A mutable URI parser and formatter for use by monkey patches. ql.io lets you monkey patch tables by attaching a Node module with each table. Here is an example of how a monkey patch module could patch the request URI.

//
// Patch the request URI. ql.io engine would use the returned URI.
//
exports['patch uri'] = function(options) {
    var statement = options.statement, uri = options.uri, params = options.params, count = 0;
    if(statement.offset && statement.limit) {
        uri.setParam('paginationInput.pageNumber', statement.offset / statement.limit);
    }
    uri.removeEmptyParams();

    count = 0
    if(params.FreeShippingOnly) {
        uri.addParam("itemFilter(" + count + ").name", 'FreeShippingOnly');
        uri.addParam("itemFilter(" + count + ").value", params.FreeShippingOnly);
        count++;
    }
    if(params.MinPrice) {
        uri.addParam("itemFilter(" + count + ").name", 'MinPrice');
        uri.addParam("itemFilter(" + count + ").value", params.MinPrice);
        count++;
    }
    return uri;
}
0.8.0

12 years ago

0.7.0

12 years ago

0.6.3

12 years ago

0.6.1

12 years ago

0.6.0

12 years ago

0.5.0

12 years ago

0.4.4

12 years ago

0.4.2

12 years ago

0.4.1

12 years ago

0.4.0

12 years ago

0.4.0-beta

12 years ago

0.3.0

12 years ago