UNPKG
moysklad-extension-queue
Version:
latest (0.2.1)
0.2.1
0.2.0
0.1.1
0.1.0
0.0.3
0.0.2
Очередь http запросов (расширение для библиотеки moysklad)
wmakeev/moysklad-tools
moysklad-extension-queue
/
lib
/
defaultNum.js
12 lines
(11 loc)
•
257 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
'use strict'
;
module
.
exports
=
defNum
=>
val
=>
{
if
(
typeof
val ===
'string'
) {
let
num =
Number
.
parseInt
(val);
return
Number
.
isNaN
(num) ? defNum : num; }
else
if
(
typeof
val ===
'number'
) {
return
val; }
else
{
return
defNum; } };