@cleanweb/oore 1.2.0-alpha.9 → 1.2.0

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/build/slots/hook.js +11 -14
  2. package/package.json +1 -1
@@ -23,16 +23,7 @@ var isElementChild = function (child) {
23
23
  };
24
24
  exports.isElementChild = isElementChild;
25
25
  var getComponentSlotName = function (TargetComponent, child) {
26
- if (typeof TargetComponent === 'string') {
27
- return TargetComponent;
28
- }
29
- else if ('slotName' in TargetComponent) {
30
- return TargetComponent.slotName;
31
- }
32
- else if ('displayName' in TargetComponent) {
33
- return TargetComponent.displayName;
34
- }
35
- else if (child) {
26
+ if (child) {
36
27
  var keyTypes = ['string', 'number', 'symbol'];
37
28
  var slotName = child.props['data-slot-name'];
38
29
  if (keyTypes.includes(typeof slotName)) {
@@ -41,11 +32,17 @@ var getComponentSlotName = function (TargetComponent, child) {
41
32
  }
42
33
  return slotName;
43
34
  }
44
- else
45
- return undefined;
46
35
  }
47
- else
48
- return undefined;
36
+ if (typeof TargetComponent === 'string') {
37
+ return TargetComponent;
38
+ }
39
+ else if ('slotName' in TargetComponent) {
40
+ return TargetComponent.slotName;
41
+ }
42
+ else if ('displayName' in TargetComponent) {
43
+ return TargetComponent.displayName;
44
+ }
45
+ return undefined;
49
46
  };
50
47
  exports.getComponentSlotName = getComponentSlotName;
51
48
  var useSlots = function (children, slotComponents, _requiredSlots) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleanweb/oore",
3
- "version": "1.2.0-alpha.9",
3
+ "version": "1.2.0",
4
4
  "description": "A library of helpers for writing cleaner React function components with object-oriented patterns.",
5
5
  "engines": {
6
6
  "node": ">=20"