text: // Generated by CoffeeScript 2.7.0
  module.exports = {
    stringify: function(mode) {
      if (typeof mode === 'number') {
        return mode.toString(8);
      } else {
        return mode;
      }
    },
    /*
    Compare multiple mode. All arguments modes must match. If first mode is any array, then
    other arguments mode must much at least one element of the array.
    */
    compare: function(...modes) {
      var i, j, mode, ref, ref1;
      ref = modes[0];
      if (ref == null) {
        throw Error(`Invalid mode: ${ref}`);
      }
      if (!Array.isArray(ref)) {
        ref = [ref];
      }
      ref = ref.map((mode) => {
        return this.stringify(mode);
      });
      for (i = j = 1, ref1 = modes.length; (1 <= ref1 ? j < ref1 : j > ref1); i = 1 <= ref1 ? ++j : --j) {
        mode = this.stringify(modes[i]);
        if (!ref.some(function(m) {
          var l;
          l = Math.min(m.length, mode.length);
          return m.substr(-l) === mode.substr(-l);
        })) {
          return false;
        }
      }
      return true;
    }
  };
  