Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
--this.__size__;
this.emit('_delete', key);
return true;
}),
entries: d(function () { return new Iterator(this, 'key+value'); }),
get: d(function (key) {
key = this._serialize(key);
if (key == null) return;
return this.__setData__[key];
}),
has: d(function (value) {
var key = this._serialize(value);
if (key == null) return false;
return hasOwnProperty.call(this.__setData__, key);
}),
size: d.gs(function () { return this.__size__; }),
values: d(function () { return new Iterator(this); })
});
this.__size__ -= 1;
if (!this.__postponed__) {
this.emit('change', { type: 'delete', value: value, dbjs: dbEvent, target: this });
return;
}
event = this.__postponedEvent__;
if (!event) event = this.__postponedEvent__ = { target: this };
if (dbEvent) event.dbjs = dbEvent;
if (event.added && event.added.has(value)) {
event.added._delete(value);
return;
}
if (!event.deleted) event.deleted = new ReadOnlySet(null, serialize);
event.deleted._add(value);
}),
_postponed_: d.gs(function () {
return this.__postponed__;
}, function (value) {
var event;
this.__postponed__ = value;
if (value) return;
event = this.__postponedEvent__;
if (!event) return;
if (event.added && event.added.size) {
if (event.deleted && event.deleted.size) {
event.type = 'batch';
} else if (event.added.size === 1) {
event.type = 'add';
event.value = event.added.values().next().value;
delete event.deleted;
delete event.added;
} else {
}),
has: d(function (key) {
return (eIndexOf.call(this.__mapKeysData__, key) !== -1);
}),
keys: d(function () { return new Iterator(this, 'key'); }),
set: d(function (key, value) {
var index = eIndexOf.call(this.__mapKeysData__, key), emit;
if (index === -1) {
index = this.__mapKeysData__.push(key) - 1;
emit = true;
}
this.__mapValuesData__[index] = value;
if (emit) this.emit('_add', index, key);
return this;
}),
size: d.gs(function () { return this.__mapKeysData__.length; }),
values: d(function () { return new Iterator(this, 'value'); }),
toString: d(function () { return '[object Map]'; })
}));
Object.defineProperty(MapPoly.prototype, Symbol.iterator, d(function () {
return this.entries();
}));
Object.defineProperty(MapPoly.prototype, Symbol.toStringTag, d('c', 'Map'));
this.__setData__.splice(i, 1);
delete this.__lastModifiedMap__[obj.__id__];
delete this.__lastEventMap__[obj.__id__];
this.emit('_delete', i, obj);
if (this.__isObjectKey__ && (this.__descriptor__.reverse !== undefined) &&
this.__descriptor__.unique && (i === this.__setData__.length)) {
nu = (i === 0) ? undefined : this.__setData__[i - 1];
postponed = notifyProperty(this.__key__,
this.__key__._serialize_(this.__descriptor__.reverse), nu, obj,
null, null, dbEvent, postponed);
}
if (!this.__isObservable__) return postponed;
this._emitDelete_(obj, dbEvent);
return postponed;
}),
last: d.gs(function () {
var data = this.__setData__, i = data.length;
return i ? data[i - 1] : undefined;
}),
lastEvent: d.gs(function () {
var last = this.last;
if (!last) return null;
return this.__lastEventMap__[last.__id__] || null;
})
});
ReverseSet.prototype.constructor = ObjectsSet;
defineObservable(ReverseSet.prototype);
ReverseSet.prototype.constructor = ReverseSet;
function Response(options) {
options = options || {};
Message.call(this, options.content, options.headers);
this.status = options.status || 200;
}
Response.prototype = Object.create(Message.prototype, {
constructor: d(Response),
/**
* The message that corresponds with the status code.
*/
statusText: d.gs(function () {
return StatusCodes[this.status];
})
});
module.exports = Response;
Observable.call(this, value);
object._observableProperties_[sKey] = this;
};
setPrototypeOf(ObservableProperty, Observable);
ObservableProperty.prototype = Object.create(proto, assign({
constructor: d(ObservableProperty),
dbKind: d('observableProperty'),
value: d.gs('', function () {
if (!accessSniff && !this.object.__prototypeTurnInProgress__) return getValue.call(this);
return this.object._resolve_(this.__sKey__);
}, function (value) {
var object = this.object, sKey = this.__sKey__;
object._set_(sKey, object._validateSet_(sKey, value));
}),
lastModified: d.gs(function () {
if (this.__lastModified__ == null) {
this.__lastModified__ = this.object._getPropertyLastModified_(this.__sKey__);
}
return this.__lastModified__;
}),
descriptor: d.gs(function () {
return this.object._getDescriptor_(this.__sKey__);
}),
toString: d(function () {
return this.object.stringifyPropertyValue(this.__sKey__);
})
}, lazy({
ownDescriptor: d(function () {
var desc = this.object._getOwnDescriptor_(this.__sKey__);
defineProperty(this, 'descriptor', d('', desc));
return desc;
value = desc._normalizeValue_(value);
if (value == null) return;
if (eIndexOf.call(this, value) !== -1) return;
this.push(value);
};
if (isIterable(value)) forOf(value, iterate, self.__setData__);
else forEach.call(value, iterate, self.__setData__);
return self;
};
setPrototypeOf(Multiple, Set);
Multiple.prototype = create(Set.prototype, assign({
constructor: d(Multiple),
dbKind: d('computedMultiple'),
first: d.gs(setGetFirst),
last: d.gs(setGetLast),
copy: d(setCopy),
every: d(setEvery),
some: d(setSome),
getObservableIndex: d(function (item) {
var observable = new ObservableValue(findIndex.call(this, item));
this.on('change', function () { observable.value = findIndex.call(this, item); });
return observable;
}),
_doClear_: d(function (dbEvent) {
var event;
if (!this.__isObservable__) {
this._clear();
return;
}
if (!this.__postponed__) {
this._clear();
key = obj._validateMultipleDelete_(this.__pSKey__, key);
if (key == null) return false;
return obj._multipleDelete_(this.__pSKey__, key, serialize(key));
}),
entries: d(function () { return new Iterator(this, 'key+value'); }),
has: d(function (key) {
var item;
if (key == null) return false;
key = this.object._normalize_(this.__pSKey__, key);
if (key == null) return false;
item = this.__setData__[this._serialize(key)];
if (item == null) return false;
if (typeof item === 'number') return true;
return Boolean(item._value_);
}),
size: d.gs(function () {
if (this.hasOwnProperty('__size__')) return this.__size__;
return this.object._getMultipleSize_(this.__pSKey__);
}),
values: d(function () { return new Iterator(this); }),
first: d.gs(setGetFirst),
last: d.gs(setGetLast),
copy: d(setCopy),
every: d(setEvery),
some: d(setSome),
$getOwn: d(function (key) {
key = this._validate_(key);
return this.object._getOwnMultipleItem_(this.__pSKey__,
key, this._serialize(key));
}),
$get: d(function (key) {
key = this._validate_(key);
return 0;
}
result = isToLater ? toDays : toDays - 1;
result += daysInMonth.call(data.from) - data.from.getDate();
return data.sign * result;
}),
month: d.gs(function () {
var data = getCalcData(this);
return (
data.sign *
(((12 - data.from.getMonth() + data.to.getMonth()) % 12) -
(data.from - mfloor.call(copy.call(data.from)) >
data.to - mfloor.call(copy.call(data.to))))
);
}),
year: d.gs(
(getYear = function () {
var data = getCalcData(this);
return (
data.sign *
(data.to.getFullYear() -
data.from.getFullYear() -
(data.from - yfloor.call(copy.call(data.from)) >
data.to - yfloor.call(copy.call(data.to))))
);
})
),
milliseconds: d.gs(toPrimitive, null),
seconds: d.gs(function () { return toInteger(this.valueOf() / 1000); }),
minutes: d.gs(function () { return toInteger(this.valueOf() / (1000 * 60)); }),
hours: d.gs(function () { return toInteger(this.valueOf() / (1000 * 60 * 60)); }),
constructor: d(ObservableProperty),
dbKind: d('observableProperty'),
value: d.gs('', function () {
if (!accessSniff && !this.object.__prototypeTurnInProgress__) return getValue.call(this);
return this.object._resolve_(this.__sKey__);
}, function (value) {
var object = this.object, sKey = this.__sKey__;
object._set_(sKey, object._validateSet_(sKey, value));
}),
lastModified: d.gs(function () {
if (this.__lastModified__ == null) {
this.__lastModified__ = this.object._getPropertyLastModified_(this.__sKey__);
}
return this.__lastModified__;
}),
descriptor: d.gs(function () {
return this.object._getDescriptor_(this.__sKey__);
}),
toString: d(function () {
return this.object.stringifyPropertyValue(this.__sKey__);
})
}, lazy({
ownDescriptor: d(function () {
var desc = this.object._getOwnDescriptor_(this.__sKey__);
defineProperty(this, 'descriptor', d('', desc));
return desc;
}, { desc: '' }),
_lastModified: d(function () {
var observable = new ReadOnly(this.lastModified), onUpdate;
this.on('change', onUpdate = function () {
observable._setValue(this.__lastModified__);
}.bind(this));