UNPKG

strapi-pfapi

Version:

a strapi plugin library uses local and redis caches to achieve single digit milliseconds on average api response time.

14 lines (9 loc) 245 B
'use strict'; module.exports = (sort) => { if (!sort) return; if (!Array.isArray(sort)) sort = [ sort ]; for (let i = 0; i < sort.length; i++) { if (!sort[i].includes(':')) sort[i] += ':asc'; } return sort; }