Socket
Socket
Sign inDemoInstall

@zxing/library

Package Overview
Dependencies
Maintainers
3
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zxing/library - npm Package Compare versions

Comparing version 0.5.1 to 0.6.0-dev.6787c8

esm5/browser/BrowserDatamatrixCodeReader.d.ts

6

esm5/core/common/detector/WhiteRectangleDetector.js

@@ -51,8 +51,8 @@ "use strict";

if (undefined === x || null === x) {
x = image.getWidth() / 2;
x = image.getWidth() / 2 | 0;
}
if (undefined === y || null === y) {
y = image.getHeight() / 2;
y = image.getHeight() / 2 | 0;
}
var halfsize = initSize / 2;
var halfsize = initSize / 2 | 0;
this.leftInit = x - halfsize;

@@ -59,0 +59,0 @@ this.rightInit = x + halfsize;

@@ -99,3 +99,3 @@ "use strict";

// Run Euclidean algorithm until r's degree is less than R/2
while (r.getDegree() >= R / 2) {
while (r.getDegree() >= (R / 2 | 0)) {
var rLastLast = rLast;

@@ -102,0 +102,0 @@ var tLastLast = tLast;

@@ -11,6 +11,6 @@ import DecodeHintType from './../DecodeHintType';

static GB2312: string;
static ISO88591: string;
private static EUC_JP;
private static UTF8;
private static PLATFORM_DEFAULT_ENCODING;
private static ISO88591;
private static ASSUME_SHIFT_JIS;

@@ -17,0 +17,0 @@ private StringUtils();

@@ -199,6 +199,6 @@ "use strict";

StringUtils.GB2312 = 'GB2312';
StringUtils.ISO88591 = CharacterSetECI_1.default.ISO8859_1.getName(); // "ISO8859_1"
StringUtils.EUC_JP = 'EUC_JP';
StringUtils.UTF8 = CharacterSetECI_1.default.UTF8.getName(); // "UTF8"
StringUtils.PLATFORM_DEFAULT_ENCODING = StringUtils.UTF8; // "UTF8"//Charset.defaultCharset().name()
StringUtils.ISO88591 = CharacterSetECI_1.default.ISO8859_1.getName(); // "ISO8859_1"
StringUtils.ASSUME_SHIFT_JIS = false;

@@ -205,0 +205,0 @@ return StringUtils;

@@ -21,2 +21,3 @@ "use strict";

var MultiFormatOneDReader_1 = require("./oned/MultiFormatOneDReader");
var DataMatrixReader_1 = require("./datamatrix/DataMatrixReader");
/*namespace com.google.zxing {*/

@@ -109,5 +110,5 @@ /**

}
// if (formats.contains(BarcodeFormat.DATA_MATRIX)) {
// readers.push(new DataMatrixReader())
// }
if (formats.contains(5 /* DATA_MATRIX */)) {
readers.push(new DataMatrixReader_1.default());
}
// if (formats.contains(BarcodeFormat.AZTEC)) {

@@ -132,3 +133,3 @@ // readers.push(new AztecReader())

readers.push(new QRCodeReader_1.default());
// readers.push(new DataMatrixReader())
readers.push(new DataMatrixReader_1.default());
// readers.push(new AztecReader())

@@ -135,0 +136,0 @@ // readers.push(new PDF417Reader())

@@ -32,2 +32,3 @@ "use strict";

var ITFReader_1 = require("./ITFReader");
var MultiFormatUPCEANReader_1 = require("./MultiFormatUPCEANReader");
/**

@@ -45,2 +46,5 @@ * @author Daniel Switkin <dswitkin@google.com>

if (possibleFormats) {
if (possibleFormats.get(7 /* EAN_13 */)) {
_this.readers.push(new MultiFormatUPCEANReader_1.default(hints));
}
// if (possibleFormats.get(BarcodeFormat.EAN_13) ||

@@ -79,2 +83,3 @@ // possibleFormats.get(BarcodeFormat.UPC_A) ||

