decova-dotnet
Version:
This package provides fundumentals that a .net developer may miss while working with Typescript, whether they are missing functinalities or funcionalities provided in a non-elegant design in javascript. Bad naming, bad design of optional parameters, non-c
59 lines • 1.91 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
require("./Map.types");
const Dictionary_1 = require("./Dictionary");
let proto = Map.prototype;
proto.xAdd = function (key, value) {
new Dictionary_1.Dictionary(this).Add(key, value);
};
proto.xEnsure = function (key, value, overwriteIfExising = false) {
return new Dictionary_1.Dictionary(this).Ensure(key, value, overwriteIfExising);
};
proto.xGet = function (key) {
return new Dictionary_1.Dictionary(this).Get(key);
};
proto.xSet = function (key, value) {
new Dictionary_1.Dictionary(this).Set(key, value);
};
proto.xUpdateOnlyIfAny = function (key, value) {
return new Dictionary_1.Dictionary(this).UpdateOnlyIfAny(key, value);
};
proto.xRemove = function (key) {
return new Dictionary_1.Dictionary(this).Remove(key);
};
proto.xEnsureRemoved = function (key) {
return new Dictionary_1.Dictionary(this).EnsureRemoved(key);
};
proto.xKeys = function () {
return new Dictionary_1.Dictionary(this).Keys.Array;
};
proto.xValues = function () {
return new Dictionary_1.Dictionary(this).Values.Array;
};
proto.xClear = function () {
new Dictionary_1.Dictionary(this).Clear();
};
proto.xForeach = function (func) {
new Dictionary_1.Dictionary(this).Foreach(func);
};
proto.xContainsKey = function (key) {
return new Dictionary_1.Dictionary(this).Contains(key);
};
proto.xClone = function () {
const clone = new Map();
this.forEach((v, k) => {
clone.set(k, v);
});
return clone;
};
proto.xCount = function () {
return new Dictionary_1.Dictionary(this).Count;
};
proto.xAny = function () {
return this.size > 0;
};
let protoConstructor = Map;
protoConstructor.FromObjectProps = function (obj) {
return Dictionary_1.Dictionary.FromObjectProps(obj)._map;
};
//# sourceMappingURL=Map.impl.js.map