Skip to content
Snippets Groups Projects
Commit c1f65486 authored by David Fifield's avatar David Fifield
Browse files

Remove unused Params.getAddress.

It was formerly used for the "broker" and "relay" query string
parameters, which were removed in
debe9c37.
parent d6d42e82
No related branches found
No related tags found
No related merge requests found
......@@ -244,33 +244,4 @@ describe('Params', function() {
});
describe('address', function() {
var DEFAULT = {
host: '1.1.1.1',
port: 2222
};
var getAddress = function(query) {
return Params.getAddress(query, 'addr', DEFAULT);
};
it('parses correctly', function() {
expect(getAddress({})).toEqual(DEFAULT);
expect(getAddress({
addr: '3.3.3.3:4444'
})).toEqual({
host: '3.3.3.3',
port: 4444
});
expect(getAddress({
x: '3.3.3.3:4444'
})).toEqual(DEFAULT);
expect(getAddress({
addr: '---'
})).toBeNull();
});
});
});
......@@ -238,17 +238,6 @@ class Params {
return Parse.byteCount(spec);
}
// Get an object value and parse it as an address spec. Returns |defaultValue|
// if param is not a key. Returns null on a parsing error.
static getAddress(query, param, defaultValue) {
var val;
val = query[param];
if (void 0 === val) {
return defaultValue;
}
return Parse.address(val);
}
// Get an object value and return it as a string. Returns default_val if param
// is not a key.
static getString(query, param, defaultValue) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment