index.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.GenericBarcode = undefined;
  6. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7. var _Barcode2 = require("../Barcode.js");
  8. var _Barcode3 = _interopRequireDefault(_Barcode2);
  9. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  10. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  12. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  13. var GenericBarcode = function (_Barcode) {
  14. _inherits(GenericBarcode, _Barcode);
  15. function GenericBarcode(data, options) {
  16. _classCallCheck(this, GenericBarcode);
  17. return _possibleConstructorReturn(this, (GenericBarcode.__proto__ || Object.getPrototypeOf(GenericBarcode)).call(this, data, options)); // Sets this.data and this.text
  18. }
  19. // Return the corresponding binary numbers for the data provided
  20. _createClass(GenericBarcode, [{
  21. key: "encode",
  22. value: function encode() {
  23. return {
  24. data: "10101010101010101010101010101010101010101",
  25. text: this.text
  26. };
  27. }
  28. // Resturn true/false if the string provided is valid for this encoder
  29. }, {
  30. key: "valid",
  31. value: function valid() {
  32. return true;
  33. }
  34. }]);
  35. return GenericBarcode;
  36. }(_Barcode3.default);
  37. exports.GenericBarcode = GenericBarcode;