ferngully-aurelia-tools
Version:
Ferngully Tools for Aurelia
23 lines • 893 B
JavaScript
define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var NullIfEmptyValueConverter = (function () {
function NullIfEmptyValueConverter() {
}
NullIfEmptyValueConverter.prototype.fromView = function (value, trimString) {
if (trimString === void 0) { trimString = true; }
if (value instanceof String) {
if (trimString) {
value = value.trim();
}
return value === "" ? null : value;
}
else {
return value.length === 0 ? null : value;
}
};
return NullIfEmptyValueConverter;
}());
exports.NullIfEmptyValueConverter = NullIfEmptyValueConverter;
});
//# sourceMappingURL=null-if-empty.js.map