cafe-utility 17.3.0 → 17.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +5 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1146,9 +1146,11 @@ function selectMax(n, t) {
1146
1146
  return e ? [e, n[e]] : null
1147
1147
  }
1148
1148
  function reposition(n, t, e, r) {
1149
- const o = n.find(i => i[t] === e)
1150
- o && (o[t] = e + r), n.sort((i, s) => asNumber(i[t]) - asNumber(s[t]))
1151
- for (let i = 0; i < n.length; i++) n[i][t] = i + 1
1149
+ const o = n.find(s => s[t] === e),
1150
+ i = n.find(s => s[t] === e + r)
1151
+ o && i ? ((o[t] = e + r), (i[t] = e)) : o && (o[t] = e + r),
1152
+ n.sort((s, c) => asNumber(s[t]) - asNumber(c[t])),
1153
+ n.forEach((s, c) => (s[t] = c + 1))
1152
1154
  }
1153
1155
  function buildUrl(n, t, e) {
1154
1156
  return joinUrl(n, t) + toQueryString(e || {})
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cafe-utility",
3
- "version": "17.3.0",
3
+ "version": "17.3.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "exports": {