Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bem-promised-models

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bem-promised-models - npm Package Compare versions

Comparing version 0.0.14 to 0.0.15

85

blocks/promised-models/__model/promised-models__model.js

@@ -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));

4

package.json
{
"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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc