@sec-ant/barcode-detector
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -7,6 +7,6 @@ /// <reference types="dom-webcodecs" /> | ||
} | ||
export type Point2D = { | ||
export interface Point2D { | ||
x: number; | ||
y: number; | ||
}; | ||
} | ||
export interface DetectedBarcode { | ||
@@ -13,0 +13,0 @@ boundingBox: DOMRectReadOnly; |
@@ -7,6 +7,6 @@ /// <reference types="dom-webcodecs" /> | ||
} | ||
export type Point2D = { | ||
export interface Point2D { | ||
x: number; | ||
y: number; | ||
}; | ||
} | ||
export interface DetectedBarcode { | ||
@@ -13,0 +13,0 @@ boundingBox: DOMRectReadOnly; |
@@ -5,6 +5,6 @@ { | ||
"private": false, | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"type": "module", | ||
"files": [ | ||
"./dist/**/*" | ||
"./dist" | ||
], | ||
@@ -36,3 +36,4 @@ "main": "./dist/cjs/index.js", | ||
"bugs": { | ||
"url": "https://github.com/Sec-ant/barcode-detector/issues" | ||
"url": "https://github.com/Sec-ant/barcode-detector/issues", | ||
"email": "zzwu@zju.edu.cn" | ||
}, | ||
@@ -50,3 +51,5 @@ "keywords": [ | ||
], | ||
"author": "Ze-Zheng Wu", | ||
"author": { | ||
"name": "Ze-Zheng Wu" | ||
}, | ||
"license": "MIT", | ||
@@ -57,14 +60,16 @@ "config": { | ||
"scripts": { | ||
"lint": "eslint . --ext .ts", | ||
"type-check": "tsc --noEmit --emitDeclarationOnly false", | ||
"prebuild": "npm run type-check", | ||
"format": "prettier . --write", | ||
"prebuild": "npm run lint && npm run type-check && npm run format", | ||
"build:es": "vite build", | ||
"build:cjs": "node ./scripts/build-cjs.js", | ||
"build:iife": "node ./scripts/build-iife.js", | ||
"build": "npm run build:es && npm run build:cjs && npm run build:iife", | ||
"postbuild:es": "tsc --declarationDir ./dist/es", | ||
"postbuild:cjs": "tsc --declarationDir ./dist/cjs", | ||
"build": "npm run build:es && npm run build:cjs && npm run build:iife", | ||
"start": "vite preview --outDir ./tests --port $npm_package_config_port -l silent", | ||
"pretest": "npm run build && node ./scripts/list-dir.js", | ||
"pretest:ui": "npm run build && node ./scripts/list-dir.js", | ||
"precoverage": "npm run build && node ./scripts/list-dir.js", | ||
"pretest": "node ./scripts/list-dir.js", | ||
"pretest:ui": "node ./scripts/list-dir.js", | ||
"precoverage": "node ./scripts/list-dir.js", | ||
"test": "start-server-and-test $npm_package_config_port 'vitest --coverage'", | ||
@@ -78,8 +83,12 @@ "test:ui": "start-server-and-test $npm_package_config_port 'vitest --ui --coverage'", | ||
"devDependencies": { | ||
"@types/dom-webcodecs": "^0.1.8", | ||
"@typescript-eslint/eslint-plugin": "^6.4.1", | ||
"@typescript-eslint/parser": "^6.4.1", | ||
"@vitest/browser": "^0.34.2", | ||
"@vitest/coverage-istanbul": "^0.34.2", | ||
"@vitest/ui": "^0.34.2", | ||
"eslint": "^8.47.0", | ||
"http-server": "^14.1.1", | ||
"npm-check-updates": "^16.13.0", | ||
"playwright": "^1.37.1", | ||
"prettier": "^3.0.2", | ||
"rimraf": "^5.0.1", | ||
@@ -92,4 +101,5 @@ "start-server-and-test": "^2.0.0", | ||
"dependencies": { | ||
"@sec-ant/zxing-wasm": "^2.1.2" | ||
"@sec-ant/zxing-wasm": "^2.1.2", | ||
"@types/dom-webcodecs": "^0.1.8" | ||
} | ||
} |
# @sec-ant/barcode-detector | ||
[![npm](https://img.shields.io/npm/v/@sec-ant/barcode-detector)](https://www.npmjs.com/package/@sec-ant/barcode-detector/v/latest) [![npm bundle size (scoped)](https://img.shields.io/bundlephobia/minzip/%40sec-ant/barcode-detector)](https://www.npmjs.com/package/@sec-ant/barcode-detector/v/latest) [![jsDelivr hits (npm scoped)](https://img.shields.io/jsdelivr/npm/hm/%40sec-ant%2Fbarcode-detector?color=%23ff5627)](https://cdn.jsdelivr.net/npm/@sec-ant/barcode-detector@latest/) | ||
A [Barcode Detection API](https://wicg.github.io/shape-detection-api/#barcode-detection-api) polyfill that uses [ZXing webassembly](https://github.com/Sec-ant/zxing-wasm) under the hood. | ||
@@ -144,4 +146,5 @@ | ||
`tsconfig.json`: | ||
```json | ||
// tsconfig.json | ||
{ | ||
@@ -197,3 +200,3 @@ "compilerOptions": { | ||
It's noteworthy that you'll always want to choose the correct version of the `.wasm` file, so the APIs exported by it are exactly what the js code expected. | ||
It's noteworthy that you'll always want to choose the correct version of the `.wasm` file, so the APIs exported by it are exactly what the js code expects. | ||
@@ -206,3 +209,3 @@ For more information on how to use this function, you can check [the notes here](https://github.com/Sec-ant/zxing-wasm#notes) and [discussions here](https://github.com/gruhn/vue-qrcode-reader/issues/354). | ||
Please check the [spec](https://wicg.github.io/shape-detection-api/#barcode-detection-api) and [MDN doc](https://developer.mozilla.org/docs/Web/API/Barcode_Detection_API) for more information. | ||
Please check the [spec](https://wicg.github.io/shape-detection-api/#barcode-detection-api), [MDN doc](https://developer.mozilla.org/docs/Web/API/Barcode_Detection_API) and [Chromium implementation](https://github.com/chromium/chromium/tree/main/third_party/blink/renderer/modules/shapedetection) for more information. | ||
@@ -219,3 +222,3 @@ ## Example | ||
const imageFile = await fetch( | ||
"https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=Hello%20world!" | ||
"https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=Hello%20world!", | ||
).then((resp) => resp.blob()); | ||
@@ -222,0 +225,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
269141
232
20
2
15
+ Added@types/dom-webcodecs@^0.1.8
+ Added@types/dom-webcodecs@0.1.11(transitive)