queued-socket.io
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -8,14 +8,4 @@ 'use strict'; | ||
var _lodash = require('lodash.foreach'); | ||
var _lodash2 = _interopRequireDefault(_lodash); | ||
var _lodash3 = require('lodash.sortby'); | ||
var _lodash4 = _interopRequireDefault(_lodash3); | ||
var _socket = require('./socket'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } | ||
@@ -50,6 +40,16 @@ | ||
var sortedItems = (0, _lodash4.default)(items, 'priority'); | ||
var sortedItems = items.sort(function (a, b) { | ||
if (a.priority < b.priority) { | ||
return -1; | ||
} | ||
(0, _lodash2.default)(sortedItems, callback); | ||
if (a.priority > b.priority) { | ||
return 1; | ||
} | ||
return 0; | ||
}); | ||
sortedItems.forEach(callback); | ||
return flush(); | ||
@@ -56,0 +56,0 @@ } |
{ | ||
"name": "queued-socket.io", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Socket.io client with offline queue", | ||
"main": "./dist/index.js", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
@@ -18,2 +18,9 @@ "build:commonjs": "cross-env BABEL_ENV=commonjs babel src --out-dir dist", | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/anchorchat/queued-socket.io.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/anchorchat/queued-socket.io/issues" | ||
}, | ||
"files": [ | ||
@@ -34,5 +41,3 @@ "dist", | ||
"dependencies": { | ||
"debug": "^3.1.0", | ||
"lodash.foreach": "^4.5.0", | ||
"lodash.sortby": "^4.7.0" | ||
"debug": "^3.1.0" | ||
}, | ||
@@ -39,0 +44,0 @@ "devDependencies": { |
@@ -1,3 +0,1 @@ | ||
import forEach from 'lodash.foreach'; | ||
import sortBy from 'lodash.sortby'; | ||
import { getClient } from './socket'; | ||
@@ -49,6 +47,16 @@ | ||
const sortedItems = sortBy(items, 'priority'); | ||
const sortedItems = items.sort((a, b) => { | ||
if (a.priority < b.priority) { | ||
return -1; | ||
} | ||
forEach(sortedItems, callback); | ||
if (a.priority > b.priority) { | ||
return 1; | ||
} | ||
return 0; | ||
}); | ||
sortedItems.forEach(callback); | ||
return flush(); | ||
@@ -55,0 +63,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
29885
2
579
1
0
- Removedlodash.foreach@^4.5.0
- Removedlodash.sortby@^4.7.0
- Removedlodash.foreach@4.5.0(transitive)
- Removedlodash.sortby@4.7.0(transitive)