File: blog-posts.js

package info (click to toggle)
node-gulp 4.0.2%2B~cs54.26.36-8
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 17,596 kB
  • sloc: javascript: 1,133,545; sh: 12; makefile: 6
file content (14 lines) | stat: -rw-r--r-- 326 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
var arraySort = require('..');

var posts = [
  { path: 'c.md', locals: { date: '2014-01-09' } },
  { path: 'a.md', locals: { date: '2014-01-02' } },
  { path: 'b.md', locals: { date: '2013-05-06' } },
];

// by `locals.date`
console.log(arraySort(posts, 'locals.date'));

// by `path`
console.log(arraySort(posts, 'path'));