@shakerquiz/utilities 4.0.59 → 4.0.61

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.59",
4
+ "version": "4.0.61",
5
5
  "author": "yurkimus <yurkimus@gmail.com>",
6
6
  "license": "ISC",
7
7
  "repository": {
@@ -27,21 +27,15 @@ export const route = maybeString => {
27
27
  * @param {string} maybeRoute
28
28
  *
29
29
  * @example
30
- * routeBreakdown('users/role') // ['role']
30
+ * routeBreakdown('users/role/search') // ['user/role']
31
31
  * routeBreakdown('games/search') // ['game']
32
32
  */
33
- export const routeBreakdown = maybeRoute => {
34
- let singulars = route(maybeRoute)
33
+ export const routeBreakdown = maybeRoute =>
34
+ route(maybeRoute)
35
35
  .split('/')
36
36
  .filter(segment => ['Entity', 'Property', 'Aggregation', 'Operation'].includes(Segment[segment].kind))
37
37
  .map(segment => Segment[segment].singular)
38
-
39
- let lastIndex = singulars.findLastIndex(segment => Segment[segment].kind === 'Entity')
40
-
41
- return singulars
42
- .slice(lastIndex, singulars.length)
43
38
  .join('/')
44
- }
45
39
 
46
40
  /**
47
41
  * @param {string} maybeRoute