All files Hash.js

100% Statements 9/9
100% Branches 4/4
100% Functions 4/4
100% Lines 9/9
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30              1508x 1508x 425x   1508x       1961x       1237x       813x 540x   273x      
import {
    isEmpty
} from './utils.js';
import Part from './Part.js';
 
export default class Hash extends Part {
    constructor (rawValue) {
        super(rawValue);
        if (!isEmpty(this._value)) {
            this._value = decodeURIComponent(this._value);
        }
        this._isEmpty = isEmpty(rawValue);
    }
 
    isEmpty () {
        return this._isEmpty;
    }
 
    toString () {
        return encodeURIComponent(super.toString());
    }
 
    toLowerCase (condition) {
        if (this._value === null) {
            return this;
        }
        return super.toLowerCase(condition);
    }
}