๐Ÿ“ฆ EdwonLim / node-less

๐Ÿ“„ keyword.js ยท 27 lines
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(function (module) {

    var Keyword = function (value) {
        this.value = value
    };

    Keyword.prototype = {
        type: "Keyword",
        eval: function () {
            return this;
        },
        toCSS: function () {
            return this.value;
        },
        compare: function (other) {
            if (other instanceof Keyword) {
                return other.value === this.value ? 0 : 1;
            } else {
                return -1;
            }
        }
    };

    module.exports = Keyword;

})(module);