@kaspernj/api-maker 1.0.151 → 1.0.152

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/package.json +1 -1
  2. package/src/can-can.cjs +14 -12
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  ]
17
17
  },
18
18
  "name": "@kaspernj/api-maker",
19
- "version": "1.0.151",
19
+ "version": "1.0.152",
20
20
  "description": "",
21
21
  "main": "index.js",
22
22
  "repository": {
package/src/can-can.cjs CHANGED
@@ -46,18 +46,20 @@ module.exports = class ApiMakerCanCan {
46
46
  const abilityDataSubject = digg(abilityData, "subject")
47
47
  const abilityDataAbility = digg(abilityData, "ability")
48
48
 
49
- // If actually same class
50
- if (abilityDataSubject == subject && abilityDataAbility == ability) return true
51
-
52
- // Sometimes in dev when using linking it will actually be two different but identical resource classes
53
- if (
54
- typeof subject == "function" &&
55
- subject.modelClassData &&
56
- typeof abilityDataSubject == "function" &&
57
- abilityDataSubject.modelClassData &&
58
- digg(subject.modelClassData(), "name") == digg(abilityDataSubject.modelClassData(), "name")
59
- ) {
60
- return true
49
+ if (abilityDataAbility == ability) {
50
+ // If actually same class
51
+ if (abilityDataSubject == subject) return true
52
+
53
+ // Sometimes in dev when using linking it will actually be two different but identical resource classes
54
+ if (
55
+ typeof subject == "function" &&
56
+ subject.modelClassData &&
57
+ typeof abilityDataSubject == "function" &&
58
+ abilityDataSubject.modelClassData &&
59
+ digg(subject.modelClassData(), "name") == digg(abilityDataSubject.modelClassData(), "name")
60
+ ) {
61
+ return true
62
+ }
61
63
  }
62
64
 
63
65
  return false