Socket
Socket
Sign inDemoInstall

io-barcode

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

io-barcode - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

2

build/browser/io-barcode.min.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):"object"==typeof exports?exports.ioBarcode=e():t.ioBarcode=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(t,e,r){var n=e.getContext("2d"),o=void 0,u=void 0;u=r.height,n.font=r.fontSize+"px "+r.font,n.textBaseline="bottom",n.textBaseline="top","left"===r.textAlign?(o=r.quite,n.textAlign="left"):"right"===r.textAlign?(o=e.width-r.quite,n.textAlign="right"):(o=e.width/2,n.textAlign="center"),n.fillText(t,o,u)}function o(t,e,r){r=u({},d,r);var o=new s["default"],i=new t(e);if(!i.isValid())throw new Error("Content is not supported by the encoding");var c=i.encode(),a=o.getContext("2d");o.width=c.length*r.width+2*r.quite,o.height=r.height+(r.displayValue?1.3*r.fontSize:0),a.clearRect(0,0,o.width,o.height),r.backgroundColor&&(a.fillStyle=r.backgroundColor,a.fillRect(0,0,o.width,o.height)),a.fillStyle=r.lineColor;for(var f=0;f<c.length;f++){var l=f*r.width+r.quite;"1"===c[f]&&a.fillRect(l,0,r.width,r.height)}return r.displayValue&&n(r.customLabel||e,o,r),o}var u=r(1)["default"],i=r(9)["default"];Object.defineProperty(e,"__esModule",{value:!0});var c=r(10),a=i(c),f=r(35),s=i(f),l={},d={width:2,height:100,quite:10,displayValue:!1,font:"monospace",textAlign:"center",fontSize:12,backgroundColor:"",lineColor:"#000"},h=function(t){l[t]=function(){for(var e=arguments.length,r=Array(e),n=0;e>n;n++)r[n]=arguments[n];return o.apply(void 0,[a["default"][t]].concat(r))}};for(var p in a["default"])h(p);e["default"]=l,t.exports=e["default"]},function(t,e,r){t.exports={"default":r(2),__esModule:!0}},function(t,e,r){r(3),t.exports=r(5).core.Object.assign},function(t,e,r){var n=r(4);n(n.S,"Object",{assign:r(7)})},function(t,e,r){function n(t,e){return function(){return t.apply(e,arguments)}}function o(t,e,r){var u,f,s,l,d=t&o.G,h=t&o.P,p=d?i:t&o.S?i[e]:(i[e]||{}).prototype,v=d?c:c[e]||(c[e]={});d&&(r=e);for(u in r)f=!(t&o.F)&&p&&u in p,f&&u in v||(s=f?p[u]:r[u],d&&!a(p[u])?l=r[u]:t&o.B&&f?l=n(s,i):t&o.W&&p[u]==s?!function(t){l=function(e){return this instanceof t?new t(e):t(e)},l.prototype=t.prototype}(s):l=h&&a(s)?n(Function.call,s):s,v[u]=l,h&&((v.prototype||(v.prototype={}))[u]=s))}var u=r(5),i=u.g,c=u.core,a=u.isFunction;o.F=1,o.G=2,o.S=4,o.P=8,o.B=16,o.W=32,t.exports=o},function(t,e,r){"use strict";function n(t){return isNaN(t=+t)?0:(t>0?v:p)(t)}function o(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}function u(t,e,r){return t[e]=r,t}function i(t){return b?function(e,r,n){return O.setDesc(e,r,o(t,n))}:u}function c(t){return null!==t&&("object"==typeof t||"function"==typeof t)}function a(t){return"function"==typeof t}function f(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}var s="undefined"!=typeof self?self:Function("return this")(),l={},d=Object.defineProperty,h={}.hasOwnProperty,p=Math.ceil,v=Math.floor,g=Math.max,y=Math.min,b=!!function(){try{return 2==d({},"a",{get:function(){return 2}}).a}catch(t){}}(),m=i(1),O=t.exports=r(6)({g:s,core:l,html:s.document&&document.documentElement,isObject:c,isFunction:a,that:function(){return this},toInteger:n,toLength:function(t){return t>0?y(n(t),9007199254740991):0},toIndex:function(t,e){return t=n(t),0>t?g(t+e,0):y(t,e)},has:function(t,e){return h.call(t,e)},create:Object.create,getProto:Object.getPrototypeOf,DESC:b,desc:o,getDesc:Object.getOwnPropertyDescriptor,setDesc:d,setDescs:Object.defineProperties,getKeys:Object.keys,getNames:Object.getOwnPropertyNames,getSymbols:Object.getOwnPropertySymbols,assertDefined:f,ES5Object:Object,toObject:function(t){return O.ES5Object(f(t))},hide:m,def:i(0),set:s.Symbol?u:m,each:[].forEach});"undefined"!=typeof __e&&(__e=l),"undefined"!=typeof __g&&(__g=s)},function(t,e){t.exports=function(t){return t.FW=!1,t.path=t.core,t}},function(t,e,r){var n=r(5),o=r(8);t.exports=Object.assign||function(t,e){for(var r=Object(n.assertDefined(t)),u=arguments.length,i=1;u>i;)for(var c,a=n.ES5Object(arguments[i++]),f=o(a),s=f.length,l=0;s>l;)r[c=f[l++]]=a[c];return r}},function(t,e,r){var n=r(5);t.exports=function(t){var e=n.getKeys(t),r=n.getDesc,o=n.getSymbols;return o&&n.each.call(o(t),function(n){r(t,n).enumerable&&e.push(n)}),e}},function(t,e){"use strict";e["default"]=function(t){return t&&t.__esModule?t:{"default":t}},e.__esModule=!0},function(t,e,r){"use strict";var n=r(9)["default"];Object.defineProperty(e,"__esModule",{value:!0});var o=r(11),u=n(o),i=r(16),c=n(i),a=r(25),f=n(a),s=r(26),l=n(s),d=r(27),h=n(d),p=r(28),v=n(p),g=r(30),y=n(g),b=r(31),m=n(b);e["default"]={EAN:u["default"],UPC:c["default"],ITF:f["default"],ITF14:l["default"],CODE39:h["default"],CODE128B:v["default"],CODE128C:y["default"],Pharmacode:m["default"]},t.exports=e["default"]},function(t,e,r){"use strict";var n=r(12)["default"],o=r(15)["default"];Object.defineProperty(e,"__esModule",{value:!0});var u={0:"0001101",1:"0011001",2:"0010011",3:"0111101",4:"0100011",5:"0110001",6:"0101111",7:"0111011",8:"0110111",9:"0001011"},i={0:"0100111",1:"0110011",2:"0011011",3:"0100001",4:"0011101",5:"0111001",6:"0000101",7:"0010001",8:"0001001",9:"0010111"},c={0:"1110010",1:"1100110",2:"1101100",3:"1000010",4:"1011100",5:"1001110",6:"1010000",7:"1000100",8:"1001000",9:"1110100"},a={0:"LLLLLL",1:"LLGLGG",2:"LLGGLG",3:"LLGGGL",4:"LGLLGG",5:"LGGLLG",6:"LGGGLL",7:"LGLGLG",8:"LGLGGL",9:"LGGLGL"},f=/^[0-9]{13}$/,s="101",l="101",d="01010",h=function(){function t(e){o(this,t),this.code=String(e)}return n(t,[{key:"isValid",value:function(){return f.test(this.code)&&Number(this.code[12])===this.checksum()}},{key:"checksum",value:function(){for(var t=0,e=0;12>e;e+=2)t+=Number(this.code[e]);for(var e=1;12>e;e+=2)t+=3*Number(this.code[e]);return(10-t%10)%10}},{key:"encode",value:function(){var t="",e=this.code[0],r=this.code.substr(1,7),n=this.code.substr(7,6);return t+=s,t+=this.encodeStruct(r,a[e]),t+=d,t+=this.encodeStruct(n,"RRRRRR"),t+=l}},{key:"encodeStruct",value:function(t,e){for(var r="",n=0;n<t.length;n++)"L"===e[n]?r+=u[t[n]]:"G"===e[n]?r+=i[t[n]]:"R"===e[n]&&(r+=c[t[n]]);return r}}]),t}();e["default"]=h,t.exports=e["default"]},function(t,e,r){"use strict";var n=r(13)["default"];e["default"]=function(){function t(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),n(t,o.key,o)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),e.__esModule=!0},function(t,e,r){t.exports={"default":r(14),__esModule:!0}},function(t,e,r){var n=r(5);t.exports=function(t,e,r){return n.setDesc(t,e,r)}},function(t,e){"use strict";e["default"]=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},e.__esModule=!0},function(t,e,r){"use strict";var n=r(17)["default"],o=r(20)["default"],u=r(15)["default"],i=r(9)["default"];Object.defineProperty(e,"__esModule",{value:!0});var c=r(11),a=i(c),f=function(t){function e(t){u(this,e),o(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,"0"+t)}return n(e,t),e}(a["default"]);e["default"]=f,t.exports=e["default"]},function(t,e,r){"use strict";var n=r(18)["default"];e["default"]=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=n(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},e.__esModule=!0},function(t,e,r){t.exports={"default":r(19),__esModule:!0}},function(t,e,r){var n=r(5);t.exports=function(t,e){return n.create(t,e)}},function(t,e,r){"use strict";var n=r(21)["default"];e["default"]=function(t,e,r){for(var o=!0;o;){var u=t,i=e,c=r;a=s=f=void 0,o=!1,null===u&&(u=Function.prototype);var a=n(u,i);if(void 0!==a){if("value"in a)return a.value;var f=a.get;return void 0===f?void 0:f.call(c)}var s=Object.getPrototypeOf(u);if(null===s)return void 0;t=s,e=i,r=c,o=!0}},e.__esModule=!0},function(t,e,r){t.exports={"default":r(22),__esModule:!0}},function(t,e,r){var n=r(5);r(23),t.exports=function(t,e){return n.getDesc(t,e)}},function(t,e,r){var n=r(5),o=r(4),u=n.isObject,i=n.toObject;n.each.call("freeze,seal,preventExtensions,isFrozen,isSealed,isExtensible,getOwnPropertyDescriptor,getPrototypeOf,keys,getOwnPropertyNames".split(","),function(t,e){var c=(n.core.Object||{})[t]||Object[t],a=0,f={};f[t]=0==e?function(t){return u(t)?c(t):t}:1==e?function(t){return u(t)?c(t):t}:2==e?function(t){return u(t)?c(t):t}:3==e?function(t){return u(t)?c(t):!0}:4==e?function(t){return u(t)?c(t):!0}:5==e?function(t){return u(t)?c(t):!1}:6==e?function(t,e){return c(i(t),e)}:7==e?function(t){return c(Object(n.assertDefined(t)))}:8==e?function(t){return c(i(t))}:r(24).get;try{c("z")}catch(s){a=1}o(o.S+o.F*a,"Object",f)})},function(t,e,r){function n(t){try{return i(t)}catch(e){return c.slice()}}var o=r(5),u={}.toString,i=o.getNames,c="object"==typeof window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.get=function(t){return c&&"[object Window]"==u.call(t)?n(t):i(o.toObject(t))}},function(t,e,r){"use strict";var n=r(12)["default"],o=r(15)["default"];Object.defineProperty(e,"__esModule",{value:!0});var u={0:"00110",1:"10001",2:"01001",3:"11000",4:"00101",5:"10100",6:"01100",7:"00011",8:"10010",9:"01010"},i="1010",c="11101",a=/^([0-9][0-9])+$/,f=function(){function t(e){o(this,t),this.code=String(e)}return n(t,[{key:"isValid",value:function(){return a.test(this.code)}},{key:"encode",value:function(){var t="";t+=i;for(var e=0;e<this.code.length;e+=2)t+=this.calculatePair(this.code.substr(e,2));return t+=c}},{key:"calculatePair",value:function(t){for(var e="",r=u[t[0]],n=u[t[1]],o=0;5>o;o++)e+="1"===r[o]?"111":"1",e+="1"===n[o]?"000":"0";return e}}]),t}();e["default"]=f,t.exports=e["default"]},function(t,e,r){"use strict";var n=r(17)["default"],o=r(20)["default"],u=r(12)["default"],i=r(15)["default"],c=r(9)["default"];Object.defineProperty(e,"__esModule",{value:!0});var a=r(25),f=c(a),s=/^[0-9]{13,14}$/,l=function(t){function e(t){i(this,e),o(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,t),13===t.length&&(this.code+=this.checksum())}return n(e,t),u(e,[{key:"isValid",value:function(){return o(Object.getPrototypeOf(e.prototype),"isValid",this).call(this)&&s.test(this.code)&&Number(this.code[13])===this.checksum()}},{key:"checksum",value:function(){for(var t=0,e=0;13>e;e++)t+=Number(this.code[e])*(3-e%2*2);return 10-t%10}}]),e}(f["default"]);e["default"]=l,t.exports=e["default"]},function(t,e,r){"use strict";var n=r(12)["default"],o=r(15)["default"];Object.defineProperty(e,"__esModule",{value:!0});var u=[[0,"0","101000111011101"],[1,"1","111010001010111"],[2,"2","101110001010111"],[3,"3","111011100010101"],[4,"4","101000111010111"],[5,"5","111010001110101"],[6,"6","101110001110101"],[7,"7","101000101110111"],[8,"8","111010001011101"],[9,"9","101110001011101"],[10,"A","111010100010111"],[11,"B","101110100010111"],[12,"C","111011101000101"],[13,"D","101011100010111"],[14,"E","111010111000101"],[15,"F","101110111000101"],[16,"G","101010001110111"],[17,"H","111010100011101"],[18,"I","101110100011101"],[19,"J","101011100011101"],[20,"K","111010101000111"],[21,"L","101110101000111"],[22,"M","111011101010001"],[23,"N","101011101000111"],[24,"O","111010111010001"],[25,"P","101110111010001"],[26,"Q","101010111000111"],[27,"R","111010101110001"],[28,"S","101110101110001"],[29,"T","101011101110001"],[30,"U","111000101010111"],[31,"V","100011101010111"],[32,"W","111000111010101"],[33,"X","100010111010111"],[34,"Y","111000101110101"],[35,"Z","100011101110101"],[36,"-","100010101110111"],[37,".","111000101011101"],[38," ","100011101011101"],[39,"$","100010001000101"],[40,"/","100010001010001"],[41,"+","100010100010001"],[42,"%","101000100010001"]],i=/^[0-9a-zA-Z\-\.\ \$\/\+\%]+$/,c=function(){function t(e){o(this,t),this.code=String(e)}return n(t,[{key:"isValid",value:function(){return i.test(this.code)}},{key:"encode",value:function(){var t=this.code.toUpperCase(),e="";e+="1000101110111010";for(var r=0;r<t.length;r++)e+=this.encodingByChar(t[r])+"0";return e+="1000101110111010"}},{key:"encodingByChar",value:function(t){for(var e=0;e<u.length;e++)if(u[e][1]===t)return u[e][2];return""}}]),t}();e["default"]=c,t.exports=e["default"]},function(t,e,r){"use strict";var n=r(17)["default"],o=r(20)["default"],u=r(12)["default"],i=r(15)["default"],c=r(9)["default"];Object.defineProperty(e,"__esModule",{value:!0});var a=r(29),f=c(a),s=function(t){function e(t){i(this,e),o(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,t),this.startCode=104}return n(e,t),u(e,[{key:"encodeClass",value:function(){for(var t="",r=0;r<this.code.length;r++)t+=o(Object.getPrototypeOf(e.prototype),"encodingByChar",this).call(this,this.code[r]);return t}},{key:"checksum",value:function(){for(var t=0,r=0;r<this.code.length;r++)t+=o(Object.getPrototypeOf(e.prototype),"weightByCharacter",this).call(this,this.code[r])*(r+1);return(t+this.startCode)%103}}]),e}(f["default"]);e["default"]=s,t.exports=e["default"]},function(t,e,r){"use strict";var n=r(12)["default"],o=r(15)["default"];Object.defineProperty(e,"__esModule",{value:!0});var u=[[" ","11011001100",0],["!","11001101100",1],['"',"11001100110",2],["#","10010011000",3],["$","10010001100",4],["%","10001001100",5],["&","10011001000",6],["'","10011000100",7],["(","10001100100",8],[")","11001001000",9],["*","11001000100",10],["+","11000100100",11],[",","10110011100",12],["-","10011011100",13],[".","10011001110",14],["/","10111001100",15],["0","10011101100",16],["1","10011100110",17],["2","11001110010",18],["3","11001011100",19],["4","11001001110",20],["5","11011100100",21],["6","11001110100",22],["7","11101101110",23],["8","11101001100",24],["9","11100101100",25],[":","11100100110",26],[";","11101100100",27],["<","11100110100",28],["=","11100110010",29],[">","11011011000",30],["?","11011000110",31],["@","11000110110",32],["A","10100011000",33],["B","10001011000",34],["C","10001000110",35],["D","10110001000",36],["E","10001101000",37],["F","10001100010",38],["G","11010001000",39],["H","11000101000",40],["I","11000100010",41],["J","10110111000",42],["K","10110001110",43],["L","10001101110",44],["M","10111011000",45],["N","10111000110",46],["O","10001110110",47],["P","11101110110",48],["Q","11010001110",49],["R","11000101110",50],["S","11011101000",51],["T","11011100010",52],["U","11011101110",53],["V","11101011000",54],["W","11101000110",55],["X","11100010110",56],["Y","11101101000",57],["Z","11101100010",58],["[","11100011010",59],["\\","11101111010",60],["]","11001000010",61],["^","11110001010",62],["_","10100110000",63],["`","10100001100",64],["a","10010110000",65],["b","10010000110",66],["c","10000101100",67],["d","10000100110",68],["e","10110010000",69],["f","10110000100",70],["g","10011010000",71],["h","10011000010",72],["i","10000110100",73],["j","10000110010",74],["k","11000010010",75],["l","11001010000",76],["m","11110111010",77],["n","11000010100",78],["o","10001111010",79],["p","10100111100",80],["q","10010111100",81],["r","10010011110",82],["s","10111100100",83],["t","10011110100",84],["u","10011110010",85],["v","11110100100",86],["w","11110010100",87],["x","11110010010",88],["y","11011011110",89],["z","11011110110",90],["{","11110110110",91],["|","10101111000",92],["}","10100011110",93],["~","10001011110",94],[String.fromCharCode(127),"10111101000",95],[String.fromCharCode(128),"10111100010",96],[String.fromCharCode(129),"11110101000",97],[String.fromCharCode(130),"11110100010",98],[String.fromCharCode(131),"10111011110",99],[String.fromCharCode(132),"10111101110",100],[String.fromCharCode(133),"11101011110",101],[String.fromCharCode(134),"11110101110",102],[String.fromCharCode(135),"11010000100",103],[String.fromCharCode(136),"11010010000",104],[String.fromCharCode(137),"11010011100",105]],i="1100011101011",c=/^[!-~ ]+$/,a=function(){function t(e){o(this,t),this.code=String(e)}return n(t,[{key:"isValid",value:function(){return c.test(this.code)}},{key:"encode",value:function(){var t="";return t+=this.encodingById(this.startCode),t+=this.encodeClass(),t+=this.encodingById(this.checksum()),t+=i}},{key:"encodingById",value:function(t){for(var e=0;e<u.length;e++)if(u[e][2]===t)return u[e][1];return""}},{key:"weightByCharacter",value:function(t){for(var e=0;e<u.length;e++)if(u[e][0]===t)return u[e][2];return 0}},{key:"encodingByChar",value:function(t){for(var e=0;e<u.length;e++)if(u[e][0]===t)return u[e][1];return""}}]),t}();e["default"]=a,t.exports=e["default"]},function(t,e,r){"use strict";var n=r(17)["default"],o=r(20)["default"],u=r(12)["default"],i=r(15)["default"],c=r(9)["default"];Object.defineProperty(e,"__esModule",{value:!0});var a=r(29),f=c(a),s=function(t){function e(t){i(this,e),o(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,t),this.code=this.code.replace(/ /g,""),this.startCode=105}return n(e,t),u(e,[{key:"encodeClass",value:function(){for(var t="",r=0;r<this.code.length;r+=2)t+=o(Object.getPrototypeOf(e.prototype),"encodingById",this).call(this,Number(this.code.substr(r,2)));return t}},{key:"checksum",value:function(){for(var t=0,e=1,r=0;r<this.code.length;r+=2)t+=Number(this.code.substr(r,2))*e,e++;return(t+this.startCode)%103}}]),e}(f["default"]);e["default"]=s,t.exports=e["default"]},function(t,e,r){"use strict";var n=r(12)["default"],o=r(15)["default"],u=r(9)["default"];Object.defineProperty(e,"__esModule",{value:!0});var i=r(32),c=u(i),a=function(){function t(e){o(this,t),this.code=Number(e)}return n(t,[{key:"isValid",value:function(){return this.code>=3&&this.code<=131070}},{key:"_calcZeros",value:function(t){for(var e=t.length-1,r=0;"0"===t[e]||0>e;)r++,e--;return r}},{key:"encodeBinary",value:function(t,e){if(0===t.length)return"";var r=void 0,n=!1,o=this._calcZeros(t);return 0===o?(r=e?"001":"00111",n=e):(r=c["default"]("001",o-(e?1:0)),r+="00111"),this.encodeBinary(t.substr(0,t.length-o-1),n)+r}},{key:"encode",value:function(){return this.encodeBinary(this.code.toString(2),!0).substr(2)}}]),t}();e["default"]=a,t.exports=e["default"]},function(t,e,r){r(33),t.exports=r(5).core.String.repeat},function(t,e,r){var n=r(4);n(n.P,"String",{repeat:r(34)})},function(t,e,r){"use strict";var n=r(5);t.exports=function(t){var e=String(n.assertDefined(this)),r="",o=n.toInteger(t);if(0>o||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(r+=e);return r}},function(t,e){var r=t.exports=function(t,e){var r=document.createElement("canvas");return r.width=t||300,r.height=e||150,r};r.Image=function(){var t=document.createElement("img");return t}}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):"object"==typeof exports?exports.ioBarcode=e():t.ioBarcode=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t,e,n){var r=e.getContext("2d"),o=void 0,u=void 0;u=n.height,r.font=n.fontWeight+" "+n.fontSize+"px "+n.font,r.textBaseline="bottom",r.textBaseline="top","left"===n.textAlign?(o=n.quite,r.textAlign="left"):"right"===n.textAlign?(o=e.width-n.quite,r.textAlign="right"):(o=e.width/2,r.textAlign="center"),r.fillText(t,o,u)}function o(t,e,n){n=u({},d,n);var o=new s["default"],i=new t(e);if(!i.isValid())throw new Error("Content is not supported by the encoding");var c=i.encode(),a=o.getContext("2d");o.width=c.length*n.width+2*n.quite,o.height=n.height+(n.displayValue?1.3*n.fontSize:0),a.clearRect(0,0,o.width,o.height),n.backgroundColor&&(a.fillStyle=n.backgroundColor,a.fillRect(0,0,o.width,o.height)),a.fillStyle=n.lineColor;for(var f=0;f<c.length;f++){var l=f*n.width+n.quite;"1"===c[f]&&a.fillRect(l,0,n.width,n.height)}return n.displayValue&&r(n.customLabel||e,o,n),o}var u=n(1)["default"],i=n(9)["default"];Object.defineProperty(e,"__esModule",{value:!0});var c=n(10),a=i(c),f=n(35),s=i(f),l={},d={width:2,height:100,quite:10,displayValue:!1,font:"monospace",textAlign:"center",fontSize:12,fontWeight:"normal",backgroundColor:"",lineColor:"#000"},h=function(t){l[t]=function(){for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return o.apply(void 0,[a["default"][t]].concat(n))}};for(var p in a["default"])h(p);e["default"]=l,t.exports=e["default"]},function(t,e,n){t.exports={"default":n(2),__esModule:!0}},function(t,e,n){n(3),t.exports=n(5).core.Object.assign},function(t,e,n){var r=n(4);r(r.S,"Object",{assign:n(7)})},function(t,e,n){function r(t,e){return function(){return t.apply(e,arguments)}}function o(t,e,n){var u,f,s,l,d=t&o.G,h=t&o.P,p=d?i:t&o.S?i[e]:(i[e]||{}).prototype,v=d?c:c[e]||(c[e]={});d&&(n=e);for(u in n)f=!(t&o.F)&&p&&u in p,f&&u in v||(s=f?p[u]:n[u],d&&!a(p[u])?l=n[u]:t&o.B&&f?l=r(s,i):t&o.W&&p[u]==s?!function(t){l=function(e){return this instanceof t?new t(e):t(e)},l.prototype=t.prototype}(s):l=h&&a(s)?r(Function.call,s):s,v[u]=l,h&&((v.prototype||(v.prototype={}))[u]=s))}var u=n(5),i=u.g,c=u.core,a=u.isFunction;o.F=1,o.G=2,o.S=4,o.P=8,o.B=16,o.W=32,t.exports=o},function(t,e,n){"use strict";function r(t){return isNaN(t=+t)?0:(t>0?v:p)(t)}function o(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}function u(t,e,n){return t[e]=n,t}function i(t){return b?function(e,n,r){return O.setDesc(e,n,o(t,r))}:u}function c(t){return null!==t&&("object"==typeof t||"function"==typeof t)}function a(t){return"function"==typeof t}function f(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}var s="undefined"!=typeof self?self:Function("return this")(),l={},d=Object.defineProperty,h={}.hasOwnProperty,p=Math.ceil,v=Math.floor,g=Math.max,y=Math.min,b=!!function(){try{return 2==d({},"a",{get:function(){return 2}}).a}catch(t){}}(),m=i(1),O=t.exports=n(6)({g:s,core:l,html:s.document&&document.documentElement,isObject:c,isFunction:a,that:function(){return this},toInteger:r,toLength:function(t){return t>0?y(r(t),9007199254740991):0},toIndex:function(t,e){return t=r(t),0>t?g(t+e,0):y(t,e)},has:function(t,e){return h.call(t,e)},create:Object.create,getProto:Object.getPrototypeOf,DESC:b,desc:o,getDesc:Object.getOwnPropertyDescriptor,setDesc:d,setDescs:Object.defineProperties,getKeys:Object.keys,getNames:Object.getOwnPropertyNames,getSymbols:Object.getOwnPropertySymbols,assertDefined:f,ES5Object:Object,toObject:function(t){return O.ES5Object(f(t))},hide:m,def:i(0),set:s.Symbol?u:m,each:[].forEach});"undefined"!=typeof __e&&(__e=l),"undefined"!=typeof __g&&(__g=s)},function(t,e){t.exports=function(t){return t.FW=!1,t.path=t.core,t}},function(t,e,n){var r=n(5),o=n(8);t.exports=Object.assign||function(t,e){for(var n=Object(r.assertDefined(t)),u=arguments.length,i=1;u>i;)for(var c,a=r.ES5Object(arguments[i++]),f=o(a),s=f.length,l=0;s>l;)n[c=f[l++]]=a[c];return n}},function(t,e,n){var r=n(5);t.exports=function(t){var e=r.getKeys(t),n=r.getDesc,o=r.getSymbols;return o&&r.each.call(o(t),function(r){n(t,r).enumerable&&e.push(r)}),e}},function(t,e){"use strict";e["default"]=function(t){return t&&t.__esModule?t:{"default":t}},e.__esModule=!0},function(t,e,n){"use strict";var r=n(9)["default"];Object.defineProperty(e,"__esModule",{value:!0});var o=n(11),u=r(o),i=n(16),c=r(i),a=n(25),f=r(a),s=n(26),l=r(s),d=n(27),h=r(d),p=n(28),v=r(p),g=n(30),y=r(g),b=n(31),m=r(b);e["default"]={EAN:u["default"],UPC:c["default"],ITF:f["default"],ITF14:l["default"],CODE39:h["default"],CODE128B:v["default"],CODE128C:y["default"],Pharmacode:m["default"]},t.exports=e["default"]},function(t,e,n){"use strict";var r=n(12)["default"],o=n(15)["default"];Object.defineProperty(e,"__esModule",{value:!0});var u={0:"0001101",1:"0011001",2:"0010011",3:"0111101",4:"0100011",5:"0110001",6:"0101111",7:"0111011",8:"0110111",9:"0001011"},i={0:"0100111",1:"0110011",2:"0011011",3:"0100001",4:"0011101",5:"0111001",6:"0000101",7:"0010001",8:"0001001",9:"0010111"},c={0:"1110010",1:"1100110",2:"1101100",3:"1000010",4:"1011100",5:"1001110",6:"1010000",7:"1000100",8:"1001000",9:"1110100"},a={0:"LLLLLL",1:"LLGLGG",2:"LLGGLG",3:"LLGGGL",4:"LGLLGG",5:"LGGLLG",6:"LGGGLL",7:"LGLGLG",8:"LGLGGL",9:"LGGLGL"},f=/^[0-9]{13}$/,s="101",l="101",d="01010",h=function(){function t(e){o(this,t),this.code=String(e)}return r(t,[{key:"isValid",value:function(){return f.test(this.code)&&Number(this.code[12])===this.checksum()}},{key:"checksum",value:function(){for(var t=0,e=0;12>e;e+=2)t+=Number(this.code[e]);for(var e=1;12>e;e+=2)t+=3*Number(this.code[e]);return(10-t%10)%10}},{key:"encode",value:function(){var t="",e=this.code[0],n=this.code.substr(1,7),r=this.code.substr(7,6);return t+=s,t+=this.encodeStruct(n,a[e]),t+=d,t+=this.encodeStruct(r,"RRRRRR"),t+=l}},{key:"encodeStruct",value:function(t,e){for(var n="",r=0;r<t.length;r++)"L"===e[r]?n+=u[t[r]]:"G"===e[r]?n+=i[t[r]]:"R"===e[r]&&(n+=c[t[r]]);return n}}]),t}();e["default"]=h,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(13)["default"];e["default"]=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),r(t,o.key,o)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),e.__esModule=!0},function(t,e,n){t.exports={"default":n(14),__esModule:!0}},function(t,e,n){var r=n(5);t.exports=function(t,e,n){return r.setDesc(t,e,n)}},function(t,e){"use strict";e["default"]=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},e.__esModule=!0},function(t,e,n){"use strict";var r=n(17)["default"],o=n(20)["default"],u=n(15)["default"],i=n(9)["default"];Object.defineProperty(e,"__esModule",{value:!0});var c=n(11),a=i(c),f=function(t){function e(t){u(this,e),o(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,"0"+t)}return r(e,t),e}(a["default"]);e["default"]=f,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(18)["default"];e["default"]=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=r(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(t.__proto__=e)},e.__esModule=!0},function(t,e,n){t.exports={"default":n(19),__esModule:!0}},function(t,e,n){var r=n(5);t.exports=function(t,e){return r.create(t,e)}},function(t,e,n){"use strict";var r=n(21)["default"];e["default"]=function(t,e,n){for(var o=!0;o;){var u=t,i=e,c=n;a=s=f=void 0,o=!1,null===u&&(u=Function.prototype);var a=r(u,i);if(void 0!==a){if("value"in a)return a.value;var f=a.get;return void 0===f?void 0:f.call(c)}var s=Object.getPrototypeOf(u);if(null===s)return void 0;t=s,e=i,n=c,o=!0}},e.__esModule=!0},function(t,e,n){t.exports={"default":n(22),__esModule:!0}},function(t,e,n){var r=n(5);n(23),t.exports=function(t,e){return r.getDesc(t,e)}},function(t,e,n){var r=n(5),o=n(4),u=r.isObject,i=r.toObject;r.each.call("freeze,seal,preventExtensions,isFrozen,isSealed,isExtensible,getOwnPropertyDescriptor,getPrototypeOf,keys,getOwnPropertyNames".split(","),function(t,e){var c=(r.core.Object||{})[t]||Object[t],a=0,f={};f[t]=0==e?function(t){return u(t)?c(t):t}:1==e?function(t){return u(t)?c(t):t}:2==e?function(t){return u(t)?c(t):t}:3==e?function(t){return u(t)?c(t):!0}:4==e?function(t){return u(t)?c(t):!0}:5==e?function(t){return u(t)?c(t):!1}:6==e?function(t,e){return c(i(t),e)}:7==e?function(t){return c(Object(r.assertDefined(t)))}:8==e?function(t){return c(i(t))}:n(24).get;try{c("z")}catch(s){a=1}o(o.S+o.F*a,"Object",f)})},function(t,e,n){function r(t){try{return i(t)}catch(e){return c.slice()}}var o=n(5),u={}.toString,i=o.getNames,c="object"==typeof window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.get=function(t){return c&&"[object Window]"==u.call(t)?r(t):i(o.toObject(t))}},function(t,e,n){"use strict";var r=n(12)["default"],o=n(15)["default"];Object.defineProperty(e,"__esModule",{value:!0});var u={0:"00110",1:"10001",2:"01001",3:"11000",4:"00101",5:"10100",6:"01100",7:"00011",8:"10010",9:"01010"},i="1010",c="11101",a=/^([0-9][0-9])+$/,f=function(){function t(e){o(this,t),this.code=String(e)}return r(t,[{key:"isValid",value:function(){return a.test(this.code)}},{key:"encode",value:function(){var t="";t+=i;for(var e=0;e<this.code.length;e+=2)t+=this.calculatePair(this.code.substr(e,2));return t+=c}},{key:"calculatePair",value:function(t){for(var e="",n=u[t[0]],r=u[t[1]],o=0;5>o;o++)e+="1"===n[o]?"111":"1",e+="1"===r[o]?"000":"0";return e}}]),t}();e["default"]=f,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(17)["default"],o=n(20)["default"],u=n(12)["default"],i=n(15)["default"],c=n(9)["default"];Object.defineProperty(e,"__esModule",{value:!0});var a=n(25),f=c(a),s=/^[0-9]{13,14}$/,l=function(t){function e(t){i(this,e),o(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,t),13===t.length&&(this.code+=this.checksum())}return r(e,t),u(e,[{key:"isValid",value:function(){return o(Object.getPrototypeOf(e.prototype),"isValid",this).call(this)&&s.test(this.code)&&Number(this.code[13])===this.checksum()}},{key:"checksum",value:function(){for(var t=0,e=0;13>e;e++)t+=Number(this.code[e])*(3-e%2*2);return 10-t%10}}]),e}(f["default"]);e["default"]=l,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(12)["default"],o=n(15)["default"];Object.defineProperty(e,"__esModule",{value:!0});var u=[[0,"0","101000111011101"],[1,"1","111010001010111"],[2,"2","101110001010111"],[3,"3","111011100010101"],[4,"4","101000111010111"],[5,"5","111010001110101"],[6,"6","101110001110101"],[7,"7","101000101110111"],[8,"8","111010001011101"],[9,"9","101110001011101"],[10,"A","111010100010111"],[11,"B","101110100010111"],[12,"C","111011101000101"],[13,"D","101011100010111"],[14,"E","111010111000101"],[15,"F","101110111000101"],[16,"G","101010001110111"],[17,"H","111010100011101"],[18,"I","101110100011101"],[19,"J","101011100011101"],[20,"K","111010101000111"],[21,"L","101110101000111"],[22,"M","111011101010001"],[23,"N","101011101000111"],[24,"O","111010111010001"],[25,"P","101110111010001"],[26,"Q","101010111000111"],[27,"R","111010101110001"],[28,"S","101110101110001"],[29,"T","101011101110001"],[30,"U","111000101010111"],[31,"V","100011101010111"],[32,"W","111000111010101"],[33,"X","100010111010111"],[34,"Y","111000101110101"],[35,"Z","100011101110101"],[36,"-","100010101110111"],[37,".","111000101011101"],[38," ","100011101011101"],[39,"$","100010001000101"],[40,"/","100010001010001"],[41,"+","100010100010001"],[42,"%","101000100010001"]],i=/^[0-9a-zA-Z\-\.\ \$\/\+\%]+$/,c=function(){function t(e){o(this,t),this.code=String(e)}return r(t,[{key:"isValid",value:function(){return i.test(this.code)}},{key:"encode",value:function(){var t=this.code.toUpperCase(),e="";e+="1000101110111010";for(var n=0;n<t.length;n++)e+=this.encodingByChar(t[n])+"0";return e+="1000101110111010"}},{key:"encodingByChar",value:function(t){for(var e=0;e<u.length;e++)if(u[e][1]===t)return u[e][2];return""}}]),t}();e["default"]=c,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(17)["default"],o=n(20)["default"],u=n(12)["default"],i=n(15)["default"],c=n(9)["default"];Object.defineProperty(e,"__esModule",{value:!0});var a=n(29),f=c(a),s=function(t){function e(t){i(this,e),o(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,t),this.startCode=104}return r(e,t),u(e,[{key:"encodeClass",value:function(){for(var t="",n=0;n<this.code.length;n++)t+=o(Object.getPrototypeOf(e.prototype),"encodingByChar",this).call(this,this.code[n]);return t}},{key:"checksum",value:function(){for(var t=0,n=0;n<this.code.length;n++)t+=o(Object.getPrototypeOf(e.prototype),"weightByCharacter",this).call(this,this.code[n])*(n+1);return(t+this.startCode)%103}}]),e}(f["default"]);e["default"]=s,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(12)["default"],o=n(15)["default"];Object.defineProperty(e,"__esModule",{value:!0});var u=[[" ","11011001100",0],["!","11001101100",1],['"',"11001100110",2],["#","10010011000",3],["$","10010001100",4],["%","10001001100",5],["&","10011001000",6],["'","10011000100",7],["(","10001100100",8],[")","11001001000",9],["*","11001000100",10],["+","11000100100",11],[",","10110011100",12],["-","10011011100",13],[".","10011001110",14],["/","10111001100",15],["0","10011101100",16],["1","10011100110",17],["2","11001110010",18],["3","11001011100",19],["4","11001001110",20],["5","11011100100",21],["6","11001110100",22],["7","11101101110",23],["8","11101001100",24],["9","11100101100",25],[":","11100100110",26],[";","11101100100",27],["<","11100110100",28],["=","11100110010",29],[">","11011011000",30],["?","11011000110",31],["@","11000110110",32],["A","10100011000",33],["B","10001011000",34],["C","10001000110",35],["D","10110001000",36],["E","10001101000",37],["F","10001100010",38],["G","11010001000",39],["H","11000101000",40],["I","11000100010",41],["J","10110111000",42],["K","10110001110",43],["L","10001101110",44],["M","10111011000",45],["N","10111000110",46],["O","10001110110",47],["P","11101110110",48],["Q","11010001110",49],["R","11000101110",50],["S","11011101000",51],["T","11011100010",52],["U","11011101110",53],["V","11101011000",54],["W","11101000110",55],["X","11100010110",56],["Y","11101101000",57],["Z","11101100010",58],["[","11100011010",59],["\\","11101111010",60],["]","11001000010",61],["^","11110001010",62],["_","10100110000",63],["`","10100001100",64],["a","10010110000",65],["b","10010000110",66],["c","10000101100",67],["d","10000100110",68],["e","10110010000",69],["f","10110000100",70],["g","10011010000",71],["h","10011000010",72],["i","10000110100",73],["j","10000110010",74],["k","11000010010",75],["l","11001010000",76],["m","11110111010",77],["n","11000010100",78],["o","10001111010",79],["p","10100111100",80],["q","10010111100",81],["r","10010011110",82],["s","10111100100",83],["t","10011110100",84],["u","10011110010",85],["v","11110100100",86],["w","11110010100",87],["x","11110010010",88],["y","11011011110",89],["z","11011110110",90],["{","11110110110",91],["|","10101111000",92],["}","10100011110",93],["~","10001011110",94],[String.fromCharCode(127),"10111101000",95],[String.fromCharCode(128),"10111100010",96],[String.fromCharCode(129),"11110101000",97],[String.fromCharCode(130),"11110100010",98],[String.fromCharCode(131),"10111011110",99],[String.fromCharCode(132),"10111101110",100],[String.fromCharCode(133),"11101011110",101],[String.fromCharCode(134),"11110101110",102],[String.fromCharCode(135),"11010000100",103],[String.fromCharCode(136),"11010010000",104],[String.fromCharCode(137),"11010011100",105]],i="1100011101011",c=/^[!-~ ]+$/,a=function(){function t(e){o(this,t),this.code=String(e)}return r(t,[{key:"isValid",value:function(){return c.test(this.code)}},{key:"encode",value:function(){var t="";return t+=this.encodingById(this.startCode),t+=this.encodeClass(),t+=this.encodingById(this.checksum()),t+=i}},{key:"encodingById",value:function(t){for(var e=0;e<u.length;e++)if(u[e][2]===t)return u[e][1];return""}},{key:"weightByCharacter",value:function(t){for(var e=0;e<u.length;e++)if(u[e][0]===t)return u[e][2];return 0}},{key:"encodingByChar",value:function(t){for(var e=0;e<u.length;e++)if(u[e][0]===t)return u[e][1];return""}}]),t}();e["default"]=a,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(17)["default"],o=n(20)["default"],u=n(12)["default"],i=n(15)["default"],c=n(9)["default"];Object.defineProperty(e,"__esModule",{value:!0});var a=n(29),f=c(a),s=function(t){function e(t){i(this,e),o(Object.getPrototypeOf(e.prototype),"constructor",this).call(this,t),this.code=this.code.replace(/ /g,""),this.startCode=105}return r(e,t),u(e,[{key:"encodeClass",value:function(){for(var t="",n=0;n<this.code.length;n+=2)t+=o(Object.getPrototypeOf(e.prototype),"encodingById",this).call(this,Number(this.code.substr(n,2)));return t}},{key:"checksum",value:function(){for(var t=0,e=1,n=0;n<this.code.length;n+=2)t+=Number(this.code.substr(n,2))*e,e++;return(t+this.startCode)%103}}]),e}(f["default"]);e["default"]=s,t.exports=e["default"]},function(t,e,n){"use strict";var r=n(12)["default"],o=n(15)["default"],u=n(9)["default"];Object.defineProperty(e,"__esModule",{value:!0});var i=n(32),c=u(i),a=function(){function t(e){o(this,t),this.code=Number(e)}return r(t,[{key:"isValid",value:function(){return this.code>=3&&this.code<=131070}},{key:"_calcZeros",value:function(t){for(var e=t.length-1,n=0;"0"===t[e]||0>e;)n++,e--;return n}},{key:"encodeBinary",value:function(t,e){if(0===t.length)return"";var n=void 0,r=!1,o=this._calcZeros(t);return 0===o?(n=e?"001":"00111",r=e):(n=c["default"]("001",o-(e?1:0)),n+="00111"),this.encodeBinary(t.substr(0,t.length-o-1),r)+n}},{key:"encode",value:function(){return this.encodeBinary(this.code.toString(2),!0).substr(2)}}]),t}();e["default"]=a,t.exports=e["default"]},function(t,e,n){n(33),t.exports=n(5).core.String.repeat},function(t,e,n){var r=n(4);r(r.P,"String",{repeat:n(34)})},function(t,e,n){"use strict";var r=n(5);t.exports=function(t){var e=String(r.assertDefined(this)),n="",o=r.toInteger(t);if(0>o||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(n+=e);return n}},function(t,e){var n=t.exports=function(t,e){var n=document.createElement("canvas");return n.width=t||300,n.height=e||150,n};n.Image=function(){var t=document.createElement("img");return t}}])});

