bem-promised-models
Advanced tools
Comparing version 0.0.14 to 0.0.15
@@ -20,9 +20,14 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
__constructor: function (initValue) { | ||
var setValue; | ||
this._cachBranches = {}; | ||
this._cachIsSetBranches = {}; | ||
this.DEFAULT_BRANCH = 'DEFAULT_BRANCH'; | ||
this.value = this.parse( | ||
initValue === undefined ? | ||
this._callOrGetDefault() : | ||
initValue | ||
); | ||
if (initValue === undefined) { | ||
this._isSet = false; | ||
setValue = this._callOrGetDefault(); | ||
} else { | ||
this._isSet = true; | ||
setValue = initValue; | ||
} | ||
this.value = this.parse(setValue); | ||
this.commit(); | ||
@@ -32,2 +37,20 @@ }, | ||
/** | ||
* check if attribute was set | ||
* @param {string} attributeName | ||
* @return {Boolean} | ||
*/ | ||
isSet: function () { | ||
return this._isSet; | ||
}, | ||
/** | ||
* set attribute to default value | ||
* @param {string} attributeName | ||
*/ | ||
unset: function () { | ||
this._isSet = false; | ||
this.value = this._callOrGetDefault(); | ||
}, | ||
/** | ||
* check if attribute is valid | ||
@@ -76,2 +99,3 @@ * @abstract | ||
this.value = this._cachBranches[branch]; | ||
this._isSet = this._cachIsSetBranches[branch]; | ||
this._emitChange(); | ||
@@ -88,2 +112,3 @@ } | ||
this._cachBranches[branch] = this.value; | ||
this._cachIsSetBranches[branch] = this._isSet; | ||
}, | ||
@@ -98,2 +123,3 @@ | ||
this.value = this.parse(value); | ||
this._isSet = true; | ||
this._emitChange(); | ||
@@ -277,2 +303,21 @@ } | ||
/** | ||
* set attribute to default value | ||
* @param {string} attributeName | ||
*/ | ||
unset: function (attributeName) { | ||
this._throwMissedAttribute(attributeName); | ||
this.attributes[attributeName].unset(); | ||
}, | ||
/** | ||
* check if attribute was set | ||
* @param {string} attributeName | ||
* @return {Boolean} | ||
*/ | ||
isSet: function (attributeName) { | ||
this._throwMissedAttribute(attributeName); | ||
return this.attributes[attributeName].isSet(); | ||
}, | ||
/** | ||
* when false calculation errors will be silent | ||
@@ -920,2 +965,16 @@ * @type {Boolean} | ||
/** | ||
* @override {Attribute} | ||
*/ | ||
isSet: function () { | ||
throw new Error('.isSet is not implemented for nested models'); | ||
}, | ||
/** | ||
* @override {Attribute} | ||
*/ | ||
unset: function () { | ||
throw new Error('.unset is not implemented for nested models'); | ||
}, | ||
/** | ||
* nested model ready | ||
@@ -953,3 +1012,3 @@ * @return {Promise} | ||
revert: function (branch) { | ||
return this.value.commit(branch); | ||
return this.value.revert(branch); | ||
}, | ||
@@ -1048,2 +1107,16 @@ | ||
*/ | ||
isSet: function () { | ||
throw new Error('.isSet is not implemented for nested models'); | ||
}, | ||
/** | ||
* @override {Attribute} | ||
*/ | ||
unset: function () { | ||
throw new Error('.unset is not implemented for nested models'); | ||
}, | ||
/** | ||
* @override {Attribute} | ||
*/ | ||
get: function () { | ||
@@ -1050,0 +1123,0 @@ return (new List(this)); |
{ | ||
"description": "BEM wrapper for promised-models", | ||
"name": "bem-promised-models", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"repository": "git@github.com:delfrrr/bem-promised-models.git", | ||
@@ -31,3 +31,3 @@ "keywords": [ | ||
"dependencies": { | ||
"promised-models": "0.0.12" | ||
"promised-models": "0.0.14" | ||
}, | ||
@@ -34,0 +34,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55346
1661
+ Addedpromised-models@0.0.14(transitive)
- Removedpromised-models@0.0.12(transitive)
Updatedpromised-models@0.0.14