From 07e4994f86a494d1912183d4185d5748e071bdc1 Mon Sep 17 00:00:00 2001 From: Morgan Roderick Date: Sat, 27 Oct 2018 15:06:59 +0200 Subject: [PATCH] Use orderByFirstCall from @sinonjs/commons --- lib/sinon/assert.js | 2 +- lib/sinon/util/core/order-by-first-call.js | 15 --------------- 2 files changed, 1 insertion(+), 16 deletions(-) delete mode 100644 lib/sinon/util/core/order-by-first-call.js diff --git a/lib/sinon/assert.js b/lib/sinon/assert.js index 74daa0bd3..396f26a4f 100644 --- a/lib/sinon/assert.js +++ b/lib/sinon/assert.js @@ -2,7 +2,7 @@ var arrayProto = require("@sinonjs/commons").prototypes.array; var calledInOrder = require("@sinonjs/commons").calledInOrder; -var orderByFirstCall = require("./util/core/order-by-first-call"); +var orderByFirstCall = require("@sinonjs/commons").orderByFirstCall; var timesInWords = require("./util/core/times-in-words"); var format = require("./util/core/format"); var sinonMatch = require("./match"); diff --git a/lib/sinon/util/core/order-by-first-call.js b/lib/sinon/util/core/order-by-first-call.js deleted file mode 100644 index 92da964bc..000000000 --- a/lib/sinon/util/core/order-by-first-call.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -var sort = require("@sinonjs/commons").prototypes.array.sort; - -module.exports = function orderByFirstCall(spies) { - return sort(spies, function(a, b) { - // uuid, won't ever be equal - var aCall = a.getCall(0); - var bCall = b.getCall(0); - var aId = (aCall && aCall.callId) || -1; - var bId = (bCall && bCall.callId) || -1; - - return aId < bId ? -1 : 1; - }); -};