UNPKG

1.28 kBJavaScriptView Raw
1"use strict";
2var collection_1 = require('../src/facade/collection');
3var lang_1 = require('../src/facade/lang');
4var TouchMap = (function () {
5 function TouchMap(map) {
6 var _this = this;
7 this.map = {};
8 this.keys = {};
9 if (lang_1.isPresent(map)) {
10 collection_1.StringMapWrapper.forEach(map, function (value /** TODO #9100 */, key /** TODO #9100 */) {
11 _this.map[key] = lang_1.isPresent(value) ? value.toString() : null;
12 _this.keys[key] = true;
13 });
14 }
15 }
16 TouchMap.prototype.get = function (key) {
17 collection_1.StringMapWrapper.delete(this.keys, key);
18 return this.map[key];
19 };
20 TouchMap.prototype.getUnused = function () {
21 var _this = this;
22 var unused = {};
23 var keys = collection_1.StringMapWrapper.keys(this.keys);
24 keys.forEach(function (key) { return unused[key] = collection_1.StringMapWrapper.get(_this.map, key); });
25 return unused;
26 };
27 return TouchMap;
28}());
29exports.TouchMap = TouchMap;
30function normalizeString(obj) {
31 if (lang_1.isBlank(obj)) {
32 return null;
33 }
34 else {
35 return obj.toString();
36 }
37}
38exports.normalizeString = normalizeString;
39//# sourceMappingURL=utils.js.map
\No newline at end of file