CODE128_AUTO.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. 'use strict';
  2. import _CODE3 from './CODE128'
  3. import _auto2 from './auto'
  4. function _interopRequireDefault(obj) {
  5. return obj && obj.__esModule ? obj : {
  6. default: obj
  7. };
  8. }
  9. function _classCallCheck(instance, Constructor) {
  10. if (!(instance instanceof Constructor)) {
  11. throw new TypeError("Cannot call a class as a function");
  12. }
  13. }
  14. function _possibleConstructorReturn(self, call) {
  15. if (!self) {
  16. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  17. }
  18. return call && (typeof call === "object" || typeof call === "function") ? call : self;
  19. }
  20. function _inherits(subClass, superClass) {
  21. if (typeof superClass !== "function" && superClass !== null) {
  22. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  23. }
  24. subClass.prototype = Object.create(superClass && superClass.prototype, {
  25. constructor: {
  26. value: subClass,
  27. enumerable: false,
  28. writable: true,
  29. configurable: true
  30. }
  31. });
  32. if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ =
  33. superClass;
  34. }
  35. var CODE128AUTO = function(_CODE) {
  36. _inherits(CODE128AUTO, _CODE);
  37. function CODE128AUTO(data, options) {
  38. _classCallCheck(this, CODE128AUTO);
  39. // ASCII value ranges 0-127, 200-211
  40. if (/^[\x00-\x7F\xC8-\xD3]+$/.test(data)) {
  41. var _this = _possibleConstructorReturn(this, (CODE128AUTO.__proto__ || Object.getPrototypeOf(
  42. CODE128AUTO)).call(this, (0, _auto2)(data), options));
  43. } else {
  44. var _this = _possibleConstructorReturn(this, (CODE128AUTO.__proto__ || Object.getPrototypeOf(
  45. CODE128AUTO)).call(this, data, options));
  46. }
  47. return _possibleConstructorReturn(_this);
  48. }
  49. return CODE128AUTO;
  50. }(_CODE3);
  51. export default CODE128AUTO;