Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.mdns.eu/nextcloud/passwords-client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/Model/AbstractModel.js')
-rw-r--r--src/Model/AbstractModel.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/Model/AbstractModel.js b/src/Model/AbstractModel.js
index bf69014..1178cd5 100644
--- a/src/Model/AbstractModel.js
+++ b/src/Model/AbstractModel.js
@@ -15,13 +15,22 @@ export default class AbstractModel {
}
/**
+ *
+ * @param {String} property
+ * @return {boolean}
+ */
+ hasProperty(property) {
+ return this._properties.hasOwnProperty(property);
+ }
+
+ /**
* @param {String} property
*
* @return {*}
* @api
*/
getProperty(property) {
- if(!this._properties.hasOwnProperty(property)) {
+ if(!this.hasProperty(property)) {
throw new UnknownPropertyError(`Read access to unknown property ${property}`);
}
@@ -40,7 +49,7 @@ export default class AbstractModel {
* @api
*/
setProperty(property, value) {
- if(!this._properties.hasOwnProperty(property)) {
+ if(!this.hasProperty(property)) {
throw new UnknownPropertyError(`Write access to unknown property ${property}`);
}