UNPKG
@httpx/assert
Version:
latest (0.16.7)
0.16.7
0.16.4
0.16.3
0.16.2
0.16.1
0.16.0
0.15.5
0.15.4
0.15.3
0.15.2
0.15.1
0.15.0
0.14.0
0.13.2
0.13.1
0.13.0
0.12.4
0.12.3
0.12.2
0.12.1
0.12.0
0.11.0
0.10.3
0.10.2
0.10.1
0.10.0
0.9.1
0.9.0
0.8.1
0.8.0
0.7.0
0.6.7
0.6.5
0.6.4
0.6.2
0.6.1
0.6.0
0.5.2
0.5.1
0.5.0
0.4.0
0.3.0
0.2.0
0.1.0
Assertions and typeguards
belgattitude.github.io/httpx/assert
belgattitude/httpx
@httpx/assert
/
dist
/
barcode.guards.cjs
2 lines
•
307 B
JavaScript
View Raw
1
2
'use strict'
;
var
s
=e=>{
if
(
typeof
e!=
"string"
||e.
length
!==
13
)
return
false
;
let
r=e.
slice
(
0
,
12
).
split
(
""
).
map
(
(
t,n
)=>
Number
(t)*(n%
2
?
3
:
1
)).
reduce
(
(
t,n
)=>
t+n,
0
);
return
Math
.
ceil
(r/
10
)*
10
-r===
Number
(e[
12
])};
exports
.
isEan13
=s;
//# sourceMappingURL=barcode.guards.cjs.map
//# sourceMappingURL=barcode.guards.cjs.map