UNPKG

@danielkalen/simplybind

Version:

Magically simple, framework-less one-way/two-way data binding for frontend/backend in ~5kb.

45 lines (36 loc) 1.16 kB
define(['exports', 'numeral'], function (exports, _numeral) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.NumberFormatValueConverter = undefined; var numeral = _interopRequireWildcard(_numeral); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var NumberFormatValueConverter = exports.NumberFormatValueConverter = function () { function NumberFormatValueConverter() { _classCallCheck(this, NumberFormatValueConverter); } NumberFormatValueConverter.prototype.toView = function toView(value, format) { return numeral(value).format(format); }; return NumberFormatValueConverter; }(); });