UNPKG
kubo-rpc-client-esm-cjs
Version:
canary (3.0.1)
latest (3.0.1)
3.0.1
A client library for the Kubo RPC API
github.com/ipfs/js-kubo-rpc-client
ipfs/js-kubo-rpc-client
kubo-rpc-client-esm-cjs
/
src
/
lib
/
mode-to-string.js
16 lines
(12 loc)
•
240 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/** *
@param
{
number | string | undefined
}
mode
*/
export
function
modeToString
(
mode
) {
if
(mode ==
null
) {
return
undefined
}
if
(
typeof
mode ===
'string'
) {
return
mode }
return
mode.
toString
(
8
).
padStart
(
4
,
'0'
) }