// this.readers.push(new Code93Reader());
_this.readers.push(new MultiFormatUPCEANReader_1.default(hints));
_this.readers.push(new Code128Reader_1.default());

@@ -81,0 +86,0 @@ _this.readers.push(new ITFReader_1.default());

@@ -10,2 +10,3 @@ export default class StringBuilder {

toString(): string;
insert(n: number, c: string): void;
}

@@ -32,2 +32,5 @@ "use strict";

};
StringBuilder.prototype.insert = function (n, c) {
this.value = this.value.substr(0, n) + c + this.value.substr(n + c.length);
};
return StringBuilder;

@@ -34,0 +37,0 @@ }());

export { default as BrowserCodeReader } from './browser/BrowserCodeReader';
export * from './browser/BrowserQRCodeReader';
export * from './browser/BrowserDatamatrixCodeReader';
export * from './browser/BrowserQRCodeSvgWriter';

@@ -45,3 +46,4 @@ export { default as HTMLCanvasElementLuminanceSource } from './browser/HTMLCanvasElementLuminanceSource';

export { default as OneDReader } from './core/oned/OneDReader';
export { default as EAN13Reader } from './core/oned/EAN13Reader';
export { default as Code128Reader } from './core/oned/Code128Reader';
export { default as ITFReader } from './core/oned/ITFReader';

@@ -10,2 +10,3 @@ "use strict";

__export(require("./browser/BrowserQRCodeReader"));
__export(require("./browser/BrowserDatamatrixCodeReader"));
__export(require("./browser/BrowserQRCodeSvgWriter"));

@@ -89,2 +90,4 @@ var HTMLCanvasElementLuminanceSource_1 = require("./browser/HTMLCanvasElementLuminanceSource");

exports.OneDReader = OneDReader_1.default;
var EAN13Reader_1 = require("./core/oned/EAN13Reader");
exports.EAN13Reader = EAN13Reader_1.default;
var Code128Reader_1 = require("./core/oned/Code128Reader");

@@ -91,0 +94,0 @@ exports.Code128Reader = Code128Reader_1.default;

@@ -23,6 +23,3 @@ /**

files: [
// 'node_modules/expect.js/index.js',
'src/**/*.ts'
],
files: ['src/**/*.ts'],

@@ -38,3 +35,2 @@ preprocessors: {

require('karma-sinon'),
require('karma-phantomjs-launcher'),
require('karma-remap-coverage'),

@@ -93,4 +89,15 @@ require('karma-typescript'),

*/
browsers: ['PhantomJS'],
browsers: ['Chrome_headless'],
customLaunchers: {
Chrome_headless: {
base: 'Chrome',
flags: [
' — headless',
' — disable-gpu',
' — remote-debugging-port=9222'
]
}
},
/**

@@ -97,0 +104,0 @@ * Keep testing or not.

{
"name": "@zxing/library",
"version": "0.5.1",
"version": "0.6.0-dev.6787c8",
"description": "TypeScript port of ZXing multi-format 1D/2D barcode image processing library, with Code128 and ITF support.",

@@ -46,11 +46,15 @@ "keywords": [

"private": false,
"main": "./bundles/library.js",
"es2015": "./bundles/library.min.js",
"main": "./umd/index.js",
"module": "./esm5/index.js",
"typings": "./esm5/index.d.ts",
"scripts": {
"clean": "shx rm -rf bundles esm5",
"build": "yarn clean && tsc && tsc --target es5 --outDir esm5 && webpack && webpack --env.prod",
"test": "mocha-webpack --webpack-config webpack.config.test.js src/test.js --timeout 20000",
"lint": "tslint src/**/*.ts"
"clean": "yarn shx rm -rf umd esm5",
"build": "yarn clean && yarn tsc && yarn webpack --mode production",
"test": "yarn mocha-webpack --webpack-config webpack.config.test.js src/test.js --timeout 20000",
"lint": "yarn tslint src/**/*.ts",
"shx": "./node_modules/.bin/shx",
"tsc": "./node_modules/.bin/tsc",
"tslint": "./node_modules/.bin/tslint",
"mocha-webpack": "./node_modules/.bin/mocha-webpack",
"webpack": "./node_modules/.bin/webpack-cli"
},