@@ -29,2 +29,3 @@ 'use strict';

fontSize: 12,
fontWeight: 'normal',
backgroundColor: '',

@@ -41,3 +42,3 @@ lineColor: '#000'

ctx.font = opts.fontSize + 'px ' + opts.font;
ctx.font = opts.fontWeight + ' ' + opts.fontSize + 'px ' + opts.font;
ctx.textBaseline = 'bottom';

@@ -44,0 +45,0 @@ ctx.textBaseline = 'top';

1.2.0 / 2015-07-10
==================
* Add font weight customization [orzarchi]
1.1.0 / 2015-07-06

@@ -3,0 +8,0 @@ ==================

@@ -14,2 +14,3 @@ import encodings from './encodings'

fontSize: 12,
fontWeight: 'normal',
backgroundColor: '',

@@ -25,3 +26,3 @@ lineColor: '#000'

ctx.font = `${opts.fontSize}px ${opts.font}`
ctx.font = `${opts.fontWeight} ${opts.fontSize}px ${opts.font}`
ctx.textBaseline = 'bottom'

@@ -28,0 +29,0 @@ ctx.textBaseline = 'top'

{
"name": "io-barcode",
"version": "1.1.0",
"version": "1.2.0",
"description": "Isomorphic barcode generator for Node and browsers",

@@ -5,0 +5,0 @@ "keywords": [],

@@ -66,2 +66,3 @@ [![npm package](https://img.shields.io/npm/v/io-barcode.svg?style=flat-square)](https://www.npmjs.org/package/io-barcode)

fontSize: 12,
fontWeight: 'bold',
backgroundColor: '',

@@ -68,0 +69,0 @@ lineColor: "#000",

@@ -36,2 +36,3 @@ import ioBarcode from '../modules'

font: 'Arial',
fontWeight: 'bold',
fontSize: 14,

@@ -38,0 +39,0 @@ quite: 50,

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc