@kaspernj/api-maker 1.0.250 → 1.0.252

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
@@ -16,7 +16,7 @@
16
16
  ]
17
17
  },
18
18
  "name": "@kaspernj/api-maker",
19
- "version": "1.0.250",
19
+ "version": "1.0.252",
20
20
  "type": "module",
21
21
  "description": "",
22
22
  "main": "index.js",
@@ -71,16 +71,10 @@ class ApiMakerBootstrapInput extends React.PureComponent {
71
71
  }
72
72
  {type == "money" &&
73
73
  <Money
74
- attribute={attribute}
75
- currenciesCollection={currenciesCollection}
76
- currencyName={currencyName}
77
- model={model}
78
74
  name={inputProps.name}
79
75
  className={this.inputClassName()}
80
- onChange={this.props.onChange}
81
- placeholder={this.props.placeholder}
82
- small={this.props.small}
83
76
  ref="money"
77
+ {...this.moneyProps()}
84
78
  />
85
79
  }
86
80
  {type != "money" &&
@@ -147,6 +141,17 @@ class ApiMakerBootstrapInput extends React.PureComponent {
147
141
  return classNames.join(" ")
148
142
  }
149
143
 
144
+ moneyProps() {
145
+ const moneyProps = {}
146
+ const forwardedProps = ["attribute", "currenciesCollection", "currencyName", "model", "onChange", "placeholder", "small"]
147
+
148
+ for (const forwardedProp of forwardedProps) {
149
+ if (forwardedProp in this.props) moneyProps[forwardedProp] = this.props[forwardedProp]
150
+ }
151
+
152
+ return moneyProps
153
+ }
154
+
150
155
  wrapperClassName () {
151
156
  const classNames = ["form-group", "component-bootstrap-string-input"]
152
157
 
@@ -81,7 +81,9 @@ export default class ApiMakerRoutesNative {
81
81
  let options
82
82
 
83
83
  // Extract options from args if any
84
- if (typeof args[args.length - 1] == "object") {
84
+ const lastArg = args[args.length - 1]
85
+
86
+ if (lastArg && typeof lastArg == "object") {
85
87
  options = args.pop()
86
88
  } else {
87
89
  options = {}