@@ -73,3 +77,2 @@ "dependencies": {

"eslint": "^4.19.1",
"jasmine": "^3.0.0",
"karma": "^2.0.0",

@@ -79,6 +82,3 @@ "karma-chai": "^0.1.0",

"karma-coverage": "^1.1.2",
"karma-jasmine": "^1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-mocha": "^1.3.0",
"karma-phantomjs-launcher": "^1.0.4",
"karma-remap-coverage": "^0.1.5",

@@ -89,11 +89,9 @@ "karma-sinon": "^1.0.5",

"karma-typescript-preprocessor": "^0.3.1",
"karma-typescript-preprocessor2": "^1.2.1",
"karma-webpack": "^2.0.9",
"mocha": "4.1.0",
"mocha-webpack": "^0.7.0",
"phantomjs-prebuilt": "^2.1.16",
"mocha": "^5.2.0",
"mocha-webpack": "^2.0.0-beta.0",
"seedrandom": "^2.4.3",
"shx": "0.2.2",
"sinon": "^4.2.2",
"ts-loader": "^3.5.0",
"ts-loader": "^4.3.1",
"tslint": "^5.10.0",

@@ -103,3 +101,4 @@ "typescript": "~2.7.1",

"uglifyjs-webpack-plugin": "^1.1.8",
"webpack": "^3.12.0",
"webpack": "^4.11.1",
"webpack-cli": "^3.0.3",
"webpack-config-utils": "2.3.0",

@@ -106,0 +105,0 @@ "webpack-node-externals": "^1.6.0"

@@ -17,11 +17,11 @@ [<img align="right" src="https://raw.github.com/wiki/zxing/zxing/zxing-logo.png"/>][1]

| 1D product | 1D industrial | 2D
| ---------------------- | -------------------- | --------------
| ~UPC-A~ | ~Code 39~ | QR Code
| ~UPC-E~ | ~Code 93~ | Data Matrix (_in-progress_)
| ~EAN-8~ | Code 128 (_no docs_) | ~Aztec (beta)~
| EAN-13 (_in-progress_) | ~Codabar~ | PDF 417 (_in-progress_)
| | ITF (_no docs_) | ~MaxiCode~
| | ~RSS-14~ |
| | ~RSS-Expanded~ |
| 1D product | 1D industrial | 2D
| ------------------ | -------------------- | --------------
| ~UPC-A~ | ~Code 39~ | QR Code
| ~UPC-E~ | ~Code 93~ | Data Matrix (_no docs_)
| ~EAN-8~ | Code 128 (_no docs_) | ~Aztec (beta)~
| EAN-13 (_no docs_) | ~Codabar~ | PDF 417 (_in-progress_)
| | ITF (_no docs_) | ~MaxiCode~
| | ~RSS-14~ |
| | ~RSS-Expanded~ |

@@ -28,0 +28,0 @@ ## Status

@@ -64,8 +64,8 @@ /*

if (undefined === x || null === x) {
x = image.getWidth() / 2;
x = image.getWidth() / 2 | 0;
}
if (undefined === y || null === y) {
y = image.getHeight() / 2;
y = image.getHeight() / 2 | 0;
}
const halfsize = initSize / 2;
const halfsize = initSize / 2 | 0;
this.leftInit = x - halfsize;

@@ -95,3 +95,2 @@ this.rightInit = x + halfsize;

public detect(): Array<ResultPoint> /*throws NotFoundException*/ {
let left = this.leftInit;

@@ -98,0 +97,0 @@ let right = this.rightInit;

@@ -107,3 +107,3 @@ /*

const coefficients = this.coefficients;
let result;
let result: number;
if (a === 1) {

@@ -110,0 +110,0 @@ // Just the sum of the coefficients

@@ -104,3 +104,3 @@ /*

// Run Euclidean algorithm until r's degree is less than R/2
while (r.getDegree() >= R / 2) {
while (r.getDegree() >= (R / 2 | 0)) {
let rLastLast = rLast;

@@ -107,0 +107,0 @@ let tLastLast = tLast;

@@ -35,6 +35,6 @@ /*

public static GB2312 = 'GB2312';
public static ISO88591 = CharacterSetECI.ISO8859_1.getName(); // "ISO8859_1"
private static EUC_JP = 'EUC_JP';
private static UTF8 = CharacterSetECI.UTF8.getName(); // "UTF8"
private static PLATFORM_DEFAULT_ENCODING = StringUtils.UTF8; // "UTF8"//Charset.defaultCharset().name()
private static ISO88591 = CharacterSetECI.ISO8859_1.getName(); // "ISO8859_1"
private static ASSUME_SHIFT_JIS = false;

@@ -41,0 +41,0 @@ // SHIFT_JIS.equalsIgnoreCase(PLATFORM_DEFAULT_ENCODING) ||

@@ -25,2 +25,3 @@ /*

import MultiFormatOneDReader from './oned/MultiFormatOneDReader';
import DataMatrixReader from './datamatrix/DataMatrixReader';

@@ -124,5 +125,5 @@ /*namespace com.google.zxing {*/

}
// if (formats.contains(BarcodeFormat.DATA_MATRIX)) {
// readers.push(new DataMatrixReader())
// }
if (formats.contains(BarcodeFormat.DATA_MATRIX)) {
readers.push(new DataMatrixReader());
}
// if (formats.contains(BarcodeFormat.AZTEC)) {

@@ -148,3 +149,3 @@ // readers.push(new AztecReader())

readers.push(new QRCodeReader());
// readers.push(new DataMatrixReader())
readers.push(new DataMatrixReader());
// readers.push(new AztecReader())

@@ -151,0 +152,0 @@ // readers.push(new PDF417Reader())

@@ -27,2 +27,3 @@ /*

import ITFReader from './ITFReader';
import MultiFormatUPCEANReader from './MultiFormatUPCEANReader';

@@ -43,2 +44,5 @@ /**

if (possibleFormats) {
if (possibleFormats.get(BarcodeFormat.EAN_13)) {
this.readers.push(new MultiFormatUPCEANReader(hints));
}
// if (possibleFormats.get(BarcodeFormat.EAN_13) ||

@@ -77,2 +81,3 @@ // possibleFormats.get(BarcodeFormat.UPC_A) ||

// this.readers.push(new Code93Reader());
this.readers.push(new MultiFormatUPCEANReader(hints));
this.readers.push(new Code128Reader());

@@ -79,0 +84,0 @@ this.readers.push(new ITFReader());

@@ -56,3 +56,3 @@ /*

private format: BarcodeFormat,
private timestamp: number/*long*/) {
private timestamp: number /*long*/) {
this.text = text;

@@ -59,0 +59,0 @@ this.rawBytes = rawBytes;

@@ -33,2 +33,6 @@ export default class StringBuilder {

}
public insert(n: number, c: string) {
this.value = this.value.substr(0, n) + c + this.value.substr(n + c.length);
}
}
// browser
export { default as BrowserCodeReader } from './browser/BrowserCodeReader';
export * from './browser/BrowserQRCodeReader';
export * from './browser/BrowserDatamatrixCodeReader';
export * from './browser/BrowserQRCodeSvgWriter';

@@ -59,3 +60,4 @@ export { default as HTMLCanvasElementLuminanceSource } from './browser/HTMLCanvasElementLuminanceSource';

export { default as OneDReader } from './core/oned/OneDReader';
export { default as EAN13Reader } from './core/oned/EAN13Reader';
export { default as Code128Reader } from './core/oned/Code128Reader';
export { default as ITFReader } from './core/oned/ITFReader';

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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