Commit 9d3aacb2 authored by Robert Knight's avatar Robert Knight

Remove unused code in src/sidebar/filter/

This used to contain Angular filters. The last references to this were
removed in c978b6b2.
parent 35438ade
import * as url from '../url';
describe('url.encode', function() {
it('urlencodes its input', function() {
const expect = 'http%3A%2F%2Ffoo.com%2Fhello%20there.pdf';
const result = url.encode('http://foo.com/hello there.pdf');
assert.equal(result, expect);
});
it('returns the empty string for null values', function() {
assert.equal(url.encode(null), '');
assert.equal(url.encode(undefined), '');
});
});
/**
* URL encode a string, dealing appropriately with null values.
*/
export function encode(str) {
if (str) {
return window.encodeURIComponent(str);
}
return '';
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment