@shakerquiz/utilities 4.0.85 → 4.0.87

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@shakerquiz/utilities",
4
- "version": "4.0.85",
4
+ "version": "4.0.87",
5
5
  "author": "yurkimus <yurkimus@gmail.com>",
6
6
  "license": "ISC",
7
7
  "repository": {
@@ -137,13 +137,25 @@ export const RoleGameStatusGameStatuses = Object.freeze({
137
137
 
138
138
  [GameStatus['Archive']]: Object.freeze([]),
139
139
 
140
- [GameStatus['Close']]: Object.freeze([]),
140
+ [GameStatus['Close']]: Object.freeze([
141
+ GameStatus['Publish'],
142
+ GameStatus['Invite'],
143
+ GameStatus['Reserve'],
144
+ ]),
141
145
 
142
146
  [GameStatus['Finish']]: Object.freeze([]),
143
147
 
144
- [GameStatus['Invite']]: Object.freeze([]),
148
+ [GameStatus['Invite']]: Object.freeze([
149
+ GameStatus['Close'],
150
+ GameStatus['Publish'],
151
+ GameStatus['Reserve'],
152
+ ]),
145
153
 
146
- [GameStatus['Reserve']]: Object.freeze([]),
154
+ [GameStatus['Reserve']]: Object.freeze([
155
+ GameStatus['Close'],
156
+ GameStatus['Invite'],
157
+ GameStatus['Publish'],
158
+ ]),
147
159
 
148
160
  [GameStatus['Moderate']]: Object.freeze([]),
149
161
 
@@ -1 +1,4 @@
1
1
  export const filterUnique = (value, index, array) => array.indexOf(value) === index
2
+
3
+ export const filterUniqueBy = predicate => (value, index, array) =>
4
+ array.findIndex(v => predicate(v) === predicate(value)) === index