MCPcopy Create free account
hub / github.com/mscdex/ssh2 / modeNum

Function modeNum

lib/protocol/SFTP.js:2523–2530  ·  view source on GitHub ↗
(mode)

Source from the content-addressed store, hash-verified

2521}
2522
2523function modeNum(mode) {
2524 // eslint-disable-next-line no-self-compare
2525 if (typeof mode === 'number' && mode === mode) // Valid, non-NaN number
2526 return mode;
2527 if (typeof mode === 'string')
2528 return modeNum(parseInt(mode, 8));
2529 throw new Error(`Cannot parse mode: ${mode}`);
2530}
2531
2532const stringFlagMap = {
2533 'r': OPEN_MODE.READ,

Callers 2

fastXferFunction · 0.85
attrsToBytesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…