MCPcopy Create free account
hub / github.com/GoogleChrome/samples / FS_modeStringToFlags

Function FS_modeStringToFlags

sqlite-wasm-cos/sqlite3-node.mjs:1339–1354  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

1337 };
1338
1339 var FS_modeStringToFlags = (str) => {
1340 if (typeof str != 'string') return str;
1341 var flagModes = {
1342 'r': 0,
1343 'r+': 2,
1344 'w': 512 | 64 | 1,
1345 'w+': 512 | 64 | 2,
1346 'a': 1024 | 64 | 1,
1347 'a+': 1024 | 64 | 2,
1348 };
1349 var flags = flagModes[str];
1350 if (typeof flags == 'undefined') {
1351 throw new Error(`Unknown file open mode: ${str}`);
1352 }
1353 return flags;
1354 };
1355
1356 var FS_fileDataToTypedArray = (data) => {
1357 if (typeof data == 'string') {

Callers 1

openFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected