Skip to content

Commit

Permalink
Update utils.js (#79)
Browse files Browse the repository at this point in the history
Fix function naming to work with Babel transpilation
  • Loading branch information
bertho-zero authored and daffl committed Aug 21, 2018
1 parent 3a4971c commit 580c74b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 21 deletions.
6 changes: 3 additions & 3 deletions packages/commons/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ exports.compareNSB = function (a, b) {
return 0;
};

exports.compareArrays = function compareArrays (a, b) {
exports.compareArrays = function (a, b) {
var i, comp;

for (i = 0; i < Math.min(a.length, b.length); i += 1) {
Expand All @@ -152,7 +152,7 @@ exports.compareArrays = function compareArrays (a, b) {
return exports.compareNSB(a.length, b.length);
};

exports.compare = function compare (a, b, compareStrings = exports.compareNSB) {
exports.compare = function (a, b, compareStrings = exports.compareNSB) {
const { compareNSB, compare, compareArrays } = exports;

// undefined
Expand Down Expand Up @@ -199,7 +199,7 @@ exports.compare = function compare (a, b, compareStrings = exports.compareNSB) {

// An in-memory sorting function according to the
// $sort special query parameter
exports.sorter = function sorter ($sort) {
exports.sorter = function ($sort) {
const criteria = Object.keys($sort).map(key => {
const direction = $sort[key];

Expand Down
29 changes: 11 additions & 18 deletions packages/commons/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 580c74b

Please sign in to comment.