miolo-model 3.0.0-beta.226 → 3.0.0-beta.227
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 +1 -1
- package/src/MioloModel.mjs +4 -4
package/package.json
CHANGED
package/src/MioloModel.mjs
CHANGED
|
@@ -118,11 +118,11 @@ export default class MioloModel extends class {} {
|
|
|
118
118
|
/**
|
|
119
119
|
* Get a value from the model's data.
|
|
120
120
|
* @param {string} field - The field to get the value from.
|
|
121
|
-
* @param {any} def - The default value to return if the field is not found.
|
|
121
|
+
* @param {any} [def=undefined] - The default value to return if the field is not found.
|
|
122
122
|
* @returns {any} The value from the model's data.
|
|
123
123
|
* @public
|
|
124
124
|
*/
|
|
125
|
-
get_value(field, def) {
|
|
125
|
+
get_value(field, def = undefined) {
|
|
126
126
|
if (this.data !== undefined) {
|
|
127
127
|
if (this.data[field] !== undefined && this.data[field] !== null) {
|
|
128
128
|
return this.data[field]
|
|
@@ -134,12 +134,12 @@ export default class MioloModel extends class {} {
|
|
|
134
134
|
/**
|
|
135
135
|
* Get a value from the model's data.
|
|
136
136
|
* @param {string} field - The field to get the value from.
|
|
137
|
-
* @param {any} def - The default value to return if the field is not found.
|
|
137
|
+
* @param {any} [def=undefined] - The default value to return if the field is not found.
|
|
138
138
|
* @returns {any} The value from the model's data.
|
|
139
139
|
* @public
|
|
140
140
|
* @deprecated Use get_value() instead.
|
|
141
141
|
*/
|
|
142
|
-
_get(field, def) {
|
|
142
|
+
_get(field, def = undefined) {
|
|
143
143
|
return this.get_value(field, def)
|
|
144
144
|
}
|
|
145
145
|
|