Skip to content

Instantly share code, notes, and snippets.

@OverZealous

OverZealous/index.js

Last active Jan 4, 2016
Embed
What would you like to do?
Sample for anysort error
var anysort = require('anysort');
var sortArr = [ 'js/vendor/angular/angular.js',
'js/vendor/angular-bootstrap/ui-bootstrap-tpls.min.js',
'js/vendor/angular-ui-router/release/angular-ui-router.js',
'js/vendor/angular-ui-utils/modules/route/route.js',
'js/vendor/firebase/firebase.js',
'js/vendor/angularfire/angularfire.js',
'js/common/**/*.js',
'js/app/**/*.js',
'js/**/*.js',
'css/*.css' ];
var data = [ 'js/app/app.js' ,
'js/app/about/about.js',
'js/app/home/home.js',
'js/app/list/list.js',
'js/app/lists/lists.js',
'js/common/directives/ActiveRoute.js',
'js/common/services/ListsService.js',
'js/templates/about/about.tpl.js',
'js/templates/home/home.tpl.js',
'js/templates/list/list.tpl.js',
'js/templates/lists/lists.tpl.js',
'js/vendor/angular/angular.js',
'js/vendor/angular-bootstrap/ui-bootstrap-tpls.min.js',
'js/vendor/angularfire/angularfire.js',
'js/vendor/firebase/firebase.js',
'js/vendor/angular-ui-router/release/angular-ui-router.js'];
// wrapped so we can tap into the sorting process
var as = anysort(sortArr);
var sorter = function(a,b){ console.log(a, '<=>', b); return as(a, b) };
data.sort(sorter);
console.log(data);
{
"name": "anysort-error",
"version": "0.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"anysort": "~0.1.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.