2 var extend, flatten, indexOf;
3 indexOf = (exports.indexOf = Array.indexOf || (Array.prototype.indexOf ? function(array, item, from) {
4 return array.indexOf(item, from);
5 } : function(array, item, from) {
6 var _len, index, other;
7 for (index = 0, _len = array.length; index < _len; index++) {
9 if (other === item && (!from || (from <= index))) {
15 exports.include = function(list, value) {
16 return indexOf(list, value) >= 0;
18 exports.starts = function(string, literal, start) {
19 return literal === string.substr(start, literal.length);
21 exports.ends = function(string, literal, back) {
24 return literal === string.substr(string.length - len - (back || 0), len);
26 exports.compact = function(array) {
27 var _i, _len, _result, item;
29 for (_i = 0, _len = array.length; _i < _len; _i++) {
37 exports.count = function(string, letter) {
40 while (pos = 1 + string.indexOf(letter, pos)) {
45 exports.merge = function(options, overrides) {
46 return extend(extend({}, options), overrides);
48 extend = (exports.extend = function(object, properties) {
50 for (key in properties) {
51 val = properties[key];
56 exports.flatten = (flatten = function(array) {
57 var _i, _len, element, flattened;
59 for (_i = 0, _len = array.length; _i < _len; _i++) {
61 if (element instanceof Array) {
62 flattened = flattened.concat(flatten(element));
64 flattened.push(element);
69 exports.del = function(obj, key) {
75 exports.last = function(array, back) {
76 return array[array.length - (back || 0) - 1];