'use strict';


module.exports = (columns, data, done) => {
    return (column) => {
        var property = column.property;

        columns.map((column) => {
            column.classes = {};

            return column;
        });

        column.sort = column.sort? -column.sort: 1;
        column.classes = {
            'sort-asc': column.sort === 1,
            'sort-desc': column.sort === -1
        };

        data.sort((a, b) => {
            if(a[property].localeCompare) {
                return a[property].localeCompare(b[property]) * column.sort;
            }

            return a[property] - b[property] * column.sort;
        });

        done({
            columns: columns,
            data: data
        });
    };
};

@@ -582,32 +582,33 @@
          return 
+(
 a%5Bproperty%5D - b%5B
@@ -616,16 +616,17 @@
 roperty%5D
+)
  * colum

Fix boolean sort