mirror of
https://github.com/libretro/RetroArch
synced 2025-02-01 00:32:46 +00:00
143 lines
1.0 MiB
143 lines
1.0 MiB
{
|
||
"version": 3,
|
||
"sources": [
|
||
"node_modules/grunt-browserify/node_modules/browserify/node_modules/browser-pack/_prelude.js",
|
||
"node_modules/async/lib/async.js",
|
||
"node_modules\\bfs-buffer\\ts\\buffer.ts",
|
||
"node_modules\\bfs-buffer\\ts\\buffer_core.ts",
|
||
"node_modules\\bfs-buffer\\ts\\buffer_core_array.ts",
|
||
"node_modules\\bfs-buffer\\ts\\buffer_core_arraybuffer.ts",
|
||
"node_modules\\bfs-buffer\\ts\\buffer_core_imagedata.ts",
|
||
"node_modules\\bfs-buffer\\ts\\extended_ascii.ts",
|
||
"node_modules\\bfs-buffer\\ts\\string_util.ts",
|
||
"node_modules\\bfs-buffer\\ts\\util.ts",
|
||
"node_modules\\bfs-path\\js\\node_modules\\bfs-path\\ts\\path.ts",
|
||
"node_modules\\bfs-process\\ts\\index.ts",
|
||
"node_modules\\bfs-process\\js\\node_modules\\bfs-process\\ts\\process.ts",
|
||
"node_modules\\bfs-process\\js\\node_modules\\bfs-process\\ts\\tty.ts",
|
||
"node_modules/browserify/node_modules/events/events.js",
|
||
"node_modules/browserify/node_modules/inherits/inherits_browser.js",
|
||
"node_modules/browserify/node_modules/isarray/index.js",
|
||
"node_modules/browserify/node_modules/readable-stream/duplex.js",
|
||
"node_modules/browserify/node_modules/readable-stream/lib/_stream_duplex.js",
|
||
"node_modules/browserify/node_modules/readable-stream/lib/_stream_passthrough.js",
|
||
"node_modules/browserify/node_modules/readable-stream/lib/_stream_readable.js",
|
||
"node_modules/browserify/node_modules/readable-stream/lib/_stream_transform.js",
|
||
"node_modules/browserify/node_modules/readable-stream/lib/_stream_writable.js",
|
||
"node_modules/browserify/node_modules/readable-stream/node_modules/core-util-is/lib/util.js",
|
||
"node_modules/browserify/node_modules/readable-stream/node_modules/process-nextick-args/index.js",
|
||
"node_modules/browserify/node_modules/readable-stream/node_modules/util-deprecate/browser.js",
|
||
"node_modules/browserify/node_modules/readable-stream/passthrough.js",
|
||
"node_modules/browserify/node_modules/readable-stream/readable.js",
|
||
"node_modules/browserify/node_modules/readable-stream/transform.js",
|
||
"node_modules/browserify/node_modules/readable-stream/writable.js",
|
||
"node_modules/browserify/node_modules/stream-browserify/index.js",
|
||
"node_modules/browserify/node_modules/string_decoder/index.js",
|
||
"node_modules/grunt-browserify/node_modules/browserify/node_modules/browser-resolve/empty.js",
|
||
"node_modules/grunt-browserify/node_modules/browserify/node_modules/insert-module-globals/node_modules/is-buffer/index.js",
|
||
"node_modules/pako/dist/pako_inflate.min.js",
|
||
"src/backend/AsyncMirror.ts",
|
||
"src/backend/Dropbox.ts",
|
||
"src/backend/FolderAdapter.ts",
|
||
"src/backend/HTML5FS.ts",
|
||
"src/backend/InMemory.ts",
|
||
"src/backend/IndexedDB.ts",
|
||
"src/backend/LocalStorage.ts",
|
||
"src/backend/MountableFileSystem.ts",
|
||
"src/backend/OverlayFS.ts",
|
||
"src/backend/WorkerFS.ts",
|
||
"src/backend/XmlHttpRequest.ts",
|
||
"src/backend/ZipFS.ts",
|
||
"src/browserify_main.ts",
|
||
"src/core/FS.ts",
|
||
"src/core/api_error.ts",
|
||
"src/core/backends.ts",
|
||
"src/core/browserfs.ts",
|
||
"src/core/file.ts",
|
||
"src/core/file_flag.ts",
|
||
"src/core/file_system.ts",
|
||
"src/core/global.ts",
|
||
"src/core/node_fs.ts",
|
||
"src/core/node_fs_stats.ts",
|
||
"src/core/util.ts",
|
||
"src/generic/emscripten_fs.ts",
|
||
"src/generic/file_index.ts",
|
||
"src/generic/inode.ts",
|
||
"src/generic/key_value_filesystem.ts",
|
||
"src/generic/preload_file.ts",
|
||
"src/generic/xhr.ts",
|
||
"src/main.ts"
|
||
],
|
||
"names": [],
|
||
"mappings": "AAAA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjvCA;;;GAGG;AACH,IAAO,WAAW,WAAW,eAAe,CAAC,CAAC;AAC9C,IAAO,eAAe,WAAW,qBAAqB,CAAC,CAAC;AACxD,IAAO,qBAAqB,WAAW,2BAA2B,CAAC,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C,CAAC,CAAC;YACX,KAAK,GAAG,CAAC,CAAC;QACZ,CAAC;gBAAS,CAAC;YACT,EAAE,CAAC,KAAK,CAAC,CAAC;QACZ,CAAC;IACH,CAAC;IAEM,mBAAK,GAAZ,UAAa,IAAY;QACvB,wCAAwC;QACxC,EAAE,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC;YACtC,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;QAChC,CAAC;QAAC,IAAI,CAAC,CAAC;YACN,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACvC,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC,CAAC;gBACjE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;oBAC5B,KAAK,CAAC;gBACR,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IACH,UAAC;AAAD,CAtFA,AAsFC,EAtFiB,MAAM,CAAC,MAAM,EAsF9B;AAED,iBAAS,GAAG,CAAC;;;;;AC1Fb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1SA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;;ACHA;AACA;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC/8BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACjhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACnEA;AACA;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;;ACDA;AACA;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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,CAAC;AAYD,EAAE,CAAC,CAAC,OAAM,CAAC,QAAQ,CAAC,KAAK,WAAW,IAAI,OAAM,CAAC,MAAM,CAAC,KAAK,WAAW,IAAW,MAAO,CAAC,QAAQ,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC;IACjH,QAAQ,CAAC,KAAK,CAAC,sCAAsC;QACnD,mCAAmC;QACnC,8CAA8C;QAC9C,6CAA6C;QAC7C,kBAAkB;QAClB,mDAAmD;QACnD,oBAAoB;QACpB,+BAA+B;QAC/B,8BAA8B;QAC9B,iFAAiF;QACjF,WAAW;QACX,kCAAkC,GAAC,IAAI,GAAC,MAAM;QAC9C,aAAa;QACb,kBAAkB;QAClB,eAAe,CAAC,CAAC;AACrB,CAAC;AAED,IAAO,GAAG,WAAW,kBAAkB,CAAC,CAAC;AACzC,iBAAS,GAAG,CAAC",
|
||
"file": "generated.js",
|
||
"sourceRoot": "",
|
||
"sourcesContent": [
|
||
"(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})",
|
||
"/*!\n * async\n * https://github.com/caolan/async\n *\n * Copyright 2010-2014 Caolan McMahon\n * Released under the MIT license\n */\n(function () {\n\n var async = {};\n function noop() {}\n function identity(v) {\n return v;\n }\n function toBool(v) {\n return !!v;\n }\n function notId(v) {\n return !v;\n }\n\n // global on the server, window in the browser\n var previous_async;\n\n // Establish the root object, `window` (`self`) in the browser, `global`\n // on the server, or `this` in some virtual machines. We use `self`\n // instead of `window` for `WebWorker` support.\n var root = typeof self === 'object' && self.self === self && self ||\n typeof global === 'object' && global.global === global && global ||\n this;\n\n if (root != null) {\n previous_async = root.async;\n }\n\n async.noConflict = function () {\n root.async = previous_async;\n return async;\n };\n\n function only_once(fn) {\n return function() {\n if (fn === null) throw new Error(\"Callback was already called.\");\n fn.apply(this, arguments);\n fn = null;\n };\n }\n\n function _once(fn) {\n return function() {\n if (fn === null) return;\n fn.apply(this, arguments);\n fn = null;\n };\n }\n\n //// cross-browser compatiblity functions ////\n\n var _toString = Object.prototype.toString;\n\n var _isArray = Array.isArray || function (obj) {\n return _toString.call(obj) === '[object Array]';\n };\n\n // Ported from underscore.js isObject\n var _isObject = function(obj) {\n var type = typeof obj;\n return type === 'function' || type === 'object' && !!obj;\n };\n\n function _isArrayLike(arr) {\n return _isArray(arr) || (\n // has a positive integer length property\n typeof arr.length === \"number\" &&\n arr.length >= 0 &&\n arr.length % 1 === 0\n );\n }\n\n function _arrayEach(arr, iterator) {\n var index = -1,\n length = arr.length;\n\n while (++index < length) {\n iterator(arr[index], index, arr);\n }\n }\n\n function _map(arr, iterator) {\n var index = -1,\n length = arr.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iterator(arr[index], index, arr);\n }\n return result;\n }\n\n function _range(count) {\n return _map(Array(count), function (v, i) { return i; });\n }\n\n function _reduce(arr, iterator, memo) {\n _arrayEach(arr, function (x, i, a) {\n memo = iterator(memo, x, i, a);\n });\n return memo;\n }\n\n function _forEachOf(object, iterator) {\n _arrayEach(_keys(object), function (key) {\n iterator(object[key], key);\n });\n }\n\n function _indexOf(arr, item) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] === item) return i;\n }\n return -1;\n }\n\n var _keys = Object.keys || function (obj) {\n var keys = [];\n for (var k in obj) {\n if (obj.hasOwnProperty(k)) {\n keys.push(k);\n }\n }\n return keys;\n };\n\n function _keyIterator(coll) {\n var i = -1;\n var len;\n var keys;\n if (_isArrayLike(coll)) {\n len = coll.length;\n return function next() {\n i++;\n return i < len ? i : null;\n };\n } else {\n keys = _keys(coll);\n len = keys.length;\n return function next() {\n i++;\n return i < len ? keys[i] : null;\n };\n }\n }\n\n // Similar to ES6's rest param (http://ariya.ofilabs.com/2013/03/es6-and-rest-parameter.html)\n // This accumulates the arguments passed into an array, after a given index.\n // From underscore.js (https://github.com/jashkenas/underscore/pull/2140).\n function _restParam(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0);\n var rest = Array(length);\n for (var index = 0; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n }\n // Currently unused but handle cases outside of the switch statement:\n // var args = Array(startIndex + 1);\n // for (index = 0; index < startIndex; index++) {\n // args[index] = arguments[index];\n // }\n // args[startIndex] = rest;\n // return func.apply(this, args);\n };\n }\n\n function _withoutIndex(iterator) {\n return function (value, index, callback) {\n return iterator(value, callback);\n };\n }\n\n //// exported async module functions ////\n\n //// nextTick implementation with browser-compatible fallback ////\n\n // capture the global reference to guard against fakeTimer mocks\n var _setImmediate = typeof setImmediate === 'function' && setImmediate;\n\n var _delay = _setImmediate ? function(fn) {\n // not a direct alias for IE10 compatibility\n _setImmediate(fn);\n } : function(fn) {\n setTimeout(fn, 0);\n };\n\n if (typeof process === 'object' && typeof process.nextTick === 'function') {\n async.nextTick = process.nextTick;\n } else {\n async.nextTick = _delay;\n }\n async.setImmediate = _setImmediate ? _delay : async.nextTick;\n\n\n async.forEach =\n async.each = function (arr, iterator, callback) {\n return async.eachOf(arr, _withoutIndex(iterator), callback);\n };\n\n async.forEachSeries =\n async.eachSeries = function (arr, iterator, callback) {\n return async.eachOfSeries(arr, _withoutIndex(iterator), callback);\n };\n\n\n async.forEachLimit =\n async.eachLimit = function (arr, limit, iterator, callback) {\n return _eachOfLimit(limit)(arr, _withoutIndex(iterator), callback);\n };\n\n async.forEachOf =\n async.eachOf = function (object, iterator, callback) {\n callback = _once(callback || noop);\n object = object || [];\n\n var iter = _keyIterator(object);\n var key, completed = 0;\n\n while ((key = iter()) != null) {\n completed += 1;\n iterator(object[key], key, only_once(done));\n }\n\n if (completed === 0) callback(null);\n\n function done(err) {\n completed--;\n if (err) {\n callback(err);\n }\n // Check key is null in case iterator isn't exhausted\n // and done resolved synchronously.\n else if (key === null && completed <= 0) {\n callback(null);\n }\n }\n };\n\n async.forEachOfSeries =\n async.eachOfSeries = function (obj, iterator, callback) {\n callback = _once(callback || noop);\n obj = obj || [];\n var nextKey = _keyIterator(obj);\n var key = nextKey();\n function iterate() {\n var sync = true;\n if (key === null) {\n return callback(null);\n }\n iterator(obj[key], key, only_once(function (err) {\n if (err) {\n callback(err);\n }\n else {\n key = nextKey();\n if (key === null) {\n return callback(null);\n } else {\n if (sync) {\n async.setImmediate(iterate);\n } else {\n iterate();\n }\n }\n }\n }));\n sync = false;\n }\n iterate();\n };\n\n\n\n async.forEachOfLimit =\n async.eachOfLimit = function (obj, limit, iterator, callback) {\n _eachOfLimit(limit)(obj, iterator, callback);\n };\n\n function _eachOfLimit(limit) {\n\n return function (obj, iterator, callback) {\n callback = _once(callback || noop);\n obj = obj || [];\n var nextKey = _keyIterator(obj);\n if (limit <= 0) {\n return callback(null);\n }\n var done = false;\n var running = 0;\n var errored = false;\n\n (function replenish () {\n if (done && running <= 0) {\n return callback(null);\n }\n\n while (running < limit && !errored) {\n var key = nextKey();\n if (key === null) {\n done = true;\n if (running <= 0) {\n callback(null);\n }\n return;\n }\n running += 1;\n iterator(obj[key], key, only_once(function (err) {\n running -= 1;\n if (err) {\n callback(err);\n errored = true;\n }\n else {\n replenish();\n }\n }));\n }\n })();\n };\n }\n\n\n function doParallel(fn) {\n return function (obj, iterator, callback) {\n return fn(async.eachOf, obj, iterator, callback);\n };\n }\n function doParallelLimit(fn) {\n return function (obj, limit, iterator, callback) {\n return fn(_eachOfLimit(limit), obj, iterator, callback);\n };\n }\n function doSeries(fn) {\n return function (obj, iterator, callback) {\n return fn(async.eachOfSeries, obj, iterator, callback);\n };\n }\n\n function _asyncMap(eachfn, arr, iterator, callback) {\n callback = _once(callback || noop);\n arr = arr || [];\n var results = _isArrayLike(arr) ? [] : {};\n eachfn(arr, function (value, index, callback) {\n iterator(value, function (err, v) {\n results[index] = v;\n callback(err);\n });\n }, function (err) {\n callback(err, results);\n });\n }\n\n async.map = doParallel(_asyncMap);\n async.mapSeries = doSeries(_asyncMap);\n async.mapLimit = doParallelLimit(_asyncMap);\n\n // reduce only has a series version, as doing reduce in parallel won't\n // work in many situations.\n async.inject =\n async.foldl =\n async.reduce = function (arr, memo, iterator, callback) {\n async.eachOfSeries(arr, function (x, i, callback) {\n iterator(memo, x, function (err, v) {\n memo = v;\n callback(err);\n });\n }, function (err) {\n callback(err, memo);\n });\n };\n\n async.foldr =\n async.reduceRight = function (arr, memo, iterator, callback) {\n var reversed = _map(arr, identity).reverse();\n async.reduce(reversed, memo, iterator, callback);\n };\n\n async.transform = function (arr, memo, iterator, callback) {\n if (arguments.length === 3) {\n callback = iterator;\n iterator = memo;\n memo = _isArray(arr) ? [] : {};\n }\n\n async.eachOf(arr, function(v, k, cb) {\n iterator(memo, v, k, cb);\n }, function(err) {\n callback(err, memo);\n });\n };\n\n function _filter(eachfn, arr, iterator, callback) {\n var results = [];\n eachfn(arr, function (x, index, callback) {\n iterator(x, function (v) {\n if (v) {\n results.push({index: index, value: x});\n }\n callback();\n });\n }, function () {\n callback(_map(results.sort(function (a, b) {\n return a.index - b.index;\n }), function (x) {\n return x.value;\n }));\n });\n }\n\n async.select =\n async.filter = doParallel(_filter);\n\n async.selectLimit =\n async.filterLimit = doParallelLimit(_filter);\n\n async.selectSeries =\n async.filterSeries = doSeries(_filter);\n\n function _reject(eachfn, arr, iterator, callback) {\n _filter(eachfn, arr, function(value, cb) {\n iterator(value, function(v) {\n cb(!v);\n });\n }, callback);\n }\n async.reject = doParallel(_reject);\n async.rejectLimit = doParallelLimit(_reject);\n async.rejectSeries = doSeries(_reject);\n\n function _createTester(eachfn, check, getResult) {\n return function(arr, limit, iterator, cb) {\n function done() {\n if (cb) cb(getResult(false, void 0));\n }\n function iteratee(x, _, callback) {\n if (!cb) return callback();\n iterator(x, function (v) {\n if (cb && check(v)) {\n cb(getResult(true, x));\n cb = iterator = false;\n }\n callback();\n });\n }\n if (arguments.length > 3) {\n eachfn(arr, limit, iteratee, done);\n } else {\n cb = iterator;\n iterator = limit;\n eachfn(arr, iteratee, done);\n }\n };\n }\n\n async.any =\n async.some = _createTester(async.eachOf, toBool, identity);\n\n async.someLimit = _createTester(async.eachOfLimit, toBool, identity);\n\n async.all =\n async.every = _createTester(async.eachOf, notId, notId);\n\n async.everyLimit = _createTester(async.eachOfLimit, notId, notId);\n\n function _findGetResult(v, x) {\n return x;\n }\n async.detect = _createTester(async.eachOf, identity, _findGetResult);\n async.detectSeries = _createTester(async.eachOfSeries, identity, _findGetResult);\n async.detectLimit = _createTester(async.eachOfLimit, identity, _findGetResult);\n\n async.sortBy = function (arr, iterator, callback) {\n async.map(arr, function (x, callback) {\n iterator(x, function (err, criteria) {\n if (err) {\n callback(err);\n }\n else {\n callback(null, {value: x, criteria: criteria});\n }\n });\n }, function (err, results) {\n if (err) {\n return callback(err);\n }\n else {\n callback(null, _map(results.sort(comparator), function (x) {\n return x.value;\n }));\n }\n\n });\n\n function comparator(left, right) {\n var a = left.criteria, b = right.criteria;\n return a < b ? -1 : a > b ? 1 : 0;\n }\n };\n\n async.auto = function (tasks, concurrency, callback) {\n if (typeof arguments[1] === 'function') {\n // concurrency is optional, shift the args.\n callback = concurrency;\n concurrency = null;\n }\n callback = _once(callback || noop);\n var keys = _keys(tasks);\n var remainingTasks = keys.length;\n if (!remainingTasks) {\n return callback(null);\n }\n if (!concurrency) {\n concurrency = remainingTasks;\n }\n\n var results = {};\n var runningTasks = 0;\n\n var hasError = false;\n\n var listeners = [];\n function addListener(fn) {\n listeners.unshift(fn);\n }\n function removeListener(fn) {\n var idx = _indexOf(listeners, fn);\n if (idx >= 0) listeners.splice(idx, 1);\n }\n function taskComplete() {\n remainingTasks--;\n _arrayEach(listeners.slice(0), function (fn) {\n fn();\n });\n }\n\n addListener(function () {\n if (!remainingTasks) {\n callback(null, results);\n }\n });\n\n _arrayEach(keys, function (k) {\n if (hasError) return;\n var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]];\n var taskCallback = _restParam(function(err, args) {\n runningTasks--;\n if (args.length <= 1) {\n args = args[0];\n }\n if (err) {\n var safeResults = {};\n _forEachOf(results, function(val, rkey) {\n safeResults[rkey] = val;\n });\n safeResults[k] = args;\n hasError = true;\n\n callback(err, safeResults);\n }\n else {\n results[k] = args;\n async.setImmediate(taskComplete);\n }\n });\n var requires = task.slice(0, task.length - 1);\n // prevent dead-locks\n var len = requires.length;\n var dep;\n while (len--) {\n if (!(dep = tasks[requires[len]])) {\n throw new Error('Has nonexistent dependency in ' + requires.join(', '));\n }\n if (_isArray(dep) && _indexOf(dep, k) >= 0) {\n throw new Error('Has cyclic dependencies');\n }\n }\n function ready() {\n return runningTasks < concurrency && _reduce(requires, function (a, x) {\n return (a && results.hasOwnProperty(x));\n }, true) && !results.hasOwnProperty(k);\n }\n if (ready()) {\n runningTasks++;\n task[task.length - 1](taskCallback, results);\n }\n else {\n addListener(listener);\n }\n function listener() {\n if (ready()) {\n runningTasks++;\n removeListener(listener);\n task[task.length - 1](taskCallback, results);\n }\n }\n });\n };\n\n\n\n async.retry = function(times, task, callback) {\n var DEFAULT_TIMES = 5;\n var DEFAULT_INTERVAL = 0;\n\n var attempts = [];\n\n var opts = {\n times: DEFAULT_TIMES,\n interval: DEFAULT_INTERVAL\n };\n\n function parseTimes(acc, t){\n if(typeof t === 'number'){\n acc.times = parseInt(t, 10) || DEFAULT_TIMES;\n } else if(typeof t === 'object'){\n acc.times = parseInt(t.times, 10) || DEFAULT_TIMES;\n acc.interval = parseInt(t.interval, 10) || DEFAULT_INTERVAL;\n } else {\n throw new Error('Unsupported argument type for \\'times\\': ' + typeof t);\n }\n }\n\n var length = arguments.length;\n if (length < 1 || length > 3) {\n throw new Error('Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)');\n } else if (length <= 2 && typeof times === 'function') {\n callback = task;\n task = times;\n }\n if (typeof times !== 'function') {\n parseTimes(opts, times);\n }\n opts.callback = callback;\n opts.task = task;\n\n function wrappedTask(wrappedCallback, wrappedResults) {\n function retryAttempt(task, finalAttempt) {\n return function(seriesCallback) {\n task(function(err, result){\n seriesCallback(!err || finalAttempt, {err: err, result: result});\n }, wrappedResults);\n };\n }\n\n function retryInterval(interval){\n return function(seriesCallback){\n setTimeout(function(){\n seriesCallback(null);\n }, interval);\n };\n }\n\n while (opts.times) {\n\n var finalAttempt = !(opts.times-=1);\n attempts.push(retryAttempt(opts.task, finalAttempt));\n if(!finalAttempt && opts.interval > 0){\n attempts.push(retryInterval(opts.interval));\n }\n }\n\n async.series(attempts, function(done, data){\n data = data[data.length - 1];\n (wrappedCallback || opts.callback)(data.err, data.result);\n });\n }\n\n // If a callback is passed, run this as a controll flow\n return opts.callback ? wrappedTask() : wrappedTask;\n };\n\n async.waterfall = function (tasks, callback) {\n callback = _once(callback || noop);\n if (!_isArray(tasks)) {\n var err = new Error('First argument to waterfall must be an array of functions');\n return callback(err);\n }\n if (!tasks.length) {\n return callback();\n }\n function wrapIterator(iterator) {\n return _restParam(function (err, args) {\n if (err) {\n callback.apply(null, [err].concat(args));\n }\n else {\n var next = iterator.next();\n if (next) {\n args.push(wrapIterator(next));\n }\n else {\n args.push(callback);\n }\n ensureAsync(iterator).apply(null, args);\n }\n });\n }\n wrapIterator(async.iterator(tasks))();\n };\n\n function _parallel(eachfn, tasks, callback) {\n callback = callback || noop;\n var results = _isArrayLike(tasks) ? [] : {};\n\n eachfn(tasks, function (task, key, callback) {\n task(_restParam(function (err, args) {\n if (args.length <= 1) {\n args = args[0];\n }\n results[key] = args;\n callback(err);\n }));\n }, function (err) {\n callback(err, results);\n });\n }\n\n async.parallel = function (tasks, callback) {\n _parallel(async.eachOf, tasks, callback);\n };\n\n async.parallelLimit = function(tasks, limit, callback) {\n _parallel(_eachOfLimit(limit), tasks, callback);\n };\n\n async.series = function(tasks, callback) {\n _parallel(async.eachOfSeries, tasks, callback);\n };\n\n async.iterator = function (tasks) {\n function makeCallback(index) {\n function fn() {\n if (tasks.length) {\n tasks[index].apply(null, arguments);\n }\n return fn.next();\n }\n fn.next = function () {\n return (index < tasks.length - 1) ? makeCallback(index + 1): null;\n };\n return fn;\n }\n return makeCallback(0);\n };\n\n async.apply = _restParam(function (fn, args) {\n return _restParam(function (callArgs) {\n return fn.apply(\n null, args.concat(callArgs)\n );\n });\n });\n\n function _concat(eachfn, arr, fn, callback) {\n var result = [];\n eachfn(arr, function (x, index, cb) {\n fn(x, function (err, y) {\n result = result.concat(y || []);\n cb(err);\n });\n }, function (err) {\n callback(err, result);\n });\n }\n async.concat = doParallel(_concat);\n async.concatSeries = doSeries(_concat);\n\n async.whilst = function (test, iterator, callback) {\n callback = callback || noop;\n if (test()) {\n var next = _restParam(function(err, args) {\n if (err) {\n callback(err);\n } else if (test.apply(this, args)) {\n iterator(next);\n } else {\n callback.apply(null, [null].concat(args));\n }\n });\n iterator(next);\n } else {\n callback(null);\n }\n };\n\n async.doWhilst = function (iterator, test, callback) {\n var calls = 0;\n return async.whilst(function() {\n return ++calls <= 1 || test.apply(this, arguments);\n }, iterator, callback);\n };\n\n async.until = function (test, iterator, callback) {\n return async.whilst(function() {\n return !test.apply(this, arguments);\n }, iterator, callback);\n };\n\n async.doUntil = function (iterator, test, callback) {\n return async.doWhilst(iterator, function() {\n return !test.apply(this, arguments);\n }, callback);\n };\n\n async.during = function (test, iterator, callback) {\n callback = callback || noop;\n\n var next = _restParam(function(err, args) {\n if (err) {\n callback(err);\n } else {\n args.push(check);\n test.apply(this, args);\n }\n });\n\n var check = function(err, truth) {\n if (err) {\n callback(err);\n } else if (truth) {\n iterator(next);\n } else {\n callback(null);\n }\n };\n\n test(check);\n };\n\n async.doDuring = function (iterator, test, callback) {\n var calls = 0;\n async.during(function(next) {\n if (calls++ < 1) {\n next(null, true);\n } else {\n test.apply(this, arguments);\n }\n }, iterator, callback);\n };\n\n function _queue(worker, concurrency, payload) {\n if (concurrency == null) {\n concurrency = 1;\n }\n else if(concurrency === 0) {\n throw new Error('Concurrency must not be zero');\n }\n function _insert(q, data, pos, callback) {\n if (callback != null && typeof callback !== \"function\") {\n throw new Error(\"task callback must be a function\");\n }\n q.started = true;\n if (!_isArray(data)) {\n data = [data];\n }\n if(data.length === 0 && q.idle()) {\n // call drain immediately if there are no tasks\n return async.setImmediate(function() {\n q.drain();\n });\n }\n _arrayEach(data, function(task) {\n var item = {\n data: task,\n callback: callback || noop\n };\n\n if (pos) {\n q.tasks.unshift(item);\n } else {\n q.tasks.push(item);\n }\n\n if (q.tasks.length === q.concurrency) {\n q.saturated();\n }\n });\n async.setImmediate(q.process);\n }\n function _next(q, tasks) {\n return function(){\n workers -= 1;\n\n var removed = false;\n var args = arguments;\n _arrayEach(tasks, function (task) {\n _arrayEach(workersList, function (worker, index) {\n if (worker === task && !removed) {\n workersList.splice(index, 1);\n removed = true;\n }\n });\n\n task.callback.apply(task, args);\n });\n if (q.tasks.length + workers === 0) {\n q.drain();\n }\n q.process();\n };\n }\n\n var workers = 0;\n var workersList = [];\n var q = {\n tasks: [],\n concurrency: concurrency,\n payload: payload,\n saturated: noop,\n empty: noop,\n drain: noop,\n started: false,\n paused: false,\n push: function (data, callback) {\n _insert(q, data, false, callback);\n },\n kill: function () {\n q.drain = noop;\n q.tasks = [];\n },\n unshift: function (data, callback) {\n _insert(q, data, true, callback);\n },\n process: function () {\n while(!q.paused && workers < q.concurrency && q.tasks.length){\n\n var tasks = q.payload ?\n q.tasks.splice(0, q.payload) :\n q.tasks.splice(0, q.tasks.length);\n\n var data = _map(tasks, function (task) {\n return task.data;\n });\n\n if (q.tasks.length === 0) {\n q.empty();\n }\n workers += 1;\n workersList.push(tasks[0]);\n var cb = only_once(_next(q, tasks));\n worker(data, cb);\n }\n },\n length: function () {\n return q.tasks.length;\n },\n running: function () {\n return workers;\n },\n workersList: function () {\n return workersList;\n },\n idle: function() {\n return q.tasks.length + workers === 0;\n },\n pause: function () {\n q.paused = true;\n },\n resume: function () {\n if (q.paused === false) { return; }\n q.paused = false;\n var resumeCount = Math.min(q.concurrency, q.tasks.length);\n // Need to call q.process once per concurrent\n // worker to preserve full concurrency after pause\n for (var w = 1; w <= resumeCount; w++) {\n async.setImmediate(q.process);\n }\n }\n };\n return q;\n }\n\n async.queue = function (worker, concurrency) {\n var q = _queue(function (items, cb) {\n worker(items[0], cb);\n }, concurrency, 1);\n\n return q;\n };\n\n async.priorityQueue = function (worker, concurrency) {\n\n function _compareTasks(a, b){\n return a.priority - b.priority;\n }\n\n function _binarySearch(sequence, item, compare) {\n var beg = -1,\n end = sequence.length - 1;\n while (beg < end) {\n var mid = beg + ((end - beg + 1) >>> 1);\n if (compare(item, sequence[mid]) >= 0) {\n beg = mid;\n } else {\n end = mid - 1;\n }\n }\n return beg;\n }\n\n function _insert(q, data, priority, callback) {\n if (callback != null && typeof callback !== \"function\") {\n throw new Error(\"task callback must be a function\");\n }\n q.started = true;\n if (!_isArray(data)) {\n data = [data];\n }\n if(data.length === 0) {\n // call drain immediately if there are no tasks\n return async.setImmediate(function() {\n q.drain();\n });\n }\n _arrayEach(data, function(task) {\n var item = {\n data: task,\n priority: priority,\n callback: typeof callback === 'function' ? callback : noop\n };\n\n q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item);\n\n if (q.tasks.length === q.concurrency) {\n q.saturated();\n }\n async.setImmediate(q.process);\n });\n }\n\n // Start with a normal queue\n var q = async.queue(worker, concurrency);\n\n // Override push to accept second parameter representing priority\n q.push = function (data, priority, callback) {\n _insert(q, data, priority, callback);\n };\n\n // Remove unshift function\n delete q.unshift;\n\n return q;\n };\n\n async.cargo = function (worker, payload) {\n return _queue(worker, 1, payload);\n };\n\n function _console_fn(name) {\n return _restParam(function (fn, args) {\n fn.apply(null, args.concat([_restParam(function (err, args) {\n if (typeof console === 'object') {\n if (err) {\n if (console.error) {\n console.error(err);\n }\n }\n else if (console[name]) {\n _arrayEach(args, function (x) {\n console[name](x);\n });\n }\n }\n })]));\n });\n }\n async.log = _console_fn('log');\n async.dir = _console_fn('dir');\n /*async.info = _console_fn('info');\n async.warn = _console_fn('warn');\n async.error = _console_fn('error');*/\n\n async.memoize = function (fn, hasher) {\n var memo = {};\n var queues = {};\n var has = Object.prototype.hasOwnProperty;\n hasher = hasher || identity;\n var memoized = _restParam(function memoized(args) {\n var callback = args.pop();\n var key = hasher.apply(null, args);\n if (has.call(memo, key)) { \n async.setImmediate(function () {\n callback.apply(null, memo[key]);\n });\n }\n else if (has.call(queues, key)) {\n queues[key].push(callback);\n }\n else {\n queues[key] = [callback];\n fn.apply(null, args.concat([_restParam(function (args) {\n memo[key] = args;\n var q = queues[key];\n delete queues[key];\n for (var i = 0, l = q.length; i < l; i++) {\n q[i].apply(null, args);\n }\n })]));\n }\n });\n memoized.memo = memo;\n memoized.unmemoized = fn;\n return memoized;\n };\n\n async.unmemoize = function (fn) {\n return function () {\n return (fn.unmemoized || fn).apply(null, arguments);\n };\n };\n\n function _times(mapper) {\n return function (count, iterator, callback) {\n mapper(_range(count), iterator, callback);\n };\n }\n\n async.times = _times(async.map);\n async.timesSeries = _times(async.mapSeries);\n async.timesLimit = function (count, limit, iterator, callback) {\n return async.mapLimit(_range(count), limit, iterator, callback);\n };\n\n async.seq = function (/* functions... */) {\n var fns = arguments;\n return _restParam(function (args) {\n var that = this;\n\n var callback = args[args.length - 1];\n if (typeof callback == 'function') {\n args.pop();\n } else {\n callback = noop;\n }\n\n async.reduce(fns, args, function (newargs, fn, cb) {\n fn.apply(that, newargs.concat([_restParam(function (err, nextargs) {\n cb(err, nextargs);\n })]));\n },\n function (err, results) {\n callback.apply(that, [err].concat(results));\n });\n });\n };\n\n async.compose = function (/* functions... */) {\n return async.seq.apply(null, Array.prototype.reverse.call(arguments));\n };\n\n\n function _applyEach(eachfn) {\n return _restParam(function(fns, args) {\n var go = _restParam(function(args) {\n var that = this;\n var callback = args.pop();\n return eachfn(fns, function (fn, _, cb) {\n fn.apply(that, args.concat([cb]));\n },\n callback);\n });\n if (args.length) {\n return go.apply(this, args);\n }\n else {\n return go;\n }\n });\n }\n\n async.applyEach = _applyEach(async.eachOf);\n async.applyEachSeries = _applyEach(async.eachOfSeries);\n\n\n async.forever = function (fn, callback) {\n var done = only_once(callback || noop);\n var task = ensureAsync(fn);\n function next(err) {\n if (err) {\n return done(err);\n }\n task(next);\n }\n next();\n };\n\n function ensureAsync(fn) {\n return _restParam(function (args) {\n var callback = args.pop();\n args.push(function () {\n var innerArgs = arguments;\n if (sync) {\n async.setImmediate(function () {\n callback.apply(null, innerArgs);\n });\n } else {\n callback.apply(null, innerArgs);\n }\n });\n var sync = true;\n fn.apply(this, args);\n sync = false;\n });\n }\n\n async.ensureAsync = ensureAsync;\n\n async.constant = _restParam(function(values) {\n var args = [null].concat(values);\n return function (callback) {\n return callback.apply(this, args);\n };\n });\n\n async.wrapSync =\n async.asyncify = function asyncify(func) {\n return _restParam(function (args) {\n var callback = args.pop();\n var result;\n try {\n result = func.apply(this, args);\n } catch (e) {\n return callback(e);\n }\n // if result is Promise object\n if (_isObject(result) && typeof result.then === \"function\") {\n result.then(function(value) {\n callback(null, value);\n })[\"catch\"](function(err) {\n callback(err.message ? err : new Error(err));\n });\n } else {\n callback(null, result);\n }\n });\n };\n\n // Node.js\n if (typeof module === 'object' && module.exports) {\n module.exports = async;\n }\n // AMD / RequireJS\n else if (typeof define === 'function' && define.amd) {\n define([], function () {\n return async;\n });\n }\n // included directly via <script> tag\n else {\n root.async = async;\n }\n\n}());\n",
|
||
"/**\n * Buffer module. Exports an appropriate version of Buffer for the current\n * platform.\n */\nimport buffer_core = require('./buffer_core');\nimport BufferCoreArray = require('./buffer_core_array');\nimport BufferCoreArrayBuffer = require('./buffer_core_arraybuffer');\nimport BufferCoreImageData = require('./buffer_core_imagedata');\nimport {StringUtil, FindUtil} from './string_util';\nimport {isArrayBuffer, isArrayBufferView} from './util';\n\n// BC implementations earlier in the array are preferred.\nvar BufferCorePreferences: buffer_core.BufferCoreImplementation[] = [\n BufferCoreArrayBuffer,\n BufferCoreImageData,\n BufferCoreArray\n];\n\nvar PreferredBufferCore: buffer_core.BufferCoreImplementation = (function(): buffer_core.BufferCoreImplementation {\n var i: number, bci: buffer_core.BufferCoreImplementation;\n for (i = 0; i < BufferCorePreferences.length; i++) {\n bci = BufferCorePreferences[i];\n if (bci.isAvailable()) return bci;\n }\n // Should never happen; Array works in all browsers.\n throw new Error(\"This browser does not support any available BufferCore implementations.\");\n})();\n\n/**\n * Checks integer writes.\n */\nfunction checkInt(buffer: NodeBuffer, value: number, offset: number, ext: number, max: number, min: number) {\n if (value > max || value < min) {\n throw new TypeError('value is out of bounds');\n } else if (offset + ext > buffer.length) {\n throw new RangeError('index out of range');\n }\n}\n\n/**\n * Checks floating point writes.\n */\nfunction checkFloat(buffer: NodeBuffer, value: number, offset: number, ext: number) {\n if (offset + ext > buffer.length) {\n throw new RangeError('index out of range');\n }\n}\n\n/**\n * Check offset into buffer.\n */\nfunction checkOffset(offset: number, ext: number, length: number): void {\n if (offset + ext > length) {\n throw new RangeError('index out of range');\n }\n}\n\n/**\n * MAX_INT for various byte sizes.\n */\nconst enum MaxInt {\n INT0 = 0,\n INT8 = 0x7F,\n INT16 = 0x7FFF,\n INT24 = 0x7FFFFF,\n INT32 = 0x7FFFFFFF,\n INT40 = 0x7FFFFFFFFF,\n INT48 = 0x7FFFFFFFFFFF\n}\n\n/**\n * MIN_INT for various byte sizes.\n */\nconst enum MinInt {\n INT0 = 0,\n INT8 = -0x80,\n INT16 = -0x8000,\n INT24 = -0x800000,\n INT32 = -0x80000000,\n INT40 = -0x8000000000,\n INT48 = -0x800000000000\n}\n\n/**\n * MAX_UINT for various sizes.\n */\nconst enum MaxUInt {\n INT0 = 0,\n INT8 = 0xFF,\n INT16 = 0xFFFF,\n INT24 = 0xFFFFFF,\n INT32 = 0xFFFFFFFF,\n INT40 = 0xFFFFFFFFFF,\n INT48 = 0xFFFFFFFFFFFF\n}\n\nvar byte2maxint: {[byte: number]: number} = {};\nbyte2maxint[0] = MaxInt.INT0;\nbyte2maxint[1] = MaxInt.INT8;\nbyte2maxint[2] = MaxInt.INT16;\nbyte2maxint[3] = MaxInt.INT24;\nbyte2maxint[4] = MaxInt.INT32;\nbyte2maxint[5] = MaxInt.INT40;\nbyte2maxint[6] = MaxInt.INT48;\nvar byte2minint: {[byte: number]: number} = {};\nbyte2minint[0] = MinInt.INT0;\nbyte2minint[1] = MinInt.INT8;\nbyte2minint[2] = MinInt.INT16;\nbyte2minint[3] = MinInt.INT24;\nbyte2minint[4] = MinInt.INT32;\nbyte2minint[5] = MinInt.INT40;\nbyte2minint[6] = MinInt.INT48;\nvar byte2maxuint: {[byte: number]: number} = {};\nbyte2maxuint[0] = MaxUInt.INT0;\nbyte2maxuint[1] = MaxUInt.INT8;\nbyte2maxuint[2] = MaxUInt.INT16;\nbyte2maxuint[3] = MaxUInt.INT24;\nbyte2maxuint[4] = MaxUInt.INT32;\nbyte2maxuint[5] = MaxUInt.INT40;\nbyte2maxuint[6] = MaxUInt.INT48;\n\n/**\n * We extend Node's buffer interface to account for differences in the browser\n * environment.\n */\nexport interface BFSBuffer extends NodeBuffer {\n // It's not tractable to emulate array indexing by defining numeric properties\n // for each index of the buffer, so we have getters/setters.\n get(index: number): number;\n set(index: number, value: number): void;\n // Used by backends to get the backing data.\n getBufferCore(): buffer_core.BufferCore;\n // Used by backends in conjunction with getBufferCore() and the length\n // property to determine which segment of the backing memory is applicable\n // for a given operation.\n getOffset(): number;\n // Like Buffer.slice, but copies the Buffer contents.\n sliceCopy(start?: number, end?: number): NodeBuffer\n}\n\n/**\n * Superset of the Buffer singleton described in node.d.ts.\n */\nexport interface BFSBufferImplementation {\n new (ab: ArrayBuffer): NodeBuffer;\n new (str: string, encoding?: string): NodeBuffer;\n new (size: number): NodeBuffer;\n new (array: any[]): NodeBuffer;\n isBuffer(obj: any): obj is NodeBuffer;\n byteLength(string: string, encoding?: string): number;\n concat(list: NodeBuffer[], totalLength?: number): NodeBuffer;\n}\n\n/**\n * A JSONified Buffer object.\n */\nexport interface JSONBufferObject {\n type: string;\n data: number[];\n}\n\n/**\n * Emulates Node's Buffer API. Wraps a BufferCore object that is responsible\n * for actually writing/reading data from some data representation in memory.\n */\nexport class Buffer implements BFSBuffer {\n // Note: This array property is *not* true, but it's required to satisfy\n // TypeScript typings.\n [idx: number]: number;\n private data: buffer_core.BufferCore;\n private offset: number = 0;\n public length: number;\n\n /**\n * Constructs a buffer.\n * @param arg1 - Instantiate a buffer of the indicated size, or\n * from the indicated Array or String.\n * @param [arg2=\"utf8\"] - Encoding to use if arg1 is a string\n */\n constructor (size: number);\n constructor (data: any[]);\n constructor (data: ArrayBufferView);\n constructor (data: ArrayBuffer);\n constructor (data: NodeBuffer);\n constructor (data: JSONBufferObject);\n constructor (data: string, encoding?: string);\n constructor (data: buffer_core.BufferCore, start?: number, end?: number);\n constructor (arg1: any, arg2: any = 'utf8', arg3?: number) {\n var i: number;\n // Node apparently allows you to construct buffers w/o 'new'.\n if (!(this instanceof Buffer)) {\n return new Buffer(arg1, arg2);\n }\n\n if (arg1 instanceof buffer_core.BufferCoreCommon) {\n // constructor (data: buffer_core.BufferCore, start?: number, end?: number)\n this.data = <buffer_core.BufferCore> arg1;\n var start = typeof arg2 === 'number' ? <number><any> arg2 : 0;\n var end = typeof arg3 === 'number' ? <number> arg3 : this.data.getLength();\n this.offset = start;\n this.length = end - start;\n } else if (typeof arg1 === 'number') {\n // constructor (size: number);\n if (arg1 !== (arg1 >>> 0)) {\n throw new RangeError('Buffer size must be a uint32.');\n }\n this.length = arg1;\n this.data = new PreferredBufferCore(arg1);\n } else if (isArrayBufferView(arg1)) {\n // constructor (data: ArrayBufferView);\n this.data = new BufferCoreArrayBuffer(arg1);\n this.length = arg1.byteLength;\n } else if (isArrayBuffer(arg1)) {\n // constructor (data: ArrayBuffer);\n // Note: Can't do 'instanceof ArrayBuffer' in Safari in some cases. :|\n this.data = new BufferCoreArrayBuffer(<ArrayBuffer> arg1);\n this.length = arg1.byteLength;\n } else if (arg1 instanceof Buffer) {\n // constructor (data: Buffer);\n var argBuff = <Buffer> arg1;\n this.data = new PreferredBufferCore(arg1.length);\n this.length = arg1.length;\n argBuff.copy(this);\n } else if (Array.isArray(arg1) || (arg1 != null && typeof arg1 === 'object' && typeof arg1[0] === 'number')) {\n // constructor (data: number[]);\n this.data = new PreferredBufferCore(arg1.length);\n for (i = 0; i < arg1.length; i++) {\n this.data.writeUInt8(i, arg1[i]);\n }\n this.length = arg1.length;\n } else if (typeof arg1 === 'string') {\n // constructor (data: string, encoding?: string);\n this.length = Buffer.byteLength(arg1, arg2);\n this.data = new PreferredBufferCore(this.length);\n this.write(arg1, 0, this.length, arg2);\n } else {\n // constructor (data: {type: string; data: number[]}, encoding?: string)\n if (arg1['type'] === 'Buffer' && Array.isArray(arg1['data'])) {\n this.data = new PreferredBufferCore(arg1.data.length);\n for (i = 0; i < arg1.data.length; i++) {\n this.data.writeUInt8(i, arg1.data[i]);\n }\n this.length = arg1.data.length;\n } else {\n throw new Error(\"Invalid argument to Buffer constructor: \" + arg1);\n }\n }\n }\n\n /* TEST METHODS BEGIN */\n\n public static getAvailableBufferCores(): buffer_core.BufferCoreImplementation[] {\n return BufferCorePreferences.filter((bci) => bci.isAvailable());\n }\n\n public static getPreferredBufferCore(): buffer_core.BufferCoreImplementation {\n return PreferredBufferCore;\n }\n\n public static setPreferredBufferCore(bci: buffer_core.BufferCoreImplementation) {\n PreferredBufferCore = bci;\n }\n\n /* TEST METHODS END */\n\n public getBufferCore(): buffer_core.BufferCore {\n return this.data;\n }\n\n public getOffset(): number {\n return this.offset;\n }\n\n /**\n * **NONSTANDARD**: Set the octet at index. Emulates NodeJS buffer's index\n * operation. Octet can be signed or unsigned.\n * @param {number} index - the index to set the value at\n * @param {number} value - the value to set at the given index\n */\n public set(index: number, value: number): number {\n // In Node, the following happens:\n // buffer[0] = -1;\n // buffer[0]; // 255\n if (value < 0) {\n return this.writeInt8(value, index);\n } else {\n return this.writeUInt8(value, index);\n }\n }\n\n /**\n * **NONSTANDARD**: Get the octet at index.\n * @param {number} index - index to fetch the value at\n * @return {number} the value at the given index\n */\n public get(index: number): number {\n return this.readUInt8(index);\n }\n\n /**\n * Writes string to the buffer at offset using the given encoding.\n * If buffer did not contain enough space to fit the entire string, it will\n * write a partial amount of the string.\n * @param {string} str - Data to be written to buffer\n * @param {number} [offset=0] - Offset in the buffer to write to\n * @param {number} [length=this.length] - Number of bytes to write\n * @param {string} [encoding=utf8] - Character encoding\n * @return {number} Number of octets written.\n */\n public write(str: string, offset = 0, length = this.length, encoding = 'utf8'): number {\n // I hate Node's optional arguments.\n if (typeof offset === 'string') {\n // 'str' and 'encoding' specified\n encoding = \"\" + offset;\n offset = 0;\n length = this.length;\n } else if (typeof length === 'string') {\n // 'str', 'offset', and 'encoding' specified\n encoding = \"\" + length;\n length = this.length;\n }\n // Check for invalid offsets.\n if (offset > this.length || offset < 0) {\n throw new RangeError(\"Invalid offset.\");\n }\n var strUtil = FindUtil(encoding);\n // Are we trying to write past the buffer?\n length = length + offset > this.length ? this.length - offset : length;\n offset += this.offset;\n return strUtil.str2byte(str,\n // Avoid creating a slice unless it's needed.\n offset === 0 && length === this.length ? this : new Buffer(this.data, offset, length + offset));\n }\n\n /**\n * Decodes a portion of the Buffer into a String.\n * @param {string} encoding - Character encoding to decode to\n * @param {number} [start=0] - Start position in the buffer\n * @param {number} [end=this.length] - Ending position in the buffer\n * @return {string} A string from buffer data encoded with encoding, beginning\n * at start, and ending at end.\n */\n public toString(encoding = 'utf8', start = 0, end = this.length): string {\n if (!(start <= end)) {\n throw new Error(\"Invalid start/end positions: \" + start + \" - \" + end);\n }\n if (start === end) {\n return '';\n }\n if (end > this.length) {\n end = this.length;\n }\n var strUtil = FindUtil(encoding);\n // Get the string representation of the given slice. Create a new buffer\n // if need be.\n return strUtil.byte2str(start === 0 && end === this.length ? this : new Buffer(this.data, start + this.offset, end + this.offset));\n }\n\n /**\n * Returns a JSON-representation of the Buffer instance, which is identical to\n * the output for JSON Arrays. JSON.stringify implicitly calls this function\n * when stringifying a Buffer instance.\n * @return {object} An object that can be used for JSON stringification.\n */\n public toJSON(): JSONBufferObject {\n // Construct a byte array for the JSON 'data'.\n var len = this.length;\n var byteArr = new Array(len);\n for (var i = 0; i < len; i++) {\n byteArr[i] = this.readUInt8(i);\n }\n return {\n type: 'Buffer',\n data: byteArr\n };\n }\n\n /**\n * Returns a string with the first 50 hexadecimal values of the Buffer.\n */\n public inspect(): string {\n var digits: string[] = [], i: number, len = this.length < INSPECT_MAX_BYTES ? this.length : INSPECT_MAX_BYTES;\n for (i = 0; i < len; i++) {\n digits.push(this.readUInt8(i).toString(16));\n }\n return `<Buffer ${digits.join(\" \")}${this.length > len ? \" ... \" : \"\"}>`;\n }\n\n /**\n * Converts the buffer into an ArrayBuffer. Will attempt to use an underlying\n * ArrayBuffer, but will need to copy the data if the underlaying object is an\n * ArrayBufferView or not an ArrayBuffer.\n */\n public toArrayBuffer(): ArrayBuffer {\n var buffCore = this.getBufferCore();\n if (buffCore instanceof BufferCoreArrayBuffer) {\n var dv = buffCore.getDataView(),\n ab = dv.buffer;\n // Ensure 1-1 mapping from AB to Buffer.\n if (this.offset === 0 && dv.byteOffset === 0 && dv.byteLength === ab.byteLength && this.length === dv.byteLength) {\n return ab;\n } else {\n return ab.slice(this.offset + dv.byteOffset, this.length);\n }\n } else {\n var ab = new ArrayBuffer(this.length),\n newBuff = new Buffer(ab);\n this.copy(newBuff, 0, 0, this.length);\n return ab;\n }\n }\n\n /**\n * Converts the buffer into a Uint8Array. Will attempt to use an underlying\n * ArrayBuffer, but will need to copy the data if the Buffer is not backed\n * by an ArrayBuffer.\n */\n public toUint8Array(): Uint8Array {\n var buffCore = this.getBufferCore();\n if (buffCore instanceof BufferCoreArrayBuffer) {\n var dv = buffCore.getDataView(),\n ab = dv.buffer,\n offset = this.offset + dv.byteOffset,\n length = this.length;\n\n return new Uint8Array(ab).subarray(offset, offset + length);\n } else {\n var ab = new ArrayBuffer(this.length),\n newBuff = new Buffer(ab);\n this.copy(newBuff, 0, 0, this.length);\n return new Uint8Array(ab);\n }\n }\n\n /**\n * Operates similar to Array#indexOf(). Accepts a String, Buffer or Number.\n * Strings are interpreted as UTF8. Buffers will use the entire buffer. So in order\n * to compare a partial Buffer use Buffer#slice(). Numbers can range from 0 to 255.\n */\n public indexOf(value: string | NodeBuffer | number, byteOffset: number = 0): number {\n var normalizedValue: NodeBuffer;\n if (typeof(value) === 'string') {\n normalizedValue = new Buffer(<string> value, 'utf8');\n } else if (Buffer.isBuffer(value)) {\n normalizedValue = value;\n } else if (typeof(value) === 'number') {\n normalizedValue = new Buffer([<number> value]);\n } else {\n throw new TypeError(`indexOf only operates on strings, buffers, and numbers.`);\n }\n\n // Node's normalization code.\n if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n byteOffset >>= 0;\n\n // Negative offsets are from the end of the array.\n if (byteOffset < 0) {\n byteOffset = this.length + byteOffset;\n if (byteOffset < 0) {\n // If the calculated index is less than 0, then the whole array will be searched.\n byteOffset = 0;\n }\n }\n\n var valOffset = 0, currentVal: number, valLen = normalizedValue.length,\n bufLen = this.length;\n // Edge-case: Can't indexOf with zero-length data.\n if (valLen === 0) {\n return -1;\n }\n\n while (valOffset < valLen && byteOffset < bufLen) {\n if (normalizedValue.readUInt8(valOffset) == this.readUInt8(byteOffset)) {\n valOffset++;\n } else {\n // Doesn't match. Restart search.\n valOffset = 0;\n }\n byteOffset++;\n }\n\n if (valOffset == valLen) {\n return byteOffset - valLen;\n } else {\n return -1;\n }\n }\n\n /**\n * Does copy between buffers. The source and target regions can be overlapped.\n * All values passed that are undefined/NaN or are out of bounds are set equal\n * to their respective defaults.\n * @param {Buffer} target - Buffer to copy into\n * @param {number} [targetStart=0] - Index to start copying to in the targetBuffer\n * @param {number} [sourceStart=0] - Index in this buffer to start copying from\n * @param {number} [sourceEnd=this.length] - Index in this buffer stop copying at\n * @return {number} The number of bytes copied into the target buffer.\n */\n public copy(target: NodeBuffer, targetStart = 0, sourceStart = 0, sourceEnd = this.length): number {\n if (sourceStart < 0) {\n throw new RangeError('sourceStart out of bounds');\n }\n if (sourceEnd < 0) {\n throw new RangeError('sourceEnd out of bounds');\n }\n if (targetStart < 0) {\n throw new RangeError(\"targetStart out of bounds\");\n }\n\n if (sourceEnd <= sourceStart || sourceStart >= this.length || targetStart > target.length) {\n return 0;\n }\n\n var bytesCopied = Math.min(sourceEnd - sourceStart, target.length - targetStart, this.length - sourceStart);\n\n // Fast path.\n if (target instanceof Buffer && this.data instanceof BufferCoreArrayBuffer) {\n let targetCore = target.getBufferCore();\n if (targetCore instanceof BufferCoreArrayBuffer) {\n return (<BufferCoreArrayBuffer> this.data).copyTo(targetCore, targetStart + target.offset, sourceStart + this.offset, sourceStart + bytesCopied + this.offset);\n }\n }\n\n // Copy as many 32-bit chunks as possible.\n // TODO: Alignment.\n for (let i = 0; i < bytesCopied - 3; i += 4) {\n target.writeInt32LE(this.readInt32LE(sourceStart + i), targetStart + i);\n }\n // Copy any remaining bytes, if applicable\n for (let i = bytesCopied & 0xFFFFFFFC; i < bytesCopied; i++) {\n target.writeUInt8(this.readUInt8(sourceStart + i), targetStart + i);\n }\n return bytesCopied;\n }\n\n /**\n * Returns a slice of this buffer.\n * @param {number} [start=0] - Index to start slicing from\n * @param {number} [end=this.length] - Index to stop slicing at\n * @return {Buffer} A new buffer which references the same\n * memory as the old, but offset and cropped by the start (defaults to 0) and\n * end (defaults to buffer.length) indexes. Negative indexes start from the end\n * of the buffer.\n */\n public slice(start = 0, end = this.length): NodeBuffer {\n start = start >> 0;\n end = end >> 0;\n // Translate negative indices to positive ones.\n if (start < 0) {\n start += this.length;\n if (start < 0) {\n start = 0;\n }\n }\n if (end < 0) {\n end += this.length;\n if (end < 0) {\n end = 0;\n }\n }\n if (end > this.length) {\n end = this.length;\n }\n if (start > end) {\n start = end;\n }\n\n // Sanity check.\n if (start < 0 || end < 0 || start > this.length || end > this.length) {\n throw new Error(\"Invalid slice indices.\");\n }\n // Create a new buffer backed by the same BufferCore.\n return new Buffer(this.data, start + this.offset, end + this.offset);\n }\n\n /**\n * [NONSTANDARD] A copy-based version of Buffer.slice.\n */\n public sliceCopy(start: number = 0, end: number = this.length): NodeBuffer {\n // Translate negative indices to positive ones.\n if (start < 0) {\n start += this.length;\n if (start < 0) {\n start = 0;\n }\n }\n if (end < 0) {\n end += this.length;\n if (end < 0) {\n end = 0;\n }\n }\n if (end > this.length) {\n end = this.length;\n }\n if (start > end) {\n start = end;\n }\n\n // Sanity check.\n if (start < 0 || end < 0 || start >= this.length || end > this.length) {\n throw new Error(\"Invalid slice indices.\");\n }\n\n // Copy the BufferCore.\n return new Buffer(this.data.copy(start + this.offset, end + this.offset));\n }\n\n /**\n * Fills the buffer with the specified value. If the offset and end are not\n * given it will fill the entire buffer.\n * @param {(string|number)} value - The value to fill the buffer with\n * @param {number} [offset=0]\n * @param {number} [end=this.length]\n */\n public fill(value: any, offset = 0, end = this.length): NodeBuffer {\n var i: number;\n offset = offset >> 0;\n end = end >> 0;\n\n if (offset < 0 || end > this.length) {\n throw new RangeError('out of range index');\n } else if (end <= offset) {\n return this;\n }\n\n if (typeof value !== 'string') {\n // Coerces various things to numbers. Node does this.\n value = value >>> 0;\n } else if (value.length === 1) {\n var code = value.charCodeAt(0);\n if (code < 256) {\n value = code;\n }\n }\n\n if (typeof value === 'number') {\n offset += this.offset;\n end += this.offset;\n this.data.fill(value, offset, end);\n } else if (value.length > 0) {\n var byteLen = Buffer.byteLength(value, 'utf8'),\n lastBulkWrite = end - byteLen;\n while (offset < lastBulkWrite) {\n this.write(value, offset, byteLen, 'utf8');\n offset += byteLen;\n }\n if (offset < end) {\n this.write(value, offset, end - offset, 'utf8');\n }\n }\n return this;\n }\n\n public readUIntLE(offset: number, byteLength: number, noAssert = false): number {\n offset = offset >>> 0;\n byteLength = byteLength >>> 0;\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length);\n }\n offset += this.offset;\n var value: number = 0;\n switch (byteLength) {\n case 1:\n return this.data.readUInt8(offset);\n case 2:\n return this.data.readUInt16LE(offset);\n case 3:\n return this.data.readUInt8(offset) | (this.data.readUInt16LE(offset + 1) << 8);\n case 4:\n return this.data.readUInt32LE(offset);\n case 6:\n // Shift right by 40 bits.\n // (Note: We shift by 23 to avoid introducing a sign bit!)\n value += (this.data.readUInt8(offset + 5) << 23) * 0x20000;\n // FALL-THRU\n case 5:\n // Shift right by 32 bits.\n value += (this.data.readUInt8(offset + 4) << 23) * 0x200;\n return value + this.data.readUInt32LE(offset);\n default:\n throw new Error(`Invalid byteLength: ${byteLength}`);\n }\n }\n\n public readUIntBE(offset: number, byteLength: number, noAssert = false): number {\n offset = offset >>> 0;\n byteLength = byteLength >>> 0;\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length);\n }\n offset += this.offset;\n var value: number = 0;\n switch (byteLength) {\n case 1:\n return this.data.readUInt8(offset);\n case 2:\n return this.data.readUInt16BE(offset);\n case 3:\n return this.data.readUInt8(offset + 2) | (this.data.readUInt16BE(offset) << 8);\n case 4:\n return this.data.readUInt32BE(offset);\n case 6:\n // Shift right by 40 bits.\n // (Note: We shift by 23 to avoid introducing a sign bit!)\n value += (this.data.readUInt8(offset) << 23) * 0x20000;\n offset++;\n // FALL-THRU\n case 5:\n // Shift right by 32 bits.\n value += (this.data.readUInt8(offset) << 23) * 0x200;\n return value + this.data.readUInt32BE(offset + 1);\n default:\n throw new Error(`Invalid byteLength: ${byteLength}`);\n }\n }\n\n public readIntLE(offset: number, byteLength: number, noAssert = false): number {\n offset = offset >>> 0;\n byteLength = byteLength >>> 0;\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length);\n }\n offset += this.offset;\n switch (byteLength) {\n case 1:\n return this.data.readInt8(offset);\n case 2:\n return this.data.readInt16LE(offset);\n case 3:\n return this.data.readUInt8(offset) | (this.data.readInt16LE(offset + 1) << 8);\n case 4:\n return this.data.readInt32LE(offset);\n case 6:\n // Shift right by 40 bits.\n // (Note: We shift by 23 to avoid introducing a sign bit!)\n return ((this.data.readInt8(offset + 5) << 23) * 0x20000) + this.readUIntLE(offset - this.offset, 5, noAssert);\n case 5:\n // Shift right by 32 bits.\n return ((this.data.readInt8(offset + 4) << 23) * 0x200) + this.data.readUInt32LE(offset);\n default:\n throw new Error(`Invalid byteLength: ${byteLength}`);\n }\n }\n\n public readIntBE(offset: number, byteLength: number, noAssert = false): number {\n offset = offset >>> 0;\n byteLength = byteLength >>> 0;\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length);\n }\n offset += this.offset;\n switch (byteLength) {\n case 1:\n return this.data.readInt8(offset);\n case 2:\n return this.data.readInt16BE(offset);\n case 3:\n return this.data.readUInt8(offset + 2) | (this.data.readInt16BE(offset) << 8);\n case 4:\n return this.data.readInt32BE(offset);\n case 6:\n // Shift right by 40 bits.\n // (Note: We shift by 23 to avoid introducing a sign bit!)\n return ((this.data.readInt8(offset) << 23) * 0x20000) + this.readUIntBE(offset - this.offset + 1, 5, noAssert);\n case 5:\n // Shift right by 32 bits.\n return ((this.data.readInt8(offset) << 23) * 0x200) + this.data.readUInt32BE(offset + 1);\n default:\n throw new Error(`Invalid byteLength: ${byteLength}`);\n }\n }\n\n public readUInt8(offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkOffset(offset, 1, this.length);\n }\n offset += this.offset;\n return this.data.readUInt8(offset);\n }\n\n public readUInt16LE(offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkOffset(offset, 2, this.length);\n }\n offset += this.offset;\n return this.data.readUInt16LE(offset);\n }\n\n public readUInt16BE(offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkOffset(offset, 2, this.length);\n }\n offset += this.offset;\n return this.data.readUInt16BE(offset);\n }\n\n public readUInt32LE(offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkOffset(offset, 4, this.length);\n }\n offset += this.offset;\n return this.data.readUInt32LE(offset);\n }\n\n public readUInt32BE(offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkOffset(offset, 4, this.length);\n }\n offset += this.offset;\n return this.data.readUInt32BE(offset);\n }\n\n public readInt8(offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkOffset(offset, 1, this.length);\n }\n offset += this.offset;\n return this.data.readInt8(offset);\n }\n\n public readInt16LE(offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkOffset(offset, 2, this.length);\n }\n offset += this.offset;\n return this.data.readInt16LE(offset);\n }\n\n public readInt16BE(offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkOffset(offset, 2, this.length);\n }\n offset += this.offset;\n return this.data.readInt16BE(offset);\n }\n\n public readInt32LE(offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkOffset(offset, 4, this.length);\n }\n offset += this.offset;\n return this.data.readInt32LE(offset);\n }\n\n public readInt32BE(offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkOffset(offset, 4, this.length);\n }\n offset += this.offset;\n return this.data.readInt32BE(offset);\n }\n\n public readFloatLE(offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkOffset(offset, 4, this.length);\n }\n offset += this.offset;\n return this.data.readFloatLE(offset);\n }\n\n public readFloatBE(offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkOffset(offset, 4, this.length);\n }\n offset += this.offset;\n return this.data.readFloatBE(offset);\n }\n\n public readDoubleLE(offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkOffset(offset, 8, this.length);\n }\n offset += this.offset;\n return this.data.readDoubleLE(offset);\n }\n\n public readDoubleBE(offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkOffset(offset, 8, this.length);\n }\n offset += this.offset;\n return this.data.readDoubleBE(offset);\n }\n\n public writeUIntLE(value: number, offset: number, byteLength: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkInt(this, value, offset, byteLength, byte2maxuint[byteLength], 0);\n }\n var rv = offset + byteLength;\n offset += this.offset;\n switch (byteLength) {\n case 1:\n this.data.writeUInt8(offset, value);\n break;\n case 2:\n this.data.writeUInt16LE(offset, value);\n break;\n case 3:\n this.data.writeUInt8(offset, value & 0xFF);\n this.data.writeUInt16LE(offset + 1, value >> 8);\n break;\n case 4:\n this.data.writeUInt32LE(offset, value);\n break;\n case 6:\n this.data.writeUInt8(offset, value & 0xFF);\n // \"Bit shift\", since we're over 32-bits.\n value = Math.floor(value / 256);\n offset++;\n // FALL-THRU\n case 5:\n this.data.writeUInt8(offset, value & 0xFF);\n // \"Bit shift\", since we're over 32-bits.\n value = Math.floor(value / 256);\n this.data.writeUInt32LE(offset + 1, value);\n break;\n default:\n throw new Error(`Invalid byteLength: ${byteLength}`);\n }\n return rv;\n }\n\n public writeUIntBE(value: number, offset: number, byteLength: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkInt(this, value, offset, byteLength, byte2maxuint[byteLength], 0);\n }\n var rv = offset + byteLength;\n offset += this.offset;\n switch (byteLength) {\n case 1:\n this.data.writeUInt8(offset, value);\n break;\n case 2:\n this.data.writeUInt16BE(offset, value);\n break;\n case 3:\n this.data.writeUInt8(offset + 2, value & 0xFF);\n this.data.writeUInt16BE(offset, value >> 8);\n break;\n case 4:\n this.data.writeUInt32BE(offset, value);\n break;\n case 6:\n this.data.writeUInt8(offset + 5, value & 0xFF);\n // \"Bit shift\", since we're over 32-bits.\n value = Math.floor(value / 256);\n // FALL-THRU\n case 5:\n this.data.writeUInt8(offset + 4, value & 0xFF);\n // \"Bit shift\", since we're over 32-bits.\n value = Math.floor(value / 256);\n this.data.writeUInt32BE(offset, value);\n break;\n default:\n throw new Error(`Invalid byteLength: ${byteLength}`);\n }\n return rv;\n }\n\n public writeIntLE(value: number, offset: number, byteLength: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkInt(this, value, offset, byteLength, byte2maxint[byteLength], byte2minint[byteLength]);\n }\n var rv = offset + byteLength;\n offset += this.offset;\n switch (byteLength) {\n case 1:\n this.data.writeInt8(offset, value);\n break;\n case 2:\n this.data.writeInt16LE(offset, value);\n break;\n case 3:\n this.data.writeUInt8(offset, value & 0xFF);\n this.data.writeInt16LE(offset + 1, value >> 8);\n break;\n case 4:\n this.data.writeInt32LE(offset, value);\n break;\n case 6:\n this.data.writeUInt8(offset, value & 0xFF);\n // \"Bit shift\", since we're over 32-bits.\n value = Math.floor(value / 256);\n offset++;\n // FALL-THRU\n case 5:\n this.data.writeUInt8(offset, value & 0xFF);\n // \"Bit shift\", since we're over 32-bits.\n value = Math.floor(value / 256);\n this.data.writeInt32LE(offset + 1, value);\n break;\n default:\n throw new Error(`Invalid byteLength: ${byteLength}`);\n }\n return rv;\n }\n\n public writeIntBE(value: number, offset: number, byteLength: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkInt(this, value, offset, byteLength, byte2maxint[byteLength], byte2minint[byteLength]);\n }\n var rv = offset + byteLength;\n offset += this.offset;\n switch (byteLength) {\n case 1:\n this.data.writeInt8(offset, value);\n break;\n case 2:\n this.data.writeInt16BE(offset, value);\n break;\n case 3:\n this.data.writeUInt8(offset + 2, value & 0xFF);\n this.data.writeInt16BE(offset, value >> 8);\n break;\n case 4:\n this.data.writeInt32BE(offset, value);\n break;\n case 6:\n this.data.writeUInt8(offset + 5, value & 0xFF);\n // \"Bit shift\", since we're over 32-bits.\n value = Math.floor(value / 256);\n // FALL-THRU\n case 5:\n this.data.writeUInt8(offset + 4, value & 0xFF);\n // \"Bit shift\", since we're over 32-bits.\n value = Math.floor(value / 256);\n this.data.writeInt32BE(offset, value);\n break;\n default:\n throw new Error(`Invalid byteLength: ${byteLength}`);\n }\n return rv;\n }\n\n public writeUInt8(value: number, offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkInt(this, value, offset, 1, MaxUInt.INT8, 0);\n }\n this.data.writeUInt8(offset + this.offset, value);\n return offset + 1;\n }\n\n public writeUInt16LE(value: number, offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkInt(this, value, offset, 2, MaxUInt.INT16, 0);\n }\n this.data.writeUInt16LE(offset + this.offset, value);\n return offset + 2;\n }\n\n public writeUInt16BE(value: number, offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkInt(this, value, offset, 2, MaxUInt.INT16, 0);\n }\n this.data.writeUInt16BE(offset + this.offset, value);\n return offset + 2;\n }\n\n public writeUInt32LE(value: number, offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkInt(this, value, offset, 4, MaxUInt.INT32, 0);\n }\n this.data.writeUInt32LE(offset + this.offset, value);\n return offset + 4;\n }\n\n public writeUInt32BE(value: number, offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkInt(this, value, offset, 4, MaxUInt.INT32, 0);\n }\n this.data.writeUInt32BE(offset + this.offset, value);\n return offset + 4;\n }\n\n public writeInt8(value: number, offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkInt(this, value, offset, 1, MaxInt.INT8, MinInt.INT8);\n }\n this.data.writeInt8(offset + this.offset, value);\n return offset + 1;\n }\n\n public writeInt16LE(value: number, offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkInt(this, value, offset, 2, MaxInt.INT16, MinInt.INT16);\n }\n this.data.writeInt16LE(offset + this.offset, value);\n return offset + 2;\n }\n\n public writeInt16BE(value: number, offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkInt(this, value, offset, 2, MaxInt.INT16, MinInt.INT16);\n }\n this.data.writeInt16BE(offset + this.offset, value);\n return offset + 2;\n }\n\n public writeInt32LE(value: number, offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkInt(this, value, offset, 4, MaxInt.INT32, MinInt.INT32);\n }\n this.data.writeInt32LE(offset + this.offset, value);\n return offset + 4;\n }\n\n public writeInt32BE(value: number, offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkInt(this, value, offset, 4, MaxInt.INT32, MinInt.INT32);\n }\n this.data.writeInt32BE(offset + this.offset, value);\n return offset + 4;\n }\n\n public writeFloatLE(value: number, offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkFloat(this, value, offset, 4);\n }\n this.data.writeFloatLE(offset + this.offset, value);\n return offset + 4;\n }\n\n public writeFloatBE(value: number, offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkFloat(this, value, offset, 4);\n }\n this.data.writeFloatBE(offset + this.offset, value);\n return offset + 4;\n }\n\n public writeDoubleLE(value: number, offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkFloat(this, value, offset, 8);\n }\n this.data.writeDoubleLE(offset + this.offset, value);\n return offset + 8;\n }\n\n public writeDoubleBE(value: number, offset: number, noAssert = false): number {\n offset = offset >>> 0;\n if (!noAssert) {\n checkFloat(this, value, offset, 8);\n }\n this.data.writeDoubleBE(offset + this.offset, value);\n return offset + 8;\n }\n\n ///**************************STATIC METHODS********************************///\n\n /**\n * Checks if enc is a valid string encoding type.\n * @param {string} enc - Name of a string encoding type.\n * @return {boolean} Whether or not enc is a valid encoding type.\n */\n public static isEncoding(enc: string): boolean {\n try {\n FindUtil(enc);\n } catch (e) {\n return false;\n }\n return true;\n }\n\n public static compare(a: NodeBuffer, b: NodeBuffer): number {\n if (a === b) {\n return 0;\n } else {\n var i: number,\n aLen = a.length,\n bLen = b.length,\n cmpLength = Math.min(aLen, bLen),\n u1: number, u2: number;\n for (i = 0; i < cmpLength; i++) {\n u1 = a.readUInt8(i);\n u2 = b.readUInt8(i);\n if (u1 !== u2) {\n return u1 > u2 ? 1 : -1;\n }\n }\n if (aLen === bLen) {\n return 0;\n } else {\n return aLen > bLen ? 1 : -1;\n }\n }\n }\n\n /**\n * Tests if obj is a Buffer.\n * @param {object} obj - An arbitrary object\n * @return {boolean} True if this object is a Buffer.\n */\n public static isBuffer(obj: any): obj is NodeBuffer {\n return obj instanceof Buffer;\n }\n\n /**\n * Gives the actual byte length of a string. This is not the same as\n * String.prototype.length since that returns the number of characters in a\n * string.\n * @param {string} str - The string to get the byte length of\n * @param {string} [encoding=utf8] - Character encoding of the string\n * @return {number} The number of bytes in the string\n */\n public static byteLength(str: string, encoding: string = 'utf8'): number {\n var strUtil: StringUtil;\n try {\n strUtil = FindUtil(encoding);\n } catch (e) {\n // Default to UTF8.\n strUtil = FindUtil('utf8');\n }\n if (typeof(str) !== 'string') {\n str = \"\" + str;\n }\n return strUtil.byteLength(str);\n }\n\n /**\n * Returns a buffer which is the result of concatenating all the buffers in the\n * list together.\n * If the list has no items, or if the totalLength is 0, then it returns a\n * zero-length buffer.\n * If the list has exactly one item, then the first item of the list is\n * returned.\n * If the list has more than one item, then a new Buffer is created.\n * If totalLength is not provided, it is read from the buffers in the list.\n * However, this adds an additional loop to the function, so it is faster to\n * provide the length explicitly.\n * @param {Buffer[]} list - List of Buffer objects to concat\n * @param {number} [totalLength] - Total length of the buffers when concatenated\n * @return {Buffer}\n */\n public static concat(list: NodeBuffer[], totalLength?: number): NodeBuffer {\n var item: NodeBuffer;\n if (list.length === 0 || totalLength === 0) {\n return new Buffer(0);\n } else {\n if (totalLength === undefined) {\n // Calculate totalLength\n totalLength = 0;\n for (var i = 0; i < list.length; i++) {\n item = list[i];\n if (!Buffer.isBuffer(item)) {\n throw new TypeError(`Concat only operates on Buffer objects.`);\n }\n totalLength += item.length;\n }\n }\n var buf = new Buffer(totalLength);\n var curPos = 0;\n for (var j = 0; j < list.length; j++) {\n item = list[j];\n if (!Buffer.isBuffer(item)) {\n throw new TypeError(`Concat only operates on Buffer objects.`);\n }\n curPos += item.copy(buf, curPos);\n }\n return buf;\n }\n }\n\n /**\n * Returns a boolean of whether this and otherBuffer have the same bytes.\n */\n public equals(buffer: NodeBuffer): boolean {\n if (Buffer.isBuffer(buffer)) {\n var i: number;\n if (buffer.length !== this.length) {\n return false;\n } else {\n // TODO: Bigger strides.\n for (i = 0; i < this.length; i++) {\n if (this.readUInt8(i) !== buffer.readUInt8(i)) {\n return false;\n }\n }\n return true;\n }\n } else {\n throw new TypeError(`Argument must be a buffer.`);\n }\n }\n\n /**\n * Returns a number indicating whether this comes before or after or is\n * the same as the otherBuffer in sort order.\n */\n public compare(buffer: NodeBuffer): number {\n return Buffer.compare(this, buffer);\n }\n}\n\n// Type-check the class.\nvar _: BFSBufferImplementation = Buffer;\n\n/**\n * Emulation of Node's SlowBuffer. We don't differentiate between the two.\n */\nexport class SlowBuffer extends Buffer implements NodeBuffer {\n constructor (length: any, arg2?: any, arg3?: number) {\n // Node apparently allows you to construct buffers w/o 'new'.\n if (!(this instanceof SlowBuffer)) {\n return new SlowBuffer(length, arg2, arg3);\n }\n // Logic copied from Node; its constructor is simpler.\n if (+length != length) {\n length = 0;\n }\n\n super(+length);\n }\n\n public static isBuffer(obj: any): obj is NodeBuffer {\n return Buffer.isBuffer(obj);\n }\n\n public static byteLength(str: string, encoding?: string): number {\n return Buffer.byteLength(str, encoding);\n }\n\n public static concat(list: NodeBuffer[], totalLength?: number): NodeBuffer {\n return Buffer.concat(list, totalLength);\n }\n}\n// Type-check the class.\n_ = SlowBuffer;\n\n/**\n * Determines how many bytes to print via inspect().\n */\nexport var INSPECT_MAX_BYTES: number = 50;\n",
|
||
"/**\n * !!!NOTE: This file should not depend on any other file!!!\n *\n * Buffers are referenced everywhere, so it can cause a circular dependency.\n */\n\nvar FLOAT_POS_INFINITY = Math.pow(2, 128);\nvar FLOAT_NEG_INFINITY = -1 * FLOAT_POS_INFINITY;\nvar FLOAT_POS_INFINITY_AS_INT = 0x7F800000;\nvar FLOAT_NEG_INFINITY_AS_INT = -8388608;\nvar FLOAT_NaN_AS_INT = 0x7fc00000;\n\n/**\n * The core data-writing and reading methods of any buffer.\n */\nexport interface BufferCore {\n /**\n * Get the size of this buffer core, in bytes.\n */\n getLength(): number;\n /**\n * Writes bottom 8 bits of the given integer at the provided index.\n */\n writeInt8(i: number, data: number): void;\n /**\n * Writes bottom 16 bits of the given integer at the provided index.\n * Little endian.\n */\n writeInt16LE(i: number, data: number): void;\n /**\n * Writes bottom 16 bits of the given integer at the provided index.\n * Big endian.\n */\n writeInt16BE(i: number, data: number): void;\n /**\n * Writes all 32 bits of the given integer at the provided index.\n * Little endian.\n */\n writeInt32LE(i: number, data: number): void;\n /**\n * Writes all 32 bits of the given integer at the provided index.\n * Big endian.\n */\n writeInt32BE(i: number, data: number): void;\n /**\n * Writes the number as an 8 bit unsigned integer.\n */\n writeUInt8(i: number, data: number): void;\n /**\n * Writes the number as a 16 bit unsigned integer.\n * Little endian.\n */\n writeUInt16LE(i: number, data: number): void;\n /**\n * Writes the number as a 16 bit unsigned integer.\n * Big endian.\n */\n writeUInt16BE(i: number, data: number): void;\n /**\n * Writes the number as a 32 bit unsigned integer.\n * Little endian.\n */\n writeUInt32LE(i: number, data: number): void;\n /**\n * Writes the number as a 32 bit unsigned integer.\n * Big endian.\n */\n writeUInt32BE(i: number, data: number): void;\n /**\n * Writes the number as a 32-bit float.\n * Little endian.\n */\n writeFloatLE(i: number, data: number): void;\n /**\n * Writes the number as a 32-bit float.\n * Big endian.\n */\n writeFloatBE(i: number, data: number): void;\n /**\n * Writes the number as a 64-bit float.\n * Little endian.\n */\n writeDoubleLE(i: number, data: number): void;\n /**\n * Writes the number as a 64-bit float.\n * Big endian.\n */\n writeDoubleBE(i: number, data: number): void;\n /**\n * Reads the byte at the given index.\n */\n readInt8(i: number): number;\n /**\n * Reads the two bytes at the given index (little endian).\n */\n readInt16LE(i: number): number;\n /**\n * Reads the two bytes at the given index (big endian).\n */\n readInt16BE(i: number): number;\n /**\n * Reads the four bytes at the given index (little endian).\n */\n readInt32LE(i: number): number;\n /**\n * Reads the four bytes at the given index (big endian).\n */\n readInt32BE(i: number): number;\n /**\n * Reads the byte at the given index as an unsigned integer.\n */\n readUInt8(i: number): number;\n /**\n * Reads the two bytes at the given index as an unsigned integer (little endian).\n */\n readUInt16LE(i: number): number;\n /**\n * Reads the two bytes at the given index as an unsigned integer (big endian).\n */\n readUInt16BE(i: number): number;\n /**\n * Reads the four bytes at the given index as an unsigned integer (little endian).\n */\n readUInt32LE(i: number): number;\n /**\n * Reads the four bytes at the given index as an unsigned integer (big endian).\n */\n readUInt32BE(i: number): number;\n /**\n * Reads a 32-bit floating point number at the given index (little endian).\n */\n readFloatLE(i: number): number;\n /**\n * Reads a 32-bit floating point number at the given index (big endian).\n */\n readFloatBE(i: number): number;\n /**\n * Reads a 64-bit floating point number at the given index (little endian).\n */\n readDoubleLE(i: number): number;\n /**\n * Reads a 64-bit floating point number at the given index (big endian).\n */\n readDoubleBE(i: number): number;\n /**\n * Copies the contents of the buffer core, from start to end, into a new\n * BufferCore.\n * (the interval [start, end)).\n */\n copy(start: number, end: number): BufferCore;\n /**\n * Fills [start, end) with the given byte value.\n */\n fill(value: number, start: number, end: number): void;\n}\n\nexport interface BufferCoreImplementation {\n /**\n * The common constructor that all BufferCores need to support.\n */\n new(length: number): BufferCore;\n /**\n * Returns 'true' if the BufferCore is available in the current environment.\n */\n isAvailable(): boolean;\n /**\n * The name of this particular implementation. Used for unit testing purposes.\n */\n name: string;\n}\n\n/**\n * Contains common definitions for most of the BufferCore classes.\n * Subclasses only need to implement write/readUInt8 for full functionality.\n */\nexport class BufferCoreCommon {\n public getLength(): number {\n throw new Error('BufferCore implementations should implement getLength.');\n }\n public writeInt8(i: number, data: number): void {\n // Pack the sign bit as the highest bit.\n // Note that we keep the highest bit in the value byte as the sign bit if it\n // exists.\n this.writeUInt8(i, (data & 0xFF) | ((data & 0x80000000) >>> 24));\n }\n public writeInt16LE(i: number, data: number): void {\n this.writeUInt8(i, data & 0xFF);\n // Pack the sign bit as the highest bit.\n // Note that we keep the highest bit in the value byte as the sign bit if it\n // exists.\n this.writeUInt8(i+1, ((data >>> 8) & 0xFF) | ((data & 0x80000000) >>> 24));\n }\n public writeInt16BE(i: number, data: number): void {\n this.writeUInt8(i+1, data & 0xFF);\n // Pack the sign bit as the highest bit.\n // Note that we keep the highest bit in the value byte as the sign bit if it\n // exists.\n this.writeUInt8(i, ((data >>> 8) & 0xFF) | ((data & 0x80000000) >>> 24));\n }\n public writeInt32LE(i: number, data: number): void {\n this.writeUInt8(i, data & 0xFF);\n this.writeUInt8(i+1, (data >>> 8) & 0xFF);\n this.writeUInt8(i+2, (data >>> 16) & 0xFF);\n this.writeUInt8(i+3, (data >>> 24) & 0xFF);\n }\n public writeInt32BE(i: number, data: number): void {\n this.writeUInt8(i+3, data & 0xFF);\n this.writeUInt8(i+2, (data >>> 8) & 0xFF);\n this.writeUInt8(i+1, (data >>> 16) & 0xFF);\n this.writeUInt8(i, (data >>> 24) & 0xFF);\n }\n public writeUInt8(i: number, data: number): void {\n throw new Error('BufferCore implementations should implement writeUInt8.');\n }\n public writeUInt16LE(i: number, data: number): void {\n this.writeUInt8(i, data & 0xFF);\n this.writeUInt8(i+1, (data >> 8) & 0xFF);\n }\n public writeUInt16BE(i: number, data: number): void {\n this.writeUInt8(i+1, data & 0xFF);\n this.writeUInt8(i, (data >> 8) & 0xFF);\n }\n public writeUInt32LE(i: number, data: number): void {\n this.writeInt32LE(i, data|0);\n }\n public writeUInt32BE(i: number, data: number): void {\n this.writeInt32BE(i, data|0);\n }\n public writeFloatLE(i: number, data: number): void {\n this.writeInt32LE(i, this.float2intbits(data));\n }\n public writeFloatBE(i: number, data: number): void {\n this.writeInt32BE(i, this.float2intbits(data));\n }\n public writeDoubleLE(i: number, data: number): void {\n var doubleBits = this.double2longbits(data);\n this.writeInt32LE(i, doubleBits[0]);\n this.writeInt32LE(i+4, doubleBits[1]);\n }\n public writeDoubleBE(i: number, data: number): void {\n var doubleBits = this.double2longbits(data);\n this.writeInt32BE(i+4, doubleBits[0]);\n this.writeInt32BE(i, doubleBits[1]);\n }\n public readInt8(i: number): number {\n var val = this.readUInt8(i);\n if (val & 0x80) {\n // Sign bit is set, so perform sign extension.\n return val | 0xFFFFFF80;\n } else {\n return val;\n }\n }\n public readInt16LE(i: number): number {\n var val = this.readUInt16LE(i);\n if (val & 0x8000) {\n // Sign bit is set, so perform sign extension.\n return val | 0xFFFF8000;\n } else {\n return val;\n }\n }\n public readInt16BE(i: number): number {\n var val = this.readUInt16BE(i);\n if (val & 0x8000) {\n // Sign bit is set, so perform sign extension.\n return val | 0xFFFF8000;\n } else {\n return val;\n }\n }\n public readInt32LE(i: number): number {\n return this.readUInt32LE(i) | 0;\n }\n public readInt32BE(i: number): number {\n return this.readUInt32BE(i) | 0;\n }\n public readUInt8(i: number): number {\n throw new Error('BufferCore implementations should implement readUInt8.');\n }\n public readUInt16LE(i: number): number {\n return (this.readUInt8(i+1) << 8) | this.readUInt8(i);\n }\n public readUInt16BE(i: number): number {\n return (this.readUInt8(i) << 8) | this.readUInt8(i+1);\n }\n public readUInt32LE(i: number): number {\n return ((this.readUInt8(i+3) << 24) | (this.readUInt8(i+2) << 16) | (this.readUInt8(i+1) << 8) | this.readUInt8(i)) >>> 0;\n }\n public readUInt32BE(i: number): number {\n return ((this.readUInt8(i) << 24) | (this.readUInt8(i+1) << 16) | (this.readUInt8(i+2) << 8) | this.readUInt8(i+3)) >>> 0;\n }\n public readFloatLE(i: number): number {\n return this.intbits2float(this.readInt32LE(i));\n }\n public readFloatBE(i: number): number {\n return this.intbits2float(this.readInt32BE(i));\n }\n public readDoubleLE(i: number): number {\n return this.longbits2double(this.readInt32LE(i+4), this.readInt32LE(i));\n }\n public readDoubleBE(i: number): number {\n return this.longbits2double(this.readInt32BE(i), this.readInt32BE(i+4));\n }\n public copy(start: number, end: number): BufferCore {\n throw new Error('BufferCore implementations should implement copy.');\n }\n public fill(value: number, start: number, end: number): void {\n // Stupid unoptimized fill: Byte-by-byte.\n for (var i = start; i < end; i++) {\n this.writeUInt8(i, value);\n }\n }\n\n private float2intbits(f_val: number) : number {\n var exp: number, f_view: number, i_view: number, sig: number, sign: number;\n\n // Special cases!\n if (f_val === 0) {\n return 0;\n }\n // We map the infinities to JavaScript infinities. Map them back.\n if (f_val === Number.POSITIVE_INFINITY) {\n return FLOAT_POS_INFINITY_AS_INT;\n }\n if (f_val === Number.NEGATIVE_INFINITY) {\n return FLOAT_NEG_INFINITY_AS_INT;\n }\n // Convert JavaScript NaN to Float NaN value.\n if (isNaN(f_val)) {\n return FLOAT_NaN_AS_INT;\n }\n\n // We have more bits of precision than a float, so below we round to\n // the nearest significand. This appears to be what the x86\n // Java does for normal floating point operations.\n\n sign = f_val < 0 ? 1 : 0;\n f_val = Math.abs(f_val);\n // Subnormal zone!\n // (−1)^signbits×2^−126×0.significandbits\n // Largest subnormal magnitude:\n // 0000 0000 0111 1111 1111 1111 1111 1111\n // Smallest subnormal magnitude:\n // 0000 0000 0000 0000 0000 0000 0000 0001\n if (f_val <= 1.1754942106924411e-38 && f_val >= 1.4012984643248170e-45) {\n exp = 0;\n sig = Math.round((f_val / Math.pow(2, -126)) * Math.pow(2, 23));\n return (sign << 31) | (exp << 23) | sig;\n } else {\n // Regular FP numbers\n exp = Math.floor(Math.log(f_val) / Math.LN2);\n sig = Math.round((f_val / Math.pow(2, exp) - 1) * Math.pow(2, 23));\n return (sign << 31) | ((exp + 127) << 23) | sig;\n }\n }\n\n private double2longbits(d_val: number): number[] {\n var d_view: number, exp: number, high_bits: number, i_view: number, sig: number, sign: number;\n\n // Special cases\n if (d_val === 0) {\n return [0, 0];\n }\n if (d_val === Number.POSITIVE_INFINITY) {\n // High bits: 0111 1111 1111 0000 0000 0000 0000 0000\n // Low bits: 0000 0000 0000 0000 0000 0000 0000 0000\n return [0, 2146435072];\n } else if (d_val === Number.NEGATIVE_INFINITY) {\n // High bits: 1111 1111 1111 0000 0000 0000 0000 0000\n // Low bits: 0000 0000 0000 0000 0000 0000 0000 0000\n return [0, -1048576];\n } else if (isNaN(d_val)) {\n // High bits: 0111 1111 1111 1000 0000 0000 0000 0000\n // Low bits: 0000 0000 0000 0000 0000 0000 0000 0000\n return [0, 2146959360];\n }\n sign = d_val < 0 ? 1 << 31 : 0;\n d_val = Math.abs(d_val);\n\n // Check if it is a subnormal number.\n // (-1)s × 0.f × 2-1022\n // Largest subnormal magnitude:\n // 0000 0000 0000 1111 1111 1111 1111 1111\n // 1111 1111 1111 1111 1111 1111 1111 1111\n // Smallest subnormal magnitude:\n // 0000 0000 0000 0000 0000 0000 0000 0000\n // 0000 0000 0000 0000 0000 0000 0000 0001\n if (d_val <= 2.2250738585072010e-308 && d_val >= 5.0000000000000000e-324) {\n exp = 0;\n sig = (d_val / Math.pow(2, -1022)) * Math.pow(2, 52);\n } else {\n exp = Math.floor(Math.log(d_val) / Math.LN2);\n // If d_val is close to a power of two, there's a chance that exp\n // will be 1 greater than it should due to loss of accuracy in the\n // log result.\n if (d_val < Math.pow(2, exp)) {\n exp = exp - 1;\n }\n sig = (d_val / Math.pow(2, exp) - 1) * Math.pow(2, 52);\n exp = (exp + 1023) << 20;\n }\n\n // Simulate >> 32\n high_bits = ((sig * Math.pow(2, -32)) | 0) | sign | exp;\n return [sig & 0xFFFF, high_bits];\n }\n\n private intbits2float(int32: number) {\n // Map +/- infinity to JavaScript equivalents\n if (int32 === FLOAT_POS_INFINITY_AS_INT) {\n return Number.POSITIVE_INFINITY;\n } else if (int32 === FLOAT_NEG_INFINITY_AS_INT) {\n return Number.NEGATIVE_INFINITY;\n }\n var sign = (int32 & 0x80000000) >>> 31;\n var exponent = (int32 & 0x7F800000) >>> 23;\n var significand = int32 & 0x007FFFFF;\n var value : number;\n if (exponent === 0) { // we must denormalize!\n value = Math.pow(-1, sign) * significand * Math.pow(2, -149);\n } else {\n value = Math.pow(-1, sign) * (1 + significand * Math.pow(2, -23)) * Math.pow(2, exponent - 127);\n }\n // NaN check\n if (value < FLOAT_NEG_INFINITY || value > FLOAT_POS_INFINITY) {\n value = NaN;\n }\n return value;\n }\n\n private longbits2double(uint32_a: number, uint32_b: number): number {\n var sign = (uint32_a & 0x80000000) >>> 31;\n var exponent = (uint32_a & 0x7FF00000) >>> 20;\n var significand = ((uint32_a & 0x000FFFFF) * Math.pow(2, 32)) + uint32_b;\n\n // Special values!\n if (exponent === 0 && significand === 0) {\n return 0;\n }\n if (exponent === 2047) {\n if (significand === 0) {\n if (sign === 1) {\n return Number.NEGATIVE_INFINITY;\n }\n return Number.POSITIVE_INFINITY;\n } else {\n return NaN;\n }\n }\n if (exponent === 0) // we must denormalize!\n return Math.pow(-1, sign) * significand * Math.pow(2, -1074);\n return Math.pow(-1, sign) * (1 + significand * Math.pow(2, -52)) * Math.pow(2, exponent - 1023);\n }\n}\n",
|
||
"import {BufferCoreCommon, BufferCore, BufferCoreImplementation} from './buffer_core';\n\n// Used to clear segments of an array index.\nvar clearMasks: number[] = [0xFFFFFF00, 0xFFFF00FF, 0xFF00FFFF, 0x00FFFFFF];\n\n/**\n * Implementation of BufferCore that is backed by an array of 32-bit ints.\n * Data is stored little endian.\n * Example: Bytes 0 through 3 are present in the first int:\n * BYTE 3 BYTE 2 BYTE 1 BYTE 0\n * 0000 0000 | 0000 0000 | 0000 0000 | 0000 0000\n */\nclass BufferCoreArray extends BufferCoreCommon implements BufferCore {\n public static isAvailable(): boolean {\n return true;\n }\n\n public static name = \"Array\";\n\n private buff: number[];\n private length: number;\n constructor(length: number) {\n super();\n this.length = length;\n this.buff = new Array(Math.ceil(length/4));\n // Zero-fill the array.\n var bufflen = this.buff.length;\n for (var i = 0; i < bufflen; i++) {\n this.buff[i] = 0;\n }\n }\n public getLength(): number {\n return this.length;\n }\n public writeUInt8(i: number, data: number): void {\n data &= 0xFF;\n // Which int? (Equivalent to (i/4)|0)\n var arrIdx = i >> 2;\n // Which offset? (Equivalent to i - arrIdx*4)\n var intIdx = i & 3;\n this.buff[arrIdx] = this.buff[arrIdx] & clearMasks[intIdx];\n this.buff[arrIdx] = this.buff[arrIdx] | (data << (intIdx << 3));\n }\n public readUInt8(i: number): number {\n // Which int?\n var arrIdx = i >> 2;\n // Which offset?\n var intIdx = i & 3;\n // Bring the data we want into the lowest 8 bits, and truncate.\n return (this.buff[arrIdx] >> (intIdx << 3)) & 0xFF;\n }\n public copy(start: number, end: number): BufferCore {\n // Stupid unoptimized copy. Later, we could do optimizations when aligned.\n var newBC = new BufferCoreArray(end - start);\n for (var i = start; i < end; i++) {\n newBC.writeUInt8(i - start, this.readUInt8(i));\n }\n return newBC;\n }\n}\n\n// Type-check the class.\nvar _: BufferCoreImplementation = BufferCoreArray;\n\nexport = BufferCoreArray;\n",
|
||
"import {BufferCoreCommon, BufferCore, BufferCoreImplementation} from './buffer_core';\nimport {isArrayBuffer, isArrayBufferView} from './util';\n\n/**\n * Represents data using an ArrayBuffer.\n */\nclass BufferCoreArrayBuffer extends BufferCoreCommon implements BufferCore {\n public static isAvailable(): boolean {\n return typeof DataView !== 'undefined';\n }\n\n public static name = \"ArrayBuffer\";\n\n private buff: DataView;\n private length: number;\n constructor(length: number);\n constructor(buff: ArrayBufferView);\n constructor(buff: ArrayBuffer);\n constructor(arg1: number | ArrayBufferView | ArrayBuffer) {\n super();\n if (typeof arg1 === 'number') {\n this.buff = new DataView(new ArrayBuffer(arg1));\n } else if (arg1 instanceof DataView) {\n this.buff = arg1;\n } else if (isArrayBufferView(arg1)) {\n this.buff = new DataView(arg1.buffer, arg1.byteOffset, arg1.byteLength);\n } else if (isArrayBuffer(arg1)) {\n this.buff = new DataView(<ArrayBuffer> arg1);\n } else {\n throw new TypeError(\"Invalid argument.\");\n }\n this.length = this.buff.byteLength;\n }\n public getLength(): number {\n return this.length;\n }\n public writeInt8(i: number, data: number): void {\n this.buff.setInt8(i, data);\n }\n public writeInt16LE(i: number, data: number): void {\n this.buff.setInt16(i, data, true);\n }\n public writeInt16BE(i: number, data: number): void {\n this.buff.setInt16(i, data, false);\n }\n public writeInt32LE(i: number, data: number): void {\n this.buff.setInt32(i, data, true);\n }\n public writeInt32BE(i: number, data: number): void {\n this.buff.setInt32(i, data, false);\n }\n public writeUInt8(i: number, data: number): void {\n this.buff.setUint8(i, data);\n }\n public writeUInt16LE(i: number, data: number): void {\n this.buff.setUint16(i, data, true);\n }\n public writeUInt16BE(i: number, data: number): void {\n this.buff.setUint16(i, data, false);\n }\n public writeUInt32LE(i: number, data: number): void {\n this.buff.setUint32(i, data, true);\n }\n public writeUInt32BE(i: number, data: number): void {\n this.buff.setUint32(i, data, false);\n }\n public writeFloatLE(i: number, data: number): void {\n this.buff.setFloat32(i, data, true);\n }\n public writeFloatBE(i: number, data: number): void {\n this.buff.setFloat32(i, data, false);\n }\n public writeDoubleLE(i: number, data: number): void {\n this.buff.setFloat64(i, data, true);\n }\n public writeDoubleBE(i: number, data: number): void {\n this.buff.setFloat64(i, data, false);\n }\n public readInt8(i: number): number {\n return this.buff.getInt8(i);\n }\n public readInt16LE(i: number): number {\n return this.buff.getInt16(i, true);\n }\n public readInt16BE(i: number): number {\n return this.buff.getInt16(i, false);\n }\n public readInt32LE(i: number): number {\n return this.buff.getInt32(i, true);\n }\n public readInt32BE(i: number): number {\n return this.buff.getInt32(i, false);\n }\n public readUInt8(i: number): number {\n return this.buff.getUint8(i);\n }\n public readUInt16LE(i: number): number {\n return this.buff.getUint16(i, true);\n }\n public readUInt16BE(i: number): number {\n return this.buff.getUint16(i, false);\n }\n public readUInt32LE(i: number): number {\n return this.buff.getUint32(i, true);\n }\n public readUInt32BE(i: number): number {\n return this.buff.getUint32(i, false);\n }\n public readFloatLE(i: number): number {\n return this.buff.getFloat32(i, true);\n }\n public readFloatBE(i: number): number {\n return this.buff.getFloat32(i, false);\n }\n public readDoubleLE(i: number): number {\n return this.buff.getFloat64(i, true);\n }\n public readDoubleBE(i: number): number {\n return this.buff.getFloat64(i, false);\n }\n public copy(start: number, end: number): BufferCore {\n let aBuff = this.buff.buffer;\n let aBuffOff = this.buff.byteOffset;\n let newBuff: ArrayBuffer;\n // Some ArrayBuffer implementations (IE10) do not have 'slice'.\n if (ArrayBuffer.prototype.slice) {\n // ArrayBuffer.slice is copying; exactly what we want.\n newBuff = aBuff.slice(aBuffOff + start, aBuffOff + end);\n } else {\n var len = end - start;\n newBuff = new ArrayBuffer(len);\n // Copy the old contents in.\n var newUintArray = new Uint8Array(newBuff);\n var oldUintArray = new Uint8Array(aBuff, aBuffOff);\n newUintArray.set(oldUintArray.subarray(start, end));\n }\n return new BufferCoreArrayBuffer(newBuff);\n }\n /**\n * (Nonstandard) Copy [start, end) to [offset+start, offset+end) in target.\n */\n public copyTo(target: BufferCoreArrayBuffer, offset: number, start: number, end: number): number {\n let targetU8 = new Uint8Array(target.buff.buffer, target.buff.byteOffset);\n let sourceU8 = new Uint8Array(this.buff.buffer, this.buff.byteOffset + start, end - start);\n targetU8.set(sourceU8, offset);\n return end - start;\n }\n public fill(value: number, start: number, end: number): void {\n // Value must be a byte wide.\n value = value & 0xFF;\n var i: number;\n var len = end - start;\n var intBytes = (((len)/4)|0)*4;\n // Optimization: Write 4 bytes at a time.\n // TODO: Could we copy 8 bytes at a time using Float64, or could we\n // lose precision?\n var intVal = (value << 24) | (value << 16) | (value << 8) | value\n for (i = 0; i < intBytes; i += 4) {\n this.writeInt32LE(i + start, intVal);\n }\n for (i = intBytes; i < len; i++) {\n this.writeUInt8(i + start, value);\n }\n }\n\n /**\n * Custom method for this buffer core. Get the backing object.\n */\n public getDataView(): DataView {\n return this.buff;\n }\n}\n\n// Type-check the class.\nvar _: BufferCoreImplementation = BufferCoreArrayBuffer;\n\nexport = BufferCoreArrayBuffer;\n",
|
||
"import {BufferCoreCommon, BufferCore, BufferCoreImplementation} from './buffer_core';\n\n/**\n * Deprecated type, so it is not present in TypeScript's lib.d.ts.\n */\ninterface CanvasPixelArray {\n // Values are [0,255].\n [index: number]: number;\n length: number;\n}\ndeclare var CanvasPixelArray: CanvasPixelArray;\n\n/**\n * Implementation of BufferCore that is backed by an ImageData object.\n * Useful in browsers with HTML5 canvas support, but no TypedArray support\n * (IE9).\n */\nclass BufferCoreImageData extends BufferCoreCommon implements BufferCore {\n private static imageDataFactory: CanvasRenderingContext2D;\n /**\n * Constructs a CanvasPixelArray that represents the given amount of bytes.\n */\n private static getCanvasPixelArray(bytes: number): CanvasPixelArray {\n var ctx: CanvasRenderingContext2D = BufferCoreImageData.imageDataFactory;\n // Lazily initialize, otherwise every browser (even those that will never\n // use this code) will create a canvas on script load.\n if (ctx === undefined) {\n BufferCoreImageData.imageDataFactory = ctx = document.createElement('canvas').getContext('2d');\n }\n // You cannot create image data with size 0, so up it to size 1.\n if (bytes === 0) bytes = 1;\n return ctx.createImageData(Math.ceil(bytes / 4), 1).data;\n }\n public static isAvailable(): boolean {\n // Modern browsers have removed this deprecated API, so it is not always around.\n // NOTE: IE11 in IE8 compat. mode has CanvasPixelArray defined, but you can't\n // use it! Hence the check for getContext.\n return typeof(CanvasPixelArray) !== 'undefined' && document.createElement('canvas')['getContext'] !== undefined;\n }\n public static name = \"ImageData\";\n\n private buff: CanvasPixelArray;\n private length: number;\n constructor(length: number) {\n super();\n this.length = length;\n this.buff = BufferCoreImageData.getCanvasPixelArray(length);\n }\n public getLength(): number {\n return this.length;\n }\n public writeUInt8(i: number, data: number): void {\n this.buff[i] = data;\n }\n public readUInt8(i: number): number {\n return this.buff[i];\n }\n public copy(start: number, end: number): BufferCore {\n // AFAIK, there's no efficient way to clone ImageData.\n var newBC = new BufferCoreImageData(end - start);\n for (var i = start; i < end; i++) {\n newBC.writeUInt8(i - start, this.buff[i]);\n }\n return newBC;\n }\n}\n\n// Type-check the class.\nvar _: BufferCoreImplementation = BufferCoreImageData;\n\nexport = BufferCoreImageData;\n",
|
||
"/**\n * (Nonstandard) String utility function for 8-bit ASCII with the extended\n * character set. Unlike the ASCII above, we do not mask the high bits.\n *\n * Placed into a separate file so it can be used with other Buffer implementations.\n * @see http://en.wikipedia.org/wiki/Extended_ASCII\n */\nexport default class ExtendedASCII {\n private static extendedChars = [ '\\u00C7', '\\u00FC', '\\u00E9', '\\u00E2', '\\u00E4',\n '\\u00E0', '\\u00E5', '\\u00E7', '\\u00EA', '\\u00EB', '\\u00E8', '\\u00EF',\n '\\u00EE', '\\u00EC', '\\u00C4', '\\u00C5', '\\u00C9', '\\u00E6', '\\u00C6',\n '\\u00F4', '\\u00F6', '\\u00F2', '\\u00FB', '\\u00F9', '\\u00FF', '\\u00D6',\n '\\u00DC', '\\u00F8', '\\u00A3', '\\u00D8', '\\u00D7', '\\u0192', '\\u00E1',\n '\\u00ED', '\\u00F3', '\\u00FA', '\\u00F1', '\\u00D1', '\\u00AA', '\\u00BA',\n '\\u00BF', '\\u00AE', '\\u00AC', '\\u00BD', '\\u00BC', '\\u00A1', '\\u00AB',\n '\\u00BB', '_', '_', '_', '\\u00A6', '\\u00A6', '\\u00C1', '\\u00C2', '\\u00C0',\n '\\u00A9', '\\u00A6', '\\u00A6', '+', '+', '\\u00A2', '\\u00A5', '+', '+', '-',\n '-', '+', '-', '+', '\\u00E3', '\\u00C3', '+', '+', '-', '-', '\\u00A6', '-',\n '+', '\\u00A4', '\\u00F0', '\\u00D0', '\\u00CA', '\\u00CB', '\\u00C8', 'i',\n '\\u00CD', '\\u00CE', '\\u00CF', '+', '+', '_', '_', '\\u00A6', '\\u00CC', '_',\n '\\u00D3', '\\u00DF', '\\u00D4', '\\u00D2', '\\u00F5', '\\u00D5', '\\u00B5',\n '\\u00FE', '\\u00DE', '\\u00DA', '\\u00DB', '\\u00D9', '\\u00FD', '\\u00DD',\n '\\u00AF', '\\u00B4', '\\u00AD', '\\u00B1', '_', '\\u00BE', '\\u00B6', '\\u00A7',\n '\\u00F7', '\\u00B8', '\\u00B0', '\\u00A8', '\\u00B7', '\\u00B9', '\\u00B3',\n '\\u00B2', '_', ' ' ];\n\n public static str2byte(str: string, buf: NodeBuffer): number {\n var length = str.length > buf.length ? buf.length : str.length;\n for (var i = 0; i < length; i++) {\n var charCode = str.charCodeAt(i);\n if (charCode > 0x7F) {\n // Check if extended ASCII.\n var charIdx = ExtendedASCII.extendedChars.indexOf(str.charAt(i));\n if (charIdx > -1) {\n charCode = charIdx + 0x80;\n }\n // Otherwise, keep it as-is.\n }\n buf.writeUInt8(charCode, i);\n }\n return length;\n }\n\n public static byte2str(buff: NodeBuffer): string {\n var chars = new Array(buff.length);\n for (var i = 0; i < buff.length; i++) {\n var charCode = buff.readUInt8(i);\n if (charCode > 0x7F) {\n chars[i] = ExtendedASCII.extendedChars[charCode - 128]\n } else {\n chars[i] = String.fromCharCode(charCode);\n }\n }\n return chars.join('');\n }\n\n public static byteLength(str: string): number { return str.length; }\n}\n",
|
||
"import buffer = require(\"./buffer\");\nimport ExtendedASCII from './extended_ascii';\n\nvar fromCharCode = String.fromCharCode;\n\n/**\n * Efficiently converts an array of character codes into a JS string.\n * Avoids an issue with String.fromCharCode when the number of arguments is too large.\n */\nexport function fromCharCodes(charCodes: number[]): string {\n // 8K blocks.\n var numChars = charCodes.length,\n numChunks = ((numChars - 1) >> 13) + 1,\n chunks: string[] = new Array<string>(numChunks), i: number;\n for (i = 0; i < numChunks; i++) {\n chunks[i] = fromCharCode.apply(String, charCodes.slice(i * 0x2000, (i + 1) * 0x2000));\n }\n return chunks.join(\"\");\n}\n\n/**\n * Contains string utility functions, mainly for converting between JavaScript\n * strings and binary buffers of arbitrary encoding types.\n */\n\n/**\n * Encapsulates utility functions for a particular string encoding.\n */\nexport interface StringUtil {\n /**\n * Converts the string into its binary representation, and then writes the\n * binary representation into the buffer at the given offset.\n *\n * We assume that the offset / length is pre-validated.\n * @param [BrowserFS.node.Buffer] buf the buffer to write into\n * @param [String] str the string that will be converted\n * @param [Number] offset the offset to start writing into the buffer at\n * @param [Number] length an upper bound on the length of the string that we\n * can write\n * @return [Number] number of bytes written into the buffer\n */\n str2byte(str: string, buf: NodeBuffer): number;\n /**\n * Converts the data in the byte array into a string.\n * @todo Is this the best API? Are we doing needless copying?\n * @param [Array] byteArray an array of bytes\n * @return [String] the array interpreted as a binary string\n */\n byte2str(buf: NodeBuffer): string;\n /**\n * Returns the number of bytes that the string will take up using the given\n * encoding.\n * @param [String] str the string to get the byte length for\n * @return [Number] the number of bytes that the string will take up using the\n * given encoding.\n */\n byteLength(str: string): number;\n}\n\n/**\n * Find the 'utility' object for the given string encoding. Throws an exception\n * if the encoding is invalid.\n * @param [String] encoding a string encoding\n * @return [BrowserFS.StringUtil.*] The StringUtil object for the given encoding\n */\nexport function FindUtil(encoding: string): StringUtil {\n encoding = (function() {\n switch (typeof encoding) {\n case 'object':\n return \"\" + encoding; // Implicitly calls toString on any object (Node does this)\n case 'string':\n return encoding; // No transformation needed.\n default:\n throw new TypeError('Invalid encoding argument specified');\n }\n })();\n encoding = encoding.toLowerCase();\n // This is the same logic as Node's source code.\n switch (encoding) {\n case 'utf8':\n case 'utf-8':\n return UTF8;\n case 'ascii':\n return ASCII;\n case 'binary':\n return BINARY;\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return UCS2;\n case 'hex':\n return HEX;\n case 'base64':\n return BASE64;\n // Custom BFS: For efficiently representing data as JavaScript UTF-16\n // strings.\n case 'binary_string':\n return BINSTR;\n case 'binary_string_ie':\n return BINSTRIE;\n case 'extended_ascii':\n return ExtendedASCII;\n default:\n throw new TypeError(`Unknown encoding: ${encoding}`);\n }\n}\n\n/**\n * String utility functions for UTF-8. Note that some UTF-8 strings *cannot* be\n * expressed in terms of JavaScript UTF-16 strings.\n * @see http://en.wikipedia.org/wiki/UTF-8\n */\nexport class UTF8 {\n public static str2byte(str: string, buf: NodeBuffer): number {\n var maxJ = buf.length,\n i = 0,\n j = 0,\n strLen = str.length;\n while (i < strLen && j < maxJ) {\n var code = str.charCodeAt(i++);\n if (0xD800 <= code && code <= 0xDBFF) {\n // 4 bytes: Surrogate pairs! UTF-16 fun time.\n if (j + 3 >= maxJ || i >= strLen) {\n break;\n }\n\n // Get the next UTF16 character.\n var next = str.charCodeAt(i);\n if (0xDC00 <= next && next <= 0xDFFF) {\n // First pair: 10 bits of data, with an implicitly set 11th bit\n // Second pair: 10 bits of data\n var codePoint = (((code & 0x3FF) | 0x400) << 10) | (next & 0x3FF);\n // Highest 3 bits in first byte\n buf.writeUInt8((codePoint >> 18) | 0xF0, j++);\n // Rest are all 6 bits\n buf.writeUInt8(((codePoint >> 12) & 0x3F) | 0x80, j++);\n buf.writeUInt8(((codePoint >> 6) & 0x3F) | 0x80, j++);\n buf.writeUInt8((codePoint & 0x3F) | 0x80, j++);\n i++;\n } else {\n // This surrogate pair is missing a friend!\n // Write unicode replacement character.\n buf.writeUInt8(0xef, j++);\n buf.writeUInt8(0xbf, j++);\n buf.writeUInt8(0xbd, j++);\n }\n } else if (0xDC00 <= code && code <= 0xDFFF) {\n // Unmatched second surrogate!\n // Write unicode replacement character.\n buf.writeUInt8(0xef, j++);\n buf.writeUInt8(0xbf, j++);\n buf.writeUInt8(0xbd, j++);\n } else if (code < 0x80) {\n // One byte\n buf.writeUInt8(code, j++);\n } else if (code < 0x800) {\n // Two bytes\n if (j + 1 >= maxJ) {\n break;\n }\n // Highest 5 bits in first byte\n buf.writeUInt8((code >> 6) | 0xC0, j++);\n // Lower 6 bits in second byte\n buf.writeUInt8((code & 0x3F) | 0x80, j++);\n } else if (code < 0x10000) {\n // Three bytes\n if (j + 2 >= maxJ) {\n break;\n }\n // Highest 4 bits in first byte\n buf.writeUInt8((code >> 12) | 0xE0, j++);\n // Middle 6 bits in second byte\n buf.writeUInt8(((code >> 6) & 0x3F) | 0x80, j++);\n // Lowest 6 bits in third byte\n buf.writeUInt8((code & 0x3F) | 0x80, j++);\n }\n }\n return j;\n }\n\n public static byte2str(buff: NodeBuffer): string {\n var chars: number[] = [];\n var i = 0;\n while (i < buff.length) {\n var code = buff.readUInt8(i++);\n if (code < 0x80) {\n chars.push(code);\n } else if (code < 0xC0) {\n // This is the second byte of a multibyte character. This shouldn't be\n // possible.\n throw new Error('Found incomplete part of character in string.');\n } else if (code < 0xE0) {\n // 2 bytes: 5 and 6 bits\n chars.push(((code & 0x1F) << 6) | (buff.readUInt8(i++) & 0x3F));\n } else if (code < 0xF0) {\n // 3 bytes: 4, 6, and 6 bits\n chars.push(((code & 0xF) << 12) | ((buff.readUInt8(i++) & 0x3F) << 6) | (buff.readUInt8(i++) & 0x3F));\n } else if (code < 0xF8) {\n // 4 bytes: 3, 6, 6, 6 bits; surrogate pairs time!\n // First 11 bits; remove 11th bit as per UTF-16 standard\n var byte3 = buff.readUInt8(i + 2);\n chars.push(((((code & 0x7) << 8) | ((buff.readUInt8(i++) & 0x3F) << 2) | ((buff.readUInt8(i++) & 0x3F) >> 4)) & 0x3FF) | 0xD800);\n // Final 10 bits\n chars.push((((byte3 & 0xF) << 6) | (buff.readUInt8(i++) & 0x3F)) | 0xDC00);\n } else {\n throw new Error('Unable to represent UTF-8 string as UTF-16 JavaScript string.');\n }\n }\n return fromCharCodes(chars);\n }\n\n // From http://stackoverflow.com/a/23329386\n public static byteLength(str: string): number {\n var s = str.length;\n for (var i=str.length-1; i>=0; i--) {\n var code = str.charCodeAt(i);\n if (code > 0x7f && code <= 0x7ff) s++;\n else if (code > 0x7ff && code <= 0xffff) s+=2;\n if (code >= 0xDC00 && code <= 0xDFFF) i--; //trail surrogate\n }\n return s;\n }\n}\n\n/**\n * String utility functions for 8-bit ASCII. Like Node, we mask the high bits of\n * characters in JavaScript UTF-16 strings.\n * @see http://en.wikipedia.org/wiki/ASCII\n */\nexport class ASCII {\n public static str2byte(str: string, buf: NodeBuffer): number {\n var length = str.length > buf.length ? buf.length : str.length;\n for (var i = 0; i < length; i++) {\n buf.writeUInt8(str.charCodeAt(i) % 256, i);\n }\n return length;\n }\n\n public static byte2str(buff: NodeBuffer): string {\n var chars = new Array<number>(buff.length);\n for (var i = 0; i < buff.length; i++) {\n chars[i] = buff.readUInt8(i) & 0x7F;\n }\n return fromCharCodes(chars);\n }\n\n public static byteLength(str: string): number { return str.length; }\n}\n\n/**\n * String utility functions for Node's BINARY strings, which represent a single\n * byte per character.\n */\nexport class BINARY {\n public static str2byte(str: string, buf: NodeBuffer): number {\n var length = str.length > buf.length ? buf.length : str.length;\n for (var i = 0; i < length; i++) {\n buf.writeUInt8(str.charCodeAt(i) & 0xFF, i);\n }\n return length;\n }\n\n public static byte2str(buff: NodeBuffer): string {\n var chars = new Array<number>(buff.length);\n for (var i = 0; i < buff.length; i++) {\n chars[i] = buff.readUInt8(i) & 0xFF;\n }\n return fromCharCodes(chars);\n }\n\n public static byteLength(str: string): number { return str.length; }\n}\n\n/**\n * Contains string utility functions for base-64 encoding.\n *\n * Adapted from the StackOverflow comment linked below.\n * @see http://stackoverflow.com/questions/246801/how-can-you-encode-to-base64-using-javascript#246813\n * @see http://en.wikipedia.org/wiki/Base64\n * @todo Bake in support for btoa() and atob() if available.\n */\nexport class BASE64 {\n private static b64chars = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', '='];\n private static num2b64: string[] = (function() {\n var obj = new Array(BASE64.b64chars.length);\n for (var idx = 0; idx < BASE64.b64chars.length; idx++) {\n var i = BASE64.b64chars[idx];\n obj[idx] = i;\n }\n return obj;\n })();\n\n private static b642num: {[chr: string]: number} = (function(): {[chr: string]: number} {\n var obj: {[chr: string]: number} = {};\n for (var idx = 0; idx < BASE64.b64chars.length; idx++) {\n var i = BASE64.b64chars[idx];\n obj[i] = idx;\n }\n obj['-'] = 62;\n obj['_'] = 63;\n return obj;\n })();\n\n public static byte2str(buff: NodeBuffer): string {\n var output = '';\n var i = 0;\n while (i < buff.length) {\n var chr1 = buff.readUInt8(i++);\n var chr2 = i < buff.length ? buff.readUInt8(i++) : NaN;\n var chr3 = i < buff.length ? buff.readUInt8(i++) : NaN;\n var enc1 = chr1 >> 2;\n var enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n var enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n var enc4 = chr3 & 63;\n if (isNaN(chr2)) {\n enc3 = enc4 = 64;\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n output = output + BASE64.num2b64[enc1] + BASE64.num2b64[enc2] + BASE64.num2b64[enc3] + BASE64.num2b64[enc4];\n }\n return output;\n }\n\n public static str2byte(str: string, buf: NodeBuffer): number {\n var length = buf.length;\n var output = '';\n var i = 0;\n str = str.replace(/[^A-Za-z0-9\\+\\/\\=\\-\\_]/g, '');\n var j = 0;\n while (i < str.length && j < buf.length) {\n var enc1 = BASE64.b642num[str.charAt(i++)];\n var enc2 = BASE64.b642num[str.charAt(i++)];\n var enc3 = BASE64.b642num[str.charAt(i++)];\n var enc4 = BASE64.b642num[str.charAt(i++)];\n var chr1 = (enc1 << 2) | (enc2 >> 4);\n var chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n var chr3 = ((enc3 & 3) << 6) | enc4;\n buf.writeUInt8(chr1, j++);\n if (j === length) {\n break;\n }\n if (enc3 !== 64) {\n output += buf.writeUInt8(chr2, j++);\n }\n if (j === length) {\n break;\n }\n if (enc4 !== 64) {\n output += buf.writeUInt8(chr3, j++);\n }\n if (j === length) {\n break;\n }\n }\n return j;\n }\n\n public static byteLength(str: string): number {\n return Math.floor(((str.replace(/[^A-Za-z0-9\\+\\/\\-\\_]/g, '')).length * 6) / 8);\n }\n}\n\n/**\n * String utility functions for the UCS-2 encoding. Note that our UCS-2 handling\n * is identical to our UTF-16 handling.\n *\n * Note: UCS-2 handling is identical to UTF-16.\n * @see http://en.wikipedia.org/wiki/UCS2\n */\nexport class UCS2 {\n public static str2byte(str: string, buf: NodeBuffer): number {\n var len = str.length;\n // Clip length to longest string of valid characters that can fit in the\n // byte range.\n if (len * 2 > buf.length) {\n len = buf.length % 2 === 1 ? (buf.length - 1) / 2 : buf.length / 2;\n }\n for (var i = 0; i < len; i++) {\n buf.writeUInt16LE(str.charCodeAt(i), i * 2);\n }\n return len * 2;\n }\n\n public static byte2str(buff: NodeBuffer): string {\n if (buff.length % 2 !== 0) {\n throw new Error('Invalid UCS2 byte array.');\n }\n var chars = new Array(buff.length / 2);\n for (var i = 0; i < buff.length; i += 2) {\n chars[i / 2] = String.fromCharCode(buff.readUInt8(i) | (buff.readUInt8(i + 1) << 8));\n }\n return chars.join('');\n }\n\n public static byteLength(str: string): number {\n return str.length * 2;\n }\n}\n\n/**\n * Contains string utility functions for hex encoding.\n * @see http://en.wikipedia.org/wiki/Hexadecimal\n */\nexport class HEX {\n private static HEXCHARS = '0123456789abcdef';\n\n private static num2hex: string[] = (function() {\n var obj = new Array(HEX.HEXCHARS.length);\n for (var idx = 0; idx < HEX.HEXCHARS.length; idx++) {\n var i = HEX.HEXCHARS[idx];\n obj[idx] = i;\n }\n return obj;\n })();\n\n private static hex2num: {[chr: string]: number} = (function(): {[chr: string]: number} {\n var idx: number, i: string;\n var obj: {[chr: string]: number} = {};\n for (idx = 0; idx < HEX.HEXCHARS.length; idx++) {\n i = HEX.HEXCHARS[idx];\n obj[i] = idx;\n }\n var capitals = 'ABCDEF';\n for (idx = 0; idx < capitals.length; idx++) {\n i = capitals[idx];\n obj[i] = idx + 10;\n }\n return obj;\n })();\n\n public static str2byte(str: string, buf: NodeBuffer): number {\n if (str.length % 2 === 1) {\n throw new Error('Invalid hex string');\n }\n // Each character is 1 byte encoded as two hex characters; so 1 byte becomes\n // 2 bytes.\n var numBytes = str.length >> 1;\n if (numBytes > buf.length) {\n numBytes = buf.length;\n }\n for (var i = 0; i < numBytes; i++) {\n var char1 = this.hex2num[str.charAt(i << 1)];\n var char2 = this.hex2num[str.charAt((i << 1) + 1)];\n buf.writeUInt8((char1 << 4) | char2, i);\n }\n return numBytes;\n }\n\n public static byte2str(buff: NodeBuffer): string {\n var len = buff.length;\n var chars = new Array(len << 1);\n var j = 0;\n for (var i = 0; i < len; i++) {\n var hex2 = buff.readUInt8(i) & 0xF;\n var hex1 = buff.readUInt8(i) >> 4;\n chars[j++] = this.num2hex[hex1];\n chars[j++] = this.num2hex[hex2];\n }\n return chars.join('');\n }\n\n public static byteLength(str: string): number {\n // Assuming a valid string.\n return str.length >> 1;\n }\n}\n\n/**\n * Contains string utility functions for binary string encoding. This is where we\n * pack arbitrary binary data as a UTF-16 string.\n *\n * Each character in the string is two bytes. The first character in the string\n * is special: The first byte specifies if the binary data is of odd byte length.\n * If it is, then it is a 1 and the second byte is the first byte of data; if\n * not, it is a 0 and the second byte is 0.\n *\n * Everything is little endian.\n */\nexport class BINSTR {\n public static str2byte(str: string, buf: NodeBuffer): number {\n // Special case: Empty string\n if (str.length === 0) {\n return 0;\n }\n var numBytes = BINSTR.byteLength(str);\n if (numBytes > buf.length) {\n numBytes = buf.length;\n }\n var j = 0;\n var startByte = 0;\n var endByte = startByte + numBytes;\n // Handle first character separately\n var firstChar = str.charCodeAt(j++);\n if (firstChar !== 0) {\n buf.writeUInt8(firstChar & 0xFF, 0);\n startByte = 1;\n }\n for (var i = startByte; i < endByte; i += 2) {\n var chr = str.charCodeAt(j++);\n if (endByte - i === 1) {\n // Write first byte of character\n buf.writeUInt8(chr >> 8, i);\n }\n if (endByte - i >= 2) {\n // Write both bytes in character\n buf.writeUInt16BE(chr, i);\n }\n }\n return numBytes;\n }\n\n public static byte2str(buff: NodeBuffer): string {\n var len = buff.length;\n // Special case: Empty string\n if (len === 0) {\n return '';\n }\n var charLen = (len >> 1) + 1,\n chars = new Array<number>(charLen),\n j = 0, i: number;\n\n // Even or odd length?\n if ((len & 1) === 1) {\n chars[0] = 0x100 | buff.readUInt8(j++);\n } else {\n chars[0] = 0;\n }\n\n for (i = 1; i < charLen; i++) {\n chars[i] = buff.readUInt16BE(j);\n j += 2;\n }\n return fromCharCodes(chars);\n }\n\n public static byteLength(str: string): number {\n if (str.length === 0) {\n // Special case: Empty string.\n return 0;\n }\n var firstChar = str.charCodeAt(0);\n var bytelen = (str.length - 1) << 1;\n if (firstChar !== 0) {\n bytelen++;\n }\n return bytelen;\n }\n}\n\n/**\n * IE/older FF version of binary string. One byte per character, offset by 0x20.\n */\nexport class BINSTRIE {\n public static str2byte(str: string, buf: NodeBuffer): number {\n var length = str.length > buf.length ? buf.length : str.length;\n for (var i = 0; i < length; i++) {\n buf.writeUInt8(str.charCodeAt(i) - 0x20, i);\n }\n return length;\n }\n\n public static byte2str(buff: NodeBuffer): string {\n var chars = new Array(buff.length);\n for (var i = 0; i < buff.length; i++) {\n chars[i] = String.fromCharCode(buff.readUInt8(i) + 0x20);\n }\n return chars.join('');\n }\n\n public static byteLength(str: string): number {\n return str.length;\n }\n}\n",
|
||
"/**\n * Check if the input is an array buffer view.\n */\nexport var isArrayBufferView: (ab: any) => ab is ArrayBufferView;\n/**\n * Check if the input is an array buffer.\n * (Note: Must check if ab is null / an object first.)\n */\nexport var isArrayBuffer: (ab: any) => ab is ArrayBuffer;\n\nif (typeof(ArrayBuffer) === 'undefined') {\n isArrayBufferView = (ab: any): ab is ArrayBufferView => false;\n isArrayBuffer = (ab: any): ab is ArrayBuffer => false;\n} else {\n isArrayBuffer = function(ab: any): ab is ArrayBuffer {\n return typeof ab.byteLength === 'number';\n };\n if (ArrayBuffer['isView']) {\n isArrayBufferView = function(ab: any): ab is ArrayBufferView {\n return ArrayBuffer.isView(ab);\n };\n } else {\n isArrayBufferView = function(ab: any): ab is ArrayBufferView {\n return isArrayBuffer(ab['buffer']);\n }\n }\n}",
|
||
"// Type information only.\nimport _path = require('path');\n\n// Split a filename into [root, dir, basename, ext], unix version\n// 'root' is just a slash, or nothing.\nvar splitPathRe = /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\nfunction posixSplitPath(filename: string): string[] {\n var out = splitPathRe.exec(filename);\n out.shift();\n return out;\n}\n\n/**\n * Emulates Node's `path` module. This module contains utilities for handling and\n * transforming file paths. **All** of these methods perform only string\n * transformations. The file system is not consulted to check whether paths are\n * valid.\n * @see http://nodejs.org/api/path.html\n * @class\n */\nclass path {\n /**\n * Normalize a string path, taking care of '..' and '.' parts.\n *\n * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.\n * @example Usage example\n * path.normalize('/foo/bar//baz/asdf/quux/..')\n * // returns\n * '/foo/bar/baz/asdf'\n * @param [String] p The path to normalize.\n * @return [String]\n */\n public static normalize(p: string): string {\n // Special case: '' -> '.'\n if (p === '') {\n p = '.';\n }\n // It's very important to know if the path is relative or not, since it\n // changes how we process .. and reconstruct the split string.\n var absolute = p.charAt(0) === path.sep;\n // Remove repeated //s\n p = path._removeDuplicateSeps(p);\n // Try to remove as many '../' as possible, and remove '.' completely.\n var components = p.split(path.sep);\n var goodComponents: string[] = [];\n for (var idx = 0; idx < components.length; idx++) {\n var c = components[idx];\n if (c === '.') {\n continue;\n } else if (c === '..' && (absolute || (!absolute && goodComponents.length > 0 && goodComponents[0] !== '..'))) {\n // In the absolute case: Path is relative to root, so we may pop even if\n // goodComponents is empty (e.g. /../ => /)\n // In the relative case: We're getting rid of a directory that preceded\n // it (e.g. /foo/../bar -> /bar)\n goodComponents.pop();\n } else {\n goodComponents.push(c);\n }\n }\n\n // Add in '.' when it's a relative path with no other nonempty components.\n // Possible results: '.' and './' (input: [''] or [])\n // @todo Can probably simplify this logic.\n if (!absolute && goodComponents.length < 2) {\n switch (goodComponents.length) {\n case 1:\n if (goodComponents[0] === '') {\n goodComponents.unshift('.');\n }\n break;\n default:\n goodComponents.push('.');\n }\n }\n p = goodComponents.join(path.sep);\n if (absolute && p.charAt(0) !== path.sep) {\n p = path.sep + p;\n }\n return p;\n }\n\n /**\n * Join all arguments together and normalize the resulting path.\n *\n * Arguments must be strings.\n * @example Usage\n * path.join('/foo', 'bar', 'baz/asdf', 'quux', '..')\n * // returns\n * '/foo/bar/baz/asdf'\n *\n * path.join('foo', {}, 'bar')\n * // throws exception\n * TypeError: Arguments to path.join must be strings\n * @param [String,...] paths Each component of the path\n * @return [String]\n */\n public static join(...paths: any[]): string {\n // Required: Prune any non-strings from the path. I also prune empty segments\n // so we can do a simple join of the array.\n var processed: string[] = [];\n for (var i = 0; i < paths.length; i++) {\n var segment = paths[i];\n if (typeof segment !== 'string') {\n throw new TypeError(\"Invalid argument type to path.join: \" + (typeof segment));\n } else if (segment !== '') {\n processed.push(segment);\n }\n }\n return path.normalize(processed.join(path.sep));\n }\n\n /**\n * Resolves to to an absolute path.\n *\n * If to isn't already absolute from arguments are prepended in right to left\n * order, until an absolute path is found. If after using all from paths still\n * no absolute path is found, the current working directory is used as well.\n * The resulting path is normalized, and trailing slashes are removed unless\n * the path gets resolved to the root directory. Non-string arguments are\n * ignored.\n *\n * Another way to think of it is as a sequence of cd commands in a shell.\n *\n * path.resolve('foo/bar', '/tmp/file/', '..', 'a/../subfile')\n *\n * Is similar to:\n *\n * cd foo/bar\n * cd /tmp/file/\n * cd ..\n * cd a/../subfile\n * pwd\n *\n * The difference is that the different paths don't need to exist and may also\n * be files.\n * @example Usage example\n * path.resolve('/foo/bar', './baz')\n * // returns\n * '/foo/bar/baz'\n *\n * path.resolve('/foo/bar', '/tmp/file/')\n * // returns\n * '/tmp/file'\n *\n * path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif')\n * // if currently in /home/myself/node, it returns\n * '/home/myself/node/wwwroot/static_files/gif/image.gif'\n * @param [String,...] paths\n * @return [String]\n */\n public static resolve(...paths: string[]): string {\n // Monitor for invalid paths, throw out empty paths, and look for the *last*\n // absolute path that we see.\n var processed: string[] = [];\n for (var i = 0; i < paths.length; i++) {\n var p = paths[i];\n if (typeof p !== 'string') {\n throw new TypeError(\"Invalid argument type to path.join: \" + (typeof p));\n } else if (p !== '') {\n // Remove anything that has occurred before this absolute path, as it\n // doesn't matter.\n if (p.charAt(0) === path.sep) {\n processed = [];\n }\n processed.push(p);\n }\n }\n // Special: Remove trailing slash unless it's the root\n var resolved = path.normalize(processed.join(path.sep));\n if (resolved.length > 1 && resolved.charAt(resolved.length - 1) === path.sep) {\n return resolved.substr(0, resolved.length - 1);\n }\n // Special: If it doesn't start with '/', it's relative and we need to append\n // the current directory.\n if (resolved.charAt(0) !== path.sep) {\n // Remove ./, since we're going to append the current directory.\n if (resolved.charAt(0) === '.' && (resolved.length === 1 || resolved.charAt(1) === path.sep)) {\n resolved = resolved.length === 1 ? '' : resolved.substr(2);\n }\n // Append the current directory, which *must* be an absolute path.\n var cwd = process.cwd();\n if (resolved !== '') {\n // cwd will never end in a /... unless it's the root.\n resolved = this.normalize(cwd + (cwd !== '/' ? path.sep : '') + resolved);\n } else {\n resolved = cwd;\n }\n }\n return resolved;\n }\n\n /**\n * Solve the relative path from from to to.\n *\n * At times we have two absolute paths, and we need to derive the relative path\n * from one to the other. This is actually the reverse transform of\n * path.resolve, which means we see that:\n *\n * path.resolve(from, path.relative(from, to)) == path.resolve(to)\n *\n * @example Usage example\n * path.relative('C:\\\\orandea\\\\test\\\\aaa', 'C:\\\\orandea\\\\impl\\\\bbb')\n * // returns\n * '..\\\\..\\\\impl\\\\bbb'\n *\n * path.relative('/data/orandea/test/aaa', '/data/orandea/impl/bbb')\n * // returns\n * '../../impl/bbb'\n * @param [String] from\n * @param [String] to\n * @return [String]\n */\n public static relative(from: string, to: string): string {\n var i: number;\n // Alright. Let's resolve these two to absolute paths and remove any\n // weirdness.\n from = path.resolve(from);\n to = path.resolve(to);\n var fromSegs = from.split(path.sep);\n var toSegs = to.split(path.sep);\n // Remove the first segment on both, as it's '' (both are absolute paths)\n toSegs.shift();\n fromSegs.shift();\n // There are two segments to this path:\n // * Going *up* the directory hierarchy with '..'\n // * Going *down* the directory hierarchy with foo/baz/bat.\n var upCount = 0;\n var downSegs: string[] = [];\n // Figure out how many things in 'from' are shared with 'to'.\n for (i = 0; i < fromSegs.length; i++) {\n var seg = fromSegs[i];\n if (seg === toSegs[i]) {\n continue;\n }\n // The rest of 'from', including the current element, indicates how many\n // directories we need to go up.\n upCount = fromSegs.length - i;\n break;\n }\n // The rest of 'to' indicates where we need to change to. We place this\n // outside of the loop, as toSegs.length may be greater than fromSegs.length.\n downSegs = toSegs.slice(i);\n // Special case: If 'from' is '/'\n if (fromSegs.length === 1 && fromSegs[0] === '') {\n upCount = 0;\n }\n // upCount can't be greater than the number of fromSegs\n // (cd .. from / is still /)\n if (upCount > fromSegs.length) {\n upCount = fromSegs.length;\n }\n // Create the final string!\n var rv = '';\n for (i = 0; i < upCount; i++) {\n rv += '../';\n }\n rv += downSegs.join(path.sep);\n // Special case: Remove trailing '/'. Happens if it's all up and no down.\n if (rv.length > 1 && rv.charAt(rv.length - 1) === path.sep) {\n rv = rv.substr(0, rv.length - 1);\n }\n return rv;\n }\n\n /**\n * Return the directory name of a path. Similar to the Unix `dirname` command.\n *\n * Note that BrowserFS does not validate if the path is actually a valid\n * directory.\n * @example Usage example\n * path.dirname('/foo/bar/baz/asdf/quux')\n * // returns\n * '/foo/bar/baz/asdf'\n * @param [String] p The path to get the directory name of.\n * @return [String]\n */\n public static dirname(p: string): string {\n // We get rid of //, but we don't modify anything else (e.g. any extraneous .\n // and ../ are kept intact)\n p = path._removeDuplicateSeps(p);\n var absolute = p.charAt(0) === path.sep;\n var sections = p.split(path.sep);\n // Do 1 if it's /foo/bar, 2 if it's /foo/bar/\n if (sections.pop() === '' && sections.length > 0) {\n sections.pop();\n }\n // # of sections needs to be > 1 if absolute, since the first section is '' for '/'.\n // If not absolute, the first section is the first part of the path, and is OK\n // to return.\n if (sections.length > 1 || (sections.length === 1 && !absolute)) {\n return sections.join(path.sep);\n } else if (absolute) {\n return path.sep;\n } else {\n return '.';\n }\n }\n\n /**\n * Return the last portion of a path. Similar to the Unix basename command.\n * @example Usage example\n * path.basename('/foo/bar/baz/asdf/quux.html')\n * // returns\n * 'quux.html'\n *\n * path.basename('/foo/bar/baz/asdf/quux.html', '.html')\n * // returns\n * 'quux'\n * @param [String] p\n * @param [String?] ext\n * @return [String]\n */\n public static basename(p: string, ext: string = \"\"): string {\n // Special case: Normalize will modify this to '.'\n if (p === '') {\n return p;\n }\n // Normalize the string first to remove any weirdness.\n p = path.normalize(p);\n // Get the last part of the string.\n var sections = p.split(path.sep);\n var lastPart = sections[sections.length - 1];\n // Special case: If it's empty, then we have a string like so: foo/\n // Meaning, 'foo' is guaranteed to be a directory.\n if (lastPart === '' && sections.length > 1) {\n return sections[sections.length - 2];\n }\n // Remove the extension, if need be.\n if (ext.length > 0) {\n var lastPartExt = lastPart.substr(lastPart.length - ext.length);\n if (lastPartExt === ext) {\n return lastPart.substr(0, lastPart.length - ext.length);\n }\n }\n return lastPart;\n }\n\n /**\n * Return the extension of the path, from the last '.' to end of string in the\n * last portion of the path. If there is no '.' in the last portion of the path\n * or the first character of it is '.', then it returns an empty string.\n * @example Usage example\n * path.extname('index.html')\n * // returns\n * '.html'\n *\n * path.extname('index.')\n * // returns\n * '.'\n *\n * path.extname('index')\n * // returns\n * ''\n * @param [String] p\n * @return [String]\n */\n public static extname(p: string): string {\n p = path.normalize(p);\n var sections = p.split(path.sep);\n p = sections.pop();\n // Special case: foo/file.ext/ should return '.ext'\n if (p === '' && sections.length > 0) {\n p = sections.pop();\n }\n if (p === '..') {\n return '';\n }\n var i = p.lastIndexOf('.');\n if (i === -1 || i === 0) {\n return '';\n }\n return p.substr(i);\n }\n\n /**\n * Checks if the given path is an absolute path.\n *\n * Despite not being documented, this is a tested part of Node's path API.\n * @param [String] p\n * @return [Boolean] True if the path appears to be an absolute path.\n */\n public static isAbsolute(p: string): boolean {\n return p.length > 0 && p.charAt(0) === path.sep;\n }\n\n /**\n * Unknown. Undocumented.\n */\n public static _makeLong(p: string): string {\n return p;\n }\n\n /**\n * Returns an object from a path string.\n */\n public static parse(p: string): _path.ParsedPath {\n var allParts = posixSplitPath(p);\n return {\n root: allParts[0],\n dir: allParts[0] + allParts[1].slice(0, -1),\n base: allParts[2],\n ext: allParts[3],\n name: allParts[2].slice(0, allParts[2].length - allParts[3].length)\n };\n }\n\n public static format(pathObject: _path.ParsedPath): string {\n if (pathObject === null || typeof pathObject !== 'object') {\n throw new TypeError(`Parameter 'pathObject' must be an object, not ${typeof pathObject}`);\n }\n\n var root = pathObject.root || '';\n\n if (typeof root !== 'string') {\n throw new TypeError(\n \"'pathObject.root' must be a string or undefined, not \" +\n typeof pathObject.root\n );\n }\n\n var dir = pathObject.dir ? pathObject.dir + path.sep : '';\n var base = pathObject.base || '';\n return dir + base;\n }\n\n // The platform-specific file separator. BrowserFS uses `/`.\n public static sep: string = '/';\n\n private static _replaceRegex = new RegExp(\"//+\", 'g');\n\n private static _removeDuplicateSeps(p: string): string {\n p = p.replace(this._replaceRegex, this.sep);\n return p;\n }\n\n // The platform-specific path delimiter. BrowserFS uses `:`.\n public static delimiter = ':';\n\n public static posix = path;\n // XXX: Typing hack. We don't actually support win32.\n public static win32 = path;\n}\n\nvar _: typeof _path = path;\n\nexport = path;\n",
|
||
"import Process = require('./process');\nimport TTD = require('./tty');\n\nvar process = new Process(),\n processProxy: Process = <any> {};\n\nfunction defineKey(key: string) {\n if ((<any> processProxy)[key]) {\n // Probably a builtin Object property we don't care about.\n return;\n }\n if (typeof (<any> process)[key] === 'function') {\n (<any> processProxy)[key] = function() {\n return (<Function> (<any> process)[key]).apply(process, arguments);\n };\n } else {\n (<any> processProxy)[key] = (<any> process)[key];\n }\n}\n\nfor (var key in process) {\n // Don't check if process.hasOwnProperty; we want to also expose objects\n // up the prototype hierarchy.\n defineKey(key);\n}\n\n// Special key: Ensure we update public-facing values of stdin/stdout/stderr.\nprocessProxy.initializeTTYs = function() {\n if (process.stdin === null) {\n process.initializeTTYs();\n processProxy.stdin = process.stdin;\n processProxy.stdout = process.stdout;\n processProxy.stderr = process.stderr;\n }\n};\n\nprocess.nextTick(() => {\n processProxy.initializeTTYs();\n});\n\nexport = processProxy;\n",
|
||
"// Use path and TTY for type information only. We lazily pull them in\n// to avoid circular dependencies :(\n// (path depends on process for cwd(), TTY depends on streams which depends\n// on process.nextTick/process.stdout/stderr/stdin).\nimport _path = require('path');\nimport _TTY = require('./tty');\nimport events = require('events');\n\n// Path depends on process. Avoid a circular reference by dynamically including path when we need it.\nvar path: typeof _path = null;\n\nclass Item {\n private fun: Function;\n private array: any[];\n constructor(fun: Function, array: any[]) {\n this.fun = fun;\n this.array = array;\n }\n\n public run(): void {\n this.fun.apply(null, this.array);\n }\n}\n\n/**\n * Contains a queue of Items for process.nextTick.\n * Inspired by node-process: https://github.com/defunctzombie/node-process\n */\nclass NextTickQueue {\n private _queue: Item[] = [];\n private _draining = false;\n // Used/assigned by the drainQueue function.\n private _currentQueue: Item[] = null;\n private _queueIndex = -1;\n\n public push(item: Item): void {\n if (this._queue.push(item) === 1 && !this._draining) {\n setTimeout(() => this._drainQueue(), 0);\n }\n }\n\n private _cleanUpNextTick() {\n this._draining = false;\n if (this._currentQueue && this._currentQueue.length) {\n this._queue = this._currentQueue.concat(this._queue);\n } else {\n this._queueIndex = -1;\n }\n if (this._queue.length) {\n this._drainQueue();\n }\n }\n\n private _drainQueue() {\n if (this._draining) {\n return;\n }\n // If an Item throws an unhandled exception, this function will clean things up.\n var timeout = setTimeout(() => this._cleanUpNextTick());\n this._draining = true;\n\n var len = this._queue.length;\n while(len) {\n this._currentQueue = this._queue;\n this._queue = [];\n while (++this._queueIndex < len) {\n if (this._currentQueue) {\n this._currentQueue[this._queueIndex].run();\n }\n }\n this._queueIndex = -1;\n len = this._queue.length;\n }\n this._currentQueue = null;\n this._draining = false;\n clearTimeout(timeout);\n }\n}\n\n/**\n * Partial implementation of Node's `process` module.\n * We implement the portions that are relevant for the filesystem.\n * @see http://nodejs.org/api/process.html\n * @class\n */\nclass Process extends events.EventEmitter implements NodeJS.Process {\n private startTime = Date.now();\n\n private _cwd: string = '/';\n /**\n * Changes the current working directory.\n *\n * **Note**: BrowserFS does not validate that the directory actually exists.\n *\n * @example Usage example\n * console.log('Starting directory: ' + process.cwd());\n * process.chdir('/tmp');\n * console.log('New directory: ' + process.cwd());\n * @param [String] dir The directory to change to.\n */\n public chdir(dir: string): void {\n // XXX: Circular dependency hack.\n if (path === null) {\n path = require('path');\n }\n this._cwd = path.resolve(dir);\n }\n /**\n * Returns the current working directory.\n * @example Usage example\n * console.log('Current directory: ' + process.cwd());\n * @return [String] The current working directory.\n */\n public cwd(): string {\n return this._cwd;\n }\n /**\n * Returns what platform you are running on.\n * @return [String]\n */\n public platform: string = 'browser';\n /**\n * Number of seconds BrowserFS has been running.\n * @return [Number]\n */\n public uptime(): number {\n return ((Date.now() - this.startTime) / 1000) | 0;\n }\n\n public argv: string[] = [];\n public stdout: _TTY = null;\n public stderr: _TTY = null;\n public stdin: _TTY = null;\n\n private _queue: NextTickQueue = new NextTickQueue();\n\n public nextTick(fun: any, ...args: any[]) {\n this._queue.push(new Item(fun, args));\n }\n\n public execPath = __dirname;\n\n public abort(): void {\n this.emit('abort');\n }\n\n public env: {[name: string]: string} = {};\n public exitCode: number = 0;\n public exit(code: number): void {\n this.exitCode = code;\n this.emit('exit', [code]);\n }\n\n private _gid: number = 1;\n public getgid(): number {\n return this._gid;\n }\n public setgid(gid: number | string): void {\n if (typeof gid === 'number') {\n this._gid = gid;\n } else {\n this._gid = 1;\n }\n }\n\n private _uid: number = 1;\n public getuid(): number {\n return this._uid;\n }\n public setuid(uid: number | string): void {\n if (typeof uid === 'number') {\n this._uid = uid;\n } else {\n this._uid = 1;\n }\n }\n\n public version: string = 'v5.0';\n\n public versions = {\n http_parser: '0.0',\n node: '5.0',\n v8: '0.0',\n uv: '0.0',\n zlib: '0.0',\n ares: '0.0',\n icu: '0.0',\n modules: '0',\n openssl: '0.0'\n };\n\n public config = {\n target_defaults:\n { cflags: <any[]> [],\n default_configuration: 'Release',\n defines: <string[]> [],\n include_dirs: <string[]> [],\n libraries: <string[]> [] },\n variables:\n { clang: 0,\n host_arch: 'x32',\n node_install_npm: false,\n node_install_waf: false,\n node_prefix: '',\n node_shared_cares: false,\n node_shared_http_parser: false,\n node_shared_libuv: false,\n node_shared_zlib: false,\n node_shared_v8: false,\n node_use_dtrace: false,\n node_use_etw: false,\n node_use_openssl: false,\n node_shared_openssl: false,\n strict_aliasing: false,\n target_arch: 'x32',\n v8_use_snapshot: false,\n v8_no_strict_aliasing: 0,\n visibility: '' } };\n\n public kill(pid: number, signal?: string): void {\n this.emit('kill', [pid, signal]);\n }\n\n public pid = (Math.random()*1000)|0;\n\n public title = 'node';\n public arch = 'x32';\n public memoryUsage(): {rss: number; heapTotal: number; heapUsed: number;} {\n return { rss: 0, heapTotal: 0, heapUsed: 0 }\n }\n\n private _mask = 18;\n public umask(mask: number = this._mask): number {\n let oldMask = this._mask;\n this._mask = mask;\n this.emit('umask', [mask]);\n return oldMask;\n }\n\n public hrtime(): [number, number] {\n let timeinfo: number;\n if (typeof performance !== 'undefined') {\n timeinfo = performance.now();\n } else if (Date['now']) {\n timeinfo = Date.now();\n } else {\n timeinfo = (new Date()).getTime();\n }\n let secs = (timeinfo / 1000)|0;\n timeinfo -= secs * 1000;\n timeinfo = (timeinfo * 1000000)|0;\n return [secs, timeinfo];\n }\n\n /**\n * [BFS only] Initialize the TTY devices.\n */\n public initializeTTYs(): void {\n // Guard against multiple invocations.\n if (this.stdout === null) {\n let TTY: typeof _TTY = require('./tty');\n this.stdout = new TTY();\n this.stderr = new TTY();\n this.stdin = new TTY();\n }\n }\n}\n\nexport = Process;",
|
||
"import stream = require('stream');\n\nclass TTY extends stream.Duplex {\n public isRaw: boolean = false;\n public columns: number = 80;\n public rows: number = 120;\n public isTTY: boolean = true;\n private _bufferedWrites: Buffer[] = [];\n private _waitingForWrites: boolean = false;\n\n constructor() {\n super();\n }\n\n /**\n * Toggle raw mode.\n */\n public setRawMode(mode: boolean): void {\n if (this.isRaw !== mode) {\n this.isRaw = mode;\n // [BFS] TTY implementations can use this to change their event emitting\n // patterns.\n this.emit('modeChange');\n }\n }\n\n /**\n * [BFS] Update the number of columns available on the terminal.\n */\n public changeColumns(columns: number): void {\n if (columns !== this.columns) {\n this.columns = columns;\n // Resize event.\n this.emit('resize');\n }\n }\n\n /**\n * [BFS] Update the number of rows available on the terminal.\n */\n public changeRows(rows: number): void {\n if (rows !== this.rows) {\n this.rows = rows;\n // Resize event.\n this.emit('resize');\n }\n }\n\n /**\n * Returns 'true' if the given object is a TTY.\n */\n public static isatty(fd: any): fd is TTY {\n return fd && fd instanceof TTY;\n }\n\n public _write(chunk: any, encoding: string, cb: Function): void {\n var error: any;\n try {\n var data: Buffer;\n if (typeof(chunk) === 'string') {\n data = new Buffer(chunk, encoding);\n } else {\n data = chunk;\n }\n this._bufferedWrites.push(data);\n if (this._waitingForWrites) {\n this._read(1024);\n }\n } catch (e) {\n error = e;\n } finally {\n cb(error);\n }\n }\n\n public _read(size: number): void {\n // Size is advisory -- we can ignore it.\n if (this._bufferedWrites.length === 0) {\n this._waitingForWrites = true;\n } else {\n while (this._bufferedWrites.length > 0) {\n this._waitingForWrites = this.push(this._bufferedWrites.shift());\n if (!this._waitingForWrites) {\n break;\n }\n }\n }\n }\n}\n\nexport = TTY;\n",
|
||
"// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nfunction EventEmitter() {\n this._events = this._events || {};\n this._maxListeners = this._maxListeners || undefined;\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nEventEmitter.defaultMaxListeners = 10;\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function(n) {\n if (!isNumber(n) || n < 0 || isNaN(n))\n throw TypeError('n must be a positive number');\n this._maxListeners = n;\n return this;\n};\n\nEventEmitter.prototype.emit = function(type) {\n var er, handler, len, args, i, listeners;\n\n if (!this._events)\n this._events = {};\n\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events.error ||\n (isObject(this._events.error) && !this._events.error.length)) {\n er = arguments[1];\n if (er instanceof Error) {\n throw er; // Unhandled 'error' event\n }\n throw TypeError('Uncaught, unspecified \"error\" event.');\n }\n }\n\n handler = this._events[type];\n\n if (isUndefined(handler))\n return false;\n\n if (isFunction(handler)) {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n } else if (isObject(handler)) {\n args = Array.prototype.slice.call(arguments, 1);\n listeners = handler.slice();\n len = listeners.length;\n for (i = 0; i < len; i++)\n listeners[i].apply(this, args);\n }\n\n return true;\n};\n\nEventEmitter.prototype.addListener = function(type, listener) {\n var m;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events)\n this._events = {};\n\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (this._events.newListener)\n this.emit('newListener', type,\n isFunction(listener.listener) ?\n listener.listener : listener);\n\n if (!this._events[type])\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n else if (isObject(this._events[type]))\n // If we've already got an array, just append.\n this._events[type].push(listener);\n else\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n\n // Check for listener leak\n if (isObject(this._events[type]) && !this._events[type].warned) {\n if (!isUndefined(this._maxListeners)) {\n m = this._maxListeners;\n } else {\n m = EventEmitter.defaultMaxListeners;\n }\n\n if (m && m > 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n if (typeof console.trace === 'function') {\n // not supported in IE 10\n console.trace();\n }\n }\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n var fired = false;\n\n function g() {\n this.removeListener(type, g);\n\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n\n g.listener = listener;\n this.on(type, g);\n\n return this;\n};\n\n// emits a 'removeListener' event iff the listener was removed\nEventEmitter.prototype.removeListener = function(type, listener) {\n var list, position, length, i;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events || !this._events[type])\n return this;\n\n list = this._events[type];\n length = list.length;\n position = -1;\n\n if (list === listener ||\n (isFunction(list.listener) && list.listener === listener)) {\n delete this._events[type];\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n\n } else if (isObject(list)) {\n for (i = length; i-- > 0;) {\n if (list[i] === listener ||\n (list[i].listener && list[i].listener === listener)) {\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (list.length === 1) {\n list.length = 0;\n delete this._events[type];\n } else {\n list.splice(position, 1);\n }\n\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n var key, listeners;\n\n if (!this._events)\n return this;\n\n // not listening for removeListener, no need to emit\n if (!this._events.removeListener) {\n if (arguments.length === 0)\n this._events = {};\n else if (this._events[type])\n delete this._events[type];\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n for (key in this._events) {\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = {};\n return this;\n }\n\n listeners = this._events[type];\n\n if (isFunction(listeners)) {\n this.removeListener(type, listeners);\n } else if (listeners) {\n // LIFO order\n while (listeners.length)\n this.removeListener(type, listeners[listeners.length - 1]);\n }\n delete this._events[type];\n\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n var ret;\n if (!this._events || !this._events[type])\n ret = [];\n else if (isFunction(this._events[type]))\n ret = [this._events[type]];\n else\n ret = this._events[type].slice();\n return ret;\n};\n\nEventEmitter.prototype.listenerCount = function(type) {\n if (this._events) {\n var evlistener = this._events[type];\n\n if (isFunction(evlistener))\n return 1;\n else if (evlistener)\n return evlistener.length;\n }\n return 0;\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n};\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\n",
|
||
"if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n",
|
||
"module.exports = Array.isArray || function (arr) {\n return Object.prototype.toString.call(arr) == '[object Array]';\n};\n",
|
||
"module.exports = require(\"./lib/_stream_duplex.js\")\n",
|
||
"// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n'use strict';\n\n/*<replacement>*/\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) keys.push(key);\n return keys;\n}\n/*</replacement>*/\n\n\nmodule.exports = Duplex;\n\n/*<replacement>*/\nvar processNextTick = require('process-nextick-args');\n/*</replacement>*/\n\n\n\n/*<replacement>*/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/*</replacement>*/\n\nvar Readable = require('./_stream_readable');\nvar Writable = require('./_stream_writable');\n\nutil.inherits(Duplex, Readable);\n\nvar keys = objectKeys(Writable.prototype);\nfor (var v = 0; v < keys.length; v++) {\n var method = keys[v];\n if (!Duplex.prototype[method])\n Duplex.prototype[method] = Writable.prototype[method];\n}\n\nfunction Duplex(options) {\n if (!(this instanceof Duplex))\n return new Duplex(options);\n\n Readable.call(this, options);\n Writable.call(this, options);\n\n if (options && options.readable === false)\n this.readable = false;\n\n if (options && options.writable === false)\n this.writable = false;\n\n this.allowHalfOpen = true;\n if (options && options.allowHalfOpen === false)\n this.allowHalfOpen = false;\n\n this.once('end', onend);\n}\n\n// the no-half-open enforcer\nfunction onend() {\n // if we allow half-open state, or if the writable side ended,\n // then we're ok.\n if (this.allowHalfOpen || this._writableState.ended)\n return;\n\n // no more data can be written.\n // But allow more writes to happen in this tick.\n processNextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n self.end();\n}\n\nfunction forEach (xs, f) {\n for (var i = 0, l = xs.length; i < l; i++) {\n f(xs[i], i);\n }\n}\n",
|
||
"// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n'use strict';\n\nmodule.exports = PassThrough;\n\nvar Transform = require('./_stream_transform');\n\n/*<replacement>*/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/*</replacement>*/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n if (!(this instanceof PassThrough))\n return new PassThrough(options);\n\n Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function(chunk, encoding, cb) {\n cb(null, chunk);\n};\n",
|
||
"'use strict';\n\nmodule.exports = Readable;\n\n/*<replacement>*/\nvar processNextTick = require('process-nextick-args');\n/*</replacement>*/\n\n\n/*<replacement>*/\nvar isArray = require('isarray');\n/*</replacement>*/\n\n\n/*<replacement>*/\nvar Buffer = require('buffer').Buffer;\n/*</replacement>*/\n\nReadable.ReadableState = ReadableState;\n\nvar EE = require('events');\n\n/*<replacement>*/\nvar EElistenerCount = function(emitter, type) {\n return emitter.listeners(type).length;\n};\n/*</replacement>*/\n\n\n\n/*<replacement>*/\nvar Stream;\n(function (){try{\n Stream = require('st' + 'ream');\n}catch(_){}finally{\n if (!Stream)\n Stream = require('events').EventEmitter;\n}}())\n/*</replacement>*/\n\nvar Buffer = require('buffer').Buffer;\n\n/*<replacement>*/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/*</replacement>*/\n\n\n\n/*<replacement>*/\nvar debugUtil = require('util');\nvar debug;\nif (debugUtil && debugUtil.debuglog) {\n debug = debugUtil.debuglog('stream');\n} else {\n debug = function () {};\n}\n/*</replacement>*/\n\nvar StringDecoder;\n\nutil.inherits(Readable, Stream);\n\nvar Duplex;\nfunction ReadableState(options, stream) {\n Duplex = Duplex || require('./_stream_duplex');\n\n options = options || {};\n\n // object stream flag. Used to make read(n) ignore n and to\n // make all the buffer merging and length checks go away\n this.objectMode = !!options.objectMode;\n\n if (stream instanceof Duplex)\n this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n // the point at which it stops calling _read() to fill the buffer\n // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n var hwm = options.highWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm;\n\n // cast to ints.\n this.highWaterMark = ~~this.highWaterMark;\n\n this.buffer = [];\n this.length = 0;\n this.pipes = null;\n this.pipesCount = 0;\n this.flowing = null;\n this.ended = false;\n this.endEmitted = false;\n this.reading = false;\n\n // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true;\n\n // whenever we return null, then we set a flag to say\n // that we're awaiting a 'readable' event emission.\n this.needReadable = false;\n this.emittedReadable = false;\n this.readableListening = false;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // when piping, we only care about 'readable' events that happen\n // after read()ing all the bytes and not getting any pushback.\n this.ranOut = false;\n\n // the number of writers that are awaiting a drain event in .pipe()s\n this.awaitDrain = 0;\n\n // if true, a maybeReadMore has been scheduled\n this.readingMore = false;\n\n this.decoder = null;\n this.encoding = null;\n if (options.encoding) {\n if (!StringDecoder)\n StringDecoder = require('string_decoder/').StringDecoder;\n this.decoder = new StringDecoder(options.encoding);\n this.encoding = options.encoding;\n }\n}\n\nvar Duplex;\nfunction Readable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n\n if (!(this instanceof Readable))\n return new Readable(options);\n\n this._readableState = new ReadableState(options, this);\n\n // legacy\n this.readable = true;\n\n if (options && typeof options.read === 'function')\n this._read = options.read;\n\n Stream.call(this);\n}\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function(chunk, encoding) {\n var state = this._readableState;\n\n if (!state.objectMode && typeof chunk === 'string') {\n encoding = encoding || state.defaultEncoding;\n if (encoding !== state.encoding) {\n chunk = new Buffer(chunk, encoding);\n encoding = '';\n }\n }\n\n return readableAddChunk(this, state, chunk, encoding, false);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function(chunk) {\n var state = this._readableState;\n return readableAddChunk(this, state, chunk, '', true);\n};\n\nReadable.prototype.isPaused = function() {\n return this._readableState.flowing === false;\n};\n\nfunction readableAddChunk(stream, state, chunk, encoding, addToFront) {\n var er = chunkInvalid(state, chunk);\n if (er) {\n stream.emit('error', er);\n } else if (chunk === null) {\n state.reading = false;\n onEofChunk(stream, state);\n } else if (state.objectMode || chunk && chunk.length > 0) {\n if (state.ended && !addToFront) {\n var e = new Error('stream.push() after EOF');\n stream.emit('error', e);\n } else if (state.endEmitted && addToFront) {\n var e = new Error('stream.unshift() after end event');\n stream.emit('error', e);\n } else {\n if (state.decoder && !addToFront && !encoding)\n chunk = state.decoder.write(chunk);\n\n if (!addToFront)\n state.reading = false;\n\n // if we want the data now, just emit it.\n if (state.flowing && state.length === 0 && !state.sync) {\n stream.emit('data', chunk);\n stream.read(0);\n } else {\n // update the buffer info.\n state.length += state.objectMode ? 1 : chunk.length;\n if (addToFront)\n state.buffer.unshift(chunk);\n else\n state.buffer.push(chunk);\n\n if (state.needReadable)\n emitReadable(stream);\n }\n\n maybeReadMore(stream, state);\n }\n } else if (!addToFront) {\n state.reading = false;\n }\n\n return needMoreData(state);\n}\n\n\n// if it's past the high water mark, we can push in some more.\n// Also, if we have no data yet, we can stand some\n// more bytes. This is to work around cases where hwm=0,\n// such as the repl. Also, if the push() triggered a\n// readable event, and the user called read(largeNumber) such that\n// needReadable was set, then we ought to push more, so that another\n// 'readable' event will be triggered.\nfunction needMoreData(state) {\n return !state.ended &&\n (state.needReadable ||\n state.length < state.highWaterMark ||\n state.length === 0);\n}\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function(enc) {\n if (!StringDecoder)\n StringDecoder = require('string_decoder/').StringDecoder;\n this._readableState.decoder = new StringDecoder(enc);\n this._readableState.encoding = enc;\n return this;\n};\n\n// Don't raise the hwm > 8MB\nvar MAX_HWM = 0x800000;\nfunction computeNewHighWaterMark(n) {\n if (n >= MAX_HWM) {\n n = MAX_HWM;\n } else {\n // Get the next highest power of 2\n n--;\n n |= n >>> 1;\n n |= n >>> 2;\n n |= n >>> 4;\n n |= n >>> 8;\n n |= n >>> 16;\n n++;\n }\n return n;\n}\n\nfunction howMuchToRead(n, state) {\n if (state.length === 0 && state.ended)\n return 0;\n\n if (state.objectMode)\n return n === 0 ? 0 : 1;\n\n if (n === null || isNaN(n)) {\n // only flow one buffer at a time\n if (state.flowing && state.buffer.length)\n return state.buffer[0].length;\n else\n return state.length;\n }\n\n if (n <= 0)\n return 0;\n\n // If we're asking for more than the target buffer level,\n // then raise the water mark. Bump up to the next highest\n // power of 2, to prevent increasing it excessively in tiny\n // amounts.\n if (n > state.highWaterMark)\n state.highWaterMark = computeNewHighWaterMark(n);\n\n // don't have that much. return null, unless we've ended.\n if (n > state.length) {\n if (!state.ended) {\n state.needReadable = true;\n return 0;\n } else {\n return state.length;\n }\n }\n\n return n;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function(n) {\n debug('read', n);\n var state = this._readableState;\n var nOrig = n;\n\n if (typeof n !== 'number' || n > 0)\n state.emittedReadable = false;\n\n // if we're doing read(0) to trigger a readable event, but we\n // already have a bunch of data in the buffer, then just trigger\n // the 'readable' event and move on.\n if (n === 0 &&\n state.needReadable &&\n (state.length >= state.highWaterMark || state.ended)) {\n debug('read: emitReadable', state.length, state.ended);\n if (state.length === 0 && state.ended)\n endReadable(this);\n else\n emitReadable(this);\n return null;\n }\n\n n = howMuchToRead(n, state);\n\n // if we've ended, and we're now clear, then finish it up.\n if (n === 0 && state.ended) {\n if (state.length === 0)\n endReadable(this);\n return null;\n }\n\n // All the actual chunk generation logic needs to be\n // *below* the call to _read. The reason is that in certain\n // synthetic stream cases, such as passthrough streams, _read\n // may be a completely synchronous operation which may change\n // the state of the read buffer, providing enough data when\n // before there was *not* enough.\n //\n // So, the steps are:\n // 1. Figure out what the state of things will be after we do\n // a read from the buffer.\n //\n // 2. If that resulting state will trigger a _read, then call _read.\n // Note that this may be asynchronous, or synchronous. Yes, it is\n // deeply ugly to write APIs this way, but that still doesn't mean\n // that the Readable class should behave improperly, as streams are\n // designed to be sync/async agnostic.\n // Take note if the _read call is sync or async (ie, if the read call\n // has returned yet), so that we know whether or not it's safe to emit\n // 'readable' etc.\n //\n // 3. Actually pull the requested chunks out of the buffer and return.\n\n // if we need a readable event, then we need to do some reading.\n var doRead = state.needReadable;\n debug('need readable', doRead);\n\n // if we currently have less than the highWaterMark, then also read some\n if (state.length === 0 || state.length - n < state.highWaterMark) {\n doRead = true;\n debug('length less than watermark', doRead);\n }\n\n // however, if we've ended, then there's no point, and if we're already\n // reading, then it's unnecessary.\n if (state.ended || state.reading) {\n doRead = false;\n debug('reading or ended', doRead);\n }\n\n if (doRead) {\n debug('do read');\n state.reading = true;\n state.sync = true;\n // if the length is currently zero, then we *need* a readable event.\n if (state.length === 0)\n state.needReadable = true;\n // call internal read method\n this._read(state.highWaterMark);\n state.sync = false;\n }\n\n // If _read pushed data synchronously, then `reading` will be false,\n // and we need to re-evaluate how much data we can return to the user.\n if (doRead && !state.reading)\n n = howMuchToRead(nOrig, state);\n\n var ret;\n if (n > 0)\n ret = fromList(n, state);\n else\n ret = null;\n\n if (ret === null) {\n state.needReadable = true;\n n = 0;\n }\n\n state.length -= n;\n\n // If we have nothing in the buffer, then we want to know\n // as soon as we *do* get something into the buffer.\n if (state.length === 0 && !state.ended)\n state.needReadable = true;\n\n // If we tried to read() past the EOF, then emit end on the next tick.\n if (nOrig !== n && state.ended && state.length === 0)\n endReadable(this);\n\n if (ret !== null)\n this.emit('data', ret);\n\n return ret;\n};\n\nfunction chunkInvalid(state, chunk) {\n var er = null;\n if (!(Buffer.isBuffer(chunk)) &&\n typeof chunk !== 'string' &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n er = new TypeError('Invalid non-string/buffer chunk');\n }\n return er;\n}\n\n\nfunction onEofChunk(stream, state) {\n if (state.ended) return;\n if (state.decoder) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length) {\n state.buffer.push(chunk);\n state.length += state.objectMode ? 1 : chunk.length;\n }\n }\n state.ended = true;\n\n // emit 'readable' now to make sure it gets picked up.\n emitReadable(stream);\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow. This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n var state = stream._readableState;\n state.needReadable = false;\n if (!state.emittedReadable) {\n debug('emitReadable', state.flowing);\n state.emittedReadable = true;\n if (state.sync)\n processNextTick(emitReadable_, stream);\n else\n emitReadable_(stream);\n }\n}\n\nfunction emitReadable_(stream) {\n debug('emit readable');\n stream.emit('readable');\n flow(stream);\n}\n\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data. that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n if (!state.readingMore) {\n state.readingMore = true;\n processNextTick(maybeReadMore_, stream, state);\n }\n}\n\nfunction maybeReadMore_(stream, state) {\n var len = state.length;\n while (!state.reading && !state.flowing && !state.ended &&\n state.length < state.highWaterMark) {\n debug('maybeReadMore read 0');\n stream.read(0);\n if (len === state.length)\n // didn't get any data, stop spinning.\n break;\n else\n len = state.length;\n }\n state.readingMore = false;\n}\n\n// abstract method. to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function(n) {\n this.emit('error', new Error('not implemented'));\n};\n\nReadable.prototype.pipe = function(dest, pipeOpts) {\n var src = this;\n var state = this._readableState;\n\n switch (state.pipesCount) {\n case 0:\n state.pipes = dest;\n break;\n case 1:\n state.pipes = [state.pipes, dest];\n break;\n default:\n state.pipes.push(dest);\n break;\n }\n state.pipesCount += 1;\n debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n\n var doEnd = (!pipeOpts || pipeOpts.end !== false) &&\n dest !== process.stdout &&\n dest !== process.stderr;\n\n var endFn = doEnd ? onend : cleanup;\n if (state.endEmitted)\n processNextTick(endFn);\n else\n src.once('end', endFn);\n\n dest.on('unpipe', onunpipe);\n function onunpipe(readable) {\n debug('onunpipe');\n if (readable === src) {\n cleanup();\n }\n }\n\n function onend() {\n debug('onend');\n dest.end();\n }\n\n // when the dest drains, it reduces the awaitDrain counter\n // on the source. This would be more elegant with a .once()\n // handler in flow(), but adding and removing repeatedly is\n // too slow.\n var ondrain = pipeOnDrain(src);\n dest.on('drain', ondrain);\n\n var cleanedUp = false;\n function cleanup() {\n debug('cleanup');\n // cleanup event handlers once the pipe is broken\n dest.removeListener('close', onclose);\n dest.removeListener('finish', onfinish);\n dest.removeListener('drain', ondrain);\n dest.removeListener('error', onerror);\n dest.removeListener('unpipe', onunpipe);\n src.removeListener('end', onend);\n src.removeListener('end', cleanup);\n src.removeListener('data', ondata);\n\n cleanedUp = true;\n\n // if the reader is waiting for a drain event from this\n // specific writer, then it would cause it to never start\n // flowing again.\n // So, if this is awaiting a drain, then we just call it now.\n // If we don't know, then assume that we are waiting for one.\n if (state.awaitDrain &&\n (!dest._writableState || dest._writableState.needDrain))\n ondrain();\n }\n\n src.on('data', ondata);\n function ondata(chunk) {\n debug('ondata');\n var ret = dest.write(chunk);\n if (false === ret) {\n // If the user unpiped during `dest.write()`, it is possible\n // to get stuck in a permanently paused state if that write\n // also returned false.\n if (state.pipesCount === 1 &&\n state.pipes[0] === dest &&\n src.listenerCount('data') === 1 &&\n !cleanedUp) {\n debug('false write response, pause', src._readableState.awaitDrain);\n src._readableState.awaitDrain++;\n }\n src.pause();\n }\n }\n\n // if the dest has an error, then stop piping into it.\n // however, don't suppress the throwing behavior for this.\n function onerror(er) {\n debug('onerror', er);\n unpipe();\n dest.removeListener('error', onerror);\n if (EElistenerCount(dest, 'error') === 0)\n dest.emit('error', er);\n }\n // This is a brutally ugly hack to make sure that our error handler\n // is attached before any userland ones. NEVER DO THIS.\n if (!dest._events || !dest._events.error)\n dest.on('error', onerror);\n else if (isArray(dest._events.error))\n dest._events.error.unshift(onerror);\n else\n dest._events.error = [onerror, dest._events.error];\n\n\n // Both close and finish should trigger unpipe, but only once.\n function onclose() {\n dest.removeListener('finish', onfinish);\n unpipe();\n }\n dest.once('close', onclose);\n function onfinish() {\n debug('onfinish');\n dest.removeListener('close', onclose);\n unpipe();\n }\n dest.once('finish', onfinish);\n\n function unpipe() {\n debug('unpipe');\n src.unpipe(dest);\n }\n\n // tell the dest that it's being piped to\n dest.emit('pipe', src);\n\n // start the flow if it hasn't been started already.\n if (!state.flowing) {\n debug('pipe resume');\n src.resume();\n }\n\n return dest;\n};\n\nfunction pipeOnDrain(src) {\n return function() {\n var state = src._readableState;\n debug('pipeOnDrain', state.awaitDrain);\n if (state.awaitDrain)\n state.awaitDrain--;\n if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n state.flowing = true;\n flow(src);\n }\n };\n}\n\n\nReadable.prototype.unpipe = function(dest) {\n var state = this._readableState;\n\n // if we're not piping anywhere, then do nothing.\n if (state.pipesCount === 0)\n return this;\n\n // just one destination. most common case.\n if (state.pipesCount === 1) {\n // passed in one, but it's not the right one.\n if (dest && dest !== state.pipes)\n return this;\n\n if (!dest)\n dest = state.pipes;\n\n // got a match.\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n if (dest)\n dest.emit('unpipe', this);\n return this;\n }\n\n // slow case. multiple pipe destinations.\n\n if (!dest) {\n // remove all.\n var dests = state.pipes;\n var len = state.pipesCount;\n state.pipes = null;\n state.pipesCount = 0;\n state.flowing = false;\n\n for (var i = 0; i < len; i++)\n dests[i].emit('unpipe', this);\n return this;\n }\n\n // try to find the right one.\n var i = indexOf(state.pipes, dest);\n if (i === -1)\n return this;\n\n state.pipes.splice(i, 1);\n state.pipesCount -= 1;\n if (state.pipesCount === 1)\n state.pipes = state.pipes[0];\n\n dest.emit('unpipe', this);\n\n return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function(ev, fn) {\n var res = Stream.prototype.on.call(this, ev, fn);\n\n // If listening to data, and it has not explicitly been paused,\n // then call resume to start the flow of data on the next tick.\n if (ev === 'data' && false !== this._readableState.flowing) {\n this.resume();\n }\n\n if (ev === 'readable' && this.readable) {\n var state = this._readableState;\n if (!state.readableListening) {\n state.readableListening = true;\n state.emittedReadable = false;\n state.needReadable = true;\n if (!state.reading) {\n processNextTick(nReadingNextTick, this);\n } else if (state.length) {\n emitReadable(this, state);\n }\n }\n }\n\n return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\n\nfunction nReadingNextTick(self) {\n debug('readable nexttick read 0');\n self.read(0);\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function() {\n var state = this._readableState;\n if (!state.flowing) {\n debug('resume');\n state.flowing = true;\n resume(this, state);\n }\n return this;\n};\n\nfunction resume(stream, state) {\n if (!state.resumeScheduled) {\n state.resumeScheduled = true;\n processNextTick(resume_, stream, state);\n }\n}\n\nfunction resume_(stream, state) {\n if (!state.reading) {\n debug('resume read 0');\n stream.read(0);\n }\n\n state.resumeScheduled = false;\n stream.emit('resume');\n flow(stream);\n if (state.flowing && !state.reading)\n stream.read(0);\n}\n\nReadable.prototype.pause = function() {\n debug('call pause flowing=%j', this._readableState.flowing);\n if (false !== this._readableState.flowing) {\n debug('pause');\n this._readableState.flowing = false;\n this.emit('pause');\n }\n return this;\n};\n\nfunction flow(stream) {\n var state = stream._readableState;\n debug('flow', state.flowing);\n if (state.flowing) {\n do {\n var chunk = stream.read();\n } while (null !== chunk && state.flowing);\n }\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function(stream) {\n var state = this._readableState;\n var paused = false;\n\n var self = this;\n stream.on('end', function() {\n debug('wrapped end');\n if (state.decoder && !state.ended) {\n var chunk = state.decoder.end();\n if (chunk && chunk.length)\n self.push(chunk);\n }\n\n self.push(null);\n });\n\n stream.on('data', function(chunk) {\n debug('wrapped data');\n if (state.decoder)\n chunk = state.decoder.write(chunk);\n\n // don't skip over falsy values in objectMode\n if (state.objectMode && (chunk === null || chunk === undefined))\n return;\n else if (!state.objectMode && (!chunk || !chunk.length))\n return;\n\n var ret = self.push(chunk);\n if (!ret) {\n paused = true;\n stream.pause();\n }\n });\n\n // proxy all the other methods.\n // important when wrapping filters and duplexes.\n for (var i in stream) {\n if (this[i] === undefined && typeof stream[i] === 'function') {\n this[i] = function(method) { return function() {\n return stream[method].apply(stream, arguments);\n }; }(i);\n }\n }\n\n // proxy certain important events.\n var events = ['error', 'close', 'destroy', 'pause', 'resume'];\n forEach(events, function(ev) {\n stream.on(ev, self.emit.bind(self, ev));\n });\n\n // when we try to consume some more bytes, simply unpause the\n // underlying stream.\n self._read = function(n) {\n debug('wrapped _read', n);\n if (paused) {\n paused = false;\n stream.resume();\n }\n };\n\n return self;\n};\n\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\nfunction fromList(n, state) {\n var list = state.buffer;\n var length = state.length;\n var stringMode = !!state.decoder;\n var objectMode = !!state.objectMode;\n var ret;\n\n // nothing in the list, definitely empty.\n if (list.length === 0)\n return null;\n\n if (length === 0)\n ret = null;\n else if (objectMode)\n ret = list.shift();\n else if (!n || n >= length) {\n // read it all, truncate the array.\n if (stringMode)\n ret = list.join('');\n else if (list.length === 1)\n ret = list[0];\n else\n ret = Buffer.concat(list, length);\n list.length = 0;\n } else {\n // read just some of it.\n if (n < list[0].length) {\n // just take a part of the first list item.\n // slice is the same for buffers and strings.\n var buf = list[0];\n ret = buf.slice(0, n);\n list[0] = buf.slice(n);\n } else if (n === list[0].length) {\n // first list is a perfect match\n ret = list.shift();\n } else {\n // complex case.\n // we have enough to cover it, but it spans past the first buffer.\n if (stringMode)\n ret = '';\n else\n ret = new Buffer(n);\n\n var c = 0;\n for (var i = 0, l = list.length; i < l && c < n; i++) {\n var buf = list[0];\n var cpy = Math.min(n - c, buf.length);\n\n if (stringMode)\n ret += buf.slice(0, cpy);\n else\n buf.copy(ret, c, 0, cpy);\n\n if (cpy < buf.length)\n list[0] = buf.slice(cpy);\n else\n list.shift();\n\n c += cpy;\n }\n }\n }\n\n return ret;\n}\n\nfunction endReadable(stream) {\n var state = stream._readableState;\n\n // If we get here before consuming all the bytes, then that is a\n // bug in node. Should never happen.\n if (state.length > 0)\n throw new Error('endReadable called on non-empty stream');\n\n if (!state.endEmitted) {\n state.ended = true;\n processNextTick(endReadableNT, state, stream);\n }\n}\n\nfunction endReadableNT(state, stream) {\n // Check that we didn't get one last unshift.\n if (!state.endEmitted && state.length === 0) {\n state.endEmitted = true;\n stream.readable = false;\n stream.emit('end');\n }\n}\n\nfunction forEach (xs, f) {\n for (var i = 0, l = xs.length; i < l; i++) {\n f(xs[i], i);\n }\n}\n\nfunction indexOf (xs, x) {\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) return i;\n }\n return -1;\n}\n",
|
||
"// a transform stream is a readable/writable stream where you do\n// something with the data. Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored. (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation. For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes. When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up. When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer. When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks. If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk. However,\n// a pathological inflate type of transform can cause excessive buffering\n// here. For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output. In this case, you could write a very small\n// amount of input, and end up with a very large amount of output. In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform. A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n'use strict';\n\nmodule.exports = Transform;\n\nvar Duplex = require('./_stream_duplex');\n\n/*<replacement>*/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/*</replacement>*/\n\nutil.inherits(Transform, Duplex);\n\n\nfunction TransformState(stream) {\n this.afterTransform = function(er, data) {\n return afterTransform(stream, er, data);\n };\n\n this.needTransform = false;\n this.transforming = false;\n this.writecb = null;\n this.writechunk = null;\n}\n\nfunction afterTransform(stream, er, data) {\n var ts = stream._transformState;\n ts.transforming = false;\n\n var cb = ts.writecb;\n\n if (!cb)\n return stream.emit('error', new Error('no writecb in Transform class'));\n\n ts.writechunk = null;\n ts.writecb = null;\n\n if (data !== null && data !== undefined)\n stream.push(data);\n\n if (cb)\n cb(er);\n\n var rs = stream._readableState;\n rs.reading = false;\n if (rs.needReadable || rs.length < rs.highWaterMark) {\n stream._read(rs.highWaterMark);\n }\n}\n\n\nfunction Transform(options) {\n if (!(this instanceof Transform))\n return new Transform(options);\n\n Duplex.call(this, options);\n\n this._transformState = new TransformState(this);\n\n // when the writable side finishes, then flush out anything remaining.\n var stream = this;\n\n // start out asking for a readable event once data is transformed.\n this._readableState.needReadable = true;\n\n // we have implemented the _read method, and done the other things\n // that Readable wants before the first _read call, so unset the\n // sync guard flag.\n this._readableState.sync = false;\n\n if (options) {\n if (typeof options.transform === 'function')\n this._transform = options.transform;\n\n if (typeof options.flush === 'function')\n this._flush = options.flush;\n }\n\n this.once('prefinish', function() {\n if (typeof this._flush === 'function')\n this._flush(function(er) {\n done(stream, er);\n });\n else\n done(stream);\n });\n}\n\nTransform.prototype.push = function(chunk, encoding) {\n this._transformState.needTransform = false;\n return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side. You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk. If you pass\n// an error, then that'll put the hurt on the whole operation. If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function(chunk, encoding, cb) {\n throw new Error('not implemented');\n};\n\nTransform.prototype._write = function(chunk, encoding, cb) {\n var ts = this._transformState;\n ts.writecb = cb;\n ts.writechunk = chunk;\n ts.writeencoding = encoding;\n if (!ts.transforming) {\n var rs = this._readableState;\n if (ts.needTransform ||\n rs.needReadable ||\n rs.length < rs.highWaterMark)\n this._read(rs.highWaterMark);\n }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function(n) {\n var ts = this._transformState;\n\n if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\n ts.transforming = true;\n this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n } else {\n // mark that we need a transform, so that any data that comes in\n // will get processed, now that we've asked for it.\n ts.needTransform = true;\n }\n};\n\n\nfunction done(stream, er) {\n if (er)\n return stream.emit('error', er);\n\n // if there's nothing in the write buffer, then that means\n // that nothing more will ever be provided\n var ws = stream._writableState;\n var ts = stream._transformState;\n\n if (ws.length)\n throw new Error('calling transform done when ws.length != 0');\n\n if (ts.transforming)\n throw new Error('calling transform done when still transforming');\n\n return stream.push(null);\n}\n",
|
||
"// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n'use strict';\n\nmodule.exports = Writable;\n\n/*<replacement>*/\nvar processNextTick = require('process-nextick-args');\n/*</replacement>*/\n\n\n/*<replacement>*/\nvar Buffer = require('buffer').Buffer;\n/*</replacement>*/\n\nWritable.WritableState = WritableState;\n\n\n/*<replacement>*/\nvar util = require('core-util-is');\nutil.inherits = require('inherits');\n/*</replacement>*/\n\n\n/*<replacement>*/\nvar internalUtil = {\n deprecate: require('util-deprecate')\n};\n/*</replacement>*/\n\n\n\n/*<replacement>*/\nvar Stream;\n(function (){try{\n Stream = require('st' + 'ream');\n}catch(_){}finally{\n if (!Stream)\n Stream = require('events').EventEmitter;\n}}())\n/*</replacement>*/\n\nvar Buffer = require('buffer').Buffer;\n\nutil.inherits(Writable, Stream);\n\nfunction nop() {}\n\nfunction WriteReq(chunk, encoding, cb) {\n this.chunk = chunk;\n this.encoding = encoding;\n this.callback = cb;\n this.next = null;\n}\n\nvar Duplex;\nfunction WritableState(options, stream) {\n Duplex = Duplex || require('./_stream_duplex');\n\n options = options || {};\n\n // object stream flag to indicate whether or not this stream\n // contains buffers or objects.\n this.objectMode = !!options.objectMode;\n\n if (stream instanceof Duplex)\n this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n // the point at which write() starts returning false\n // Note: 0 is a valid value, means that we always return false if\n // the entire buffer is not flushed immediately on write()\n var hwm = options.highWaterMark;\n var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm;\n\n // cast to ints.\n this.highWaterMark = ~~this.highWaterMark;\n\n this.needDrain = false;\n // at the start of calling end()\n this.ending = false;\n // when end() has been called, and returned\n this.ended = false;\n // when 'finish' is emitted\n this.finished = false;\n\n // should we decode strings into buffers before passing to _write?\n // this is here so that some node-core streams can optimize string\n // handling at a lower level.\n var noDecode = options.decodeStrings === false;\n this.decodeStrings = !noDecode;\n\n // Crypto is kind of old and crusty. Historically, its default string\n // encoding is 'binary' so we have to make this configurable.\n // Everything else in the universe uses 'utf8', though.\n this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n // not an actual buffer we keep track of, but a measurement\n // of how much we're waiting to get pushed to some underlying\n // socket or file.\n this.length = 0;\n\n // a flag to see when we're in the middle of a write.\n this.writing = false;\n\n // when true all writes will be buffered until .uncork() call\n this.corked = 0;\n\n // a flag to be able to tell if the onwrite cb is called immediately,\n // or on a later tick. We set this to true at first, because any\n // actions that shouldn't happen until \"later\" should generally also\n // not happen before the first write call.\n this.sync = true;\n\n // a flag to know if we're processing previously buffered items, which\n // may call the _write() callback in the same tick, so that we don't\n // end up in an overlapped onwrite situation.\n this.bufferProcessing = false;\n\n // the callback that's passed to _write(chunk,cb)\n this.onwrite = function(er) {\n onwrite(stream, er);\n };\n\n // the callback that the user supplies to write(chunk,encoding,cb)\n this.writecb = null;\n\n // the amount that is being written when _write is called.\n this.writelen = 0;\n\n this.bufferedRequest = null;\n this.lastBufferedRequest = null;\n\n // number of pending user-supplied write callbacks\n // this must be 0 before 'finish' can be emitted\n this.pendingcb = 0;\n\n // emit prefinish if the only thing we're waiting for is _write cbs\n // This is relevant for synchronous Transform streams\n this.prefinished = false;\n\n // True if the error was already emitted and should not be thrown again\n this.errorEmitted = false;\n}\n\nWritableState.prototype.getBuffer = function writableStateGetBuffer() {\n var current = this.bufferedRequest;\n var out = [];\n while (current) {\n out.push(current);\n current = current.next;\n }\n return out;\n};\n\n(function (){try {\nObject.defineProperty(WritableState.prototype, 'buffer', {\n get: internalUtil.deprecate(function() {\n return this.getBuffer();\n }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' +\n 'instead.')\n});\n}catch(_){}}());\n\n\nvar Duplex;\nfunction Writable(options) {\n Duplex = Duplex || require('./_stream_duplex');\n\n // Writable ctor is applied to Duplexes, though they're not\n // instanceof Writable, they're instanceof Readable.\n if (!(this instanceof Writable) && !(this instanceof Duplex))\n return new Writable(options);\n\n this._writableState = new WritableState(options, this);\n\n // legacy.\n this.writable = true;\n\n if (options) {\n if (typeof options.write === 'function')\n this._write = options.write;\n\n if (typeof options.writev === 'function')\n this._writev = options.writev;\n }\n\n Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function() {\n this.emit('error', new Error('Cannot pipe. Not readable.'));\n};\n\n\nfunction writeAfterEnd(stream, cb) {\n var er = new Error('write after end');\n // TODO: defer error events consistently everywhere, not just the cb\n stream.emit('error', er);\n processNextTick(cb, er);\n}\n\n// If we get something that is not a buffer, string, null, or undefined,\n// and we're not in objectMode, then that's an error.\n// Otherwise stream chunks are all considered to be of length=1, and the\n// watermarks determine how many objects to keep in the buffer, rather than\n// how many bytes or characters.\nfunction validChunk(stream, state, chunk, cb) {\n var valid = true;\n\n if (!(Buffer.isBuffer(chunk)) &&\n typeof chunk !== 'string' &&\n chunk !== null &&\n chunk !== undefined &&\n !state.objectMode) {\n var er = new TypeError('Invalid non-string/buffer chunk');\n stream.emit('error', er);\n processNextTick(cb, er);\n valid = false;\n }\n return valid;\n}\n\nWritable.prototype.write = function(chunk, encoding, cb) {\n var state = this._writableState;\n var ret = false;\n\n if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (Buffer.isBuffer(chunk))\n encoding = 'buffer';\n else if (!encoding)\n encoding = state.defaultEncoding;\n\n if (typeof cb !== 'function')\n cb = nop;\n\n if (state.ended)\n writeAfterEnd(this, cb);\n else if (validChunk(this, state, chunk, cb)) {\n state.pendingcb++;\n ret = writeOrBuffer(this, state, chunk, encoding, cb);\n }\n\n return ret;\n};\n\nWritable.prototype.cork = function() {\n var state = this._writableState;\n\n state.corked++;\n};\n\nWritable.prototype.uncork = function() {\n var state = this._writableState;\n\n if (state.corked) {\n state.corked--;\n\n if (!state.writing &&\n !state.corked &&\n !state.finished &&\n !state.bufferProcessing &&\n state.bufferedRequest)\n clearBuffer(this, state);\n }\n};\n\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n // node::ParseEncoding() requires lower case.\n if (typeof encoding === 'string')\n encoding = encoding.toLowerCase();\n if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64',\n'ucs2', 'ucs-2','utf16le', 'utf-16le', 'raw']\n.indexOf((encoding + '').toLowerCase()) > -1))\n throw new TypeError('Unknown encoding: ' + encoding);\n this._writableState.defaultEncoding = encoding;\n};\n\nfunction decodeChunk(state, chunk, encoding) {\n if (!state.objectMode &&\n state.decodeStrings !== false &&\n typeof chunk === 'string') {\n chunk = new Buffer(chunk, encoding);\n }\n return chunk;\n}\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn. Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, chunk, encoding, cb) {\n chunk = decodeChunk(state, chunk, encoding);\n\n if (Buffer.isBuffer(chunk))\n encoding = 'buffer';\n var len = state.objectMode ? 1 : chunk.length;\n\n state.length += len;\n\n var ret = state.length < state.highWaterMark;\n // we must ensure that previous needDrain will not be reset to false.\n if (!ret)\n state.needDrain = true;\n\n if (state.writing || state.corked) {\n var last = state.lastBufferedRequest;\n state.lastBufferedRequest = new WriteReq(chunk, encoding, cb);\n if (last) {\n last.next = state.lastBufferedRequest;\n } else {\n state.bufferedRequest = state.lastBufferedRequest;\n }\n } else {\n doWrite(stream, state, false, len, chunk, encoding, cb);\n }\n\n return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n state.writelen = len;\n state.writecb = cb;\n state.writing = true;\n state.sync = true;\n if (writev)\n stream._writev(chunk, state.onwrite);\n else\n stream._write(chunk, encoding, state.onwrite);\n state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n --state.pendingcb;\n if (sync)\n processNextTick(cb, er);\n else\n cb(er);\n\n stream._writableState.errorEmitted = true;\n stream.emit('error', er);\n}\n\nfunction onwriteStateUpdate(state) {\n state.writing = false;\n state.writecb = null;\n state.length -= state.writelen;\n state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n var state = stream._writableState;\n var sync = state.sync;\n var cb = state.writecb;\n\n onwriteStateUpdate(state);\n\n if (er)\n onwriteError(stream, state, sync, er, cb);\n else {\n // Check if we're actually ready to finish, but don't emit yet\n var finished = needFinish(state);\n\n if (!finished &&\n !state.corked &&\n !state.bufferProcessing &&\n state.bufferedRequest) {\n clearBuffer(stream, state);\n }\n\n if (sync) {\n processNextTick(afterWrite, stream, state, finished, cb);\n } else {\n afterWrite(stream, state, finished, cb);\n }\n }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n if (!finished)\n onwriteDrain(stream, state);\n state.pendingcb--;\n cb();\n finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n if (state.length === 0 && state.needDrain) {\n state.needDrain = false;\n stream.emit('drain');\n }\n}\n\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n state.bufferProcessing = true;\n var entry = state.bufferedRequest;\n\n if (stream._writev && entry && entry.next) {\n // Fast case, write everything using _writev()\n var buffer = [];\n var cbs = [];\n while (entry) {\n cbs.push(entry.callback);\n buffer.push(entry);\n entry = entry.next;\n }\n\n // count the one we are adding, as well.\n // TODO(isaacs) clean this up\n state.pendingcb++;\n state.lastBufferedRequest = null;\n doWrite(stream, state, true, state.length, buffer, '', function(err) {\n for (var i = 0; i < cbs.length; i++) {\n state.pendingcb--;\n cbs[i](err);\n }\n });\n\n // Clear buffer\n } else {\n // Slow case, write chunks one-by-one\n while (entry) {\n var chunk = entry.chunk;\n var encoding = entry.encoding;\n var cb = entry.callback;\n var len = state.objectMode ? 1 : chunk.length;\n\n doWrite(stream, state, false, len, chunk, encoding, cb);\n entry = entry.next;\n // if we didn't call the onwrite immediately, then\n // it means that we need to wait until it does.\n // also, that means that the chunk and cb are currently\n // being processed, so move the buffer counter past them.\n if (state.writing) {\n break;\n }\n }\n\n if (entry === null)\n state.lastBufferedRequest = null;\n }\n state.bufferedRequest = entry;\n state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function(chunk, encoding, cb) {\n cb(new Error('not implemented'));\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function(chunk, encoding, cb) {\n var state = this._writableState;\n\n if (typeof chunk === 'function') {\n cb = chunk;\n chunk = null;\n encoding = null;\n } else if (typeof encoding === 'function') {\n cb = encoding;\n encoding = null;\n }\n\n if (chunk !== null && chunk !== undefined)\n this.write(chunk, encoding);\n\n // .end() fully uncorks\n if (state.corked) {\n state.corked = 1;\n this.uncork();\n }\n\n // ignore unnecessary end() calls.\n if (!state.ending && !state.finished)\n endWritable(this, state, cb);\n};\n\n\nfunction needFinish(state) {\n return (state.ending &&\n state.length === 0 &&\n state.bufferedRequest === null &&\n !state.finished &&\n !state.writing);\n}\n\nfunction prefinish(stream, state) {\n if (!state.prefinished) {\n state.prefinished = true;\n stream.emit('prefinish');\n }\n}\n\nfunction finishMaybe(stream, state) {\n var need = needFinish(state);\n if (need) {\n if (state.pendingcb === 0) {\n prefinish(stream, state);\n state.finished = true;\n stream.emit('finish');\n } else {\n prefinish(stream, state);\n }\n }\n return need;\n}\n\nfunction endWritable(stream, state, cb) {\n state.ending = true;\n finishMaybe(stream, state);\n if (cb) {\n if (state.finished)\n processNextTick(cb);\n else\n stream.once('finish', cb);\n }\n state.ended = true;\n}\n",
|
||
"// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\n\nfunction isArray(arg) {\n if (Array.isArray) {\n return Array.isArray(arg);\n }\n return objectToString(arg) === '[object Array]';\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = Buffer.isBuffer;\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n",
|
||
"'use strict';\n\nif (!process.version ||\n process.version.indexOf('v0.') === 0 ||\n process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {\n module.exports = nextTick;\n} else {\n module.exports = process.nextTick;\n}\n\nfunction nextTick(fn) {\n var args = new Array(arguments.length - 1);\n var i = 0;\n while (i < args.length) {\n args[i++] = arguments[i];\n }\n process.nextTick(function afterTick() {\n fn.apply(null, args);\n });\n}\n",
|
||
"\n/**\n * Module exports.\n */\n\nmodule.exports = deprecate;\n\n/**\n * Mark that a method should not be used.\n * Returns a modified function which warns once by default.\n *\n * If `localStorage.noDeprecation = true` is set, then it is a no-op.\n *\n * If `localStorage.throwDeprecation = true` is set, then deprecated functions\n * will throw an Error when invoked.\n *\n * If `localStorage.traceDeprecation = true` is set, then deprecated functions\n * will invoke `console.trace()` instead of `console.error()`.\n *\n * @param {Function} fn - the function to deprecate\n * @param {String} msg - the string to print to the console when `fn` is invoked\n * @returns {Function} a new \"deprecated\" version of `fn`\n * @api public\n */\n\nfunction deprecate (fn, msg) {\n if (config('noDeprecation')) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (config('throwDeprecation')) {\n throw new Error(msg);\n } else if (config('traceDeprecation')) {\n console.trace(msg);\n } else {\n console.warn(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n}\n\n/**\n * Checks `localStorage` for boolean values for the given `name`.\n *\n * @param {String} name\n * @returns {Boolean}\n * @api private\n */\n\nfunction config (name) {\n // accessing global.localStorage can trigger a DOMException in sandboxed iframes\n try {\n if (!global.localStorage) return false;\n } catch (_) {\n return false;\n }\n var val = global.localStorage[name];\n if (null == val) return false;\n return String(val).toLowerCase() === 'true';\n}\n",
|
||
"module.exports = require(\"./lib/_stream_passthrough.js\")\n",
|
||
"var Stream = (function (){\n try {\n return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify\n } catch(_){}\n}());\nexports = module.exports = require('./lib/_stream_readable.js');\nexports.Stream = Stream || exports;\nexports.Readable = exports;\nexports.Writable = require('./lib/_stream_writable.js');\nexports.Duplex = require('./lib/_stream_duplex.js');\nexports.Transform = require('./lib/_stream_transform.js');\nexports.PassThrough = require('./lib/_stream_passthrough.js');\n",
|
||
"module.exports = require(\"./lib/_stream_transform.js\")\n",
|
||
"module.exports = require(\"./lib/_stream_writable.js\")\n",
|
||
"// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nmodule.exports = Stream;\n\nvar EE = require('events').EventEmitter;\nvar inherits = require('inherits');\n\ninherits(Stream, EE);\nStream.Readable = require('readable-stream/readable.js');\nStream.Writable = require('readable-stream/writable.js');\nStream.Duplex = require('readable-stream/duplex.js');\nStream.Transform = require('readable-stream/transform.js');\nStream.PassThrough = require('readable-stream/passthrough.js');\n\n// Backwards-compat with node 0.4.x\nStream.Stream = Stream;\n\n\n\n// old-style streams. Note that the pipe method (the only relevant\n// part of this class) is overridden in the Readable class.\n\nfunction Stream() {\n EE.call(this);\n}\n\nStream.prototype.pipe = function(dest, options) {\n var source = this;\n\n function ondata(chunk) {\n if (dest.writable) {\n if (false === dest.write(chunk) && source.pause) {\n source.pause();\n }\n }\n }\n\n source.on('data', ondata);\n\n function ondrain() {\n if (source.readable && source.resume) {\n source.resume();\n }\n }\n\n dest.on('drain', ondrain);\n\n // If the 'end' option is not supplied, dest.end() will be called when\n // source gets the 'end' or 'close' events. Only dest.end() once.\n if (!dest._isStdio && (!options || options.end !== false)) {\n source.on('end', onend);\n source.on('close', onclose);\n }\n\n var didOnEnd = false;\n function onend() {\n if (didOnEnd) return;\n didOnEnd = true;\n\n dest.end();\n }\n\n\n function onclose() {\n if (didOnEnd) return;\n didOnEnd = true;\n\n if (typeof dest.destroy === 'function') dest.destroy();\n }\n\n // don't leave dangling pipes when there are errors.\n function onerror(er) {\n cleanup();\n if (EE.listenerCount(this, 'error') === 0) {\n throw er; // Unhandled stream error in pipe.\n }\n }\n\n source.on('error', onerror);\n dest.on('error', onerror);\n\n // remove all the event listeners that were added.\n function cleanup() {\n source.removeListener('data', ondata);\n dest.removeListener('drain', ondrain);\n\n source.removeListener('end', onend);\n source.removeListener('close', onclose);\n\n source.removeListener('error', onerror);\n dest.removeListener('error', onerror);\n\n source.removeListener('end', cleanup);\n source.removeListener('close', cleanup);\n\n dest.removeListener('close', cleanup);\n }\n\n source.on('end', cleanup);\n source.on('close', cleanup);\n\n dest.on('close', cleanup);\n\n dest.emit('pipe', source);\n\n // Allow for unix-like usage: A.pipe(B).pipe(C)\n return dest;\n};\n",
|
||
"// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar Buffer = require('buffer').Buffer;\n\nvar isBufferEncoding = Buffer.isEncoding\n || function(encoding) {\n switch (encoding && encoding.toLowerCase()) {\n case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true;\n default: return false;\n }\n }\n\n\nfunction assertEncoding(encoding) {\n if (encoding && !isBufferEncoding(encoding)) {\n throw new Error('Unknown encoding: ' + encoding);\n }\n}\n\n// StringDecoder provides an interface for efficiently splitting a series of\n// buffers into a series of JS strings without breaking apart multi-byte\n// characters. CESU-8 is handled as part of the UTF-8 encoding.\n//\n// @TODO Handling all encodings inside a single object makes it very difficult\n// to reason about this code, so it should be split up in the future.\n// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code\n// points as used by CESU-8.\nvar StringDecoder = exports.StringDecoder = function(encoding) {\n this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');\n assertEncoding(encoding);\n switch (this.encoding) {\n case 'utf8':\n // CESU-8 represents each of Surrogate Pair by 3-bytes\n this.surrogateSize = 3;\n break;\n case 'ucs2':\n case 'utf16le':\n // UTF-16 represents each of Surrogate Pair by 2-bytes\n this.surrogateSize = 2;\n this.detectIncompleteChar = utf16DetectIncompleteChar;\n break;\n case 'base64':\n // Base-64 stores 3 bytes in 4 chars, and pads the remainder.\n this.surrogateSize = 3;\n this.detectIncompleteChar = base64DetectIncompleteChar;\n break;\n default:\n this.write = passThroughWrite;\n return;\n }\n\n // Enough space to store all bytes of a single character. UTF-8 needs 4\n // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate).\n this.charBuffer = new Buffer(6);\n // Number of bytes received for the current incomplete multi-byte character.\n this.charReceived = 0;\n // Number of bytes expected for the current incomplete multi-byte character.\n this.charLength = 0;\n};\n\n\n// write decodes the given buffer and returns it as JS string that is\n// guaranteed to not contain any partial multi-byte characters. Any partial\n// character found at the end of the buffer is buffered up, and will be\n// returned when calling write again with the remaining bytes.\n//\n// Note: Converting a Buffer containing an orphan surrogate to a String\n// currently works, but converting a String to a Buffer (via `new Buffer`, or\n// Buffer#write) will replace incomplete surrogates with the unicode\n// replacement character. See https://codereview.chromium.org/121173009/ .\nStringDecoder.prototype.write = function(buffer) {\n var charStr = '';\n // if our last write ended with an incomplete multibyte character\n while (this.charLength) {\n // determine how many remaining bytes this buffer has to offer for this char\n var available = (buffer.length >= this.charLength - this.charReceived) ?\n this.charLength - this.charReceived :\n buffer.length;\n\n // add the new bytes to the char buffer\n buffer.copy(this.charBuffer, this.charReceived, 0, available);\n this.charReceived += available;\n\n if (this.charReceived < this.charLength) {\n // still not enough chars in this buffer? wait for more ...\n return '';\n }\n\n // remove bytes belonging to the current character from the buffer\n buffer = buffer.slice(available, buffer.length);\n\n // get the character that was split\n charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);\n\n // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character\n var charCode = charStr.charCodeAt(charStr.length - 1);\n if (charCode >= 0xD800 && charCode <= 0xDBFF) {\n this.charLength += this.surrogateSize;\n charStr = '';\n continue;\n }\n this.charReceived = this.charLength = 0;\n\n // if there are no more bytes in this buffer, just emit our char\n if (buffer.length === 0) {\n return charStr;\n }\n break;\n }\n\n // determine and set charLength / charReceived\n this.detectIncompleteChar(buffer);\n\n var end = buffer.length;\n if (this.charLength) {\n // buffer the incomplete character bytes we got\n buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);\n end -= this.charReceived;\n }\n\n charStr += buffer.toString(this.encoding, 0, end);\n\n var end = charStr.length - 1;\n var charCode = charStr.charCodeAt(end);\n // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character\n if (charCode >= 0xD800 && charCode <= 0xDBFF) {\n var size = this.surrogateSize;\n this.charLength += size;\n this.charReceived += size;\n this.charBuffer.copy(this.charBuffer, size, 0, size);\n buffer.copy(this.charBuffer, 0, 0, size);\n return charStr.substring(0, end);\n }\n\n // or just emit the charStr\n return charStr;\n};\n\n// detectIncompleteChar determines if there is an incomplete UTF-8 character at\n// the end of the given buffer. If so, it sets this.charLength to the byte\n// length that character, and sets this.charReceived to the number of bytes\n// that are available for this character.\nStringDecoder.prototype.detectIncompleteChar = function(buffer) {\n // determine how many bytes we have to check at the end of this buffer\n var i = (buffer.length >= 3) ? 3 : buffer.length;\n\n // Figure out if one of the last i bytes of our buffer announces an\n // incomplete char.\n for (; i > 0; i--) {\n var c = buffer[buffer.length - i];\n\n // See http://en.wikipedia.org/wiki/UTF-8#Description\n\n // 110XXXXX\n if (i == 1 && c >> 5 == 0x06) {\n this.charLength = 2;\n break;\n }\n\n // 1110XXXX\n if (i <= 2 && c >> 4 == 0x0E) {\n this.charLength = 3;\n break;\n }\n\n // 11110XXX\n if (i <= 3 && c >> 3 == 0x1E) {\n this.charLength = 4;\n break;\n }\n }\n this.charReceived = i;\n};\n\nStringDecoder.prototype.end = function(buffer) {\n var res = '';\n if (buffer && buffer.length)\n res = this.write(buffer);\n\n if (this.charReceived) {\n var cr = this.charReceived;\n var buf = this.charBuffer;\n var enc = this.encoding;\n res += buf.slice(0, cr).toString(enc);\n }\n\n return res;\n};\n\nfunction passThroughWrite(buffer) {\n return buffer.toString(this.encoding);\n}\n\nfunction utf16DetectIncompleteChar(buffer) {\n this.charReceived = buffer.length % 2;\n this.charLength = this.charReceived ? 2 : 0;\n}\n\nfunction base64DetectIncompleteChar(buffer) {\n this.charReceived = buffer.length % 3;\n this.charLength = this.charReceived ? 3 : 0;\n}\n",
|
||
null,
|
||
"/**\n * Determine if an object is Buffer\n *\n * Author: Feross Aboukhadijeh <feross@feross.org> <http://feross.org>\n * License: MIT\n *\n * `npm install is-buffer`\n */\n\nmodule.exports = function (obj) {\n return !!(obj != null &&\n (obj._isBuffer || // For Safari 5-7 (missing Object.prototype.constructor)\n (obj.constructor &&\n typeof obj.constructor.isBuffer === 'function' &&\n obj.constructor.isBuffer(obj))\n ))\n}\n",
|
||
"/* pako 1.0.0 nodeca/pako */\n!function(e){if(\"object\"==typeof exports&&\"undefined\"!=typeof module)module.exports=e();else if(\"function\"==typeof define&&define.amd)define([],e);else{var t;t=\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:this,t.pako=e()}}(function(){return function e(t,i,n){function a(o,s){if(!i[o]){if(!t[o]){var f=\"function\"==typeof require&&require;if(!s&&f)return f(o,!0);if(r)return r(o,!0);var l=new Error(\"Cannot find module '\"+o+\"'\");throw l.code=\"MODULE_NOT_FOUND\",l}var d=i[o]={exports:{}};t[o][0].call(d.exports,function(e){var i=t[o][1][e];return a(i?i:e)},d,d.exports,e,t,i,n)}return i[o].exports}for(var r=\"function\"==typeof require&&require,o=0;o<n.length;o++)a(n[o]);return a}({1:[function(e,t,i){\"use strict\";var n=\"undefined\"!=typeof Uint8Array&&\"undefined\"!=typeof Uint16Array&&\"undefined\"!=typeof Int32Array;i.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var i=t.shift();if(i){if(\"object\"!=typeof i)throw new TypeError(i+\"must be non-object\");for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])}}return e},i.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var a={arraySet:function(e,t,i,n,a){if(t.subarray&&e.subarray)return void e.set(t.subarray(i,i+n),a);for(var r=0;n>r;r++)e[a+r]=t[i+r]},flattenChunks:function(e){var t,i,n,a,r,o;for(n=0,t=0,i=e.length;i>t;t++)n+=e[t].length;for(o=new Uint8Array(n),a=0,t=0,i=e.length;i>t;t++)r=e[t],o.set(r,a),a+=r.length;return o}},r={arraySet:function(e,t,i,n,a){for(var r=0;n>r;r++)e[a+r]=t[i+r]},flattenChunks:function(e){return[].concat.apply([],e)}};i.setTyped=function(e){e?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,a)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,r))},i.setTyped(n)},{}],2:[function(e,t,i){\"use strict\";function n(e,t){if(65537>t&&(e.subarray&&o||!e.subarray&&r))return String.fromCharCode.apply(null,a.shrinkBuf(e,t));for(var i=\"\",n=0;t>n;n++)i+=String.fromCharCode(e[n]);return i}var a=e(\"./common\"),r=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(s){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(s){o=!1}for(var f=new a.Buf8(256),l=0;256>l;l++)f[l]=l>=252?6:l>=248?5:l>=240?4:l>=224?3:l>=192?2:1;f[254]=f[254]=1,i.string2buf=function(e){var t,i,n,r,o,s=e.length,f=0;for(r=0;s>r;r++)i=e.charCodeAt(r),55296===(64512&i)&&s>r+1&&(n=e.charCodeAt(r+1),56320===(64512&n)&&(i=65536+(i-55296<<10)+(n-56320),r++)),f+=128>i?1:2048>i?2:65536>i?3:4;for(t=new a.Buf8(f),o=0,r=0;f>o;r++)i=e.charCodeAt(r),55296===(64512&i)&&s>r+1&&(n=e.charCodeAt(r+1),56320===(64512&n)&&(i=65536+(i-55296<<10)+(n-56320),r++)),128>i?t[o++]=i:2048>i?(t[o++]=192|i>>>6,t[o++]=128|63&i):65536>i?(t[o++]=224|i>>>12,t[o++]=128|i>>>6&63,t[o++]=128|63&i):(t[o++]=240|i>>>18,t[o++]=128|i>>>12&63,t[o++]=128|i>>>6&63,t[o++]=128|63&i);return t},i.buf2binstring=function(e){return n(e,e.length)},i.binstring2buf=function(e){for(var t=new a.Buf8(e.length),i=0,n=t.length;n>i;i++)t[i]=e.charCodeAt(i);return t},i.buf2string=function(e,t){var i,a,r,o,s=t||e.length,l=new Array(2*s);for(a=0,i=0;s>i;)if(r=e[i++],128>r)l[a++]=r;else if(o=f[r],o>4)l[a++]=65533,i+=o-1;else{for(r&=2===o?31:3===o?15:7;o>1&&s>i;)r=r<<6|63&e[i++],o--;o>1?l[a++]=65533:65536>r?l[a++]=r:(r-=65536,l[a++]=55296|r>>10&1023,l[a++]=56320|1023&r)}return n(l,a)},i.utf8border=function(e,t){var i;for(t=t||e.length,t>e.length&&(t=e.length),i=t-1;i>=0&&128===(192&e[i]);)i--;return 0>i?t:0===i?t:i+f[e[i]]>t?i:t}},{\"./common\":1}],3:[function(e,t,i){\"use strict\";function n(e,t,i,n){for(var a=65535&e|0,r=e>>>16&65535|0,o=0;0!==i;){o=i>2e3?2e3:i,i-=o;do a=a+t[n++]|0,r=r+a|0;while(--o);a%=65521,r%=65521}return a|r<<16|0}t.exports=n},{}],4:[function(e,t,i){\"use strict\";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(e,t,i){\"use strict\";function n(){for(var e,t=[],i=0;256>i;i++){e=i;for(var n=0;8>n;n++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t}function a(e,t,i,n){var a=r,o=n+i;e^=-1;for(var s=n;o>s;s++)e=e>>>8^a[255&(e^t[s])];return-1^e}var r=n();t.exports=a},{}],6:[function(e,t,i){\"use strict\";function n(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=\"\",this.comment=\"\",this.hcrc=0,this.done=!1}t.exports=n},{}],7:[function(e,t,i){\"use strict\";var n=30,a=12;t.exports=function(e,t){var i,r,o,s,f,l,d,u,h,c,b,w,m,k,_,g,v,p,x,y,S,E,B,Z,A;i=e.state,r=e.next_in,Z=e.input,o=r+(e.avail_in-5),s=e.next_out,A=e.output,f=s-(t-e.avail_out),l=s+(e.avail_out-257),d=i.dmax,u=i.wsize,h=i.whave,c=i.wnext,b=i.window,w=i.hold,m=i.bits,k=i.lencode,_=i.distcode,g=(1<<i.lenbits)-1,v=(1<<i.distbits)-1;e:do{15>m&&(w+=Z[r++]<<m,m+=8,w+=Z[r++]<<m,m+=8),p=k[w&g];t:for(;;){if(x=p>>>24,w>>>=x,m-=x,x=p>>>16&255,0===x)A[s++]=65535&p;else{if(!(16&x)){if(0===(64&x)){p=k[(65535&p)+(w&(1<<x)-1)];continue t}if(32&x){i.mode=a;break e}e.msg=\"invalid literal/length code\",i.mode=n;break e}y=65535&p,x&=15,x&&(x>m&&(w+=Z[r++]<<m,m+=8),y+=w&(1<<x)-1,w>>>=x,m-=x),15>m&&(w+=Z[r++]<<m,m+=8,w+=Z[r++]<<m,m+=8),p=_[w&v];i:for(;;){if(x=p>>>24,w>>>=x,m-=x,x=p>>>16&255,!(16&x)){if(0===(64&x)){p=_[(65535&p)+(w&(1<<x)-1)];continue i}e.msg=\"invalid distance code\",i.mode=n;break e}if(S=65535&p,x&=15,x>m&&(w+=Z[r++]<<m,m+=8,x>m&&(w+=Z[r++]<<m,m+=8)),S+=w&(1<<x)-1,S>d){e.msg=\"invalid distance too far back\",i.mode=n;break e}if(w>>>=x,m-=x,x=s-f,S>x){if(x=S-x,x>h&&i.sane){e.msg=\"invalid distance too far back\",i.mode=n;break e}if(E=0,B=b,0===c){if(E+=u-x,y>x){y-=x;do A[s++]=b[E++];while(--x);E=s-S,B=A}}else if(x>c){if(E+=u+c-x,x-=c,y>x){y-=x;do A[s++]=b[E++];while(--x);if(E=0,y>c){x=c,y-=x;do A[s++]=b[E++];while(--x);E=s-S,B=A}}}else if(E+=c-x,y>x){y-=x;do A[s++]=b[E++];while(--x);E=s-S,B=A}for(;y>2;)A[s++]=B[E++],A[s++]=B[E++],A[s++]=B[E++],y-=3;y&&(A[s++]=B[E++],y>1&&(A[s++]=B[E++]))}else{E=s-S;do A[s++]=A[E++],A[s++]=A[E++],A[s++]=A[E++],y-=3;while(y>2);y&&(A[s++]=A[E++],y>1&&(A[s++]=A[E++]))}break}}break}}while(o>r&&l>s);y=m>>3,r-=y,m-=y<<3,w&=(1<<m)-1,e.next_in=r,e.next_out=s,e.avail_in=o>r?5+(o-r):5-(r-o),e.avail_out=l>s?257+(l-s):257-(s-l),i.hold=w,i.bits=m}},{}],8:[function(e,t,i){\"use strict\";function n(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function a(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new k.Buf16(320),this.work=new k.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function r(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=\"\",t.wrap&&(e.adler=1&t.wrap),t.mode=T,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new k.Buf32(be),t.distcode=t.distdyn=new k.Buf32(we),t.sane=1,t.back=-1,A):N}function o(e){var t;return e&&e.state?(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,r(e)):N}function s(e,t){var i,n;return e&&e.state?(n=e.state,0>t?(i=0,t=-t):(i=(t>>4)+1,48>t&&(t&=15)),t&&(8>t||t>15)?N:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=i,n.wbits=t,o(e))):N}function f(e,t){var i,n;return e?(n=new a,e.state=n,n.window=null,i=s(e,t),i!==A&&(e.state=null),i):N}function l(e){return f(e,ke)}function d(e){if(_e){var t;for(w=new k.Buf32(512),m=new k.Buf32(32),t=0;144>t;)e.lens[t++]=8;for(;256>t;)e.lens[t++]=9;for(;280>t;)e.lens[t++]=7;for(;288>t;)e.lens[t++]=8;for(p(y,e.lens,0,288,w,0,e.work,{bits:9}),t=0;32>t;)e.lens[t++]=5;p(S,e.lens,0,32,m,0,e.work,{bits:5}),_e=!1}e.lencode=w,e.lenbits=9,e.distcode=m,e.distbits=5}function u(e,t,i,n){var a,r=e.state;return null===r.window&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new k.Buf8(r.wsize)),n>=r.wsize?(k.arraySet(r.window,t,i-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):(a=r.wsize-r.wnext,a>n&&(a=n),k.arraySet(r.window,t,i-n,a,r.wnext),n-=a,n?(k.arraySet(r.window,t,i-n,n,0),r.wnext=n,r.whave=r.wsize):(r.wnext+=a,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=a))),0}function h(e,t){var i,a,r,o,s,f,l,h,c,b,w,m,be,we,me,ke,_e,ge,ve,pe,xe,ye,Se,Ee,Be=0,Ze=new k.Buf8(4),Ae=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return N;i=e.state,i.mode===G&&(i.mode=X),s=e.next_out,r=e.output,l=e.avail_out,o=e.next_in,a=e.input,f=e.avail_in,h=i.hold,c=i.bits,b=f,w=l,ye=A;e:for(;;)switch(i.mode){case T:if(0===i.wrap){i.mode=X;break}for(;16>c;){if(0===f)break e;f--,h+=a[o++]<<c,c+=8}if(2&i.wrap&&35615===h){i.check=0,Ze[0]=255&h,Ze[1]=h>>>8&255,i.check=g(i.check,Ze,2,0),h=0,c=0,i.mode=U;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&h)<<8)+(h>>8))%31){e.msg=\"incorrect header check\",i.mode=ue;break}if((15&h)!==F){e.msg=\"unknown compression method\",i.mode=ue;break}if(h>>>=4,c-=4,xe=(15&h)+8,0===i.wbits)i.wbits=xe;else if(xe>i.wbits){e.msg=\"invalid window size\",i.mode=ue;break}i.dmax=1<<xe,e.adler=i.check=1,i.mode=512&h?Y:G,h=0,c=0;break;case U:for(;16>c;){if(0===f)break e;f--,h+=a[o++]<<c,c+=8}if(i.flags=h,(255&i.flags)!==F){e.msg=\"unknown compression method\",i.mode=ue;break}if(57344&i.flags){e.msg=\"unknown header flags set\",i.mode=ue;break}i.head&&(i.head.text=h>>8&1),512&i.flags&&(Ze[0]=255&h,Ze[1]=h>>>8&255,i.check=g(i.check,Ze,2,0)),h=0,c=0,i.mode=D;case D:for(;32>c;){if(0===f)break e;f--,h+=a[o++]<<c,c+=8}i.head&&(i.head.time=h),512&i.flags&&(Ze[0]=255&h,Ze[1]=h>>>8&255,Ze[2]=h>>>16&255,Ze[3]=h>>>24&255,i.check=g(i.check,Ze,4,0)),h=0,c=0,i.mode=L;case L:for(;16>c;){if(0===f)break e;f--,h+=a[o++]<<c,c+=8}i.head&&(i.head.xflags=255&h,i.head.os=h>>8),512&i.flags&&(Ze[0]=255&h,Ze[1]=h>>>8&255,i.check=g(i.check,Ze,2,0)),h=0,c=0,i.mode=H;case H:if(1024&i.flags){for(;16>c;){if(0===f)break e;f--,h+=a[o++]<<c,c+=8}i.length=h,i.head&&(i.head.extra_len=h),512&i.flags&&(Ze[0]=255&h,Ze[1]=h>>>8&255,i.check=g(i.check,Ze,2,0)),h=0,c=0}else i.head&&(i.head.extra=null);i.mode=M;case M:if(1024&i.flags&&(m=i.length,m>f&&(m=f),m&&(i.head&&(xe=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),k.arraySet(i.head.extra,a,o,m,xe)),512&i.flags&&(i.check=g(i.check,a,m,o)),f-=m,o+=m,i.length-=m),i.length))break e;i.length=0,i.mode=K;case K:if(2048&i.flags){if(0===f)break e;m=0;do xe=a[o+m++],i.head&&xe&&i.length<65536&&(i.head.name+=String.fromCharCode(xe));while(xe&&f>m);if(512&i.flags&&(i.check=g(i.check,a,m,o)),f-=m,o+=m,xe)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=j;case j:if(4096&i.flags){if(0===f)break e;m=0;do xe=a[o+m++],i.head&&xe&&i.length<65536&&(i.head.comment+=String.fromCharCode(xe));while(xe&&f>m);if(512&i.flags&&(i.check=g(i.check,a,m,o)),f-=m,o+=m,xe)break e}else i.head&&(i.head.comment=null);i.mode=P;case P:if(512&i.flags){for(;16>c;){if(0===f)break e;f--,h+=a[o++]<<c,c+=8}if(h!==(65535&i.check)){e.msg=\"header crc mismatch\",i.mode=ue;break}h=0,c=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=G;break;case Y:for(;32>c;){if(0===f)break e;f--,h+=a[o++]<<c,c+=8}e.adler=i.check=n(h),h=0,c=0,i.mode=q;case q:if(0===i.havedict)return e.next_out=s,e.avail_out=l,e.next_in=o,e.avail_in=f,i.hold=h,i.bits=c,R;e.adler=i.check=1,i.mode=G;case G:if(t===B||t===Z)break e;case X:if(i.last){h>>>=7&c,c-=7&c,i.mode=fe;break}for(;3>c;){if(0===f)break e;f--,h+=a[o++]<<c,c+=8}switch(i.last=1&h,h>>>=1,c-=1,3&h){case 0:i.mode=W;break;case 1:if(d(i),i.mode=te,t===Z){h>>>=2,c-=2;break e}break;case 2:i.mode=V;break;case 3:e.msg=\"invalid block type\",i.mode=ue}h>>>=2,c-=2;break;case W:for(h>>>=7&c,c-=7&c;32>c;){if(0===f)break e;f--,h+=a[o++]<<c,c+=8}if((65535&h)!==(h>>>16^65535)){e.msg=\"invalid stored block lengths\",i.mode=ue;break}if(i.length=65535&h,h=0,c=0,i.mode=J,t===Z)break e;case J:i.mode=Q;case Q:if(m=i.length){if(m>f&&(m=f),m>l&&(m=l),0===m)break e;k.arraySet(r,a,o,m,s),f-=m,o+=m,l-=m,s+=m,i.length-=m;break}i.mode=G;break;case V:for(;14>c;){if(0===f)break e;f--,h+=a[o++]<<c,c+=8}if(i.nlen=(31&h)+257,h>>>=5,c-=5,i.ndist=(31&h)+1,h>>>=5,c-=5,i.ncode=(15&h)+4,h>>>=4,c-=4,i.nlen>286||i.ndist>30){e.msg=\"too many length or distance symbols\",i.mode=ue;break}i.have=0,i.mode=$;case $:for(;i.have<i.ncode;){for(;3>c;){if(0===f)break e;f--,h+=a[o++]<<c,c+=8}i.lens[Ae[i.have++]]=7&h,h>>>=3,c-=3}for(;i.have<19;)i.lens[Ae[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,Se={bits:i.lenbits},ye=p(x,i.lens,0,19,i.lencode,0,i.work,Se),i.lenbits=Se.bits,ye){e.msg=\"invalid code lengths set\",i.mode=ue;break}i.have=0,i.mode=ee;case ee:for(;i.have<i.nlen+i.ndist;){for(;Be=i.lencode[h&(1<<i.lenbits)-1],me=Be>>>24,ke=Be>>>16&255,_e=65535&Be,!(c>=me);){if(0===f)break e;f--,h+=a[o++]<<c,c+=8}if(16>_e)h>>>=me,c-=me,i.lens[i.have++]=_e;else{if(16===_e){for(Ee=me+2;Ee>c;){if(0===f)break e;f--,h+=a[o++]<<c,c+=8}if(h>>>=me,c-=me,0===i.have){e.msg=\"invalid bit length repeat\",i.mode=ue;break}xe=i.lens[i.have-1],m=3+(3&h),h>>>=2,c-=2}else if(17===_e){for(Ee=me+3;Ee>c;){if(0===f)break e;f--,h+=a[o++]<<c,c+=8}h>>>=me,c-=me,xe=0,m=3+(7&h),h>>>=3,c-=3}else{for(Ee=me+7;Ee>c;){if(0===f)break e;f--,h+=a[o++]<<c,c+=8}h>>>=me,c-=me,xe=0,m=11+(127&h),h>>>=7,c-=7}if(i.have+m>i.nlen+i.ndist){e.msg=\"invalid bit length repeat\",i.mode=ue;break}for(;m--;)i.lens[i.have++]=xe}}if(i.mode===ue)break;if(0===i.lens[256]){e.msg=\"invalid code -- missing end-of-block\",i.mode=ue;break}if(i.lenbits=9,Se={bits:i.lenbits},ye=p(y,i.lens,0,i.nlen,i.lencode,0,i.work,Se),i.lenbits=Se.bits,ye){e.msg=\"invalid literal/lengths set\",i.mode=ue;break}if(i.distbits=6,i.distcode=i.distdyn,Se={bits:i.distbits},ye=p(S,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,Se),i.distbits=Se.bits,ye){e.msg=\"invalid distances set\",i.mode=ue;break}if(i.mode=te,t===Z)break e;case te:i.mode=ie;case ie:if(f>=6&&l>=258){e.next_out=s,e.avail_out=l,e.next_in=o,e.avail_in=f,i.hold=h,i.bits=c,v(e,w),s=e.next_out,r=e.output,l=e.avail_out,o=e.next_in,a=e.input,f=e.avail_in,h=i.hold,c=i.bits,i.mode===G&&(i.back=-1);break}for(i.back=0;Be=i.lencode[h&(1<<i.lenbits)-1],me=Be>>>24,ke=Be>>>16&255,_e=65535&Be,!(c>=me);){if(0===f)break e;f--,h+=a[o++]<<c,c+=8}if(ke&&0===(240&ke)){for(ge=me,ve=ke,pe=_e;Be=i.lencode[pe+((h&(1<<ge+ve)-1)>>ge)],me=Be>>>24,ke=Be>>>16&255,_e=65535&Be,!(c>=ge+me);){if(0===f)break e;f--,h+=a[o++]<<c,c+=8}h>>>=ge,c-=ge,i.back+=ge}if(h>>>=me,c-=me,i.back+=me,i.length=_e,0===ke){i.mode=se;break}if(32&ke){i.back=-1,i.mode=G;break}if(64&ke){e.msg=\"invalid literal/length code\",i.mode=ue;break}i.extra=15&ke,i.mode=ne;case ne:if(i.extra){for(Ee=i.extra;Ee>c;){if(0===f)break e;f--,h+=a[o++]<<c,c+=8}i.length+=h&(1<<i.extra)-1,h>>>=i.extra,c-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=ae;case ae:for(;Be=i.distcode[h&(1<<i.distbits)-1],me=Be>>>24,ke=Be>>>16&255,_e=65535&Be,!(c>=me);){if(0===f)break e;f--,h+=a[o++]<<c,c+=8}if(0===(240&ke)){for(ge=me,ve=ke,pe=_e;Be=i.distcode[pe+((h&(1<<ge+ve)-1)>>ge)],me=Be>>>24,ke=Be>>>16&255,_e=65535&Be,!(c>=ge+me);){if(0===f)break e;f--,h+=a[o++]<<c,c+=8}h>>>=ge,c-=ge,i.back+=ge}if(h>>>=me,c-=me,i.back+=me,64&ke){e.msg=\"invalid distance code\",i.mode=ue;break}i.offset=_e,i.extra=15&ke,i.mode=re;case re:if(i.extra){for(Ee=i.extra;Ee>c;){if(0===f)break e;f--,h+=a[o++]<<c,c+=8}i.offset+=h&(1<<i.extra)-1,h>>>=i.extra,c-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg=\"invalid distance too far back\",i.mode=ue;break}i.mode=oe;case oe:if(0===l)break e;if(m=w-l,i.offset>m){if(m=i.offset-m,m>i.whave&&i.sane){e.msg=\"invalid distance too far back\",i.mode=ue;break}m>i.wnext?(m-=i.wnext,be=i.wsize-m):be=i.wnext-m,m>i.length&&(m=i.length),we=i.window}else we=r,be=s-i.offset,m=i.length;m>l&&(m=l),l-=m,i.length-=m;do r[s++]=we[be++];while(--m);0===i.length&&(i.mode=ie);break;case se:if(0===l)break e;r[s++]=i.length,l--,i.mode=ie;break;case fe:if(i.wrap){for(;32>c;){if(0===f)break e;f--,h|=a[o++]<<c,c+=8}if(w-=l,e.total_out+=w,i.total+=w,w&&(e.adler=i.check=i.flags?g(i.check,r,w,s-w):_(i.check,r,w,s-w)),w=l,(i.flags?h:n(h))!==i.check){e.msg=\"incorrect data check\",i.mode=ue;break}h=0,c=0}i.mode=le;case le:if(i.wrap&&i.flags){for(;32>c;){if(0===f)break e;f--,h+=a[o++]<<c,c+=8}if(h!==(4294967295&i.total)){e.msg=\"incorrect length check\",i.mode=ue;break}h=0,c=0}i.mode=de;case de:ye=z;break e;case ue:ye=O;break e;case he:return C;case ce:default:return N}return e.next_out=s,e.avail_out=l,e.next_in=o,e.avail_in=f,i.hold=h,i.bits=c,(i.wsize||w!==e.avail_out&&i.mode<ue&&(i.mode<fe||t!==E))&&u(e,e.output,e.next_out,w-e.avail_out)?(i.mode=he,C):(b-=e.avail_in,w-=e.avail_out,e.total_in+=b,e.total_out+=w,i.total+=w,i.wrap&&w&&(e.adler=i.check=i.flags?g(i.check,r,w,e.next_out-w):_(i.check,r,w,e.next_out-w)),e.data_type=i.bits+(i.last?64:0)+(i.mode===G?128:0)+(i.mode===te||i.mode===J?256:0),(0===b&&0===w||t===E)&&ye===A&&(ye=I),ye)}function c(e){if(!e||!e.state)return N;var t=e.state;return t.window&&(t.window=null),e.state=null,A}function b(e,t){var i;return e&&e.state?(i=e.state,0===(2&i.wrap)?N:(i.head=t,t.done=!1,A)):N}var w,m,k=e(\"../utils/common\"),_=e(\"./adler32\"),g=e(\"./crc32\"),v=e(\"./inffast\"),p=e(\"./inftrees\"),x=0,y=1,S=2,E=4,B=5,Z=6,A=0,z=1,R=2,N=-2,O=-3,C=-4,I=-5,F=8,T=1,U=2,D=3,L=4,H=5,M=6,K=7,j=8,P=9,Y=10,q=11,G=12,X=13,W=14,J=15,Q=16,V=17,$=18,ee=19,te=20,ie=21,ne=22,ae=23,re=24,oe=25,se=26,fe=27,le=28,de=29,ue=30,he=31,ce=32,be=852,we=592,me=15,ke=me,_e=!0;i.inflateReset=o,i.inflateReset2=s,i.inflateResetKeep=r,i.inflateInit=l,i.inflateInit2=f,i.inflate=h,i.inflateEnd=c,i.inflateGetHeader=b,i.inflateInfo=\"pako inflate (from Nodeca project)\"},{\"../utils/common\":1,\"./adler32\":3,\"./crc32\":5,\"./inffast\":7,\"./inftrees\":9}],9:[function(e,t,i){\"use strict\";var n=e(\"../utils/common\"),a=15,r=852,o=592,s=0,f=1,l=2,d=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],u=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],h=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,i,b,w,m,k,_){var g,v,p,x,y,S,E,B,Z,A=_.bits,z=0,R=0,N=0,O=0,C=0,I=0,F=0,T=0,U=0,D=0,L=null,H=0,M=new n.Buf16(a+1),K=new n.Buf16(a+1),j=null,P=0;for(z=0;a>=z;z++)M[z]=0;for(R=0;b>R;R++)M[t[i+R]]++;for(C=A,O=a;O>=1&&0===M[O];O--);if(C>O&&(C=O),0===O)return w[m++]=20971520,w[m++]=20971520,_.bits=1,0;for(N=1;O>N&&0===M[N];N++);for(N>C&&(C=N),T=1,z=1;a>=z;z++)if(T<<=1,T-=M[z],0>T)return-1;if(T>0&&(e===s||1!==O))return-1;for(K[1]=0,z=1;a>z;z++)K[z+1]=K[z]+M[z];for(R=0;b>R;R++)0!==t[i+R]&&(k[K[t[i+R]]++]=R);if(e===s?(L=j=k,S=19):e===f?(L=d,H-=257,j=u,P-=257,S=256):(L=h,j=c,S=-1),D=0,R=0,z=N,y=m,I=C,F=0,p=-1,U=1<<C,x=U-1,e===f&&U>r||e===l&&U>o)return 1;for(var Y=0;;){Y++,E=z-F,k[R]<S?(B=0,Z=k[R]):k[R]>S?(B=j[P+k[R]],Z=L[H+k[R]]):(B=96,Z=0),g=1<<z-F,v=1<<I,N=v;do v-=g,w[y+(D>>F)+v]=E<<24|B<<16|Z|0;while(0!==v);for(g=1<<z-1;D&g;)g>>=1;if(0!==g?(D&=g-1,D+=g):D=0,R++,0===--M[z]){if(z===O)break;z=t[i+k[R]]}if(z>C&&(D&x)!==p){for(0===F&&(F=C),y+=N,I=z-F,T=1<<I;O>I+F&&(T-=M[I+F],!(0>=T));)I++,T<<=1;if(U+=1<<I,e===f&&U>r||e===l&&U>o)return 1;p=D&x,w[p]=C<<24|I<<16|y-m|0}}return 0!==D&&(w[y+D]=z-F<<24|64<<16|0),_.bits=C,0}},{\"../utils/common\":1}],10:[function(e,t,i){\"use strict\";t.exports={2:\"need dictionary\",1:\"stream end\",0:\"\",\"-1\":\"file error\",\"-2\":\"stream error\",\"-3\":\"data error\",\"-4\":\"insufficient memory\",\"-5\":\"buffer error\",\"-6\":\"incompatible version\"}},{}],11:[function(e,t,i){\"use strict\";function n(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0}t.exports=n},{}],\"/lib/inflate.js\":[function(e,t,i){\"use strict\";function n(e){if(!(this instanceof n))return new n(e);this.options=s.assign({chunkSize:16384,windowBits:0,to:\"\"},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0===(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var i=o.inflateInit2(this.strm,t.windowBits);if(i!==l.Z_OK)throw new Error(d[i]);this.header=new h,o.inflateGetHeader(this.strm,this.header)}function a(e,t){var i=new n(t);if(i.push(e,!0),i.err)throw i.msg;return i.result}function r(e,t){return t=t||{},t.raw=!0,a(e,t)}var o=e(\"./zlib/inflate\"),s=e(\"./utils/common\"),f=e(\"./utils/strings\"),l=e(\"./zlib/constants\"),d=e(\"./zlib/messages\"),u=e(\"./zlib/zstream\"),h=e(\"./zlib/gzheader\"),c=Object.prototype.toString;n.prototype.push=function(e,t){var i,n,a,r,d,u=this.strm,h=this.options.chunkSize,b=!1;if(this.ended)return!1;n=t===~~t?t:t===!0?l.Z_FINISH:l.Z_NO_FLUSH,\"string\"==typeof e?u.input=f.binstring2buf(e):\"[object ArrayBuffer]\"===c.call(e)?u.input=new Uint8Array(e):u.input=e,u.next_in=0,u.avail_in=u.input.length;do{if(0===u.avail_out&&(u.output=new s.Buf8(h),u.next_out=0,u.avail_out=h),i=o.inflate(u,l.Z_NO_FLUSH),i===l.Z_BUF_ERROR&&b===!0&&(i=l.Z_OK,b=!1),i!==l.Z_STREAM_END&&i!==l.Z_OK)return this.onEnd(i),this.ended=!0,!1;u.next_out&&(0===u.avail_out||i===l.Z_STREAM_END||0===u.avail_in&&(n===l.Z_FINISH||n===l.Z_SYNC_FLUSH))&&(\"string\"===this.options.to?(a=f.utf8border(u.output,u.next_out),r=u.next_out-a,d=f.buf2string(u.output,a),u.next_out=r,u.avail_out=h-r,r&&s.arraySet(u.output,u.output,a,r,0),this.onData(d)):this.onData(s.shrinkBuf(u.output,u.next_out))),0===u.avail_in&&0===u.avail_out&&(b=!0)}while((u.avail_in>0||0===u.avail_out)&&i!==l.Z_STREAM_END);return i===l.Z_STREAM_END&&(n=l.Z_FINISH),n===l.Z_FINISH?(i=o.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===l.Z_OK):n===l.Z_SYNC_FLUSH?(this.onEnd(l.Z_OK),u.avail_out=0,!0):!0},n.prototype.onData=function(e){this.chunks.push(e)},n.prototype.onEnd=function(e){e===l.Z_OK&&(\"string\"===this.options.to?this.result=this.chunks.join(\"\"):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},i.Inflate=n,i.inflate=a,i.inflateRaw=r,i.ungzip=a},{\"./utils/common\":1,\"./utils/strings\":2,\"./zlib/constants\":4,\"./zlib/gzheader\":6,\"./zlib/inflate\":8,\"./zlib/messages\":10,\"./zlib/zstream\":11}]},{},[])(\"/lib/inflate.js\")});\n",
|
||
"import file_system = require('../core/file_system');\r\nimport {ApiError, ErrorCode} from '../core/api_error';\r\nimport file_flag = require('../core/file_flag');\r\nimport file = require('../core/file');\r\nimport Stats from '../core/node_fs_stats';\r\nimport preload_file = require('../generic/preload_file');\r\n\r\ninterface IAsyncOperation {\r\n\tapiMethod: string;\r\n\targuments: any[];\r\n}\r\n\r\n/**\r\n * We define our own file to interpose on syncSync() for mirroring purposes.\r\n */\r\nclass MirrorFile extends preload_file.PreloadFile<AsyncMirror> implements file.File {\r\n constructor(fs: AsyncMirror, path: string, flag: file_flag.FileFlag, stat: Stats, data: Buffer) {\r\n super(fs, path, flag, stat, data);\r\n }\r\n\r\n public syncSync(): void {\r\n if (this.isDirty()) {\r\n this._fs._syncSync(this);\r\n this.resetDirty();\r\n }\r\n }\r\n\r\n public closeSync(): void {\r\n this.syncSync();\r\n }\r\n}\r\n\r\n/**\r\n * AsyncMirrorFS mirrors a synchronous filesystem into an asynchronous filesystem\r\n * by:\r\n * * Performing operations over the in-memory copy, while asynchronously pipelining them\r\n * to the backing store.\r\n * * During application loading, the contents of the async file system can be reloaded into\r\n * the synchronous store, if desired.\r\n * The two stores will be kept in sync. The most common use-case is to pair a synchronous\r\n * in-memory filesystem with an asynchronous backing store.\r\n */\r\nexport default class AsyncMirror extends file_system.SynchronousFileSystem implements file_system.FileSystem {\r\n /**\r\n * Queue of pending asynchronous operations.\r\n */\r\n private _queue: IAsyncOperation[] = [];\r\n private _queueRunning: boolean = false;\r\n private _sync: file_system.FileSystem;\r\n private _async: file_system.FileSystem;\r\n private _isInitialized: boolean = false;\r\n private _initializeCallbacks: ((e?: ApiError) => void)[] = [];\r\n constructor(sync: file_system.FileSystem, async: file_system.FileSystem) {\r\n super();\r\n this._sync = sync;\r\n this._async = async;\r\n if (!sync.supportsSynch()) {\r\n throw new Error(\"Expected synchronous storage.\");\r\n }\r\n if (async.supportsSynch()) {\r\n throw new Error(\"Expected asynchronous storage.\");\r\n }\r\n }\r\n\r\n public getName(): string {\r\n\t \treturn \"AsyncMirror\";\r\n }\r\n\r\n public static isAvailable(): boolean {\r\n return true;\r\n }\r\n\r\n public _syncSync(fd: preload_file.PreloadFile<any>) {\r\n this._sync.writeFileSync(fd.getPath(), fd.getBuffer(), null, file_flag.FileFlag.getFileFlag('w'), fd.getStats().mode);\r\n this.enqueueOp({\r\n apiMethod: 'writeFile',\r\n arguments: [fd.getPath(), fd.getBuffer(), null, fd.getFlag(), fd.getStats().mode]\r\n });\r\n }\r\n\r\n /**\r\n * Called once to load up files from async storage into sync storage.\r\n */\r\n public initialize(userCb: (err?: ApiError) => void): void {\r\n const callbacks = this._initializeCallbacks;\r\n\r\n const end = (e?: ApiError): void => {\r\n this._isInitialized = !e;\r\n this._initializeCallbacks = [];\r\n callbacks.forEach((cb) => cb(e));\r\n };\r\n\r\n if (!this._isInitialized) {\r\n // First call triggers initialization, the rest wait.\r\n if (callbacks.push(userCb) === 1) {\r\n const copyDirectory = (p: string, mode: number, cb: (err?: ApiError) => void) => {\r\n if (p !== '/') {\r\n this._sync.mkdirSync(p, mode);\r\n }\r\n this._async.readdir(p, (err, files) => {\r\n if (err) {\r\n cb(err);\r\n } else {\r\n var i = 0;\r\n function copyNextFile(err?: ApiError) {\r\n if (err) {\r\n cb(err);\r\n } else if (i < files.length) {\r\n copyItem(`${p}/${files[i]}`, copyNextFile);\r\n i++;\r\n } else {\r\n cb();\r\n }\r\n }\r\n copyNextFile();\r\n }\r\n });\r\n }, copyFile = (p: string, mode: number, cb: (err?: ApiError) => void) => {\r\n this._async.readFile(p, null, file_flag.FileFlag.getFileFlag('r'), (err, data) => {\r\n if (err) {\r\n cb(err);\r\n } else {\r\n try {\r\n this._sync.writeFileSync(p, data, null, file_flag.FileFlag.getFileFlag('w'), mode);\r\n } catch (e) {\r\n err = e;\r\n } finally {\r\n cb(err);\r\n }\r\n }\r\n });\r\n }, copyItem = (p: string, cb: (err?: ApiError) => void) => {\r\n this._async.stat(p, false, (err, stats) => {\r\n if (err) {\r\n cb(err);\r\n } else if (stats.isDirectory()) {\r\n copyDirectory(p, stats.mode, cb);\r\n } else {\r\n copyFile(p, stats.mode, cb);\r\n }\r\n });\r\n };\r\n copyDirectory('/', 0, end);\r\n }\r\n } else {\r\n userCb();\r\n }\r\n }\r\n\r\n private checkInitialized(): void {\r\n if (!this._isInitialized) {\r\n throw new ApiError(ErrorCode.EPERM, \"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.\");\r\n }\r\n }\r\n\r\n public isReadOnly(): boolean { return false; }\r\n public supportsSynch(): boolean { return true; }\r\n public supportsLinks(): boolean { return false; }\r\n public supportsProps(): boolean { return this._sync.supportsProps() && this._async.supportsProps(); }\r\n\r\n private enqueueOp(op: IAsyncOperation) {\r\n this._queue.push(op);\r\n if (!this._queueRunning) {\r\n this._queueRunning = true;\r\n var doNextOp = (err?: ApiError) => {\r\n if (err) {\r\n console.error(`WARNING: File system has desynchronized. Received following error: ${err}\\n$`);\r\n }\r\n if (this._queue.length > 0) {\r\n var op = this._queue.shift(),\r\n args = op.arguments;\r\n args.push(doNextOp);\r\n (<Function> (<any> this._async)[op.apiMethod]).apply(this._async, args);\r\n } else {\r\n this._queueRunning = false;\r\n }\r\n };\r\n doNextOp();\r\n }\r\n }\r\n\r\n public renameSync(oldPath: string, newPath: string): void {\r\n this.checkInitialized();\r\n this._sync.renameSync(oldPath, newPath);\r\n this.enqueueOp({\r\n apiMethod: 'rename',\r\n arguments: [oldPath, newPath]\r\n });\r\n }\r\n public statSync(p: string, isLstat: boolean): Stats {\r\n this.checkInitialized();\r\n return this._sync.statSync(p, isLstat);\r\n }\r\n public openSync(p: string, flag: file_flag.FileFlag, mode: number): file.File {\r\n this.checkInitialized();\r\n // Sanity check: Is this open/close permitted?\r\n var fd = this._sync.openSync(p, flag, mode);\r\n fd.closeSync();\r\n return new MirrorFile(this, p, flag, this._sync.statSync(p, false), this._sync.readFileSync(p, null, file_flag.FileFlag.getFileFlag('r')));\r\n }\r\n public unlinkSync(p: string): void {\r\n this.checkInitialized();\r\n this._sync.unlinkSync(p);\r\n this.enqueueOp({\r\n apiMethod: 'unlink',\r\n arguments: [p]\r\n });\r\n }\r\n public rmdirSync(p: string): void {\r\n this.checkInitialized();\r\n this._sync.rmdirSync(p);\r\n this.enqueueOp({\r\n apiMethod: 'rmdir',\r\n arguments: [p]\r\n });\r\n }\r\n public mkdirSync(p: string, mode: number): void {\r\n this.checkInitialized();\r\n this._sync.mkdirSync(p, mode);\r\n this.enqueueOp({\r\n apiMethod: 'mkdir',\r\n arguments: [p, mode]\r\n });\r\n }\r\n public readdirSync(p: string): string[] {\r\n this.checkInitialized();\r\n return this._sync.readdirSync(p);\r\n }\r\n public existsSync(p: string): boolean {\r\n this.checkInitialized();\r\n return this._sync.existsSync(p);\r\n }\r\n public chmodSync(p: string, isLchmod: boolean, mode: number): void {\r\n this.checkInitialized();\r\n this._sync.chmodSync(p, isLchmod, mode);\r\n this.enqueueOp({\r\n apiMethod: 'chmod',\r\n arguments: [p, isLchmod, mode]\r\n });\r\n }\r\n public chownSync(p: string, isLchown: boolean, uid: number, gid: number): void {\r\n this.checkInitialized();\r\n this._sync.chownSync(p, isLchown, uid, gid);\r\n this.enqueueOp({\r\n apiMethod: 'chown',\r\n arguments: [p, isLchown, uid, gid]\r\n });\r\n }\r\n public utimesSync(p: string, atime: Date, mtime: Date): void {\r\n this.checkInitialized();\r\n this._sync.utimesSync(p, atime, mtime);\r\n this.enqueueOp({\r\n apiMethod: 'utimes',\r\n arguments: [p, atime, mtime]\r\n });\r\n }\r\n}\r\n",
|
||
"import preload_file = require('../generic/preload_file');\r\nimport file_system = require('../core/file_system');\r\nimport file_flag = require('../core/file_flag');\r\nimport {default as Stats, FileType} from '../core/node_fs_stats';\r\nimport {ApiError, ErrorCode} from '../core/api_error';\r\nimport file = require('../core/file');\r\nimport async = require('async');\r\nimport path = require('path');\r\nimport {arrayBuffer2Buffer, buffer2ArrayBuffer} from '../core/util';\r\n\r\nvar errorCodeLookup: {[dropboxErrorCode: number]: ErrorCode} = null;\r\n// Lazily construct error code lookup, since DropboxJS might be loaded *after* BrowserFS (or not at all!)\r\nfunction constructErrorCodeLookup() {\r\n if (errorCodeLookup !== null) {\r\n return;\r\n }\r\n errorCodeLookup = {};\r\n // This indicates a network transmission error on modern browsers. Internet Explorer might cause this code to be reported on some API server errors.\r\n errorCodeLookup[Dropbox.ApiError.NETWORK_ERROR] = ErrorCode.EIO;\r\n // This happens when the contentHash parameter passed to a Dropbox.Client#readdir or Dropbox.Client#stat matches the most recent content, so the API call response is omitted, to save bandwidth.\r\n // errorCodeLookup[Dropbox.ApiError.NO_CONTENT];\r\n // The error property on {Dropbox.ApiError#response} should indicate which input parameter is invalid and why.\r\n errorCodeLookup[Dropbox.ApiError.INVALID_PARAM] = ErrorCode.EINVAL;\r\n // The OAuth token used for the request will never become valid again, so the user should be re-authenticated.\r\n errorCodeLookup[Dropbox.ApiError.INVALID_TOKEN] = ErrorCode.EPERM;\r\n // This indicates a bug in dropbox.js and should never occur under normal circumstances.\r\n // ^ Actually, that's false. This occurs when you try to move folders to themselves, or move a file over another file.\r\n errorCodeLookup[Dropbox.ApiError.OAUTH_ERROR] = ErrorCode.EPERM;\r\n // This happens when trying to read from a non-existing file, readdir a non-existing directory, write a file into a non-existing directory, etc.\r\n errorCodeLookup[Dropbox.ApiError.NOT_FOUND] = ErrorCode.ENOENT;\r\n // This indicates a bug in dropbox.js and should never occur under normal circumstances.\r\n errorCodeLookup[Dropbox.ApiError.INVALID_METHOD] = ErrorCode.EINVAL;\r\n // This happens when a Dropbox.Client#readdir or Dropbox.Client#stat call would return more than a maximum amount of directory entries.\r\n errorCodeLookup[Dropbox.ApiError.NOT_ACCEPTABLE] = ErrorCode.EINVAL;\r\n // This is used by some backend methods to indicate that the client needs to download server-side changes and perform conflict resolution. Under normal usage, errors with this code should never surface to the code using dropbox.js.\r\n errorCodeLookup[Dropbox.ApiError.CONFLICT] = ErrorCode.EINVAL;\r\n // Status value indicating that the application is making too many requests.\r\n errorCodeLookup[Dropbox.ApiError.RATE_LIMITED] = ErrorCode.EBUSY;\r\n // The request should be retried after some time.\r\n errorCodeLookup[Dropbox.ApiError.SERVER_ERROR] = ErrorCode.EBUSY;\r\n // Status value indicating that the user's Dropbox is over its storage quota.\r\n errorCodeLookup[Dropbox.ApiError.OVER_QUOTA] = ErrorCode.ENOSPC;\r\n}\r\n\r\ninterface ICachedPathInfo {\r\n stat: Dropbox.File.Stat;\r\n}\r\n\r\ninterface ICachedFileInfo extends ICachedPathInfo {\r\n contents: ArrayBuffer;\r\n}\r\n\r\nfunction isFileInfo(cache: ICachedPathInfo): cache is ICachedFileInfo {\r\n return cache && cache.stat.isFile;\r\n}\r\n\r\ninterface ICachedDirInfo extends ICachedPathInfo {\r\n contents: string[];\r\n}\r\n\r\nfunction isDirInfo(cache: ICachedPathInfo): cache is ICachedDirInfo {\r\n return cache && cache.stat.isFolder;\r\n}\r\n\r\nfunction isArrayBuffer(ab: any): ab is ArrayBuffer {\r\n // Accept null / undefined, too.\r\n return ab === null || ab === undefined || (typeof(ab) === 'object' && typeof(ab['byteLength']) === 'number');\r\n}\r\n\r\n/**\r\n * Wraps a Dropbox client and caches operations.\r\n */\r\nclass CachedDropboxClient {\r\n private _cache: {[path: string]: ICachedPathInfo} = {};\r\n private _client: Dropbox.Client;\r\n\r\n constructor(client: Dropbox.Client) {\r\n this._client = client;\r\n }\r\n\r\n private getCachedInfo(p: string): ICachedPathInfo {\r\n return this._cache[p.toLowerCase()];\r\n }\r\n\r\n private putCachedInfo(p: string, cache: ICachedPathInfo): void {\r\n this._cache[p.toLowerCase()] = cache;\r\n }\r\n\r\n private deleteCachedInfo(p: string): void {\r\n delete this._cache[p.toLowerCase()];\r\n }\r\n\r\n private getCachedDirInfo(p: string): ICachedDirInfo {\r\n var info = this.getCachedInfo(p);\r\n if (isDirInfo(info)) {\r\n return info;\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n private getCachedFileInfo(p: string): ICachedFileInfo {\r\n var info = this.getCachedInfo(p);\r\n if (isFileInfo(info)) {\r\n return info;\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n private updateCachedDirInfo(p: string, stat: Dropbox.File.Stat, contents: string[] = null): void {\r\n var cachedInfo = this.getCachedInfo(p);\r\n // Dropbox uses the *contentHash* property for directories.\r\n // Ignore stat objects w/o a contentHash defined; those actually exist!!!\r\n // (Example: readdir returns an array of stat objs; stat objs for dirs in that context have no contentHash)\r\n if (stat.contentHash !== null && (cachedInfo === undefined || cachedInfo.stat.contentHash !== stat.contentHash)) {\r\n this.putCachedInfo(p, <ICachedDirInfo> {\r\n stat: stat,\r\n contents: contents\r\n });\r\n }\r\n }\r\n\r\n private updateCachedFileInfo(p: string, stat: Dropbox.File.Stat, contents: ArrayBuffer = null): void {\r\n var cachedInfo = this.getCachedInfo(p);\r\n // Dropbox uses the *versionTag* property for files.\r\n // Ignore stat objects w/o a versionTag defined.\r\n if (stat.versionTag !== null && (cachedInfo === undefined || cachedInfo.stat.versionTag !== stat.versionTag)) {\r\n this.putCachedInfo(p, <ICachedFileInfo> {\r\n stat: stat,\r\n contents: contents\r\n });\r\n }\r\n }\r\n\r\n private updateCachedInfo(p: string, stat: Dropbox.File.Stat, contents: ArrayBuffer | string[] = null): void {\r\n if (stat.isFile && isArrayBuffer(contents)) {\r\n this.updateCachedFileInfo(p, stat, contents);\r\n } else if (stat.isFolder && Array.isArray(contents)) {\r\n this.updateCachedDirInfo(p, stat, contents);\r\n }\r\n }\r\n\r\n public readdir(p: string, cb: (error: Dropbox.ApiError, contents?: string[]) => void): void {\r\n var cacheInfo = this.getCachedDirInfo(p);\r\n\r\n this._wrap((interceptCb) => {\r\n if (cacheInfo !== null && cacheInfo.contents) {\r\n this._client.readdir(p, {\r\n contentHash: cacheInfo.stat.contentHash\r\n }, interceptCb);\r\n } else {\r\n this._client.readdir(p, interceptCb);\r\n }\r\n }, (err: Dropbox.ApiError, filenames: string[], stat: Dropbox.File.Stat, folderEntries: Dropbox.File.Stat[]) => {\r\n if (err) {\r\n if (err.status === Dropbox.ApiError.NO_CONTENT && cacheInfo !== null) {\r\n cb(null, cacheInfo.contents.slice(0));\r\n } else {\r\n cb(err);\r\n }\r\n } else {\r\n this.updateCachedDirInfo(p, stat, filenames.slice(0));\r\n folderEntries.forEach((entry) => {\r\n this.updateCachedInfo(path.join(p, entry.name), entry);\r\n });\r\n cb(null, filenames);\r\n }\r\n });\r\n }\r\n\r\n public remove(p: string, cb: (error?: Dropbox.ApiError) => void): void {\r\n this._wrap((interceptCb) => {\r\n this._client.remove(p, interceptCb);\r\n }, (err: Dropbox.ApiError, stat?: Dropbox.File.Stat) => {\r\n if (!err) {\r\n this.updateCachedInfo(p, stat);\r\n }\r\n cb(err);\r\n });\r\n }\r\n\r\n public move(src: string, dest: string, cb: (error?: Dropbox.ApiError) => void): void {\r\n this._wrap((interceptCb) => {\r\n this._client.move(src, dest, interceptCb);\r\n }, (err: Dropbox.ApiError, stat: Dropbox.File.Stat) => {\r\n if (!err) {\r\n this.deleteCachedInfo(src);\r\n this.updateCachedInfo(dest, stat);\r\n }\r\n cb(err);\r\n });\r\n }\r\n\r\n public stat(p: string, cb: (error: Dropbox.ApiError, stat?: Dropbox.File.Stat) => void): void {\r\n this._wrap((interceptCb) => {\r\n this._client.stat(p, interceptCb);\r\n }, (err: Dropbox.ApiError, stat: Dropbox.File.Stat) => {\r\n if (!err) {\r\n this.updateCachedInfo(p, stat);\r\n }\r\n cb(err, stat);\r\n });\r\n }\r\n\r\n public readFile(p: string, cb: (error: Dropbox.ApiError, file?: ArrayBuffer, stat?: Dropbox.File.Stat) => void): void {\r\n var cacheInfo = this.getCachedFileInfo(p);\r\n if (cacheInfo !== null && cacheInfo.contents !== null) {\r\n // Try to use cached info; issue a stat to see if contents are up-to-date.\r\n this.stat(p, (error, stat?) => {\r\n if (error) {\r\n cb(error);\r\n } else if (stat.contentHash === cacheInfo.stat.contentHash) {\r\n // No file changes.\r\n cb(error, cacheInfo.contents.slice(0), cacheInfo.stat);\r\n } else {\r\n // File changes; rerun to trigger actual readFile.\r\n this.readFile(p, cb);\r\n }\r\n });\r\n } else {\r\n this._wrap((interceptCb) => {\r\n this._client.readFile(p, { arrayBuffer: true }, interceptCb);\r\n }, (err: Dropbox.ApiError, contents: any, stat: Dropbox.File.Stat) => {\r\n if (!err) {\r\n this.updateCachedInfo(p, stat, contents.slice(0));\r\n }\r\n cb(err, contents, stat);\r\n });\r\n }\r\n }\r\n\r\n public writeFile(p: string, contents: ArrayBuffer, cb: (error: Dropbox.ApiError, stat?: Dropbox.File.Stat) => void): void {\r\n this._wrap((interceptCb) => {\r\n this._client.writeFile(p, contents, interceptCb);\r\n },(err: Dropbox.ApiError, stat: Dropbox.File.Stat) => {\r\n if (!err) {\r\n this.updateCachedInfo(p, stat, contents.slice(0));\r\n }\r\n cb(err, stat);\r\n });\r\n }\r\n\r\n public mkdir(p: string, cb: (error?: Dropbox.ApiError) => void): void {\r\n this._wrap((interceptCb) => {\r\n this._client.mkdir(p, interceptCb);\r\n }, (err: Dropbox.ApiError, stat: Dropbox.File.Stat) => {\r\n if (!err) {\r\n this.updateCachedInfo(p, stat, []);\r\n }\r\n cb(err);\r\n });\r\n }\r\n\r\n /**\r\n * Wraps an operation such that we retry a failed operation 3 times.\r\n * Necessary to deal with Dropbox rate limiting.\r\n *\r\n * @param performOp Function that performs the operation. Will be called up to three times.\r\n * @param cb Called when the operation succeeds, fails in a non-temporary manner, or fails three times.\r\n */\r\n private _wrap(performOp: (interceptCb: (error: Dropbox.ApiError) => void) => void, cb: Function): void {\r\n var numRun = 0,\r\n interceptCb = function (error: Dropbox.ApiError): void {\r\n // Timeout duration, in seconds.\r\n var timeoutDuration: number = 2;\r\n if (error && 3 > (++numRun)) {\r\n switch(error.status) {\r\n case Dropbox.ApiError.SERVER_ERROR:\r\n case Dropbox.ApiError.NETWORK_ERROR:\r\n case Dropbox.ApiError.RATE_LIMITED:\r\n setTimeout(() => {\r\n performOp(interceptCb);\r\n }, timeoutDuration * 1000);\r\n break;\r\n default:\r\n cb.apply(null, arguments);\r\n break;\r\n }\r\n } else {\r\n cb.apply(null, arguments);\r\n }\r\n };\r\n\r\n performOp(interceptCb);\r\n }\r\n}\r\n\r\nexport class DropboxFile extends preload_file.PreloadFile<DropboxFileSystem> implements file.File {\r\n constructor(_fs: DropboxFileSystem, _path: string, _flag: file_flag.FileFlag, _stat: Stats, contents?: NodeBuffer) {\r\n super(_fs, _path, _flag, _stat, contents)\r\n }\r\n\r\n public sync(cb: (e?: ApiError) => void): void {\r\n if (this.isDirty()) {\r\n var buffer = this.getBuffer(),\r\n arrayBuffer = buffer2ArrayBuffer(buffer);\r\n this._fs._writeFileStrict(this.getPath(), arrayBuffer, (e?: ApiError) => {\r\n if (!e) {\r\n this.resetDirty();\r\n }\r\n cb(e);\r\n });\r\n } else {\r\n cb();\r\n }\r\n }\r\n\r\n public close(cb: (e?: ApiError) => void): void {\r\n this.sync(cb);\r\n }\r\n}\r\n\r\nexport default class DropboxFileSystem extends file_system.BaseFileSystem implements file_system.FileSystem {\r\n // The Dropbox client.\r\n private _client: CachedDropboxClient;\r\n\r\n /**\r\n * Arguments: an authenticated Dropbox.js client\r\n */\r\n constructor(client: Dropbox.Client) {\r\n super();\r\n this._client = new CachedDropboxClient(client);\r\n constructErrorCodeLookup();\r\n }\r\n\r\n public getName(): string {\r\n return 'Dropbox';\r\n }\r\n\r\n public static isAvailable(): boolean {\r\n // Checks if the Dropbox library is loaded.\r\n return typeof Dropbox !== 'undefined';\r\n }\r\n\r\n public isReadOnly(): boolean {\r\n return false;\r\n }\r\n\r\n // Dropbox doesn't support symlinks, properties, or synchronous calls\r\n\r\n public supportsSymlinks(): boolean {\r\n return false;\r\n }\r\n\r\n public supportsProps(): boolean {\r\n return false;\r\n }\r\n\r\n public supportsSynch(): boolean {\r\n return false;\r\n }\r\n\r\n public empty(mainCb: (e?: ApiError) => void): void {\r\n this._client.readdir('/', (error, files) => {\r\n if (error) {\r\n mainCb(this.convert(error, '/'));\r\n } else {\r\n var deleteFile = (file: string, cb: (err?: ApiError) => void) => {\r\n var p = path.join('/', file);\r\n this._client.remove(p, (err) => {\r\n cb(err ? this.convert(err, p) : null);\r\n });\r\n };\r\n var finished = (err?: ApiError) => {\r\n if (err) {\r\n mainCb(err);\r\n } else {\r\n mainCb();\r\n }\r\n };\r\n // XXX: <any> typing is to get around overly-restrictive ErrorCallback typing.\r\n async.each(files, <any> deleteFile, <any> finished);\r\n }\r\n });\r\n }\r\n\r\n public rename(oldPath: string, newPath: string, cb: (e?: ApiError) => void): void {\r\n this._client.move(oldPath, newPath, (error) => {\r\n if (error) {\r\n // the move is permitted if newPath is a file.\r\n // Check if this is the case, and remove if so.\r\n this._client.stat(newPath, (error2, stat) => {\r\n if (error2 || stat.isFolder) {\r\n var missingPath = (<any> error.response).error.indexOf(oldPath) > -1 ? oldPath : newPath;\r\n cb(this.convert(error, missingPath));\r\n } else {\r\n // Delete file, repeat rename.\r\n this._client.remove(newPath, (error2) => {\r\n if (error2) {\r\n cb(this.convert(error2, newPath));\r\n } else {\r\n this.rename(oldPath, newPath, cb);\r\n }\r\n });\r\n }\r\n });\r\n } else {\r\n cb();\r\n }\r\n });\r\n }\r\n\r\n public stat(path: string, isLstat: boolean, cb: (err: ApiError, stat?: Stats) => void): void {\r\n // Ignore lstat case -- Dropbox doesn't support symlinks\r\n // Stat the file\r\n this._client.stat(path, (error, stat) => {\r\n if (error) {\r\n cb(this.convert(error, path));\r\n } else if ((stat != null) && stat.isRemoved) {\r\n // Dropbox keeps track of deleted files, so if a file has existed in the\r\n // past but doesn't any longer, you wont get an error\r\n cb(ApiError.FileError(ErrorCode.ENOENT, path));\r\n } else {\r\n var stats = new Stats(this._statType(stat), stat.size);\r\n return cb(null, stats);\r\n }\r\n });\r\n }\r\n\r\n public open(path: string, flags: file_flag.FileFlag, mode: number, cb: (err: ApiError, fd?: file.File) => any): void {\r\n // Try and get the file's contents\r\n this._client.readFile(path, (error, content, dbStat) => {\r\n if (error) {\r\n // If the file's being opened for reading and doesn't exist, return an\r\n // error\r\n if (flags.isReadable()) {\r\n cb(this.convert(error, path));\r\n } else {\r\n switch (error.status) {\r\n // If it's being opened for writing or appending, create it so that\r\n // it can be written to\r\n case Dropbox.ApiError.NOT_FOUND:\r\n var ab = new ArrayBuffer(0);\r\n return this._writeFileStrict(path, ab, (error2: ApiError, stat?: Dropbox.File.Stat) => {\r\n if (error2) {\r\n cb(error2);\r\n } else {\r\n var file = this._makeFile(path, flags, stat, arrayBuffer2Buffer(ab));\r\n cb(null, file);\r\n }\r\n });\r\n default:\r\n return cb(this.convert(error, path));\r\n }\r\n }\r\n } else {\r\n // No error\r\n var buffer: Buffer;\r\n // Dropbox.js seems to set `content` to `null` rather than to an empty\r\n // buffer when reading an empty file. Not sure why this is.\r\n if (content === null) {\r\n buffer = new Buffer(0);\r\n } else {\r\n buffer = arrayBuffer2Buffer(content);\r\n }\r\n var file = this._makeFile(path, flags, dbStat, buffer);\r\n return cb(null, file);\r\n }\r\n });\r\n }\r\n\r\n public _writeFileStrict(p: string, data: ArrayBuffer, cb: (e: ApiError, stat?: Dropbox.File.Stat) => void): void {\r\n var parent = path.dirname(p);\r\n this.stat(parent, false, (error: ApiError, stat?: Stats): void => {\r\n if (error) {\r\n cb(ApiError.FileError(ErrorCode.ENOENT, parent));\r\n } else {\r\n this._client.writeFile(p, data, (error2, stat) => {\r\n if (error2) {\r\n cb(this.convert(error2, p));\r\n } else {\r\n cb(null, stat);\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Private\r\n * Returns a BrowserFS object representing the type of a Dropbox.js stat object\r\n */\r\n public _statType(stat: Dropbox.File.Stat): FileType {\r\n return stat.isFile ? FileType.FILE : FileType.DIRECTORY;\r\n }\r\n\r\n /**\r\n * Private\r\n * Returns a BrowserFS object representing a File, created from the data\r\n * returned by calls to the Dropbox API.\r\n */\r\n public _makeFile(path: string, flag: file_flag.FileFlag, stat: Dropbox.File.Stat, buffer: NodeBuffer): DropboxFile {\r\n var type = this._statType(stat);\r\n var stats = new Stats(type, stat.size);\r\n return new DropboxFile(this, path, flag, stats, buffer);\r\n }\r\n\r\n /**\r\n * Private\r\n * Delete a file or directory from Dropbox\r\n * isFile should reflect which call was made to remove the it (`unlink` or\r\n * `rmdir`). If this doesn't match what's actually at `path`, an error will be\r\n * returned\r\n */\r\n public _remove(path: string, cb: (e?: ApiError) => void, isFile: boolean): void {\r\n this._client.stat(path, (error, stat) => {\r\n if (error) {\r\n cb(this.convert(error, path));\r\n } else {\r\n if (stat.isFile && !isFile) {\r\n cb(ApiError.FileError(ErrorCode.ENOTDIR, path));\r\n } else if (!stat.isFile && isFile) {\r\n cb(ApiError.FileError(ErrorCode.EISDIR, path));\r\n } else {\r\n this._client.remove(path, (error) => {\r\n if (error) {\r\n cb(this.convert(error, path));\r\n } else {\r\n cb(null);\r\n }\r\n });\r\n }\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Delete a file\r\n */\r\n public unlink(path: string, cb: (e?: ApiError) => void): void {\r\n this._remove(path, cb, true);\r\n }\r\n\r\n /**\r\n * Delete a directory\r\n */\r\n public rmdir(path: string, cb: (e?: ApiError) => void): void {\r\n this._remove(path, cb, false);\r\n }\r\n\r\n /**\r\n * Create a directory\r\n */\r\n public mkdir(p: string, mode: number, cb: (e?: ApiError) => void): void {\r\n // Dropbox.js' client.mkdir() behaves like `mkdir -p`, i.e. it creates a\r\n // directory and all its ancestors if they don't exist.\r\n // Node's fs.mkdir() behaves like `mkdir`, i.e. it throws an error if an attempt\r\n // is made to create a directory without a parent.\r\n // To handle this inconsistency, a check for the existence of `path`'s parent\r\n // must be performed before it is created, and an error thrown if it does\r\n // not exist\r\n var parent = path.dirname(p);\r\n this._client.stat(parent, (error, stat) => {\r\n if (error) {\r\n cb(this.convert(error, parent));\r\n } else {\r\n this._client.mkdir(p, (error) => {\r\n if (error) {\r\n cb(ApiError.FileError(ErrorCode.EEXIST, p));\r\n } else {\r\n cb(null);\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Get the names of the files in a directory\r\n */\r\n public readdir(path: string, cb: (err: ApiError, files?: string[]) => void): void {\r\n this._client.readdir(path, (error, files) => {\r\n if (error) {\r\n return cb(this.convert(error));\r\n } else {\r\n return cb(null, files);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Converts a Dropbox-JS error into a BFS error.\r\n */\r\n public convert(err: Dropbox.ApiError, path: string = null): ApiError {\r\n var errorCode = errorCodeLookup[err.status];\r\n if (errorCode === undefined) {\r\n errorCode = ErrorCode.EIO;\r\n }\r\n\r\n if (path == null) {\r\n return new ApiError(errorCode);\r\n } else {\r\n return ApiError.FileError(errorCode, path);\r\n }\r\n }\r\n}\r\n",
|
||
"import {BaseFileSystem, FileSystem} from '../core/file_system';\r\nimport path = require('path');\r\nimport {ApiError} from '../core/api_error';\r\n\r\n/**\r\n * The FolderAdapter file system wraps a file system, and scopes all interactions to a subfolder of that file system.\r\n */\r\nexport default class FolderAdapter extends BaseFileSystem implements FileSystem {\r\n private _wrapped: FileSystem;\r\n private _folder: string;\r\n constructor(folder: string, wrapped: FileSystem) {\r\n super();\r\n this._folder = folder;\r\n this._wrapped = wrapped;\r\n }\r\n\r\n /**\r\n * Initialize the file system. Ensures that the wrapped file system\r\n * has the given folder.\r\n */\r\n public initialize(cb: (e?: ApiError) => void) {\r\n this._wrapped.exists(this._folder, (exists: boolean) => {\r\n if (exists) {\r\n cb();\r\n } else if (this._wrapped.isReadOnly()) {\r\n cb(ApiError.ENOENT(this._folder));\r\n } else {\r\n this._wrapped.mkdir(this._folder, 0x1ff, cb);\r\n }\r\n });\r\n }\r\n\r\n public getName(): string { return this._wrapped.getName(); }\r\n public isReadOnly(): boolean { return this._wrapped.isReadOnly(); }\r\n public supportsProps(): boolean { return this._wrapped.supportsProps(); }\r\n public supportsSynch(): boolean { return this._wrapped.supportsSynch(); }\r\n public supportsLinks(): boolean { return false; }\r\n\r\n public static isAvailable(): boolean {\r\n return true;\r\n }\r\n}\r\n\r\nfunction translateError(folder: string, e: any): any {\r\n if (e !== null && typeof e === 'object') {\r\n let err = <ApiError> e;\r\n let p = err.path;\r\n if (p) {\r\n p = '/' + path.relative(folder, p);\r\n err.message = err.message.replace(err.path, p);\r\n err.path = p;\r\n }\r\n }\r\n return e;\r\n}\r\n\r\nfunction wrapCallback(folder: string, cb: any): any {\r\n if (typeof cb === 'function') {\r\n return function(err) {\r\n if (arguments.length > 0) {\r\n arguments[0] = translateError(folder, err);\r\n }\r\n (<Function> cb).apply(null, arguments);\r\n };\r\n } else {\r\n return cb;\r\n }\r\n}\r\n\r\nfunction wrapFunction(name: string, wrapFirst: boolean, wrapSecond: boolean): Function {\r\n if (name.slice(name.length - 4) !== 'Sync') {\r\n // Async function. Translate error in callback.\r\n return function() {\r\n if (arguments.length > 0) {\r\n if (wrapFirst) {\r\n arguments[0] = path.join(this._folder, arguments[0]);\r\n }\r\n if (wrapSecond) {\r\n arguments[1] = path.join(this._folder, arguments[1]);\r\n }\r\n arguments[arguments.length - 1] = wrapCallback(this._folder, arguments[arguments.length - 1]);\r\n }\r\n return this._wrapped[name].apply(this._wrapped, arguments);\r\n };\r\n } else {\r\n // Sync function. Translate error in catch.\r\n return function() {\r\n try {\r\n if (wrapFirst) {\r\n arguments[0] = path.join(this._folder, arguments[0]);\r\n }\r\n if (wrapSecond) {\r\n arguments[1] = path.join(this._folder, arguments[1]);\r\n }\r\n return this._wrapped[name].apply(this._wrapped, arguments);\r\n } catch (e) {\r\n throw translateError(this._folder, e);\r\n }\r\n };\r\n }\r\n}\r\n\r\n// First argument is a path.\r\n['diskSpace', 'stat', 'statSync', 'open', 'openSync', 'unlink', 'unlinkSync',\r\n 'rmdir', 'rmdirSync' ,'mkdir', 'mkdirSync', 'readdir', 'readdirSync', 'exists',\r\n 'existsSync', 'realpath', 'realpathSync', 'truncate', 'truncateSync', 'readFile',\r\n 'readFileSync', 'writeFile', 'writeFileSync', 'appendFile', 'appendFileSync',\r\n 'chmod', 'chmodSync', 'chown', 'chownSync', 'utimes', 'utimeSync', 'readlink',\r\n 'readlinkSync'].forEach((name: string) => {\r\n FolderAdapter.prototype[name] = wrapFunction(name, true, false);\r\n});\r\n\r\n// First and second arguments are paths.\r\n['rename', 'renameSync', 'link', 'linkSync', 'symlink', 'symlinkSync'].forEach((name: string) => {\r\n FolderAdapter.prototype[name] = wrapFunction(name, true, true);\r\n});\r\n",
|
||
"import preload_file = require('../generic/preload_file');\r\nimport file_system = require('../core/file_system');\r\nimport {ApiError, ErrorCode} from '../core/api_error';\r\nimport {FileFlag, ActionType} from '../core/file_flag';\r\nimport {default as Stats, FileType} from '../core/node_fs_stats';\r\nimport file = require('../core/file');\r\nimport path = require('path');\r\nimport global = require('../core/global');\r\nimport async = require('async');\r\nimport {buffer2ArrayBuffer, arrayBuffer2Buffer} from '../core/util';\r\n\r\nfunction isDirectoryEntry(entry: Entry): entry is DirectoryEntry {\r\n return entry.isDirectory;\r\n}\r\n\r\nvar _getFS: (type:number, size:number, successCallback: FileSystemCallback, errorCallback?: ErrorCallback) => void = global.webkitRequestFileSystem || global.requestFileSystem || null;\r\n\r\nfunction _requestQuota(type: number, size: number, success: (size: number) => void, errorCallback: ErrorCallback) {\r\n // We cast navigator and window to '<any>' because everything here is\r\n // nonstandard functionality, despite the fact that Chrome has the only\r\n // implementation of the HTML5FS and is likely driving the standardization\r\n // process. Thus, these objects defined off of navigator and window are not\r\n // present in the DefinitelyTyped TypeScript typings for FileSystem.\r\n if (typeof (<any> navigator)['webkitPersistentStorage'] !== 'undefined') {\r\n switch(type) {\r\n case global.PERSISTENT:\r\n (<any> navigator).webkitPersistentStorage.requestQuota(size, success, errorCallback);\r\n break;\r\n case global.TEMPORARY:\r\n (<any> navigator).webkitTemporaryStorage.requestQuota(size, success, errorCallback);\r\n break\r\n default:\r\n errorCallback(new TypeError(`Invalid storage type: ${type}`));\r\n break;\r\n }\r\n } else {\r\n (<any> global).webkitStorageInfo.requestQuota(type, size, success, errorCallback);\r\n }\r\n}\r\n\r\nfunction _toArray(list?: any[]): any[] {\r\n return Array.prototype.slice.call(list || [], 0);\r\n}\r\n\r\n// A note about getFile and getDirectory options:\r\n// These methods are called at numerous places in this file, and are passed\r\n// some combination of these two options:\r\n// - create: If true, the entry will be created if it doesn't exist.\r\n// If false, an error will be thrown if it doesn't exist.\r\n// - exclusive: If true, only create the entry if it doesn't already exist,\r\n// and throw an error if it does.\r\n\r\nexport class HTML5FSFile extends preload_file.PreloadFile<HTML5FS> implements file.File {\r\n constructor(_fs: HTML5FS, _path: string, _flag: FileFlag, _stat: Stats, contents?: NodeBuffer) {\r\n super(_fs, _path, _flag, _stat, contents);\r\n }\r\n\r\n public sync(cb: (e?: ApiError) => void): void {\r\n if (this.isDirty()) {\r\n // Don't create the file (it should already have been created by `open`)\r\n var opts = {\r\n create: false\r\n };\r\n var _fs = this._fs;\r\n var success: FileEntryCallback = (entry) => {\r\n entry.createWriter((writer) => {\r\n var buffer = this.getBuffer();\r\n var blob = new Blob([buffer2ArrayBuffer(buffer)]);\r\n var length = blob.size;\r\n writer.onwriteend = () => {\r\n writer.onwriteend = null;\r\n writer.truncate(length);\r\n this.resetDirty();\r\n cb();\r\n };\r\n writer.onerror = (err: DOMError) => {\r\n cb(_fs.convert(err, this.getPath(), false));\r\n };\r\n writer.write(blob);\r\n });\r\n };\r\n var error = (err: DOMError) => {\r\n cb(_fs.convert(err, this.getPath(), false));\r\n };\r\n _fs.fs.root.getFile(this.getPath(), opts, success, error);\r\n } else {\r\n cb();\r\n }\r\n }\r\n\r\n public close(cb: (e?: ApiError) => void): void {\r\n this.sync(cb);\r\n }\r\n}\r\n\r\nexport default class HTML5FS extends file_system.BaseFileSystem implements file_system.FileSystem {\r\n private size: number;\r\n private type: number;\r\n // HTML5File reaches into HTML5FS. :/\r\n public fs: FileSystem;\r\n /**\r\n * Arguments:\r\n * - type: PERSISTENT or TEMPORARY\r\n * - size: storage quota to request, in megabytes. Allocated value may be less.\r\n */\r\n constructor(size: number = 5, type: number = global.PERSISTENT) {\r\n super();\r\n // Convert MB to bytes.\r\n this.size = 1024 * 1024 * size;\r\n this.type = type;\r\n }\r\n\r\n public getName(): string {\r\n return 'HTML5 FileSystem';\r\n }\r\n\r\n public static isAvailable(): boolean {\r\n return _getFS != null;\r\n }\r\n\r\n public isReadOnly(): boolean {\r\n return false;\r\n }\r\n\r\n public supportsSymlinks(): boolean {\r\n return false;\r\n }\r\n\r\n public supportsProps(): boolean {\r\n return false;\r\n }\r\n\r\n public supportsSynch(): boolean {\r\n return false;\r\n }\r\n\r\n /**\r\n * Converts the given DOMError into an appropriate ApiError.\r\n * Full list of values here:\r\n * https://developer.mozilla.org/en-US/docs/Web/API/DOMError\r\n */\r\n public convert(err: DOMError, p: string, expectedDir: boolean): ApiError {\r\n switch (err.name) {\r\n /* The user agent failed to create a file or directory due to the existence of a file or\r\n directory with the same path. */\r\n case \"PathExistsError\":\r\n return ApiError.EEXIST(p);\r\n /* The operation failed because it would cause the application to exceed its storage quota. */\r\n case 'QuotaExceededError':\r\n return ApiError.FileError(ErrorCode.ENOSPC, p);\r\n /* A required file or directory could not be found at the time an operation was processed. */\r\n case 'NotFoundError':\r\n return ApiError.ENOENT(p);\r\n /* This is a security error code to be used in situations not covered by any other error codes.\r\n - A required file was unsafe for access within a Web application\r\n - Too many calls are being made on filesystem resources */\r\n case 'SecurityError':\r\n return ApiError.FileError(ErrorCode.EACCES, p);\r\n /* The modification requested was illegal. Examples of invalid modifications include moving a\r\n directory into its own child, moving a file into its parent directory without changing its name,\r\n or copying a directory to a path occupied by a file. */\r\n case 'InvalidModificationError':\r\n return ApiError.FileError(ErrorCode.EPERM, p);\r\n /* The user has attempted to look up a file or directory, but the Entry found is of the wrong type\r\n [e.g. is a DirectoryEntry when the user requested a FileEntry]. */\r\n case 'TypeMismatchError':\r\n return ApiError.FileError(expectedDir ? ErrorCode.ENOTDIR : ErrorCode.EISDIR, p);\r\n /* A path or URL supplied to the API was malformed. */\r\n case \"EncodingError\":\r\n /* An operation depended on state cached in an interface object, but that state that has changed\r\n since it was read from disk. */\r\n case \"InvalidStateError\":\r\n /* The user attempted to write to a file or directory which could not be modified due to the state\r\n of the underlying filesystem. */\r\n case \"NoModificationAllowedError\":\r\n default:\r\n return ApiError.FileError(ErrorCode.EINVAL, p);\r\n }\r\n }\r\n\r\n /**\r\n * Nonstandard\r\n * Requests a storage quota from the browser to back this FS.\r\n */\r\n public allocate(cb: (e?: ApiError) => void = function(){}): void {\r\n var success = (fs: FileSystem): void => {\r\n this.fs = fs;\r\n cb()\r\n };\r\n var error = (err: DOMException): void => {\r\n cb(this.convert(err, \"/\", true));\r\n };\r\n if (this.type === global.PERSISTENT) {\r\n _requestQuota(this.type, this.size, (granted: number) => {\r\n _getFS(this.type, granted, success, error);\r\n }, error);\r\n } else {\r\n _getFS(this.type, this.size, success, error);\r\n }\r\n }\r\n\r\n /**\r\n * Nonstandard\r\n * Deletes everything in the FS. Used for testing.\r\n * Karma clears the storage after you quit it but not between runs of the test\r\n * suite, and the tests expect an empty FS every time.\r\n */\r\n public empty(mainCb: (e?: ApiError) => void): void {\r\n // Get a list of all entries in the root directory to delete them\r\n this._readdir('/', (err: ApiError, entries?: Entry[]): void => {\r\n if (err) {\r\n console.error('Failed to empty FS');\r\n mainCb(err);\r\n } else {\r\n // Called when every entry has been operated on\r\n var finished = (er: any): void => {\r\n if (err) {\r\n console.error(\"Failed to empty FS\");\r\n mainCb(err);\r\n } else {\r\n mainCb();\r\n }\r\n };\r\n // Removes files and recursively removes directories\r\n var deleteEntry = (entry: Entry, cb: (e?: any) => void): void => {\r\n var succ = () => {\r\n cb();\r\n };\r\n var error = (err: DOMException) => {\r\n cb(this.convert(err, entry.fullPath, !entry.isDirectory));\r\n };\r\n if (isDirectoryEntry(entry)) {\r\n entry.removeRecursively(succ, error);\r\n } else {\r\n entry.remove(succ, error);\r\n }\r\n };\r\n // Loop through the entries and remove them, then call the callback\r\n // when they're all finished.\r\n async.each(entries, deleteEntry, finished);\r\n }\r\n });\r\n }\r\n\r\n public rename(oldPath: string, newPath: string, cb: (e?: ApiError) => void): void {\r\n var semaphore: number = 2,\r\n successCount: number = 0,\r\n root: DirectoryEntry = this.fs.root,\r\n currentPath: string = oldPath,\r\n error = (err: DOMException): void => {\r\n if (--semaphore <= 0) {\r\n cb(this.convert(err, currentPath, false));\r\n }\r\n },\r\n success = (file: Entry): void => {\r\n if (++successCount === 2) {\r\n return cb(new ApiError(ErrorCode.EINVAL, \"Something was identified as both a file and a directory. This should never happen.\"));\r\n }\r\n\r\n // SPECIAL CASE: If newPath === oldPath, and the path exists, then\r\n // this operation trivially succeeds.\r\n if (oldPath === newPath) {\r\n return cb();\r\n }\r\n\r\n // Get the new parent directory.\r\n currentPath = path.dirname(newPath);\r\n root.getDirectory(currentPath, {}, (parentDir: DirectoryEntry): void => {\r\n currentPath = path.basename(newPath);\r\n file.moveTo(parentDir, currentPath, (entry: Entry): void => { cb(); }, (err: DOMException): void => {\r\n // SPECIAL CASE: If oldPath is a directory, and newPath is a\r\n // file, rename should delete the file and perform the move.\r\n if (file.isDirectory) {\r\n currentPath = newPath;\r\n // Unlink only works on files. Try to delete newPath.\r\n this.unlink(newPath, (e?): void => {\r\n if (e) {\r\n // newPath is probably a directory.\r\n error(err);\r\n } else {\r\n // Recur, now that newPath doesn't exist.\r\n this.rename(oldPath, newPath, cb);\r\n }\r\n });\r\n } else {\r\n error(err);\r\n }\r\n });\r\n }, error);\r\n };\r\n\r\n // We don't know if oldPath is a *file* or a *directory*, and there's no\r\n // way to stat items. So launch both requests, see which one succeeds.\r\n root.getFile(oldPath, {}, success, error);\r\n root.getDirectory(oldPath, {}, success, error);\r\n }\r\n\r\n public stat(path: string, isLstat: boolean, cb: (err: ApiError, stat?: Stats) => void): void {\r\n // Throw an error if the entry doesn't exist, because then there's nothing\r\n // to stat.\r\n var opts = {\r\n create: false\r\n };\r\n // Called when the path has been successfully loaded as a file.\r\n var loadAsFile = (entry: FileEntry): void => {\r\n var fileFromEntry = (file: File): void => {\r\n var stat = new Stats(FileType.FILE, file.size);\r\n cb(null, stat);\r\n };\r\n entry.file(fileFromEntry, failedToLoad);\r\n };\r\n // Called when the path has been successfully loaded as a directory.\r\n var loadAsDir = (dir: DirectoryEntry): void => {\r\n // Directory entry size can't be determined from the HTML5 FS API, and is\r\n // implementation-dependant anyway, so a dummy value is used.\r\n var size = 4096;\r\n var stat = new Stats(FileType.DIRECTORY, size);\r\n cb(null, stat);\r\n };\r\n // Called when the path couldn't be opened as a directory or a file.\r\n var failedToLoad = (err: DOMException): void => {\r\n cb(this.convert(err, path, false /* Unknown / irrelevant */));\r\n };\r\n // Called when the path couldn't be opened as a file, but might still be a\r\n // directory.\r\n var failedToLoadAsFile = (): void => {\r\n this.fs.root.getDirectory(path, opts, loadAsDir, failedToLoad);\r\n };\r\n // No method currently exists to determine whether a path refers to a\r\n // directory or a file, so this implementation tries both and uses the first\r\n // one that succeeds.\r\n this.fs.root.getFile(path, opts, loadAsFile, failedToLoadAsFile);\r\n }\r\n\r\n public open(p: string, flags: FileFlag, mode: number, cb: (err: ApiError, fd?: file.File) => any): void {\r\n var error = (err: DOMError): void => {\r\n if (err.name === 'InvalidModificationError' && flags.isExclusive()) {\r\n cb(ApiError.EEXIST(p));\r\n } else {\r\n cb(this.convert(err, p, false));\r\n }\r\n };\r\n\r\n this.fs.root.getFile(p, {\r\n create: flags.pathNotExistsAction() === ActionType.CREATE_FILE,\r\n exclusive: flags.isExclusive()\r\n }, (entry: FileEntry): void => {\r\n // Try to fetch corresponding file.\r\n entry.file((file: File): void => {\r\n var reader = new FileReader();\r\n reader.onloadend = (event: Event): void => {\r\n var bfs_file = this._makeFile(p, flags, file, <ArrayBuffer> reader.result);\r\n cb(null, bfs_file);\r\n };\r\n reader.onerror = (ev: Event) => {\r\n error(reader.error);\r\n };\r\n reader.readAsArrayBuffer(file);\r\n }, error);\r\n }, error);\r\n }\r\n\r\n /**\r\n * Returns a BrowserFS object representing the type of a Dropbox.js stat object\r\n */\r\n private _statType(stat: Entry): FileType {\r\n return stat.isFile ? FileType.FILE : FileType.DIRECTORY;\r\n }\r\n\r\n /**\r\n * Returns a BrowserFS object representing a File, created from the data\r\n * returned by calls to the Dropbox API.\r\n */\r\n private _makeFile(path: string, flag: FileFlag, stat: File, data: ArrayBuffer = new ArrayBuffer(0)): HTML5FSFile {\r\n var stats = new Stats(FileType.FILE, stat.size);\r\n var buffer = arrayBuffer2Buffer(data);\r\n return new HTML5FSFile(this, path, flag, stats, buffer);\r\n }\r\n\r\n /**\r\n * Delete a file or directory from the file system\r\n * isFile should reflect which call was made to remove the it (`unlink` or\r\n * `rmdir`). If this doesn't match what's actually at `path`, an error will be\r\n * returned\r\n */\r\n private _remove(path: string, cb: (e?: ApiError) => void, isFile: boolean): void {\r\n var success = (entry: Entry): void => {\r\n var succ = () => {\r\n cb();\r\n };\r\n var err = (err: DOMException) => {\r\n cb(this.convert(err, path, !isFile));\r\n };\r\n entry.remove(succ, err);\r\n };\r\n var error = (err: DOMException): void => {\r\n cb(this.convert(err, path, !isFile));\r\n };\r\n // Deleting the entry, so don't create it\r\n var opts = {\r\n create: false\r\n };\r\n\r\n if (isFile) {\r\n this.fs.root.getFile(path, opts, success, error);\r\n } else {\r\n this.fs.root.getDirectory(path, opts, success, error);\r\n }\r\n }\r\n\r\n public unlink(path: string, cb: (e?: ApiError) => void): void {\r\n this._remove(path, cb, true);\r\n }\r\n\r\n public rmdir(path: string, cb: (e?: ApiError) => void): void {\r\n // Check if directory is non-empty, first.\r\n this.readdir(path, (e, files?) => {\r\n if (e) {\r\n cb(e);\r\n } else if (files.length > 0) {\r\n cb(ApiError.ENOTEMPTY(path));\r\n } else {\r\n this._remove(path, cb, false);\r\n }\r\n });\r\n }\r\n\r\n public mkdir(path: string, mode: number, cb: (e?: ApiError) => void): void {\r\n // Create the directory, but throw an error if it already exists, as per\r\n // mkdir(1)\r\n var opts = {\r\n create: true,\r\n exclusive: true\r\n };\r\n var success = (dir: DirectoryEntry): void => {\r\n cb();\r\n };\r\n var error = (err: DOMException): void => {\r\n cb(this.convert(err, path, true));\r\n };\r\n this.fs.root.getDirectory(path, opts, success, error);\r\n }\r\n\r\n /**\r\n * Returns an array of `FileEntry`s. Used internally by empty and readdir.\r\n */\r\n private _readdir(path: string, cb: (e: ApiError, entries?: Entry[]) => void): void {\r\n var error = (err: DOMException): void => {\r\n cb(this.convert(err, path, true));\r\n };\r\n // Grab the requested directory.\r\n this.fs.root.getDirectory(path, { create: false }, (dirEntry: DirectoryEntry) => {\r\n var reader = dirEntry.createReader();\r\n var entries: Entry[] = [];\r\n\r\n // Call the reader.readEntries() until no more results are returned.\r\n var readEntries = () => {\r\n reader.readEntries(((results) => {\r\n if (results.length) {\r\n entries = entries.concat(_toArray(results));\r\n readEntries();\r\n } else {\r\n cb(null, entries);\r\n }\r\n }), error);\r\n };\r\n readEntries();\r\n }, error);\r\n }\r\n\r\n /**\r\n * Map _readdir's list of `FileEntry`s to their names and return that.\r\n */\r\n public readdir(path: string, cb: (err: ApiError, files?: string[]) => void): void {\r\n this._readdir(path, (e: ApiError, entries?: Entry[]): void => {\r\n if (e) {\r\n return cb(e);\r\n }\r\n var rv: string[] = [];\r\n for (var i = 0; i < entries.length; i++) {\r\n rv.push(entries[i].name);\r\n }\r\n cb(null, rv);\r\n });\r\n }\r\n}\r\n",
|
||
"import kvfs = require('../generic/key_value_filesystem');\r\n\r\n/**\r\n * A simple in-memory key-value store backed by a JavaScript object.\r\n */\r\nexport class InMemoryStore implements kvfs.SyncKeyValueStore, kvfs.SimpleSyncStore {\r\n private store: { [key: string]: NodeBuffer } = {};\r\n\r\n public name() { return 'In-memory'; }\r\n public clear() { this.store = {}; }\r\n\r\n public beginTransaction(type: string): kvfs.SyncKeyValueRWTransaction {\r\n return new kvfs.SimpleSyncRWTransaction(this);\r\n }\r\n\r\n public get(key: string): NodeBuffer {\r\n return this.store[key];\r\n }\r\n\r\n public put(key: string, data: NodeBuffer, overwrite: boolean): boolean {\r\n if (!overwrite && this.store.hasOwnProperty(key)) {\r\n return false;\r\n }\r\n this.store[key] = data;\r\n return true;\r\n }\r\n\r\n public del(key: string): void {\r\n delete this.store[key];\r\n }\r\n}\r\n\r\n/**\r\n * A simple in-memory file system backed by an InMemoryStore.\r\n */\r\nexport default class InMemoryFileSystem extends kvfs.SyncKeyValueFileSystem {\r\n constructor() {\r\n super({ store: new InMemoryStore() });\r\n }\r\n}\r\n",
|
||
"import kvfs = require('../generic/key_value_filesystem');\r\nimport {ApiError, ErrorCode} from '../core/api_error';\r\nimport global = require('../core/global');\r\nimport {arrayBuffer2Buffer, buffer2ArrayBuffer} from '../core/util';\r\n/**\r\n * Get the indexedDB constructor for the current browser.\r\n */\r\nvar indexedDB: IDBFactory = global.indexedDB ||\r\n (<any>global).mozIndexedDB ||\r\n (<any>global).webkitIndexedDB ||\r\n global.msIndexedDB;\r\n\r\n/**\r\n * Converts a DOMException or a DOMError from an IndexedDB event into a\r\n * standardized BrowserFS API error.\r\n */\r\nfunction convertError(e: {name: string}, message: string = e.toString()): ApiError {\r\n switch(e.name) {\r\n case \"NotFoundError\":\r\n return new ApiError(ErrorCode.ENOENT, message);\r\n case \"QuotaExceededError\":\r\n return new ApiError(ErrorCode.ENOSPC, message);\r\n default:\r\n // The rest do not seem to map cleanly to standard error codes.\r\n return new ApiError(ErrorCode.EIO, message);\r\n }\r\n}\r\n\r\n/**\r\n * Produces a new onerror handler for IDB. Our errors are always fatal, so we\r\n * handle them generically: Call the user-supplied callback with a translated\r\n * version of the error, and let the error bubble up.\r\n */\r\nfunction onErrorHandler(cb: (e: ApiError) => void,\r\n code: ErrorCode = ErrorCode.EIO, message: string = null): (e?: any) => void {\r\n return function (e?: any): void {\r\n // Prevent the error from canceling the transaction.\r\n e.preventDefault();\r\n cb(new ApiError(code, message));\r\n };\r\n}\r\n\r\nexport class IndexedDBROTransaction implements kvfs.AsyncKeyValueROTransaction {\r\n constructor(public tx: IDBTransaction, public store: IDBObjectStore) { }\r\n\r\n get(key: string, cb: (e: ApiError, data?: NodeBuffer) => void): void {\r\n try {\r\n var r: IDBRequest = this.store.get(key);\r\n r.onerror = onErrorHandler(cb);\r\n r.onsuccess = (event) => {\r\n // IDB returns the value 'undefined' when you try to get keys that\r\n // don't exist. The caller expects this behavior.\r\n var result: any = (<any>event.target).result;\r\n if (result === undefined) {\r\n cb(null, result);\r\n } else {\r\n // IDB data is stored as an ArrayBuffer\r\n cb(null, arrayBuffer2Buffer(result));\r\n }\r\n };\r\n } catch (e) {\r\n cb(convertError(e));\r\n }\r\n }\r\n}\r\n\r\nexport class IndexedDBRWTransaction extends IndexedDBROTransaction implements kvfs.AsyncKeyValueRWTransaction, kvfs.AsyncKeyValueROTransaction {\r\n constructor(tx: IDBTransaction, store: IDBObjectStore) {\r\n super(tx, store);\r\n }\r\n\r\n public put(key: string, data: NodeBuffer, overwrite: boolean, cb: (e: ApiError, committed?: boolean) => void): void {\r\n try {\r\n var arraybuffer = buffer2ArrayBuffer(data),\r\n r: IDBRequest;\r\n if (overwrite) {\r\n r = this.store.put(arraybuffer, key);\r\n } else {\r\n // 'add' will never overwrite an existing key.\r\n r = this.store.add(arraybuffer, key);\r\n }\r\n // XXX: NEED TO RETURN FALSE WHEN ADD HAS A KEY CONFLICT. NO ERROR.\r\n r.onerror = onErrorHandler(cb);\r\n r.onsuccess = (event) => {\r\n cb(null, true);\r\n };\r\n } catch (e) {\r\n cb(convertError(e));\r\n }\r\n }\r\n\r\n public del(key: string, cb: (e?: ApiError) => void): void {\r\n try {\r\n // NOTE: IE8 has a bug with identifiers named 'delete' unless used as a string\r\n // like this.\r\n // http://stackoverflow.com/a/26479152\r\n var r: IDBRequest = this.store['delete'](key);\r\n r.onerror = onErrorHandler(cb);\r\n r.onsuccess = (event) => {\r\n cb();\r\n };\r\n } catch (e) {\r\n cb(convertError(e));\r\n }\r\n }\r\n\r\n public commit(cb: (e?: ApiError) => void): void {\r\n // Return to the event loop to commit the transaction.\r\n setTimeout(cb, 0);\r\n }\r\n\r\n public abort(cb: (e?: ApiError) => void): void {\r\n var _e: ApiError;\r\n try {\r\n this.tx.abort();\r\n } catch (e) {\r\n _e = convertError(e);\r\n } finally {\r\n cb(_e);\r\n }\r\n }\r\n}\r\n\r\nexport class IndexedDBStore implements kvfs.AsyncKeyValueStore {\r\n private db: IDBDatabase;\r\n\r\n /**\r\n * Constructs an IndexedDB file system.\r\n * @param cb Called once the database is instantiated and ready for use.\r\n * Passes an error if there was an issue instantiating the database.\r\n * @param objectStoreName The name of this file system. You can have\r\n * multiple IndexedDB file systems operating at once, but each must have\r\n * a different name.\r\n */\r\n constructor(cb: (e: ApiError, store?: IndexedDBStore) => void, private storeName: string = 'browserfs') {\r\n var openReq: IDBOpenDBRequest = indexedDB.open(this.storeName, 1);\r\n\r\n openReq.onupgradeneeded = (event) => {\r\n var db: IDBDatabase = (<any>event.target).result;\r\n // Huh. This should never happen; we're at version 1. Why does another\r\n // database exist?\r\n if (db.objectStoreNames.contains(this.storeName)) {\r\n db.deleteObjectStore(this.storeName);\r\n }\r\n db.createObjectStore(this.storeName);\r\n };\r\n\r\n openReq.onsuccess = (event) => {\r\n this.db = (<any>event.target).result;\r\n cb(null, this);\r\n };\r\n\r\n openReq.onerror = onErrorHandler(cb, ErrorCode.EACCES);\r\n }\r\n\r\n public name(): string {\r\n return \"IndexedDB - \" + this.storeName;\r\n }\r\n\r\n public clear(cb: (e?: ApiError) => void): void {\r\n try {\r\n var tx = this.db.transaction(this.storeName, 'readwrite'),\r\n objectStore = tx.objectStore(this.storeName),\r\n r: IDBRequest = objectStore.clear();\r\n r.onsuccess = (event) => {\r\n // Use setTimeout to commit transaction.\r\n setTimeout(cb, 0);\r\n };\r\n r.onerror = onErrorHandler(cb);\r\n } catch (e) {\r\n cb(convertError(e));\r\n }\r\n }\r\n\r\n public beginTransaction(type: string = 'readonly'): kvfs.AsyncKeyValueROTransaction {\r\n var tx = this.db.transaction(this.storeName, type),\r\n objectStore = tx.objectStore(this.storeName);\r\n if (type === 'readwrite') {\r\n return new IndexedDBRWTransaction(tx, objectStore);\r\n } else if (type === 'readonly') {\r\n return new IndexedDBROTransaction(tx, objectStore);\r\n } else {\r\n throw new ApiError(ErrorCode.EINVAL, 'Invalid transaction type.');\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * A file system that uses the IndexedDB key value file system.\r\n */\r\nexport default class IndexedDBFileSystem extends kvfs.AsyncKeyValueFileSystem {\r\n constructor(cb: (e: ApiError, fs?: IndexedDBFileSystem) => void, storeName?: string) {\r\n super();\r\n new IndexedDBStore((e, store?): void => {\r\n if (e) {\r\n cb(e);\r\n } else {\r\n this.init(store, (e?) => {\r\n cb(e, this);\r\n });\r\n }\r\n }, storeName);\r\n }\r\n\r\n public static isAvailable(): boolean {\r\n // In Safari's private browsing mode, indexedDB.open returns NULL.\r\n // In Firefox, it throws an exception.\r\n // In Chrome, it \"just works\", and clears the database when you leave the page.\r\n // Untested: Opera, IE.\r\n try {\r\n return typeof indexedDB !== 'undefined' && null !== indexedDB.open(\"__browserfs_test__\");\r\n } catch (e) {\r\n return false;\r\n }\r\n }\r\n}\r\n",
|
||
"import kvfs = require('../generic/key_value_filesystem');\r\nimport {ApiError, ErrorCode} from '../core/api_error';\r\nimport global = require('../core/global');\r\n\r\n// Some versions of FF and all versions of IE do not support the full range of\r\n// 16-bit numbers encoded as characters, as they enforce UTF-16 restrictions.\r\n// http://stackoverflow.com/questions/11170716/are-there-any-characters-that-are-not-allowed-in-localstorage/11173673#11173673\r\nvar supportsBinaryString: boolean = false,\r\n binaryEncoding: string;\r\ntry {\r\n global.localStorage.setItem(\"__test__\", String.fromCharCode(0xD800));\r\n supportsBinaryString = global.localStorage.getItem(\"__test__\") === String.fromCharCode(0xD800);\r\n} catch (e) {\r\n // IE throws an exception.\r\n supportsBinaryString = false;\r\n}\r\nbinaryEncoding = supportsBinaryString ? 'binary_string' : 'binary_string_ie';\r\nif (!Buffer.isEncoding(binaryEncoding)) {\r\n // Fallback for non BrowserFS implementations of buffer that lack a\r\n // binary_string format.\r\n binaryEncoding = \"base64\";\r\n}\r\n\r\n/**\r\n * A synchronous key-value store backed by localStorage.\r\n */\r\nexport class LocalStorageStore implements kvfs.SyncKeyValueStore, kvfs.SimpleSyncStore {\r\n constructor() { }\r\n\r\n public name(): string {\r\n return 'LocalStorage';\r\n }\r\n\r\n public clear(): void {\r\n global.localStorage.clear();\r\n }\r\n\r\n public beginTransaction(type: string): kvfs.SyncKeyValueRWTransaction {\r\n // No need to differentiate.\r\n return new kvfs.SimpleSyncRWTransaction(this);\r\n }\r\n\r\n public get(key: string): NodeBuffer {\r\n try {\r\n var data = global.localStorage.getItem(key);\r\n if (data !== null) {\r\n return new Buffer(data, binaryEncoding);\r\n }\r\n } catch (e) {\r\n\r\n }\r\n // Key doesn't exist, or a failure occurred.\r\n return undefined;\r\n }\r\n\r\n public put(key: string, data: NodeBuffer, overwrite: boolean): boolean {\r\n try {\r\n if (!overwrite && global.localStorage.getItem(key) !== null) {\r\n // Don't want to overwrite the key!\r\n return false;\r\n }\r\n global.localStorage.setItem(key, data.toString(binaryEncoding));\r\n return true;\r\n } catch (e) {\r\n throw new ApiError(ErrorCode.ENOSPC, \"LocalStorage is full.\");\r\n }\r\n }\r\n\r\n public del(key: string): void {\r\n try {\r\n global.localStorage.removeItem(key);\r\n } catch (e) {\r\n throw new ApiError(ErrorCode.EIO, \"Unable to delete key \" + key + \": \" + e);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * A synchronous file system backed by localStorage. Connects our\r\n * LocalStorageStore to our SyncKeyValueFileSystem.\r\n */\r\nexport default class LocalStorageFileSystem extends kvfs.SyncKeyValueFileSystem {\r\n constructor() { super({ store: new LocalStorageStore() }); }\r\n public static isAvailable(): boolean {\r\n return typeof global.localStorage !== 'undefined';\r\n }\r\n}\r\n",
|
||
"import file_system = require('../core/file_system');\r\nimport InMemoryFileSystem from './InMemory';\r\nimport {ApiError, ErrorCode} from '../core/api_error';\r\nimport fs = require('../core/node_fs');\r\nimport path = require('path');\r\nimport {mkdirpSync} from '../core/util';\r\n\r\n/**\r\n * The MountableFileSystem allows you to mount multiple backend types or\r\n * multiple instantiations of the same backend into a single file system tree.\r\n * The file systems do not need to know about each other; all interactions are\r\n * automatically facilitated through this interface.\r\n *\r\n * For example, if a file system is mounted at /mnt/blah, and a request came in\r\n * for /mnt/blah/foo.txt, the file system would see a request for /foo.txt.\r\n */\r\nexport default class MountableFileSystem extends file_system.BaseFileSystem implements file_system.FileSystem {\r\n private mntMap: {[path: string]: file_system.FileSystem};\r\n // Contains the list of mount points in mntMap, sorted by string length in decreasing order.\r\n // Ensures that we scan the most specific mount points for a match first, which lets us\r\n // nest mount points.\r\n private mountList: string[] = [];\r\n private rootFs: file_system.FileSystem;\r\n constructor() {\r\n super();\r\n this.mntMap = {};\r\n // The InMemory file system serves purely to provide directory listings for\r\n // mounted file systems.\r\n this.rootFs = new InMemoryFileSystem();\r\n }\r\n\r\n /**\r\n * Mounts the file system at the given mount point.\r\n */\r\n public mount(mountPoint: string, fs: file_system.FileSystem): void {\r\n if (mountPoint[0] !== '/') {\r\n mountPoint = `/${mountPoint}`;\r\n }\r\n mountPoint = path.resolve(mountPoint);\r\n if (this.mntMap[mountPoint]) {\r\n throw new ApiError(ErrorCode.EINVAL, \"Mount point \" + mountPoint + \" is already taken.\");\r\n }\r\n mkdirpSync(mountPoint, 0x1ff, this.rootFs);\r\n this.mntMap[mountPoint] = fs;\r\n this.mountList.push(mountPoint);\r\n this.mountList = this.mountList.sort((a, b) => b.length - a.length);\r\n }\r\n\r\n public umount(mountPoint: string): void {\r\n if (mountPoint[0] !== '/') {\r\n mountPoint = `/${mountPoint}`;\r\n }\r\n mountPoint = path.resolve(mountPoint);\r\n if (!this.mntMap[mountPoint]) {\r\n throw new ApiError(ErrorCode.EINVAL, \"Mount point \" + mountPoint + \" is already unmounted.\");\r\n }\r\n delete this.mntMap[mountPoint];\r\n this.mountList.splice(this.mountList.indexOf(mountPoint), 1);\r\n\r\n while (mountPoint !== '/') {\r\n if (this.rootFs.readdirSync(mountPoint).length === 0) {\r\n this.rootFs.rmdirSync(mountPoint);\r\n mountPoint = path.dirname(mountPoint);\r\n } else {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Returns the file system that the path points to.\r\n */\r\n public _getFs(path: string): {fs: file_system.FileSystem; path: string} {\r\n let mountList = this.mountList, len = mountList.length;\r\n for (let i = 0; i < len; i++) {\r\n let mountPoint = mountList[i];\r\n // We know path is normalized, so it is a substring of the mount point.\r\n if (mountPoint.length <= path.length && path.indexOf(mountPoint) === 0) {\r\n path = path.substr(mountPoint.length > 1 ? mountPoint.length : 0);\r\n if (path === '') {\r\n path = '/';\r\n }\r\n return {fs: this.mntMap[mountPoint], path: path};\r\n }\r\n }\r\n // Query our root file system.\r\n return {fs: this.rootFs, path: path};\r\n }\r\n\r\n // Global information methods\r\n\r\n public getName(): string {\r\n return 'MountableFileSystem';\r\n }\r\n\r\n public static isAvailable(): boolean {\r\n return true;\r\n }\r\n\r\n public diskSpace(path: string, cb: (total: number, free: number) => void): void {\r\n cb(0, 0);\r\n }\r\n\r\n public isReadOnly(): boolean {\r\n return false;\r\n }\r\n\r\n public supportsLinks(): boolean {\r\n // I'm not ready for cross-FS links yet.\r\n return false;\r\n }\r\n\r\n public supportsProps(): boolean {\r\n return false;\r\n }\r\n\r\n public supportsSynch(): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Fixes up error messages so they mention the mounted file location relative\r\n * to the MFS root, not to the particular FS's root.\r\n * Mutates the input error, and returns it.\r\n */\r\n private standardizeError(err: ApiError, path: string, realPath: string): ApiError {\r\n var index: number;\r\n if (-1 !== (index = err.message.indexOf(path))) {\r\n err.message = err.message.substr(0, index) + realPath + err.message.substr(index + path.length);\r\n err.path = realPath;\r\n }\r\n return err;\r\n }\r\n\r\n // The following methods involve multiple file systems, and thus have custom\r\n // logic.\r\n // Note that we go through the Node API to use its robust default argument\r\n // processing.\r\n\r\n public rename(oldPath: string, newPath: string, cb: (e?: ApiError) => void): void {\r\n // Scenario 1: old and new are on same FS.\r\n var fs1_rv = this._getFs(oldPath);\r\n var fs2_rv = this._getFs(newPath);\r\n if (fs1_rv.fs === fs2_rv.fs) {\r\n var _this = this;\r\n return fs1_rv.fs.rename(fs1_rv.path, fs2_rv.path, function(e?: ApiError) {\r\n if (e) _this.standardizeError(_this.standardizeError(e, fs1_rv.path, oldPath), fs2_rv.path, newPath);\r\n cb(e);\r\n });\r\n }\r\n\r\n // Scenario 2: Different file systems.\r\n // Read old file, write new file, delete old file.\r\n return fs.readFile(oldPath, function(err: ApiError, data?: any) {\r\n if (err) {\r\n return cb(err);\r\n }\r\n fs.writeFile(newPath, data, function(err) {\r\n if (err) {\r\n return cb(err);\r\n }\r\n fs.unlink(oldPath, cb);\r\n });\r\n });\r\n }\r\n\r\n public renameSync(oldPath: string, newPath: string): void {\r\n // Scenario 1: old and new are on same FS.\r\n var fs1_rv = this._getFs(oldPath);\r\n var fs2_rv = this._getFs(newPath);\r\n if (fs1_rv.fs === fs2_rv.fs) {\r\n try {\r\n return fs1_rv.fs.renameSync(fs1_rv.path, fs2_rv.path);\r\n } catch(e) {\r\n this.standardizeError(this.standardizeError(e, fs1_rv.path, oldPath), fs2_rv.path, newPath);\r\n throw e;\r\n }\r\n }\r\n // Scenario 2: Different file systems.\r\n var data = fs.readFileSync(oldPath);\r\n fs.writeFileSync(newPath, data);\r\n return fs.unlinkSync(oldPath);\r\n }\r\n\r\n public readdirSync(p: string): string[] {\r\n let fsInfo = this._getFs(p);\r\n\r\n // If null, rootfs did not have the directory\r\n // (or the target FS is the root fs).\r\n let rv = null;\r\n // Mount points are all defined in the root FS.\r\n // Ensure that we list those, too.\r\n if (fsInfo.fs !== this.rootFs) {\r\n try {\r\n rv = this.rootFs.readdirSync(p);\r\n } catch (e) {\r\n // Ignore.\r\n }\r\n }\r\n\r\n try {\r\n let rv2 = fsInfo.fs.readdirSync(fsInfo.path);\r\n if (rv === null) {\r\n return rv2;\r\n } else {\r\n // Filter out duplicates.\r\n return rv2.concat(rv.filter((val) => rv2.indexOf(val) === -1));\r\n }\r\n } catch(e) {\r\n if (rv === null) {\r\n throw this.standardizeError(e, fsInfo.path, p);\r\n } else {\r\n // The root FS had something.\r\n return rv;\r\n }\r\n }\r\n }\r\n\r\n public readdir(p: string, cb: (err: NodeJS.ErrnoException, listing?: string[]) => any): void {\r\n let fsInfo = this._getFs(p);\r\n fsInfo.fs.readdir(fsInfo.path, (err, files) => {\r\n if (fsInfo.fs !== this.rootFs) {\r\n try {\r\n let rv = this.rootFs.readdirSync(p);\r\n if (files) {\r\n // Filter out duplicates.\r\n files = files.concat(rv.filter((val) => files.indexOf(val) === -1));\r\n } else {\r\n files = rv;\r\n }\r\n } catch (e) {\r\n // Root FS and target FS did not have directory.\r\n if (err) {\r\n return cb(this.standardizeError(err, fsInfo.path, p));\r\n }\r\n }\r\n } else if (err) {\r\n // Root FS and target FS are the same, and did not have directory.\r\n return cb(this.standardizeError(err, fsInfo.path, p));\r\n }\r\n\r\n cb(null, files);\r\n });\r\n }\r\n\r\n public rmdirSync(p: string): void {\r\n let fsInfo = this._getFs(p);\r\n if (this._containsMountPt(p)) {\r\n throw ApiError.ENOTEMPTY(p);\r\n } else {\r\n try {\r\n fsInfo.fs.rmdirSync(fsInfo.path);\r\n } catch (e) {\r\n throw this.standardizeError(e, fsInfo.path, p);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Returns true if the given path contains a mount point.\r\n */\r\n private _containsMountPt(p: string): boolean {\r\n let mountPoints = this.mountList, len = mountPoints.length;\r\n for (let i = 0; i < len; i++) {\r\n let pt = mountPoints[i];\r\n if (pt.length >= p.length && pt.slice(0, p.length) === p) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n public rmdir(p: string, cb: (err?: NodeJS.ErrnoException) => any): void {\r\n let fsInfo = this._getFs(p);\r\n if (this._containsMountPt(p)) {\r\n cb(ApiError.ENOTEMPTY(p));\r\n } else {\r\n fsInfo.fs.rmdir(fsInfo.path, (err?) => {\r\n cb(err ? this.standardizeError(err, fsInfo.path, p) : null);\r\n });\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Tricky: Define all of the functions that merely forward arguments to the\r\n * relevant file system, or return/throw an error.\r\n * Take advantage of the fact that the *first* argument is always the path, and\r\n * the *last* is the callback function (if async).\r\n * @todo Can use numArgs to make proxying more efficient.\r\n */\r\nfunction defineFcn(name: string, isSync: boolean, numArgs: number): (...args: any[]) => any {\r\n if (isSync) {\r\n return function(...args: any[]) {\r\n let self: MountableFileSystem = this;\r\n var path = args[0];\r\n var rv = self._getFs(path);\r\n args[0] = rv.path;\r\n try {\r\n return rv.fs[name].apply(rv.fs, args);\r\n } catch (e) {\r\n (<any> self).standardizeError(e, rv.path, path);\r\n throw e;\r\n }\r\n };\r\n } else {\r\n return function(...args: any[]) {\r\n let self: MountableFileSystem = this;\r\n var path = args[0];\r\n var rv = self._getFs(path);\r\n args[0] = rv.path;\r\n if (typeof args[args.length-1] === 'function') {\r\n var cb = args[args.length - 1];\r\n args[args.length - 1] = function(...args: any[]) {\r\n if (args.length > 0 && args[0] instanceof ApiError) {\r\n (<any> self).standardizeError(args[0], rv.path, path);\r\n }\r\n cb.apply(null, args);\r\n }\r\n }\r\n return rv.fs[name].apply(rv.fs, args);\r\n };\r\n }\r\n}\r\n\r\nvar fsCmdMap = [\r\n // 1 arg functions\r\n ['exists', 'unlink', 'readlink'],\r\n // 2 arg functions\r\n ['stat', 'mkdir', 'realpath', 'truncate'],\r\n // 3 arg functions\r\n ['open', 'readFile', 'chmod', 'utimes'],\r\n // 4 arg functions\r\n ['chown'],\r\n // 5 arg functions\r\n ['writeFile', 'appendFile']];\r\n\r\nfor (var i = 0; i < fsCmdMap.length; i++) {\r\n var cmds = fsCmdMap[i];\r\n for (var j = 0; j < cmds.length; j++) {\r\n var fnName = cmds[j];\r\n (<any> MountableFileSystem.prototype)[fnName] = defineFcn(fnName, false, i + 1);\r\n (<any> MountableFileSystem.prototype)[fnName + 'Sync'] = defineFcn(fnName + 'Sync', true, i + 1);\r\n }\r\n}\r\n",
|
||
"import file_system = require('../core/file_system');\r\nimport {ApiError, ErrorCode} from '../core/api_error';\r\nimport {FileFlag, ActionType} from '../core/file_flag';\r\nimport util = require('../core/util');\r\nimport file = require('../core/file');\r\nimport Stats from '../core/node_fs_stats';\r\nimport preload_file = require('../generic/preload_file');\r\nimport path = require('path');\r\nlet deletionLogPath = '/.deletedFiles.log';\r\n\r\n/**\r\n * Given a read-only mode, makes it writable.\r\n */\r\nfunction makeModeWritable(mode: number): number {\r\n return 0x92 | mode;\r\n}\r\n\r\n/**\r\n * Overlays a RO file to make it writable.\r\n */\r\nclass OverlayFile extends preload_file.PreloadFile<OverlayFS> implements file.File {\r\n constructor(fs: OverlayFS, path: string, flag: FileFlag, stats: Stats, data: Buffer) {\r\n super(fs, path, flag, stats, data);\r\n }\r\n\r\n public syncSync(): void {\r\n if (this.isDirty()) {\r\n this._fs._syncSync(this);\r\n this.resetDirty();\r\n }\r\n }\r\n\r\n public closeSync(): void {\r\n this.syncSync();\r\n }\r\n}\r\n\r\n/**\r\n * OverlayFS makes a read-only filesystem writable by storing writes on a second,\r\n * writable file system. Deletes are persisted via metadata stored on the writable\r\n * file system.\r\n *\r\n * Currently only works for two synchronous file systems.\r\n */\r\nexport default class OverlayFS extends file_system.SynchronousFileSystem implements file_system.FileSystem {\r\n private _writable: file_system.FileSystem;\r\n private _readable: file_system.FileSystem;\r\n private _isInitialized: boolean = false;\r\n private _initializeCallbacks: ((e?: ApiError) => void)[] = [];\r\n private _deletedFiles: {[path: string]: boolean} = {};\r\n private _deleteLog: file.File = null;\r\n\r\n constructor(writable: file_system.FileSystem, readable: file_system.FileSystem) {\r\n super();\r\n this._writable = writable;\r\n this._readable = readable;\r\n if (this._writable.isReadOnly()) {\r\n throw new ApiError(ErrorCode.EINVAL, \"Writable file system must be writable.\");\r\n }\r\n if (!this._writable.supportsSynch() || !this._readable.supportsSynch()) {\r\n throw new ApiError(ErrorCode.EINVAL, \"OverlayFS currently only operates on synchronous file systems.\");\r\n }\r\n }\r\n\r\n private checkInitialized(): void {\r\n if (!this._isInitialized) {\r\n throw new ApiError(ErrorCode.EPERM, \"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.\");\r\n }\r\n }\r\n\r\n public getOverlayedFileSystems(): { readable: file_system.FileSystem; writable: file_system.FileSystem; } {\r\n return {\r\n readable: this._readable,\r\n writable: this._writable\r\n };\r\n }\r\n\r\n /**\r\n * With the given path, create the needed parent directories on the writable storage\r\n * should they not exist. Use modes from the read-only storage.\r\n */\r\n private createParentDirectories(p: string): void {\r\n var parent = path.dirname(p), toCreate: string[] = [];\r\n while (!this._writable.existsSync(parent)) {\r\n toCreate.push(parent);\r\n parent = path.dirname(parent);\r\n }\r\n toCreate = toCreate.reverse();\r\n\r\n toCreate.forEach((p: string) => {\r\n this._writable.mkdirSync(p, this.statSync(p, false).mode);\r\n });\r\n }\r\n\r\n public static isAvailable(): boolean {\r\n return true;\r\n }\r\n\r\n public _syncSync(file: preload_file.PreloadFile<any>): void {\r\n this.createParentDirectories(file.getPath());\r\n this._writable.writeFileSync(file.getPath(), file.getBuffer(), null, FileFlag.getFileFlag('w'), file.getStats().mode);\r\n }\r\n\r\n public getName() {\r\n return \"OverlayFS\";\r\n }\r\n\r\n /**\r\n * Called once to load up metadata stored on the writable file system.\r\n */\r\n public initialize(cb: (err?: ApiError) => void): void {\r\n const callbackArray = this._initializeCallbacks;\r\n\r\n const end = (e?: ApiError): void => {\r\n this._isInitialized = !e;\r\n this._initializeCallbacks = [];\r\n callbackArray.forEach(((cb) => cb(e)));\r\n };\r\n\r\n if (!this._isInitialized) {\r\n // The first call to initialize initializes, the rest wait for it to complete.\r\n if (callbackArray.push(cb) === 1) {\r\n // Read deletion log, process into metadata.\r\n this._writable.readFile(deletionLogPath, 'utf8',\r\n FileFlag.getFileFlag('r'), (err: ApiError, data?: string) => {\r\n if (err) {\r\n // ENOENT === Newly-instantiated file system, and thus empty log.\r\n if (err.errno !== ErrorCode.ENOENT) {\r\n return end(err);\r\n }\r\n } else {\r\n data.split('\\n').forEach((path: string) => {\r\n // If the log entry begins w/ 'd', it's a deletion. Otherwise, it's\r\n // an undeletion.\r\n // TODO: Clean up log during initialization phase.\r\n this._deletedFiles[path.slice(1)] = path.slice(0, 1) === 'd';\r\n });\r\n }\r\n // Open up the deletion log for appending.\r\n this._writable.open(deletionLogPath, FileFlag.getFileFlag('a'),\r\n 0x1a4, (err: ApiError, fd?: file.File) => {\r\n if (err) {\r\n end(err);\r\n } else {\r\n this._deleteLog = fd;\r\n end();\r\n }\r\n });\r\n });\r\n }\r\n } else {\r\n cb();\r\n }\r\n }\r\n\r\n public isReadOnly(): boolean { return false; }\r\n public supportsSynch(): boolean { return true; }\r\n public supportsLinks(): boolean { return false; }\r\n public supportsProps(): boolean { return this._readable.supportsProps() && this._writable.supportsProps(); }\r\n\r\n private deletePath(p: string): void {\r\n this._deletedFiles[p] = true;\r\n var buff = new Buffer(\"d\" + p + \"\\n\");\r\n this._deleteLog.writeSync(buff, 0, buff.length, null);\r\n this._deleteLog.syncSync();\r\n }\r\n\r\n private undeletePath(p: string): void {\r\n if (this._deletedFiles[p]) {\r\n this._deletedFiles[p] = false;\r\n var buff = new Buffer(\"u\" + p);\r\n this._deleteLog.writeSync(buff, 0, buff.length, null);\r\n this._deleteLog.syncSync();\r\n }\r\n }\r\n\r\n public renameSync(oldPath: string, newPath: string): void {\r\n this.checkInitialized();\r\n // Write newPath using oldPath's contents, delete oldPath.\r\n var oldStats = this.statSync(oldPath, false);\r\n if (oldStats.isDirectory()) {\r\n // Optimization: Don't bother moving if old === new.\r\n if (oldPath === newPath) {\r\n return;\r\n }\r\n\r\n var mode = 0x1ff;\r\n if (this.existsSync(newPath)) {\r\n var stats = this.statSync(newPath, false),\r\n mode = stats.mode;\r\n if (stats.isDirectory()) {\r\n if (this.readdirSync(newPath).length > 0) {\r\n throw ApiError.ENOTEMPTY(newPath);\r\n }\r\n } else {\r\n throw ApiError.ENOTDIR(newPath);\r\n }\r\n }\r\n\r\n // Take care of writable first. Move any files there, or create an empty directory\r\n // if it doesn't exist.\r\n if (this._writable.existsSync(oldPath)) {\r\n this._writable.renameSync(oldPath, newPath);\r\n } else if (!this._writable.existsSync(newPath)) {\r\n this._writable.mkdirSync(newPath, mode);\r\n }\r\n\r\n // Need to move *every file/folder* currently stored on readable to its new location\r\n // on writable.\r\n if (this._readable.existsSync(oldPath)) {\r\n this._readable.readdirSync(oldPath).forEach((name) => {\r\n // Recursion! Should work for any nested files / folders.\r\n this.renameSync(path.resolve(oldPath, name), path.resolve(newPath, name));\r\n });\r\n }\r\n } else {\r\n if (this.existsSync(newPath) && this.statSync(newPath, false).isDirectory()) {\r\n throw ApiError.EISDIR(newPath);\r\n }\r\n\r\n this.writeFileSync(newPath,\r\n this.readFileSync(oldPath, null, FileFlag.getFileFlag('r')), null,\r\n FileFlag.getFileFlag('w'), oldStats.mode);\r\n }\r\n\r\n if (oldPath !== newPath && this.existsSync(oldPath)) {\r\n this.unlinkSync(oldPath);\r\n }\r\n }\r\n public statSync(p: string, isLstat: boolean): Stats {\r\n this.checkInitialized();\r\n try {\r\n return this._writable.statSync(p, isLstat);\r\n } catch (e) {\r\n if (this._deletedFiles[p]) {\r\n throw ApiError.ENOENT(p);\r\n }\r\n var oldStat = this._readable.statSync(p, isLstat).clone();\r\n // Make the oldStat's mode writable. Preserve the topmost part of the\r\n // mode, which specifies if it is a file or a directory.\r\n oldStat.mode = makeModeWritable(oldStat.mode);\r\n return oldStat;\r\n }\r\n }\r\n public openSync(p: string, flag: FileFlag, mode: number): file.File {\r\n this.checkInitialized();\r\n if (this.existsSync(p)) {\r\n switch (flag.pathExistsAction()) {\r\n case ActionType.TRUNCATE_FILE:\r\n this.createParentDirectories(p);\r\n return this._writable.openSync(p, flag, mode);\r\n case ActionType.NOP:\r\n if (this._writable.existsSync(p)) {\r\n return this._writable.openSync(p, flag, mode);\r\n } else {\r\n // Create an OverlayFile.\r\n var stats = this._readable.statSync(p, false).clone();\r\n stats.mode = mode;\r\n return new OverlayFile(this, p, flag, stats, this._readable.readFileSync(p, null, FileFlag.getFileFlag('r')));\r\n }\r\n default:\r\n throw ApiError.EEXIST(p);\r\n }\r\n } else {\r\n switch(flag.pathNotExistsAction()) {\r\n case ActionType.CREATE_FILE:\r\n this.createParentDirectories(p);\r\n return this._writable.openSync(p, flag, mode);\r\n default:\r\n throw ApiError.ENOENT(p);\r\n }\r\n }\r\n }\r\n public unlinkSync(p: string): void {\r\n this.checkInitialized();\r\n if (this.existsSync(p)) {\r\n if (this._writable.existsSync(p)) {\r\n this._writable.unlinkSync(p);\r\n }\r\n\r\n // Does it still exist?\r\n if (this.existsSync(p)) {\r\n // Add to delete log.\r\n this.deletePath(p);\r\n }\r\n } else {\r\n throw ApiError.ENOENT(p);\r\n }\r\n }\r\n public rmdirSync(p: string): void {\r\n this.checkInitialized();\r\n if (this.existsSync(p)) {\r\n if (this._writable.existsSync(p)) {\r\n this._writable.rmdirSync(p);\r\n }\r\n if (this.existsSync(p)) {\r\n // Check if directory is empty.\r\n if (this.readdirSync(p).length > 0) {\r\n throw ApiError.ENOTEMPTY(p);\r\n } else {\r\n this.deletePath(p);\r\n }\r\n }\r\n } else {\r\n throw ApiError.ENOENT(p);\r\n }\r\n }\r\n public mkdirSync(p: string, mode: number): void {\r\n this.checkInitialized();\r\n if (this.existsSync(p)) {\r\n throw ApiError.EEXIST(p);\r\n } else {\r\n // The below will throw should any of the parent directories fail to exist\r\n // on _writable.\r\n this.createParentDirectories(p);\r\n this._writable.mkdirSync(p, mode);\r\n }\r\n }\r\n public readdirSync(p: string): string[] {\r\n this.checkInitialized();\r\n var dirStats = this.statSync(p, false);\r\n if (!dirStats.isDirectory()) {\r\n throw ApiError.ENOTDIR(p);\r\n }\r\n\r\n // Readdir in both, merge, check delete log on each file, return.\r\n var contents: string[] = [];\r\n try {\r\n contents = contents.concat(this._writable.readdirSync(p));\r\n } catch (e) {\r\n }\r\n try {\r\n contents = contents.concat(this._readable.readdirSync(p));\r\n } catch (e) {\r\n }\r\n var seenMap: {[name: string]: boolean} = {};\r\n return contents.filter((fileP: string) => {\r\n var result = seenMap[fileP] === undefined && this._deletedFiles[p + \"/\" + fileP] !== true;\r\n seenMap[fileP] = true;\r\n return result;\r\n });\r\n }\r\n public existsSync(p: string): boolean {\r\n this.checkInitialized();\r\n return this._writable.existsSync(p) || (this._readable.existsSync(p) && this._deletedFiles[p] !== true);\r\n }\r\n public chmodSync(p: string, isLchmod: boolean, mode: number): void {\r\n this.checkInitialized();\r\n this.operateOnWritable(p, () => {\r\n this._writable.chmodSync(p, isLchmod, mode);\r\n });\r\n }\r\n public chownSync(p: string, isLchown: boolean, uid: number, gid: number): void {\r\n this.checkInitialized();\r\n this.operateOnWritable(p, () => {\r\n this._writable.chownSync(p, isLchown, uid, gid);\r\n });\r\n }\r\n public utimesSync(p: string, atime: Date, mtime: Date): void {\r\n this.checkInitialized();\r\n this.operateOnWritable(p, () => {\r\n this._writable.utimesSync(p, atime, mtime);\r\n });\r\n }\r\n\r\n /**\r\n * Helper function:\r\n * - Ensures p is on writable before proceeding. Throws an error if it doesn't exist.\r\n * - Calls f to perform operation on writable.\r\n */\r\n private operateOnWritable(p: string, f: () => void): void {\r\n if (this.existsSync(p)) {\r\n if (!this._writable.existsSync(p)) {\r\n // File is on readable storage. Copy to writable storage before\r\n // changing its mode.\r\n this.copyToWritable(p);\r\n }\r\n f();\r\n } else {\r\n throw ApiError.ENOENT(p);\r\n }\r\n }\r\n\r\n /**\r\n * Copy from readable to writable storage.\r\n * PRECONDITION: File does not exist on writable storage.\r\n */\r\n private copyToWritable(p: string): void {\r\n var pStats = this.statSync(p, false);\r\n if (pStats.isDirectory()) {\r\n this._writable.mkdirSync(p, pStats.mode);\r\n } else {\r\n this.writeFileSync(p,\r\n this._readable.readFileSync(p, null, FileFlag.getFileFlag('r')), null,\r\n FileFlag.getFileFlag('w'), this.statSync(p, false).mode);\r\n }\r\n }\r\n}\r\n",
|
||
"import file_system = require('../core/file_system');\r\nimport {ApiError} from '../core/api_error';\r\nimport file_flag = require('../core/file_flag');\r\nimport {buffer2ArrayBuffer, arrayBuffer2Buffer} from '../core/util';\r\nimport file = require('../core/file');\r\nimport {default as Stats, FileType} from '../core/node_fs_stats';\r\nimport preload_file = require('../generic/preload_file');\r\nimport global = require('../core/global');\r\nimport fs = require('../core/node_fs');\r\n\r\ninterface IBrowserFSMessage {\r\n browserfsMessage: boolean;\r\n}\r\n\r\nenum SpecialArgType {\r\n // Callback\r\n CB,\r\n // File descriptor\r\n FD,\r\n // API error\r\n API_ERROR,\r\n // Stats object\r\n STATS,\r\n // Initial probe for file system information.\r\n PROBE,\r\n // FileFlag object.\r\n FILEFLAG,\r\n // Buffer object.\r\n BUFFER,\r\n // Generic Error object.\r\n ERROR\r\n}\r\n\r\ninterface ISpecialArgument {\r\n type: SpecialArgType;\r\n}\r\n\r\ninterface IProbeResponse extends ISpecialArgument {\r\n isReadOnly: boolean;\r\n supportsLinks: boolean;\r\n supportsProps: boolean;\r\n}\r\n\r\ninterface ICallbackArgument extends ISpecialArgument {\r\n // The callback ID.\r\n id: number;\r\n}\r\n\r\n/**\r\n * Converts callback arguments into ICallbackArgument objects, and back\r\n * again.\r\n */\r\nclass CallbackArgumentConverter {\r\n private _callbacks: { [id: number]: Function } = {};\r\n private _nextId: number = 0;\r\n\r\n public toRemoteArg(cb: Function): ICallbackArgument {\r\n var id = this._nextId++;\r\n this._callbacks[id] = cb;\r\n return {\r\n type: SpecialArgType.CB,\r\n id: id\r\n };\r\n }\r\n\r\n public toLocalArg(id: number): Function {\r\n var cb = this._callbacks[id];\r\n delete this._callbacks[id];\r\n return cb;\r\n }\r\n}\r\n\r\ninterface IFileDescriptorArgument extends ISpecialArgument {\r\n // The file descriptor's id on the remote side.\r\n id: number;\r\n // The entire file's data, as an array buffer.\r\n data: ArrayBuffer;\r\n // The file's stat object, as an array buffer.\r\n stat: ArrayBuffer;\r\n // The path to the file.\r\n path: string;\r\n // The flag of the open file descriptor.\r\n flag: string;\r\n}\r\n\r\nclass FileDescriptorArgumentConverter {\r\n private _fileDescriptors: { [id: number]: file.File } = {};\r\n private _nextId: number = 0;\r\n\r\n public toRemoteArg(fd: file.File, p: string, flag: file_flag.FileFlag, cb: (err: ApiError, arg?: IFileDescriptorArgument) => void): void {\r\n var id = this._nextId++,\r\n data: ArrayBuffer,\r\n stat: ArrayBuffer,\r\n argsLeft: number = 2;\r\n this._fileDescriptors[id] = fd;\r\n\r\n // Extract needed information asynchronously.\r\n fd.stat((err, stats) => {\r\n if (err) {\r\n cb(err);\r\n } else {\r\n stat = bufferToTransferrableObject(stats.toBuffer());\r\n // If it's a readable flag, we need to grab contents.\r\n if (flag.isReadable()) {\r\n fd.read(new Buffer(stats.size), 0, stats.size, 0, (err, bytesRead, buff) => {\r\n if (err) {\r\n cb(err);\r\n } else {\r\n data = bufferToTransferrableObject(buff);\r\n cb(null, {\r\n type: SpecialArgType.FD,\r\n id: id,\r\n data: data,\r\n stat: stat,\r\n path: p,\r\n flag: flag.getFlagString()\r\n });\r\n }\r\n });\r\n } else {\r\n // File is not readable, which means writing to it will append or\r\n // truncate/replace existing contents. Return an empty arraybuffer.\r\n cb(null, {\r\n type: SpecialArgType.FD,\r\n id: id,\r\n data: new ArrayBuffer(0),\r\n stat: stat,\r\n path: p,\r\n flag: flag.getFlagString()\r\n });\r\n }\r\n }\r\n });\r\n }\r\n\r\n private _applyFdChanges(remoteFd: IFileDescriptorArgument, cb: (err: ApiError, fd?: file.File) => void): void {\r\n var fd = this._fileDescriptors[remoteFd.id],\r\n data = transferrableObjectToBuffer(remoteFd.data),\r\n remoteStats = Stats.fromBuffer(transferrableObjectToBuffer(remoteFd.stat));\r\n\r\n // Write data if the file is writable.\r\n var flag = file_flag.FileFlag.getFileFlag(remoteFd.flag);\r\n if (flag.isWriteable()) {\r\n // Appendable: Write to end of file.\r\n // Writeable: Replace entire contents of file.\r\n fd.write(data, 0, data.length, flag.isAppendable() ? fd.getPos() : 0, (e) => {\r\n if (e) {\r\n cb(e);\r\n } else {\r\n function applyStatChanges() {\r\n // Check if mode changed.\r\n fd.stat((e, stats?) => {\r\n if (e) {\r\n cb(e);\r\n } else {\r\n if (stats.mode !== remoteStats.mode) {\r\n fd.chmod(remoteStats.mode, (e: any) => {\r\n cb(e, fd);\r\n });\r\n } else {\r\n cb(e, fd);\r\n }\r\n }\r\n });\r\n }\r\n\r\n // If writeable & not appendable, we need to ensure file contents are\r\n // identical to those from the remote FD. Thus, we truncate to the\r\n // length of the remote file.\r\n if (!flag.isAppendable()) {\r\n fd.truncate(data.length, () => {\r\n applyStatChanges();\r\n })\r\n } else {\r\n applyStatChanges();\r\n }\r\n }\r\n });\r\n } else {\r\n cb(null, fd);\r\n }\r\n }\r\n\r\n public applyFdAPIRequest(request: IAPIRequest, cb: (err?: ApiError) => void): void {\r\n var fdArg = <IFileDescriptorArgument> request.args[0];\r\n this._applyFdChanges(fdArg, (err, fd?) => {\r\n if (err) {\r\n cb(err);\r\n } else {\r\n // Apply method on now-changed file descriptor.\r\n (<any> fd)[request.method]((e?: ApiError) => {\r\n if (request.method === 'close') {\r\n delete this._fileDescriptors[fdArg.id];\r\n }\r\n cb(e);\r\n });\r\n }\r\n });\r\n }\r\n}\r\n\r\ninterface IAPIErrorArgument extends ISpecialArgument {\r\n // The error object, as an array buffer.\r\n errorData: ArrayBuffer;\r\n}\r\n\r\nfunction apiErrorLocal2Remote(e: ApiError): IAPIErrorArgument {\r\n return {\r\n type: SpecialArgType.API_ERROR,\r\n errorData: bufferToTransferrableObject(e.writeToBuffer())\r\n };\r\n}\r\n\r\nfunction apiErrorRemote2Local(e: IAPIErrorArgument): ApiError {\r\n return ApiError.fromBuffer(transferrableObjectToBuffer(e.errorData));\r\n}\r\n\r\ninterface IErrorArgument extends ISpecialArgument {\r\n // The name of the error (e.g. 'TypeError').\r\n name: string;\r\n // The message associated with the error.\r\n message: string;\r\n // The stack associated with the error.\r\n stack: string;\r\n}\r\n\r\nfunction errorLocal2Remote(e: Error): IErrorArgument {\r\n return {\r\n type: SpecialArgType.ERROR,\r\n name: e.name,\r\n message: e.message,\r\n stack: e.stack\r\n };\r\n}\r\n\r\nfunction errorRemote2Local(e: IErrorArgument): Error {\r\n var cnstr: {\r\n new (msg: string): Error;\r\n } = global[e.name];\r\n if (typeof(cnstr) !== 'function') {\r\n cnstr = Error;\r\n }\r\n var err = new cnstr(e.message);\r\n err.stack = e.stack;\r\n return err;\r\n}\r\n\r\ninterface IStatsArgument extends ISpecialArgument {\r\n // The stats object as an array buffer.\r\n statsData: ArrayBuffer;\r\n}\r\n\r\nfunction statsLocal2Remote(stats: Stats): IStatsArgument {\r\n return {\r\n type: SpecialArgType.STATS,\r\n statsData: bufferToTransferrableObject(stats.toBuffer())\r\n };\r\n}\r\n\r\nfunction statsRemote2Local(stats: IStatsArgument): Stats {\r\n return Stats.fromBuffer(transferrableObjectToBuffer(stats.statsData));\r\n}\r\n\r\ninterface IFileFlagArgument extends ISpecialArgument {\r\n flagStr: string;\r\n}\r\n\r\nfunction fileFlagLocal2Remote(flag: file_flag.FileFlag): IFileFlagArgument {\r\n return {\r\n type: SpecialArgType.FILEFLAG,\r\n flagStr: flag.getFlagString()\r\n };\r\n}\r\n\r\nfunction fileFlagRemote2Local(remoteFlag: IFileFlagArgument): file_flag.FileFlag {\r\n return file_flag.FileFlag.getFileFlag(remoteFlag.flagStr);\r\n}\r\n\r\ninterface IBufferArgument extends ISpecialArgument {\r\n data: ArrayBuffer;\r\n}\r\n\r\nfunction bufferToTransferrableObject(buff: NodeBuffer): ArrayBuffer {\r\n return buffer2ArrayBuffer(buff);\r\n}\r\n\r\nfunction transferrableObjectToBuffer(buff: ArrayBuffer): Buffer {\r\n return arrayBuffer2Buffer(buff);\r\n}\r\n\r\nfunction bufferLocal2Remote(buff: Buffer): IBufferArgument {\r\n return {\r\n type: SpecialArgType.BUFFER,\r\n data: bufferToTransferrableObject(buff)\r\n };\r\n}\r\n\r\nfunction bufferRemote2Local(buffArg: IBufferArgument): Buffer {\r\n return transferrableObjectToBuffer(buffArg.data);\r\n}\r\n\r\ninterface IAPIRequest extends IBrowserFSMessage {\r\n method: string;\r\n args: Array<number | string | ISpecialArgument>;\r\n}\r\n\r\nfunction isAPIRequest(data: any): data is IAPIRequest {\r\n return data != null && typeof data === 'object' && data.hasOwnProperty('browserfsMessage') && data['browserfsMessage'];\r\n}\r\n\r\ninterface IAPIResponse extends IBrowserFSMessage {\r\n cbId: number;\r\n args: Array<number | string | ISpecialArgument>;\r\n}\r\n\r\nfunction isAPIResponse(data: any): data is IAPIResponse {\r\n return data != null && typeof data === 'object' && data.hasOwnProperty('browserfsMessage') && data['browserfsMessage'];\r\n}\r\n\r\n/**\r\n * Represents a remote file in a different worker/thread.\r\n */\r\nclass WorkerFile extends preload_file.PreloadFile<WorkerFS> {\r\n private _remoteFdId: number;\r\n\r\n constructor(_fs: WorkerFS, _path: string, _flag: file_flag.FileFlag, _stat: Stats, remoteFdId: number, contents?: NodeBuffer) {\r\n super(_fs, _path, _flag, _stat, contents);\r\n this._remoteFdId = remoteFdId;\r\n }\r\n\r\n public getRemoteFdId() {\r\n return this._remoteFdId;\r\n }\r\n\r\n public toRemoteArg(): IFileDescriptorArgument {\r\n return <IFileDescriptorArgument> {\r\n type: SpecialArgType.FD,\r\n id: this._remoteFdId,\r\n data: bufferToTransferrableObject(this.getBuffer()),\r\n stat: bufferToTransferrableObject(this.getStats().toBuffer()),\r\n path: this.getPath(),\r\n flag: this.getFlag().getFlagString()\r\n };\r\n }\r\n\r\n private _syncClose(type: string, cb: (e?: ApiError) => void): void {\r\n if (this.isDirty()) {\r\n (<WorkerFS> this._fs).syncClose(type, this, (e?: ApiError) => {\r\n if (!e) {\r\n this.resetDirty();\r\n }\r\n cb(e);\r\n });\r\n } else {\r\n cb();\r\n }\r\n }\r\n\r\n public sync(cb: (e?: ApiError) => void): void {\r\n this._syncClose('sync', cb);\r\n }\r\n\r\n public close(cb: (e?: ApiError) => void): void {\r\n this._syncClose('close', cb);\r\n }\r\n}\r\n\r\n/**\r\n * WorkerFS lets you access a BrowserFS instance that is running in a different\r\n * JavaScript context (e.g. access BrowserFS in one of your WebWorkers, or\r\n * access BrowserFS running on the main page from a WebWorker).\r\n *\r\n * For example, to have a WebWorker access files in the main browser thread,\r\n * do the following:\r\n *\r\n * MAIN BROWSER THREAD:\r\n * ```\r\n * // Listen for remote file system requests.\r\n * BrowserFS.FileSystem.WorkerFS.attachRemoteListener(webWorkerObject);\r\n * ``\r\n *\r\n * WEBWORKER THREAD:\r\n * ```\r\n * // Set the remote file system as the root file system.\r\n * BrowserFS.initialize(new BrowserFS.FileSystem.WorkerFS(self));\r\n * ```\r\n *\r\n * Note that synchronous operations are not permitted on the WorkerFS, regardless\r\n * of the configuration option of the remote FS.\r\n */\r\nexport default class WorkerFS extends file_system.BaseFileSystem implements file_system.FileSystem {\r\n private _worker: Worker;\r\n private _callbackConverter = new CallbackArgumentConverter();\r\n\r\n private _isInitialized: boolean = false;\r\n private _isReadOnly: boolean = false;\r\n private _supportLinks: boolean = false;\r\n private _supportProps: boolean = false;\r\n\r\n /**\r\n * Stores outstanding API requests to the remote BrowserFS instance.\r\n */\r\n private _outstandingRequests: { [id: number]: () => void } = {};\r\n\r\n /**\r\n * Constructs a new WorkerFS instance that connects with BrowserFS running on\r\n * the specified worker.\r\n */\r\n constructor(worker: Worker) {\r\n super();\r\n this._worker = worker;\r\n this._worker.addEventListener('message',(e: MessageEvent) => {\r\n var resp: Object = e.data;\r\n if (isAPIResponse(resp)) {\r\n var i: number, args = resp.args, fixedArgs = new Array(args.length);\r\n // Dispatch event to correct id.\r\n for (i = 0; i < fixedArgs.length; i++) {\r\n fixedArgs[i] = this._argRemote2Local(args[i]);\r\n }\r\n this._callbackConverter.toLocalArg(resp.cbId).apply(null, fixedArgs);\r\n }\r\n });\r\n }\r\n\r\n public static isAvailable(): boolean {\r\n return typeof Worker !== 'undefined';\r\n }\r\n\r\n public getName(): string {\r\n return 'WorkerFS';\r\n }\r\n\r\n private _argRemote2Local(arg: any): any {\r\n if (arg == null) {\r\n return arg;\r\n }\r\n switch (typeof arg) {\r\n case 'object':\r\n if (arg['type'] != null && typeof arg['type'] === 'number') {\r\n var specialArg = <ISpecialArgument> arg;\r\n switch (specialArg.type) {\r\n case SpecialArgType.API_ERROR:\r\n return apiErrorRemote2Local(<IAPIErrorArgument> specialArg);\r\n case SpecialArgType.FD:\r\n var fdArg = <IFileDescriptorArgument> specialArg;\r\n return new WorkerFile(this, fdArg.path, file_flag.FileFlag.getFileFlag(fdArg.flag), Stats.fromBuffer(transferrableObjectToBuffer(fdArg.stat)), fdArg.id, transferrableObjectToBuffer(fdArg.data));\r\n case SpecialArgType.STATS:\r\n return statsRemote2Local(<IStatsArgument> specialArg);\r\n case SpecialArgType.FILEFLAG:\r\n return fileFlagRemote2Local(<IFileFlagArgument> specialArg);\r\n case SpecialArgType.BUFFER:\r\n return bufferRemote2Local(<IBufferArgument> specialArg);\r\n case SpecialArgType.ERROR:\r\n return errorRemote2Local(<IErrorArgument> specialArg);\r\n default:\r\n return arg;\r\n }\r\n } else {\r\n return arg;\r\n }\r\n default:\r\n return arg;\r\n }\r\n }\r\n\r\n /**\r\n * Converts a local argument into a remote argument. Public so WorkerFile objects can call it.\r\n */\r\n public _argLocal2Remote(arg: any): any {\r\n if (arg == null) {\r\n return arg;\r\n }\r\n switch (typeof arg) {\r\n case \"object\":\r\n if (arg instanceof Stats) {\r\n return statsLocal2Remote(arg);\r\n } else if (arg instanceof ApiError) {\r\n return apiErrorLocal2Remote(arg);\r\n } else if (arg instanceof WorkerFile) {\r\n return (<WorkerFile> arg).toRemoteArg();\r\n } else if (arg instanceof file_flag.FileFlag) {\r\n return fileFlagLocal2Remote(arg);\r\n } else if (arg instanceof Buffer) {\r\n return bufferLocal2Remote(arg);\r\n } else if (arg instanceof Error) {\r\n return errorLocal2Remote(arg);\r\n } else {\r\n return \"Unknown argument\";\r\n }\r\n case \"function\":\r\n return this._callbackConverter.toRemoteArg(arg);\r\n default:\r\n return arg;\r\n }\r\n }\r\n\r\n /**\r\n * Called once both local and remote sides are set up.\r\n */\r\n public initialize(cb: () => void): void {\r\n if (!this._isInitialized) {\r\n var message: IAPIRequest = {\r\n browserfsMessage: true,\r\n method: 'probe',\r\n args: [this._argLocal2Remote(new Buffer(0)), this._callbackConverter.toRemoteArg((probeResponse: IProbeResponse) => {\r\n this._isInitialized = true;\r\n this._isReadOnly = probeResponse.isReadOnly;\r\n this._supportLinks = probeResponse.supportsLinks;\r\n this._supportProps = probeResponse.supportsProps;\r\n cb();\r\n })]\r\n };\r\n this._worker.postMessage(message);\r\n } else {\r\n cb();\r\n }\r\n }\r\n\r\n public isReadOnly(): boolean { return this._isReadOnly; }\r\n public supportsSynch(): boolean { return false; }\r\n public supportsLinks(): boolean { return this._supportLinks; }\r\n public supportsProps(): boolean { return this._supportProps; }\r\n\r\n private _rpc(methodName: string, args: IArguments) {\r\n var message: IAPIRequest = {\r\n browserfsMessage: true,\r\n method: methodName,\r\n args: null\r\n }, fixedArgs = new Array(args.length), i: number;\r\n for (i = 0; i < args.length; i++) {\r\n fixedArgs[i] = this._argLocal2Remote(args[i]);\r\n }\r\n message.args = fixedArgs;\r\n this._worker.postMessage(message);\r\n }\r\n\r\n public rename(oldPath: string, newPath: string, cb: (err?: ApiError) => void): void {\r\n this._rpc('rename', arguments);\r\n }\r\n public stat(p: string, isLstat: boolean, cb: (err: ApiError, stat?: Stats) => void): void {\r\n this._rpc('stat', arguments);\r\n }\r\n public open(p: string, flag: file_flag.FileFlag, mode: number, cb: (err: ApiError, fd?: file.File) => any): void {\r\n this._rpc('open', arguments);\r\n }\r\n public unlink(p: string, cb: Function): void {\r\n this._rpc('unlink', arguments);\r\n }\r\n public rmdir(p: string, cb: Function): void {\r\n this._rpc('rmdir', arguments);\r\n }\r\n public mkdir(p: string, mode: number, cb: Function): void {\r\n this._rpc('mkdir', arguments);\r\n }\r\n public readdir(p: string, cb: (err: ApiError, files?: string[]) => void): void {\r\n this._rpc('readdir', arguments);\r\n }\r\n public exists(p: string, cb: (exists: boolean) => void): void {\r\n this._rpc('exists', arguments);\r\n }\r\n public realpath(p: string, cache: { [path: string]: string }, cb: (err: ApiError, resolvedPath?: string) => any): void {\r\n this._rpc('realpath', arguments);\r\n }\r\n public truncate(p: string, len: number, cb: Function): void {\r\n this._rpc('truncate', arguments);\r\n }\r\n public readFile(fname: string, encoding: string, flag: file_flag.FileFlag, cb: (err: ApiError, data?: any) => void): void {\r\n this._rpc('readFile', arguments);\r\n }\r\n public writeFile(fname: string, data: any, encoding: string, flag: file_flag.FileFlag, mode: number, cb: (err: ApiError) => void): void {\r\n this._rpc('writeFile', arguments);\r\n }\r\n public appendFile(fname: string, data: any, encoding: string, flag: file_flag.FileFlag, mode: number, cb: (err: ApiError) => void): void {\r\n this._rpc('appendFile', arguments);\r\n }\r\n public chmod(p: string, isLchmod: boolean, mode: number, cb: Function): void {\r\n this._rpc('chmod', arguments);\r\n }\r\n public chown(p: string, isLchown: boolean, uid: number, gid: number, cb: Function): void {\r\n this._rpc('chown', arguments);\r\n }\r\n public utimes(p: string, atime: Date, mtime: Date, cb: Function): void {\r\n this._rpc('utimes', arguments);\r\n }\r\n public link(srcpath: string, dstpath: string, cb: Function): void {\r\n this._rpc('link', arguments);\r\n }\r\n public symlink(srcpath: string, dstpath: string, type: string, cb: Function): void {\r\n this._rpc('symlink', arguments);\r\n }\r\n public readlink(p: string, cb: Function): void {\r\n this._rpc('readlink', arguments);\r\n }\r\n\r\n public syncClose(method: string, fd: file.File, cb: (e: ApiError) => void): void {\r\n this._worker.postMessage(<IAPIRequest> {\r\n browserfsMessage: true,\r\n method: method,\r\n args: [(<WorkerFile> fd).toRemoteArg(), this._callbackConverter.toRemoteArg(cb)]\r\n });\r\n }\r\n\r\n /**\r\n * Attaches a listener to the remote worker for file system requests.\r\n */\r\n public static attachRemoteListener(worker: Worker) {\r\n var fdConverter = new FileDescriptorArgumentConverter();\r\n\r\n function argLocal2Remote(arg: any, requestArgs: any[], cb: (err: ApiError, arg?: any) => void): void {\r\n switch (typeof arg) {\r\n case 'object':\r\n if (arg instanceof Stats) {\r\n cb(null, statsLocal2Remote(arg));\r\n } else if (arg instanceof ApiError) {\r\n cb(null, apiErrorLocal2Remote(arg));\r\n } else if (arg instanceof file.BaseFile) {\r\n // Pass in p and flags from original request.\r\n cb(null, fdConverter.toRemoteArg(arg, requestArgs[0], requestArgs[1], cb));\r\n } else if (arg instanceof file_flag.FileFlag) {\r\n cb(null, fileFlagLocal2Remote(arg));\r\n } else if (arg instanceof Buffer) {\r\n cb(null, bufferLocal2Remote(arg));\r\n } else if (arg instanceof Error) {\r\n cb(null, errorLocal2Remote(arg));\r\n } else {\r\n cb(null, arg);\r\n }\r\n break;\r\n default:\r\n cb(null, arg);\r\n break;\r\n }\r\n }\r\n\r\n function argRemote2Local(arg: any, fixedRequestArgs: any[]): any {\r\n if (arg == null) {\r\n return arg;\r\n }\r\n switch (typeof arg) {\r\n case 'object':\r\n if (typeof arg['type'] === 'number') {\r\n var specialArg = <ISpecialArgument> arg;\r\n switch (specialArg.type) {\r\n case SpecialArgType.CB:\r\n var cbId = (<ICallbackArgument> arg).id;\r\n return function() {\r\n var i: number, fixedArgs = new Array(arguments.length),\r\n message: IAPIResponse,\r\n countdown = arguments.length;\r\n\r\n function abortAndSendError(err: ApiError) {\r\n if (countdown > 0) {\r\n countdown = -1;\r\n message = {\r\n browserfsMessage: true,\r\n cbId: cbId,\r\n args: [apiErrorLocal2Remote(err)]\r\n };\r\n worker.postMessage(message);\r\n }\r\n }\r\n\r\n\r\n for (i = 0; i < arguments.length; i++) {\r\n // Capture i and argument.\r\n ((i: number, arg: any) => {\r\n argLocal2Remote(arg, fixedRequestArgs, (err, fixedArg?) => {\r\n fixedArgs[i] = fixedArg;\r\n if (err) {\r\n abortAndSendError(err);\r\n } else if (--countdown === 0) {\r\n message = {\r\n browserfsMessage: true,\r\n cbId: cbId,\r\n args: fixedArgs\r\n };\r\n worker.postMessage(message);\r\n }\r\n });\r\n })(i, arguments[i]);\r\n }\r\n\r\n if (arguments.length === 0) {\r\n message = {\r\n browserfsMessage: true,\r\n cbId: cbId,\r\n args: fixedArgs\r\n };\r\n worker.postMessage(message);\r\n }\r\n\r\n };\r\n case SpecialArgType.API_ERROR:\r\n return apiErrorRemote2Local(<IAPIErrorArgument> specialArg);\r\n case SpecialArgType.STATS:\r\n return statsRemote2Local(<IStatsArgument> specialArg);\r\n case SpecialArgType.FILEFLAG:\r\n return fileFlagRemote2Local(<IFileFlagArgument> specialArg);\r\n case SpecialArgType.BUFFER:\r\n return bufferRemote2Local(<IBufferArgument> specialArg);\r\n case SpecialArgType.ERROR:\r\n return errorRemote2Local(<IErrorArgument> specialArg);\r\n default:\r\n // No idea what this is.\r\n return arg;\r\n }\r\n } else {\r\n return arg;\r\n }\r\n default:\r\n return arg;\r\n }\r\n }\r\n\r\n worker.addEventListener('message',(e: MessageEvent) => {\r\n var request: Object = e.data;\r\n if (isAPIRequest(request)) {\r\n var args = request.args,\r\n fixedArgs = new Array<any>(args.length),\r\n i: number;\r\n\r\n switch (request.method) {\r\n case 'close':\r\n case 'sync':\r\n (() => {\r\n // File descriptor-relative methods.\r\n var remoteCb = <ICallbackArgument> args[1];\r\n fdConverter.applyFdAPIRequest(request, (err?: ApiError) => {\r\n // Send response.\r\n var response: IAPIResponse = {\r\n browserfsMessage: true,\r\n cbId: remoteCb.id,\r\n args: err ? [apiErrorLocal2Remote(err)] : []\r\n };\r\n worker.postMessage(response);\r\n });\r\n })();\r\n break;\r\n case 'probe':\r\n (() => {\r\n var rootFs = <file_system.FileSystem> fs.getRootFS(),\r\n remoteCb = <ICallbackArgument> args[1],\r\n probeResponse: IProbeResponse = {\r\n type: SpecialArgType.PROBE,\r\n isReadOnly: rootFs.isReadOnly(),\r\n supportsLinks: rootFs.supportsLinks(),\r\n supportsProps: rootFs.supportsProps()\r\n },\r\n response: IAPIResponse = {\r\n browserfsMessage: true,\r\n cbId: remoteCb.id,\r\n args: [probeResponse]\r\n };\r\n\r\n worker.postMessage(response);\r\n })();\r\n break;\r\n default:\r\n // File system methods.\r\n for (i = 0; i < args.length; i++) {\r\n fixedArgs[i] = argRemote2Local(args[i], fixedArgs);\r\n }\r\n var rootFS = fs.getRootFS();\r\n (<Function> rootFS[request.method]).apply(rootFS, fixedArgs);\r\n break;\r\n }\r\n }\r\n });\r\n }\r\n}\r\n",
|
||
"import file_system = require('../core/file_system');\r\nimport {ApiError, ErrorCode} from '../core/api_error';\r\nimport {FileFlag, ActionType} from '../core/file_flag';\r\nimport {copyingSlice} from '../core/util';\r\nimport file = require('../core/file');\r\nimport Stats from '../core/node_fs_stats';\r\nimport preload_file = require('../generic/preload_file');\r\nimport xhr = require('../generic/xhr');\r\nimport {FileIndex, DirInode, FileInode, Inode, isFileInode, isDirInode} from '../generic/file_index';\r\n\r\n/**\r\n * Try to convert the given buffer into a string, and pass it to the callback.\r\n * Optimization that removes the needed try/catch into a helper function, as\r\n * this is an uncommon case.\r\n */\r\nfunction tryToString(buff: Buffer, encoding: string, cb: (e: ApiError, rv?: string) => void) {\r\n try {\r\n cb(null, buff.toString(encoding));\r\n } catch (e) {\r\n cb(e);\r\n }\r\n}\r\n\r\n/**\r\n * A simple filesystem backed by XmlHttpRequests.\r\n */\r\nexport default class XmlHttpRequest extends file_system.BaseFileSystem implements file_system.FileSystem {\r\n private _index: FileIndex<{}>;\r\n public prefixUrl: string;\r\n /**\r\n * Constructs the file system.\r\n * @param listingUrlOrObj index object or the path to the JSON file index generated by\r\n * tools/XHRIndexer.coffee. This can be relative to the current webpage URL\r\n * or absolutely specified.\r\n * @param prefixUrl The url prefix to use for all web-server requests.\r\n */\r\n constructor(listingUrlOrObj: string | Object, prefixUrl: string = '') {\r\n super();\r\n if (!listingUrlOrObj) {\r\n listingUrlOrObj = 'index.json';\r\n }\r\n // prefix_url must end in a directory separator.\r\n if (prefixUrl.length > 0 && prefixUrl.charAt(prefixUrl.length - 1) !== '/') {\r\n prefixUrl = prefixUrl + '/';\r\n }\r\n this.prefixUrl = prefixUrl;\r\n\r\n let listing: Object = null;\r\n if (typeof(listingUrlOrObj) === \"string\") {\r\n listing = this._requestFileSync(<string> listingUrlOrObj, 'json');\r\n if (!listing) {\r\n throw new Error(\"Unable to find listing at URL: ${listingUrlOrObj}\");\r\n }\r\n } else {\r\n listing = listingUrlOrObj;\r\n }\r\n\r\n this._index = FileIndex.fromListing(listing);\r\n }\r\n\r\n public empty(): void {\r\n this._index.fileIterator(function(file: Stats) {\r\n file.file_data = null;\r\n });\r\n }\r\n\r\n private getXhrPath(filePath: string): string {\r\n if (filePath.charAt(0) === '/') {\r\n filePath = filePath.slice(1);\r\n }\r\n return this.prefixUrl + filePath;\r\n }\r\n\r\n /**\r\n * Only requests the HEAD content, for the file size.\r\n */\r\n public _requestFileSizeAsync(path: string, cb: (err: ApiError, size?: number) => void): void {\r\n xhr.getFileSizeAsync(this.getXhrPath(path), cb);\r\n }\r\n public _requestFileSizeSync(path: string): number {\r\n return xhr.getFileSizeSync(this.getXhrPath(path));\r\n }\r\n\r\n /**\r\n * Asynchronously download the given file.\r\n */\r\n private _requestFileAsync(p: string, type: 'buffer', cb: (err: ApiError, data?: NodeBuffer) => void): void;\r\n private _requestFileAsync(p: string, type: 'json', cb: (err: ApiError, data?: any) => void): void;\r\n private _requestFileAsync(p: string, type: string, cb: (err: ApiError, data?: any) => void): void;\r\n private _requestFileAsync(p: string, type: string, cb: (err: ApiError, data?: any) => void): void {\r\n xhr.asyncDownloadFile(this.getXhrPath(p), type, cb);\r\n }\r\n\r\n /**\r\n * Synchronously download the given file.\r\n */\r\n private _requestFileSync(p: string, type: 'buffer'): NodeBuffer;\r\n private _requestFileSync(p: string, type: 'json'): any;\r\n private _requestFileSync(p: string, type: string): any;\r\n private _requestFileSync(p: string, type: string): any {\r\n return xhr.syncDownloadFile(this.getXhrPath(p), type);\r\n }\r\n\r\n public getName(): string {\r\n return 'XmlHttpRequest';\r\n }\r\n\r\n public static isAvailable(): boolean {\r\n // @todo Older browsers use a different name for XHR, iirc.\r\n return typeof XMLHttpRequest !== \"undefined\" && XMLHttpRequest !== null;\r\n }\r\n\r\n public diskSpace(path: string, cb: (total: number, free: number) => void): void {\r\n // Read-only file system. We could calculate the total space, but that's not\r\n // important right now.\r\n cb(0, 0);\r\n }\r\n\r\n public isReadOnly(): boolean {\r\n return true;\r\n }\r\n\r\n public supportsLinks(): boolean {\r\n return false;\r\n }\r\n\r\n public supportsProps(): boolean {\r\n return false;\r\n }\r\n\r\n public supportsSynch(): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Special XHR function: Preload the given file into the index.\r\n * @param [String] path\r\n * @param [BrowserFS.Buffer] buffer\r\n */\r\n public preloadFile(path: string, buffer: NodeBuffer): void {\r\n var inode = this._index.getInode(path);\r\n if (isFileInode<Stats>(inode)) {\r\n if (inode === null) {\r\n throw ApiError.ENOENT(path);\r\n }\r\n var stats = inode.getData();\r\n stats.size = buffer.length;\r\n stats.file_data = buffer;\r\n } else {\r\n throw ApiError.EISDIR(path);\r\n }\r\n }\r\n\r\n public stat(path: string, isLstat: boolean, cb: (e: ApiError, stat?: Stats) => void): void {\r\n var inode = this._index.getInode(path);\r\n if (inode === null) {\r\n return cb(ApiError.ENOENT(path));\r\n }\r\n var stats: Stats;\r\n if (isFileInode<Stats>(inode)) {\r\n stats = inode.getData();\r\n // At this point, a non-opened file will still have default stats from the listing.\r\n if (stats.size < 0) {\r\n this._requestFileSizeAsync(path, function(e: ApiError, size?: number) {\r\n if (e) {\r\n return cb(e);\r\n }\r\n stats.size = size;\r\n cb(null, stats.clone());\r\n });\r\n } else {\r\n cb(null, stats.clone());\r\n }\r\n } else if (isDirInode(inode)) {\r\n stats = inode.getStats();\r\n cb(null, stats);\r\n } else {\r\n cb(ApiError.FileError(ErrorCode.EINVAL, path));\r\n }\r\n }\r\n\r\n public statSync(path: string, isLstat: boolean): Stats {\r\n var inode = this._index.getInode(path);\r\n if (inode === null) {\r\n throw ApiError.ENOENT(path);\r\n }\r\n var stats: Stats;\r\n if (isFileInode<Stats>(inode)) {\r\n stats = inode.getData();\r\n // At this point, a non-opened file will still have default stats from the listing.\r\n if (stats.size < 0) {\r\n stats.size = this._requestFileSizeSync(path);\r\n }\r\n } else if (isDirInode(inode)) {\r\n stats = inode.getStats();\r\n } else {\r\n throw ApiError.FileError(ErrorCode.EINVAL, path);\r\n }\r\n return stats;\r\n }\r\n\r\n public open(path: string, flags: FileFlag, mode: number, cb: (e: ApiError, file?: file.File) => void): void {\r\n // INVARIANT: You can't write to files on this file system.\r\n if (flags.isWriteable()) {\r\n return cb(new ApiError(ErrorCode.EPERM, path));\r\n }\r\n var _this = this;\r\n // Check if the path exists, and is a file.\r\n var inode = this._index.getInode(path);\r\n if (inode === null) {\r\n return cb(ApiError.ENOENT(path));\r\n }\r\n if (isFileInode<Stats>(inode)) {\r\n var stats = inode.getData();\r\n switch (flags.pathExistsAction()) {\r\n case ActionType.THROW_EXCEPTION:\r\n case ActionType.TRUNCATE_FILE:\r\n return cb(ApiError.EEXIST(path));\r\n case ActionType.NOP:\r\n // Use existing file contents.\r\n // XXX: Uh, this maintains the previously-used flag.\r\n if (stats.file_data != null) {\r\n return cb(null, new preload_file.NoSyncFile(_this, path, flags, stats.clone(), stats.file_data));\r\n }\r\n // @todo be lazier about actually requesting the file\r\n this._requestFileAsync(path, 'buffer', function(err: ApiError, buffer?: NodeBuffer) {\r\n if (err) {\r\n return cb(err);\r\n }\r\n // we don't initially have file sizes\r\n stats.size = buffer.length;\r\n stats.file_data = buffer;\r\n return cb(null, new preload_file.NoSyncFile(_this, path, flags, stats.clone(), buffer));\r\n });\r\n break;\r\n default:\r\n return cb(new ApiError(ErrorCode.EINVAL, 'Invalid FileMode object.'));\r\n }\r\n } else {\r\n return cb(ApiError.EISDIR(path));\r\n }\r\n }\r\n\r\n public openSync(path: string, flags: FileFlag, mode: number): file.File {\r\n // INVARIANT: You can't write to files on this file system.\r\n if (flags.isWriteable()) {\r\n throw new ApiError(ErrorCode.EPERM, path);\r\n }\r\n // Check if the path exists, and is a file.\r\n var inode = this._index.getInode(path);\r\n if (inode === null) {\r\n throw ApiError.ENOENT(path);\r\n }\r\n if (isFileInode<Stats>(inode)) {\r\n var stats = inode.getData();\r\n switch (flags.pathExistsAction()) {\r\n case ActionType.THROW_EXCEPTION:\r\n case ActionType.TRUNCATE_FILE:\r\n throw ApiError.EEXIST(path);\r\n case ActionType.NOP:\r\n // Use existing file contents.\r\n // XXX: Uh, this maintains the previously-used flag.\r\n if (stats.file_data != null) {\r\n return new preload_file.NoSyncFile(this, path, flags, stats.clone(), stats.file_data);\r\n }\r\n // @todo be lazier about actually requesting the file\r\n var buffer = this._requestFileSync(path, 'buffer');\r\n // we don't initially have file sizes\r\n stats.size = buffer.length;\r\n stats.file_data = buffer;\r\n return new preload_file.NoSyncFile(this, path, flags, stats.clone(), buffer);\r\n default:\r\n throw new ApiError(ErrorCode.EINVAL, 'Invalid FileMode object.');\r\n }\r\n } else {\r\n throw ApiError.EISDIR(path);\r\n }\r\n }\r\n\r\n public readdir(path: string, cb: (e: ApiError, listing?: string[]) => void): void {\r\n try {\r\n cb(null, this.readdirSync(path));\r\n } catch (e) {\r\n cb(e);\r\n }\r\n }\r\n\r\n public readdirSync(path: string): string[] {\r\n // Check if it exists.\r\n var inode = this._index.getInode(path);\r\n if (inode === null) {\r\n throw ApiError.ENOENT(path);\r\n } else if (isDirInode(inode)) {\r\n return inode.getListing();\r\n } else {\r\n throw ApiError.ENOTDIR(path);\r\n }\r\n }\r\n\r\n /**\r\n * We have the entire file as a buffer; optimize readFile.\r\n */\r\n public readFile(fname: string, encoding: string, flag: FileFlag, cb: (err: ApiError, data?: any) => void): void {\r\n // Wrap cb in file closing code.\r\n var oldCb = cb;\r\n // Get file.\r\n this.open(fname, flag, 0x1a4, function(err: ApiError, fd?: file.File) {\r\n if (err) {\r\n return cb(err);\r\n }\r\n cb = function(err: ApiError, arg?: Buffer) {\r\n fd.close(function(err2: any) {\r\n if (err == null) {\r\n err = err2;\r\n }\r\n return oldCb(err, arg);\r\n });\r\n };\r\n var fdCast = <preload_file.NoSyncFile<XmlHttpRequest>> fd;\r\n var fdBuff = <Buffer> fdCast.getBuffer();\r\n if (encoding === null) {\r\n cb(err, copyingSlice(fdBuff));\r\n } else {\r\n tryToString(fdBuff, encoding, cb);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Specially-optimized readfile.\r\n */\r\n public readFileSync(fname: string, encoding: string, flag: FileFlag): any {\r\n // Get file.\r\n var fd = this.openSync(fname, flag, 0x1a4);\r\n try {\r\n var fdCast = <preload_file.NoSyncFile<XmlHttpRequest>> fd;\r\n var fdBuff = <Buffer> fdCast.getBuffer();\r\n if (encoding === null) {\r\n return copyingSlice(fdBuff);\r\n }\r\n return fdBuff.toString(encoding);\r\n } finally {\r\n fd.closeSync();\r\n }\r\n }\r\n}\r\n",
|
||
"/**\r\n * Zip file-backed filesystem\r\n * Implemented according to the standard:\r\n * http://www.pkware.com/documents/casestudies/APPNOTE.TXT\r\n *\r\n * While there are a few zip libraries for JavaScript (e.g. JSZip and zip.js),\r\n * they are not a good match for BrowserFS. In particular, these libraries\r\n * perform a lot of unneeded data copying, and eagerly decompress every file\r\n * in the zip file upon loading to check the CRC32. They also eagerly decode\r\n * strings. Furthermore, these libraries duplicate functionality already present\r\n * in BrowserFS (e.g. UTF-8 decoding and binary data manipulation).\r\n *\r\n * This filesystem takes advantage of BrowserFS's Buffer implementation, which\r\n * efficiently represents the zip file in memory (in both ArrayBuffer-enabled\r\n * browsers *and* non-ArrayBuffer browsers), and which can neatly be 'sliced'\r\n * without copying data. Each struct defined in the standard is represented with\r\n * a buffer slice pointing to an offset in the zip file, and has getters for\r\n * each field. As we anticipate that this data will not be read often, we choose\r\n * not to store each struct field in the JavaScript object; instead, to reduce\r\n * memory consumption, we retrieve it directly from the binary data each time it\r\n * is requested.\r\n *\r\n * When the filesystem is instantiated, we determine the directory structure\r\n * of the zip file as quickly as possible. We lazily decompress and check the\r\n * CRC32 of files. We do not cache decompressed files; if this is a desired\r\n * feature, it is best implemented as a generic file system wrapper that can\r\n * cache data from arbitrary file systems.\r\n *\r\n * For inflation, we use `pajo`'s implementation:\r\n * https://github.com/nodeca/pako\r\n *\r\n * Unfortunately, their implementation falls back to an array of bytes for non-\r\n * TypedArray browsers, which is results in a much larger memory footprint in\r\n * those browsers. Perhaps one day we'll have an implementation of inflate that\r\n * works on Buffers? :)\r\n *\r\n * Current limitations:\r\n * * No encryption.\r\n * * No ZIP64 support.\r\n * * Read-only.\r\n * Write support would require that we:\r\n * - Keep track of changed/new files.\r\n * - Compress changed files, and generate appropriate metadata for each.\r\n * - Update file offsets for other files in the zip file.\r\n * - Stream it out to a location.\r\n * This isn't that bad, so we might do this at a later date.\r\n */\r\nimport {ApiError, ErrorCode} from '../core/api_error';\r\nimport {default as Stats, FileType} from '../core/node_fs_stats';\r\nimport file_system = require('../core/file_system');\r\nimport file = require('../core/file');\r\nimport {FileFlag, ActionType} from '../core/file_flag';\r\nimport preload_file = require('../generic/preload_file');\r\nimport {Arrayish, buffer2Arrayish, arrayish2Buffer, copyingSlice} from '../core/util';\r\nimport ExtendedASCII from 'bfs-buffer/js/extended_ascii';\r\nvar inflateRaw: {\r\n (data: Arrayish<number>, options?: {\r\n chunkSize: number;\r\n }): Arrayish<number>;\r\n} = require('pako/dist/pako_inflate.min').inflateRaw;\r\nimport {FileIndex, DirInode, FileInode, isDirInode, isFileInode} from '../generic/file_index';\r\n\r\n\r\n/**\r\n * 4.4.2.2: Indicates the compatibiltiy of a file's external attributes.\r\n */\r\nexport enum ExternalFileAttributeType {\r\n MSDOS = 0, AMIGA = 1, OPENVMS = 2, UNIX = 3, VM_CMS = 4, ATARI_ST = 5,\r\n OS2_HPFS = 6, MAC = 7, Z_SYSTEM = 8, CP_M = 9, NTFS = 10, MVS = 11, VSE = 12,\r\n ACORN_RISC = 13, VFAT = 14, ALT_MVS = 15, BEOS = 16, TANDEM = 17, OS_400 = 18,\r\n OSX = 19\r\n}\r\n\r\n/**\r\n * 4.4.5\r\n */\r\nexport enum CompressionMethod {\r\n STORED = 0, // The file is stored (no compression)\r\n SHRUNK = 1, // The file is Shrunk\r\n REDUCED_1 = 2, // The file is Reduced with compression factor 1\r\n REDUCED_2 = 3, // The file is Reduced with compression factor 2\r\n REDUCED_3 = 4, // The file is Reduced with compression factor 3\r\n REDUCED_4 = 5, // The file is Reduced with compression factor 4\r\n IMPLODE = 6, // The file is Imploded\r\n DEFLATE = 8, // The file is Deflated\r\n DEFLATE64 = 9, // Enhanced Deflating using Deflate64(tm)\r\n TERSE_OLD = 10, // PKWARE Data Compression Library Imploding (old IBM TERSE)\r\n BZIP2 = 12, // File is compressed using BZIP2 algorithm\r\n LZMA = 14, // LZMA (EFS)\r\n TERSE_NEW = 18, // File is compressed using IBM TERSE (new)\r\n LZ77 = 19, // IBM LZ77 z Architecture (PFS)\r\n WAVPACK = 97, // WavPack compressed data\r\n PPMD = 98 // PPMd version I, Rev 1\r\n}\r\n\r\n/**\r\n * Converts the input time and date in MS-DOS format into a JavaScript Date\r\n * object.\r\n */\r\nfunction msdos2date(time: number, date: number): Date {\r\n // MS-DOS Date\r\n //|0 0 0 0 0|0 0 0 0|0 0 0 0 0 0 0\r\n // D (1-31) M (1-23) Y (from 1980)\r\n var day = date & 0x1F;\r\n // JS date is 0-indexed, DOS is 1-indexed.\r\n var month = ((date >> 5) & 0xF) - 1;\r\n var year = (date >> 9) + 1980;\r\n // MS DOS Time\r\n //|0 0 0 0 0|0 0 0 0 0 0|0 0 0 0 0\r\n // Second Minute Hour\r\n var second = time & 0x1F;\r\n var minute = (time >> 5) & 0x3F;\r\n var hour = time >> 11;\r\n return new Date(year, month, day, hour, minute, second);\r\n}\r\n\r\n/**\r\n * Safely returns the string from the buffer, even if it is 0 bytes long.\r\n * (Normally, calling toString() on a buffer with start === end causes an\r\n * exception).\r\n */\r\nfunction safeToString(buff: NodeBuffer, useUTF8: boolean, start: number, length: number): string {\r\n if (length === 0) {\r\n return \"\";\r\n } else if (useUTF8) {\r\n return buff.toString('utf8', start, start + length);\r\n } else {\r\n return ExtendedASCII.byte2str(buff.slice(start, start + length));\r\n }\r\n}\r\n\r\n/*\r\n 4.3.6 Overall .ZIP file format:\r\n\r\n [local file header 1]\r\n [encryption header 1]\r\n [file data 1]\r\n [data descriptor 1]\r\n .\r\n .\r\n .\r\n [local file header n]\r\n [encryption header n]\r\n [file data n]\r\n [data descriptor n]\r\n [archive decryption header]\r\n [archive extra data record]\r\n [central directory header 1]\r\n .\r\n .\r\n .\r\n [central directory header n]\r\n [zip64 end of central directory record]\r\n [zip64 end of central directory locator]\r\n [end of central directory record]\r\n*/\r\n\r\n/*\r\n 4.3.7 Local file header:\r\n\r\n local file header signature 4 bytes (0x04034b50)\r\n version needed to extract 2 bytes\r\n general purpose bit flag 2 bytes\r\n compression method 2 bytes\r\n last mod file time 2 bytes\r\n last mod file date 2 bytes\r\n crc-32 4 bytes\r\n compressed size 4 bytes\r\n uncompressed size 4 bytes\r\n file name length 2 bytes\r\n extra field length 2 bytes\r\n\r\n file name (variable size)\r\n extra field (variable size)\r\n */\r\nexport class FileHeader {\r\n constructor(private data: NodeBuffer) {\r\n if (data.readUInt32LE(0) !== 0x04034b50) {\r\n throw new ApiError(ErrorCode.EINVAL, \"Invalid Zip file: Local file header has invalid signature: \" + this.data.readUInt32LE(0));\r\n }\r\n }\r\n public versionNeeded(): number { return this.data.readUInt16LE(4); }\r\n public flags(): number { return this.data.readUInt16LE(6); }\r\n public compressionMethod(): CompressionMethod { return this.data.readUInt16LE(8); }\r\n public lastModFileTime(): Date {\r\n // Time and date is in MS-DOS format.\r\n return msdos2date(this.data.readUInt16LE(10), this.data.readUInt16LE(12));\r\n }\r\n public rawLastModFileTime(): number {\r\n return this.data.readUInt32LE(10);\r\n }\r\n public crc32(): number { return this.data.readUInt32LE(14); }\r\n /**\r\n * These two values are COMPLETELY USELESS.\r\n *\r\n * Section 4.4.9:\r\n * If bit 3 of the general purpose bit flag is set,\r\n * these fields are set to zero in the local header and the\r\n * correct values are put in the data descriptor and\r\n * in the central directory.\r\n *\r\n * So we'll just use the central directory's values.\r\n */\r\n // public compressedSize(): number { return this.data.readUInt32LE(18); }\r\n // public uncompressedSize(): number { return this.data.readUInt32LE(22); }\r\n public fileNameLength(): number { return this.data.readUInt16LE(26); }\r\n public extraFieldLength(): number { return this.data.readUInt16LE(28); }\r\n public fileName(): string {\r\n return safeToString(this.data, this.useUTF8(), 30, this.fileNameLength());\r\n }\r\n public extraField(): NodeBuffer {\r\n var start = 30 + this.fileNameLength();\r\n return this.data.slice(start, start + this.extraFieldLength());\r\n }\r\n public totalSize(): number { return 30 + this.fileNameLength() + this.extraFieldLength(); }\r\n public useUTF8(): boolean { return (this.flags() & 0x800) === 0x800; }\r\n}\r\n\r\n/**\r\n 4.3.8 File data\r\n\r\n Immediately following the local header for a file\r\n SHOULD be placed the compressed or stored data for the file.\r\n If the file is encrypted, the encryption header for the file\r\n SHOULD be placed after the local header and before the file\r\n data. The series of [local file header][encryption header]\r\n [file data][data descriptor] repeats for each file in the\r\n .ZIP archive.\r\n\r\n Zero-byte files, directories, and other file types that\r\n contain no content MUST not include file data.\r\n*/\r\nexport class FileData {\r\n constructor(private header: FileHeader, private record: CentralDirectory, private data: NodeBuffer) {}\r\n public decompress(): NodeBuffer {\r\n // Check the compression\r\n var compressionMethod: CompressionMethod = this.header.compressionMethod();\r\n switch (compressionMethod) {\r\n case CompressionMethod.DEFLATE:\r\n var data = inflateRaw(\r\n buffer2Arrayish(this.data.slice(0, this.record.compressedSize())),\r\n { chunkSize: this.record.uncompressedSize() }\r\n );\r\n return arrayish2Buffer(data);\r\n case CompressionMethod.STORED:\r\n // Grab and copy.\r\n return copyingSlice(this.data, 0, this.record.uncompressedSize());\r\n default:\r\n var name: string = CompressionMethod[compressionMethod];\r\n name = name ? name : \"Unknown: \" + compressionMethod;\r\n throw new ApiError(ErrorCode.EINVAL, \"Invalid compression method on file '\" + this.header.fileName() + \"': \" + name);\r\n }\r\n }\r\n public getHeader(): FileHeader {\r\n return this.header;\r\n }\r\n public getRecord(): CentralDirectory {\r\n return this.record;\r\n }\r\n public getRawData(): NodeBuffer {\r\n return this.data;\r\n }\r\n}\r\n\r\n/*\r\n 4.3.9 Data descriptor:\r\n\r\n crc-32 4 bytes\r\n compressed size 4 bytes\r\n uncompressed size 4 bytes\r\n */\r\nexport class DataDescriptor {\r\n constructor(private data: NodeBuffer) {}\r\n public crc32(): number { return this.data.readUInt32LE(0); }\r\n public compressedSize(): number { return this.data.readUInt32LE(4); }\r\n public uncompressedSize(): number { return this.data.readUInt32LE(8); }\r\n}\r\n\r\n/*\r\n` 4.3.10 Archive decryption header:\r\n\r\n 4.3.10.1 The Archive Decryption Header is introduced in version 6.2\r\n of the ZIP format specification. This record exists in support\r\n of the Central Directory Encryption Feature implemented as part of\r\n the Strong Encryption Specification as described in this document.\r\n When the Central Directory Structure is encrypted, this decryption\r\n header MUST precede the encrypted data segment.\r\n */\r\n/*\r\n 4.3.11 Archive extra data record:\r\n\r\n archive extra data signature 4 bytes (0x08064b50)\r\n extra field length 4 bytes\r\n extra field data (variable size)\r\n\r\n 4.3.11.1 The Archive Extra Data Record is introduced in version 6.2\r\n of the ZIP format specification. This record MAY be used in support\r\n of the Central Directory Encryption Feature implemented as part of\r\n the Strong Encryption Specification as described in this document.\r\n When present, this record MUST immediately precede the central\r\n directory data structure.\r\n*/\r\nexport class ArchiveExtraDataRecord {\r\n constructor(private data: NodeBuffer) {\r\n if (this.data.readUInt32LE(0) !== 0x08064b50) {\r\n throw new ApiError(ErrorCode.EINVAL, \"Invalid archive extra data record signature: \" + this.data.readUInt32LE(0));\r\n }\r\n }\r\n public length(): number { return this.data.readUInt32LE(4); }\r\n public extraFieldData(): NodeBuffer { return this.data.slice(8, 8 + this.length()); }\r\n}\r\n\r\n/*\r\n 4.3.13 Digital signature:\r\n\r\n header signature 4 bytes (0x05054b50)\r\n size of data 2 bytes\r\n signature data (variable size)\r\n\r\n With the introduction of the Central Directory Encryption\r\n feature in version 6.2 of this specification, the Central\r\n Directory Structure MAY be stored both compressed and encrypted.\r\n Although not required, it is assumed when encrypting the\r\n Central Directory Structure, that it will be compressed\r\n for greater storage efficiency. Information on the\r\n Central Directory Encryption feature can be found in the section\r\n describing the Strong Encryption Specification. The Digital\r\n Signature record will be neither compressed nor encrypted.\r\n*/\r\nexport class DigitalSignature {\r\n constructor(private data: NodeBuffer) {\r\n if (this.data.readUInt32LE(0) !== 0x05054b50) {\r\n throw new ApiError(ErrorCode.EINVAL, \"Invalid digital signature signature: \" + this.data.readUInt32LE(0));\r\n }\r\n }\r\n public size(): number { return this.data.readUInt16LE(4); }\r\n public signatureData(): NodeBuffer { return this.data.slice(6, 6 + this.size()); }\r\n}\r\n\r\n/*\r\n 4.3.12 Central directory structure:\r\n\r\n central file header signature 4 bytes (0x02014b50)\r\n version made by 2 bytes\r\n version needed to extract 2 bytes\r\n general purpose bit flag 2 bytes\r\n compression method 2 bytes\r\n last mod file time 2 bytes\r\n last mod file date 2 bytes\r\n crc-32 4 bytes\r\n compressed size 4 bytes\r\n uncompressed size 4 bytes\r\n file name length 2 bytes\r\n extra field length 2 bytes\r\n file comment length 2 bytes\r\n disk number start 2 bytes\r\n internal file attributes 2 bytes\r\n external file attributes 4 bytes\r\n relative offset of local header 4 bytes\r\n\r\n file name (variable size)\r\n extra field (variable size)\r\n file comment (variable size)\r\n */\r\nexport class CentralDirectory {\r\n // Optimization: The filename is frequently read, so stash it here.\r\n private _filename: string;\r\n constructor(private zipData: NodeBuffer, private data: NodeBuffer) {\r\n // Sanity check.\r\n if (this.data.readUInt32LE(0) !== 0x02014b50)\r\n throw new ApiError(ErrorCode.EINVAL, \"Invalid Zip file: Central directory record has invalid signature: \" + this.data.readUInt32LE(0));\r\n this._filename = this.produceFilename();\r\n }\r\n public versionMadeBy(): number { return this.data.readUInt16LE(4); }\r\n public versionNeeded(): number { return this.data.readUInt16LE(6); }\r\n public flag(): number { return this.data.readUInt16LE(8); }\r\n public compressionMethod(): CompressionMethod { return this.data.readUInt16LE(10); }\r\n public lastModFileTime(): Date {\r\n // Time and date is in MS-DOS format.\r\n return msdos2date(this.data.readUInt16LE(12), this.data.readUInt16LE(14));\r\n }\r\n public rawLastModFileTime(): number {\r\n return this.data.readUInt32LE(12);\r\n }\r\n public crc32(): number { return this.data.readUInt32LE(16); }\r\n public compressedSize(): number { return this.data.readUInt32LE(20); }\r\n public uncompressedSize(): number { return this.data.readUInt32LE(24); }\r\n public fileNameLength(): number { return this.data.readUInt16LE(28); }\r\n public extraFieldLength(): number { return this.data.readUInt16LE(30); }\r\n public fileCommentLength(): number { return this.data.readUInt16LE(32); }\r\n public diskNumberStart(): number { return this.data.readUInt16LE(34); }\r\n public internalAttributes(): number { return this.data.readUInt16LE(36); }\r\n public externalAttributes(): number { return this.data.readUInt32LE(38); }\r\n public headerRelativeOffset(): number { return this.data.readUInt32LE(42); }\r\n public produceFilename(): string {\r\n /*\r\n 4.4.17.1 claims:\r\n * All slashes are forward ('/') slashes.\r\n * Filename doesn't begin with a slash.\r\n * No drive letters or any nonsense like that.\r\n * If filename is missing, the input came from standard input.\r\n\r\n Unfortunately, this isn't true in practice. Some Windows zip utilities use\r\n a backslash here, but the correct Unix-style path in file headers.\r\n\r\n To avoid seeking all over the file to recover the known-good filenames\r\n from file headers, we simply convert '/' to '\\' here.\r\n */\r\n var fileName: string = safeToString(this.data, this.useUTF8(), 46, this.fileNameLength());\r\n return fileName.replace(/\\\\/g, \"/\");\r\n }\r\n public fileName(): string {\r\n return this._filename;\r\n }\r\n public rawFileName(): NodeBuffer {\r\n return this.data.slice(46, 46 + this.fileNameLength());\r\n }\r\n public extraField(): NodeBuffer {\r\n var start = 44 + this.fileNameLength();\r\n return this.data.slice(start, start + this.extraFieldLength());\r\n }\r\n public fileComment(): string {\r\n var start = 46 + this.fileNameLength() + this.extraFieldLength();\r\n return safeToString(this.data, this.useUTF8(), start, this.fileCommentLength());\r\n }\r\n public rawFileComment(): NodeBuffer {\r\n let start = 46 + this.fileNameLength() + this.extraFieldLength();\r\n return this.data.slice(start, start + this.fileCommentLength());\r\n }\r\n public totalSize(): number {\r\n return 46 + this.fileNameLength() + this.extraFieldLength() + this.fileCommentLength();\r\n }\r\n public isDirectory(): boolean {\r\n // NOTE: This assumes that the zip file implementation uses the lower byte\r\n // of external attributes for DOS attributes for\r\n // backwards-compatibility. This is not mandated, but appears to be\r\n // commonplace.\r\n // According to the spec, the layout of external attributes is\r\n // platform-dependent.\r\n // If that fails, we also check if the name of the file ends in '/',\r\n // which is what Java's ZipFile implementation does.\r\n var fileName = this.fileName();\r\n return (this.externalAttributes() & 0x10 ? true : false) || (fileName.charAt(fileName.length-1) === '/');\r\n }\r\n public isFile(): boolean { return !this.isDirectory(); }\r\n public useUTF8(): boolean { return (this.flag() & 0x800) === 0x800; }\r\n public isEncrypted(): boolean { return (this.flag() & 0x1) === 0x1; }\r\n public getFileData(): FileData {\r\n // Need to grab the header before we can figure out where the actual\r\n // compressed data starts.\r\n var start = this.headerRelativeOffset();\r\n var header = new FileHeader(this.zipData.slice(start));\r\n return new FileData(header, this, this.zipData.slice(start + header.totalSize()));\r\n }\r\n public getData(): NodeBuffer {\r\n return this.getFileData().decompress();\r\n }\r\n public getRawData(): NodeBuffer {\r\n return this.getFileData().getRawData();\r\n }\r\n public getStats(): Stats {\r\n return new Stats(FileType.FILE, this.uncompressedSize(), 0x16D, new Date(), this.lastModFileTime());\r\n }\r\n}\r\n\r\n/*\r\n 4.3.16: end of central directory record\r\n end of central dir signature 4 bytes (0x06054b50)\r\n number of this disk 2 bytes\r\n number of the disk with the\r\n start of the central directory 2 bytes\r\n total number of entries in the\r\n central directory on this disk 2 bytes\r\n total number of entries in\r\n the central directory 2 bytes\r\n size of the central directory 4 bytes\r\n offset of start of central\r\n directory with respect to\r\n the starting disk number 4 bytes\r\n .ZIP file comment length 2 bytes\r\n .ZIP file comment (variable size)\r\n*/\r\nexport class EndOfCentralDirectory {\r\n constructor(private data: NodeBuffer) {\r\n if (this.data.readUInt32LE(0) !== 0x06054b50)\r\n throw new ApiError(ErrorCode.EINVAL, \"Invalid Zip file: End of central directory record has invalid signature: \" + this.data.readUInt32LE(0));\r\n }\r\n public diskNumber(): number { return this.data.readUInt16LE(4); }\r\n public cdDiskNumber(): number { return this.data.readUInt16LE(6); }\r\n public cdDiskEntryCount(): number { return this.data.readUInt16LE(8); }\r\n public cdTotalEntryCount(): number { return this.data.readUInt16LE(10); }\r\n public cdSize(): number { return this.data.readUInt32LE(12); }\r\n public cdOffset(): number { return this.data.readUInt32LE(16); }\r\n public cdZipCommentLength(): number { return this.data.readUInt16LE(20); }\r\n public cdZipComment(): string {\r\n // Assuming UTF-8. The specification doesn't specify.\r\n return safeToString(this.data, true, 22, this.cdZipCommentLength());\r\n }\r\n public rawCdZipComment(): NodeBuffer {\r\n return this.data.slice(22, 22 + this.cdZipCommentLength())\r\n }\r\n}\r\n\r\nexport class ZipTOC {\r\n constructor(public index: FileIndex<CentralDirectory>, public directoryEntries: CentralDirectory[], public eocd: EndOfCentralDirectory, public data: NodeBuffer) {\r\n }\r\n}\r\n\r\nexport default class ZipFS extends file_system.SynchronousFileSystem implements file_system.FileSystem {\r\n private _index: FileIndex<CentralDirectory> = new FileIndex<CentralDirectory>();\r\n private _directoryEntries: CentralDirectory[] = [];\r\n private _eocd: EndOfCentralDirectory = null;\r\n private data: NodeBuffer;\r\n\r\n /**\r\n * Constructs a ZipFS from the given zip file data. Name is optional, and is\r\n * used primarily for our unit tests' purposes to differentiate different\r\n * test zip files in test output.\r\n */\r\n constructor(private input: NodeBuffer | ZipTOC, private name: string = '') {\r\n super();\r\n if (input instanceof ZipTOC) {\r\n this._index = input.index;\r\n this._directoryEntries = input.directoryEntries;\r\n this._eocd = input.eocd;\r\n this.data = input.data;\r\n } else {\r\n this.data = input as NodeBuffer;\r\n this.populateIndex();\r\n }\r\n }\r\n\r\n public getName(): string {\r\n return 'ZipFS' + (this.name !== '' ? ' ' + this.name : '');\r\n }\r\n\r\n /**\r\n * Get the CentralDirectory object for the given path.\r\n */\r\n public getCentralDirectoryEntry(path: string): CentralDirectory {\r\n let inode = this._index.getInode(path);\r\n if (inode === null) {\r\n throw ApiError.ENOENT(path);\r\n }\r\n if (isFileInode<CentralDirectory>(inode)) {\r\n return inode.getData();\r\n } else if (isDirInode<CentralDirectory>(inode)) {\r\n return inode.getData();\r\n }\r\n }\r\n\r\n public getCentralDirectoryEntryAt(index: number): CentralDirectory {\r\n let dirEntry = this._directoryEntries[index];\r\n if (!dirEntry) {\r\n throw new RangeError(`Invalid directory index: ${index}.`);\r\n }\r\n return dirEntry;\r\n }\r\n\r\n public getNumberOfCentralDirectoryEntries(): number {\r\n return this._directoryEntries.length;\r\n }\r\n\r\n public getEndOfCentralDirectory(): EndOfCentralDirectory {\r\n return this._eocd;\r\n }\r\n\r\n public static isAvailable(): boolean { return true; }\r\n\r\n public diskSpace(path: string, cb: (total: number, free: number) => void): void {\r\n // Read-only file system.\r\n cb(this.data.length, 0);\r\n }\r\n\r\n public isReadOnly(): boolean {\r\n return true;\r\n }\r\n\r\n public supportsLinks(): boolean {\r\n return false;\r\n }\r\n\r\n public supportsProps(): boolean {\r\n return false;\r\n }\r\n\r\n public supportsSynch(): boolean {\r\n return true;\r\n }\r\n\r\n public statSync(path: string, isLstat: boolean): Stats {\r\n var inode = this._index.getInode(path);\r\n if (inode === null) {\r\n throw ApiError.ENOENT(path);\r\n }\r\n var stats: Stats;\r\n if (isFileInode<CentralDirectory>(inode)) {\r\n stats = inode.getData().getStats();\r\n } else if (isDirInode(inode)) {\r\n stats = inode.getStats();\r\n } else {\r\n throw new ApiError(ErrorCode.EINVAL, \"Invalid inode.\");\r\n }\r\n return stats;\r\n }\r\n\r\n public openSync(path: string, flags: FileFlag, mode: number): file.File {\r\n // INVARIANT: Cannot write to RO file systems.\r\n if (flags.isWriteable()) {\r\n throw new ApiError(ErrorCode.EPERM, path);\r\n }\r\n // Check if the path exists, and is a file.\r\n var inode = this._index.getInode(path);\r\n if (!inode) {\r\n throw ApiError.ENOENT(path);\r\n } else if (isFileInode<CentralDirectory>(inode)) {\r\n var cdRecord = inode.getData();\r\n var stats = cdRecord.getStats();\r\n switch (flags.pathExistsAction()) {\r\n case ActionType.THROW_EXCEPTION:\r\n case ActionType.TRUNCATE_FILE:\r\n throw ApiError.EEXIST(path);\r\n case ActionType.NOP:\r\n return new preload_file.NoSyncFile(this, path, flags, stats, cdRecord.getData());\r\n default:\r\n throw new ApiError(ErrorCode.EINVAL, 'Invalid FileMode object.');\r\n }\r\n } else {\r\n throw ApiError.EISDIR(path);\r\n }\r\n }\r\n\r\n public readdirSync(path: string): string[] {\r\n // Check if it exists.\r\n var inode = this._index.getInode(path);\r\n if (!inode) {\r\n throw ApiError.ENOENT(path);\r\n } else if (isDirInode(inode)) {\r\n return inode.getListing();\r\n } else {\r\n throw ApiError.ENOTDIR(path);\r\n }\r\n }\r\n\r\n /**\r\n * Specially-optimized readfile.\r\n */\r\n public readFileSync(fname: string, encoding: string, flag: FileFlag): any {\r\n // Get file.\r\n var fd = this.openSync(fname, flag, 0x1a4);\r\n try {\r\n var fdCast = <preload_file.NoSyncFile<ZipFS>> fd;\r\n var fdBuff = <Buffer> fdCast.getBuffer();\r\n if (encoding === null) {\r\n return copyingSlice(fdBuff);\r\n }\r\n return fdBuff.toString(encoding);\r\n } finally {\r\n fd.closeSync();\r\n }\r\n }\r\n\r\n /**\r\n * Locates the end of central directory record at the end of the file.\r\n * Throws an exception if it cannot be found.\r\n */\r\n private static getEOCD(data: NodeBuffer): EndOfCentralDirectory {\r\n // Unfortunately, the comment is variable size and up to 64K in size.\r\n // We assume that the magic signature does not appear in the comment, and\r\n // in the bytes between the comment and the signature. Other ZIP\r\n // implementations make this same assumption, since the alternative is to\r\n // read thread every entry in the file to get to it. :(\r\n // These are *negative* offsets from the end of the file.\r\n var startOffset = 22;\r\n var endOffset = Math.min(startOffset + 0xFFFF, data.length - 1);\r\n // There's not even a byte alignment guarantee on the comment so we need to\r\n // search byte by byte. *grumble grumble*\r\n for (var i = startOffset; i < endOffset; i++) {\r\n // Magic number: EOCD Signature\r\n if (data.readUInt32LE(data.length - i) === 0x06054b50) {\r\n return new EndOfCentralDirectory(data.slice(data.length - i));\r\n }\r\n }\r\n throw new ApiError(ErrorCode.EINVAL, \"Invalid ZIP file: Could not locate End of Central Directory signature.\");\r\n }\r\n\r\n private static addToIndex(cd: CentralDirectory, index: FileIndex<CentralDirectory>) {\r\n // Paths must be absolute, yet zip file paths are always relative to the\r\n // zip root. So we append '/' and call it a day.\r\n let filename = cd.fileName();\r\n if (filename.charAt(0) === '/') throw new Error(\"WHY IS THIS ABSOLUTE\");\r\n // XXX: For the file index, strip the trailing '/'.\r\n if (filename.charAt(filename.length - 1) === '/') {\r\n filename = filename.substr(0, filename.length-1);\r\n }\r\n\r\n if (cd.isDirectory()) {\r\n index.addPathFast('/' + filename, new DirInode<CentralDirectory>(cd));\r\n } else {\r\n index.addPathFast('/' + filename, new FileInode<CentralDirectory>(cd));\r\n }\r\n }\r\n\r\n private static computeIndexResponsive(data: NodeBuffer, index: FileIndex<CentralDirectory>, cdPtr: number, cdEnd: number, cb: (zipTOC: ZipTOC) => void, cdEntries: CentralDirectory[], eocd: EndOfCentralDirectory) {\r\n if (cdPtr < cdEnd) {\r\n let count = 0;\r\n while (count++ < 200 && cdPtr < cdEnd) {\r\n const cd: CentralDirectory = new CentralDirectory(data, data.slice(cdPtr));\r\n ZipFS.addToIndex(cd, index);\r\n cdPtr += cd.totalSize();\r\n cdEntries.push(cd);\r\n }\r\n setImmediate(() => {\r\n ZipFS.computeIndexResponsive(data, index, cdPtr, cdEnd, cb, cdEntries, eocd);\r\n });\r\n } else {\r\n cb(new ZipTOC(index, cdEntries, eocd, data));\r\n }\r\n }\r\n\r\n static computeIndex(data: NodeBuffer, cb: (zipTOC: ZipTOC) => void) {\r\n const index: FileIndex<CentralDirectory> = new FileIndex<CentralDirectory>();\r\n const eocd: EndOfCentralDirectory = ZipFS.getEOCD(data);\r\n if (eocd.diskNumber() !== eocd.cdDiskNumber())\r\n throw new ApiError(ErrorCode.EINVAL, \"ZipFS does not support spanned zip files.\");\r\n\r\n const cdPtr = eocd.cdOffset();\r\n if (cdPtr === 0xFFFFFFFF)\r\n throw new ApiError(ErrorCode.EINVAL, \"ZipFS does not support Zip64.\");\r\n const cdEnd = cdPtr + eocd.cdSize();\r\n ZipFS.computeIndexResponsive(data, index, cdPtr, cdEnd, cb, [], eocd);\r\n }\r\n\r\n private populateIndex() {\r\n var eocd: EndOfCentralDirectory = this._eocd = ZipFS.getEOCD(this.data);\r\n if (eocd.diskNumber() !== eocd.cdDiskNumber())\r\n throw new ApiError(ErrorCode.EINVAL, \"ZipFS does not support spanned zip files.\");\r\n\r\n var cdPtr = eocd.cdOffset();\r\n if (cdPtr === 0xFFFFFFFF)\r\n throw new ApiError(ErrorCode.EINVAL, \"ZipFS does not support Zip64.\");\r\n var cdEnd = cdPtr + eocd.cdSize();\r\n while (cdPtr < cdEnd) {\r\n const cd: CentralDirectory = new CentralDirectory(this.data, this.data.slice(cdPtr));\r\n cdPtr += cd.totalSize();\r\n ZipFS.addToIndex(cd, this._index);\r\n this._directoryEntries.push(cd);\r\n }\r\n }\r\n}\r\n",
|
||
"/// <reference path=\"../typings/tsd.d.ts\" />\r\n\r\n// Shim for Browserify so we can reference tsd.d.ts without\r\n// accidentally referencing it in our *.d.ts files, which\r\n// causes problems for TypeScript projects that depend on\r\n// us.\r\n\r\nexport = require('./main');\r\n",
|
||
"import {File} from './file';\r\nimport {ApiError, ErrorCode} from './api_error';\r\nimport file_system = require('./file_system');\r\nimport {FileFlag} from './file_flag';\r\nimport path = require('path');\r\nimport Stats from './node_fs_stats';\r\n// Typing info only.\r\nimport _fs = require('fs');\r\n\r\ndeclare var __numWaiting: number;\r\ndeclare var setImmediate: (cb: Function) => void;\r\n\r\n/**\r\n * Wraps a callback with a setImmediate call.\r\n * @param [Function] cb The callback to wrap.\r\n * @param [Number] numArgs The number of arguments that the callback takes.\r\n * @return [Function] The wrapped callback.\r\n */\r\nfunction wrapCb<T extends Function>(cb: T, numArgs: number): T {\r\n if (typeof cb !== 'function') {\r\n throw new ApiError(ErrorCode.EINVAL, 'Callback must be a function.');\r\n }\r\n // @todo This is used for unit testing. Maybe we should inject this logic\r\n // dynamically rather than bundle it in 'production' code.\r\n if (typeof __numWaiting === 'undefined') {\r\n __numWaiting = 0;\r\n }\r\n __numWaiting++;\r\n // We could use `arguments`, but Function.call/apply is expensive. And we only\r\n // need to handle 1-3 arguments\r\n switch (numArgs) {\r\n case 1:\r\n return <any> function(arg1: any) {\r\n setImmediate(function() {\r\n __numWaiting--;\r\n return cb(arg1);\r\n });\r\n };\r\n case 2:\r\n return <any> function(arg1: any, arg2: any) {\r\n setImmediate(function() {\r\n __numWaiting--;\r\n return cb(arg1, arg2);\r\n });\r\n };\r\n case 3:\r\n return <any> function(arg1: any, arg2: any, arg3: any) {\r\n setImmediate(function() {\r\n __numWaiting--;\r\n return cb(arg1, arg2, arg3);\r\n });\r\n };\r\n default:\r\n throw new Error('Invalid invocation of wrapCb.');\r\n }\r\n}\r\n\r\nfunction normalizeMode(mode: number|string, def: number): number {\r\n switch(typeof mode) {\r\n case 'number':\r\n // (path, flag, mode, cb?)\r\n return <number> mode;\r\n case 'string':\r\n // (path, flag, modeString, cb?)\r\n var trueMode = parseInt(<string> mode, 8);\r\n if (trueMode !== NaN) {\r\n return trueMode;\r\n }\r\n // FALL THROUGH if mode is an invalid string!\r\n default:\r\n return def;\r\n }\r\n}\r\n\r\nfunction normalizeTime(time: number | Date): Date {\r\n if (time instanceof Date) {\r\n return time;\r\n } else if (typeof time === 'number') {\r\n return new Date(time * 1000);\r\n } else {\r\n throw new ApiError(ErrorCode.EINVAL, `Invalid time.`);\r\n }\r\n}\r\n\r\nfunction normalizePath(p: string): string {\r\n // Node doesn't allow null characters in paths.\r\n if (p.indexOf('\\u0000') >= 0) {\r\n throw new ApiError(ErrorCode.EINVAL, 'Path must be a string without null bytes.');\r\n } else if (p === '') {\r\n throw new ApiError(ErrorCode.EINVAL, 'Path must not be empty.');\r\n }\r\n return path.resolve(p);\r\n}\r\n\r\nfunction normalizeOptions(options: any, defEnc: string, defFlag: string, defMode: number): {encoding: string; flag: string; mode: number} {\r\n switch (typeof options) {\r\n case 'object':\r\n return {\r\n encoding: typeof options['encoding'] !== 'undefined' ? options['encoding'] : defEnc,\r\n flag: typeof options['flag'] !== 'undefined' ? options['flag'] : defFlag,\r\n mode: normalizeMode(options['mode'], defMode)\r\n };\r\n case 'string':\r\n return {\r\n encoding: options,\r\n flag: defFlag,\r\n mode: defMode\r\n };\r\n default:\r\n return {\r\n encoding: defEnc,\r\n flag: defFlag,\r\n mode: defMode\r\n };\r\n }\r\n}\r\n\r\n// The default callback is a NOP.\r\nfunction nopCb() {};\r\n\r\n/**\r\n * The node frontend to all filesystems.\r\n * This layer handles:\r\n *\r\n * * Sanity checking inputs.\r\n * * Normalizing paths.\r\n * * Resetting stack depth for asynchronous operations which may not go through\r\n * the browser by wrapping all input callbacks using `setImmediate`.\r\n * * Performing the requested operation through the filesystem or the file\r\n * descriptor, as appropriate.\r\n * * Handling optional arguments and setting default arguments.\r\n * @see http://nodejs.org/api/fs.html\r\n * @class\r\n */\r\nexport default class FS {\r\n // Exported fs.Stats.\r\n public static Stats = Stats;\r\n\r\n private root: file_system.FileSystem = null;\r\n private fdMap: {[fd: number]: File} = {};\r\n private nextFd = 100;\r\n private getFdForFile(file: File): number {\r\n let fd = this.nextFd++;\r\n this.fdMap[fd] = file;\r\n return fd;\r\n }\r\n private fd2file(fd: number): File {\r\n let rv = this.fdMap[fd];\r\n if (rv) {\r\n return rv;\r\n } else {\r\n throw new ApiError(ErrorCode.EBADF, 'Invalid file descriptor.');\r\n }\r\n }\r\n private closeFd(fd: number): void {\r\n delete this.fdMap[fd];\r\n }\r\n\r\n public initialize(rootFS: file_system.FileSystem): file_system.FileSystem {\r\n if (!(<any> rootFS).constructor.isAvailable()) {\r\n throw new ApiError(ErrorCode.EINVAL, 'Tried to instantiate BrowserFS with an unavailable file system.');\r\n }\r\n return this.root = rootFS;\r\n }\r\n\r\n /**\r\n * converts Date or number to a fractional UNIX timestamp\r\n * Grabbed from NodeJS sources (lib/fs.js)\r\n */\r\n public _toUnixTimestamp(time: Date | number): number {\r\n if (typeof time === 'number') {\r\n return time;\r\n } else if (time instanceof Date) {\r\n return time.getTime() / 1000;\r\n }\r\n throw new Error(\"Cannot parse time: \" + time);\r\n }\r\n\r\n /**\r\n * **NONSTANDARD**: Grab the FileSystem instance that backs this API.\r\n * @return [BrowserFS.FileSystem | null] Returns null if the file system has\r\n * not been initialized.\r\n */\r\n public getRootFS(): file_system.FileSystem {\r\n if (this.root) {\r\n return this.root;\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n // FILE OR DIRECTORY METHODS\r\n\r\n /**\r\n * Asynchronous rename. No arguments other than a possible exception are given\r\n * to the completion callback.\r\n * @param [String] oldPath\r\n * @param [String] newPath\r\n * @param [Function(BrowserFS.ApiError)] callback\r\n */\r\n public rename(oldPath: string, newPath: string, cb: (err?: ApiError) => void = nopCb): void {\r\n var newCb = wrapCb(cb, 1);\r\n try {\r\n this.root.rename(normalizePath(oldPath), normalizePath(newPath), newCb);\r\n } catch (e) {\r\n newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous rename.\r\n * @param [String] oldPath\r\n * @param [String] newPath\r\n */\r\n public renameSync(oldPath: string, newPath: string): void {\r\n this.root.renameSync(normalizePath(oldPath), normalizePath(newPath));\r\n }\r\n\r\n /**\r\n * Test whether or not the given path exists by checking with the file system.\r\n * Then call the callback argument with either true or false.\r\n * @example Sample invocation\r\n * fs.exists('/etc/passwd', function (exists) {\r\n * util.debug(exists ? \"it's there\" : \"no passwd!\");\r\n * });\r\n * @param [String] path\r\n * @param [Function(Boolean)] callback\r\n */\r\n public exists(path: string, cb: (exists: boolean) => void = nopCb): void {\r\n var newCb = wrapCb(cb, 1);\r\n try {\r\n return this.root.exists(normalizePath(path), newCb);\r\n } catch (e) {\r\n // Doesn't return an error. If something bad happens, we assume it just\r\n // doesn't exist.\r\n return newCb(false);\r\n }\r\n }\r\n\r\n /**\r\n * Test whether or not the given path exists by checking with the file system.\r\n * @param [String] path\r\n * @return [boolean]\r\n */\r\n public existsSync(path: string): boolean {\r\n try {\r\n return this.root.existsSync(normalizePath(path));\r\n } catch (e) {\r\n // Doesn't return an error. If something bad happens, we assume it just\r\n // doesn't exist.\r\n return false;\r\n }\r\n }\r\n\r\n /**\r\n * Asynchronous `stat`.\r\n * @param [String] path\r\n * @param [Function(BrowserFS.ApiError, BrowserFS.node.fs.Stats)] callback\r\n */\r\n public stat(path: string, cb: (err: ApiError, stats?: Stats) => any = nopCb): void {\r\n var newCb = wrapCb(cb, 2);\r\n try {\r\n return this.root.stat(normalizePath(path), false, newCb);\r\n } catch (e) {\r\n return newCb(e, null);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous `stat`.\r\n * @param [String] path\r\n * @return [BrowserFS.node.fs.Stats]\r\n */\r\n public statSync(path: string): Stats {\r\n return this.root.statSync(normalizePath(path), false);\r\n }\r\n\r\n /**\r\n * Asynchronous `lstat`.\r\n * `lstat()` is identical to `stat()`, except that if path is a symbolic link,\r\n * then the link itself is stat-ed, not the file that it refers to.\r\n * @param [String] path\r\n * @param [Function(BrowserFS.ApiError, BrowserFS.node.fs.Stats)] callback\r\n */\r\n public lstat(path: string, cb: (err: ApiError, stats?: Stats) => any = nopCb): void {\r\n var newCb = wrapCb(cb, 2);\r\n try {\r\n return this.root.stat(normalizePath(path), true, newCb);\r\n } catch (e) {\r\n return newCb(e, null);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous `lstat`.\r\n * `lstat()` is identical to `stat()`, except that if path is a symbolic link,\r\n * then the link itself is stat-ed, not the file that it refers to.\r\n * @param [String] path\r\n * @return [BrowserFS.node.fs.Stats]\r\n */\r\n public lstatSync(path: string): Stats {\r\n return this.root.statSync(normalizePath(path), true);\r\n }\r\n\r\n // FILE-ONLY METHODS\r\n\r\n /**\r\n * Asynchronous `truncate`.\r\n * @param [String] path\r\n * @param [Number] len\r\n * @param [Function(BrowserFS.ApiError)] callback\r\n */\r\n public truncate(path: string, cb?: (err?: ApiError) => void): void;\r\n public truncate(path: string, len: number, cb?: (err?: ApiError) => void): void;\r\n public truncate(path: string, arg2: any = 0, cb: (err?: ApiError) => void = nopCb): void {\r\n var len = 0;\r\n if (typeof arg2 === 'function') {\r\n cb = arg2;\r\n } else if (typeof arg2 === 'number') {\r\n len = arg2;\r\n }\r\n\r\n var newCb = wrapCb(cb, 1);\r\n try {\r\n if (len < 0) {\r\n throw new ApiError(ErrorCode.EINVAL);\r\n }\r\n return this.root.truncate(normalizePath(path), len, newCb);\r\n } catch (e) {\r\n return newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous `truncate`.\r\n * @param [String] path\r\n * @param [Number] len\r\n */\r\n public truncateSync(path: string, len: number = 0): void {\r\n if (len < 0) {\r\n throw new ApiError(ErrorCode.EINVAL);\r\n }\r\n return this.root.truncateSync(normalizePath(path), len);\r\n }\r\n\r\n /**\r\n * Asynchronous `unlink`.\r\n * @param [String] path\r\n * @param [Function(BrowserFS.ApiError)] callback\r\n */\r\n public unlink(path: string, cb: (err?: ApiError) => void = nopCb): void {\r\n var newCb = wrapCb(cb, 1);\r\n try {\r\n return this.root.unlink(normalizePath(path), newCb);\r\n } catch (e) {\r\n return newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous `unlink`.\r\n * @param [String] path\r\n */\r\n public unlinkSync(path: string): void {\r\n return this.root.unlinkSync(normalizePath(path));\r\n }\r\n\r\n /**\r\n * Asynchronous file open.\r\n * Exclusive mode ensures that path is newly created.\r\n *\r\n * `flags` can be:\r\n *\r\n * * `'r'` - Open file for reading. An exception occurs if the file does not exist.\r\n * * `'r+'` - Open file for reading and writing. An exception occurs if the file does not exist.\r\n * * `'rs'` - Open file for reading in synchronous mode. Instructs the filesystem to not cache writes.\r\n * * `'rs+'` - Open file for reading and writing, and opens the file in synchronous mode.\r\n * * `'w'` - Open file for writing. The file is created (if it does not exist) or truncated (if it exists).\r\n * * `'wx'` - Like 'w' but opens the file in exclusive mode.\r\n * * `'w+'` - Open file for reading and writing. The file is created (if it does not exist) or truncated (if it exists).\r\n * * `'wx+'` - Like 'w+' but opens the file in exclusive mode.\r\n * * `'a'` - Open file for appending. The file is created if it does not exist.\r\n * * `'ax'` - Like 'a' but opens the file in exclusive mode.\r\n * * `'a+'` - Open file for reading and appending. The file is created if it does not exist.\r\n * * `'ax+'` - Like 'a+' but opens the file in exclusive mode.\r\n *\r\n * @see http://www.manpagez.com/man/2/open/\r\n * @param [String] path\r\n * @param [String] flags\r\n * @param [Number?] mode defaults to `0644`\r\n * @param [Function(BrowserFS.ApiError, BrowserFS.File)] callback\r\n */\r\n public open(path: string, flag: string, cb?: (err: ApiError, fd?: number) => any): void;\r\n public open(path: string, flag: string, mode: number|string, cb?: (err: ApiError, fd?: number) => any): void;\r\n public open(path: string, flag: string, arg2?: any, cb: (err: ApiError, fd?: number) => any = nopCb): void {\r\n var mode = normalizeMode(arg2, 0x1a4);\r\n cb = typeof arg2 === 'function' ? arg2 : cb;\r\n var newCb = wrapCb(cb, 2);\r\n try {\r\n this.root.open(normalizePath(path), FileFlag.getFileFlag(flag), mode, (e: ApiError, file?: File) => {\r\n if (file) {\r\n newCb(e, this.getFdForFile(file));\r\n } else {\r\n newCb(e);\r\n }\r\n });\r\n } catch (e) {\r\n newCb(e, null);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous file open.\r\n * @see http://www.manpagez.com/man/2/open/\r\n * @param [String] path\r\n * @param [String] flags\r\n * @param [Number?] mode defaults to `0644`\r\n * @return [BrowserFS.File]\r\n */\r\n public openSync(path: string, flag: string, mode: number|string = 0x1a4): number {\r\n return this.getFdForFile(\r\n this.root.openSync(normalizePath(path), FileFlag.getFileFlag(flag), normalizeMode(mode, 0x1a4)));\r\n }\r\n\r\n /**\r\n * Asynchronously reads the entire contents of a file.\r\n * @example Usage example\r\n * fs.readFile('/etc/passwd', function (err, data) {\r\n * if (err) throw err;\r\n * console.log(data);\r\n * });\r\n * @param [String] filename\r\n * @param [Object?] options\r\n * @option options [String] encoding The string encoding for the file contents. Defaults to `null`.\r\n * @option options [String] flag Defaults to `'r'`.\r\n * @param [Function(BrowserFS.ApiError, String | BrowserFS.node.Buffer)] callback If no encoding is specified, then the raw buffer is returned.\r\n */\r\n public readFile(filename: string, cb: (err: ApiError, data?: Buffer) => void ): void;\r\n public readFile(filename: string, options: { flag?: string; }, callback: (err: ApiError, data: Buffer) => void): void;\r\n public readFile(filename: string, options: { encoding: string; flag?: string; }, callback: (err: ApiError, data: string) => void): void;\r\n public readFile(filename: string, encoding: string, cb?: (err: ApiError, data?: string) => void ): void;\r\n public readFile(filename: string, arg2: any = {}, cb: (err: ApiError, data?: any) => void = nopCb ) {\r\n var options = normalizeOptions(arg2, null, 'r', null);\r\n cb = typeof arg2 === 'function' ? arg2 : cb;\r\n var newCb = wrapCb(cb, 2);\r\n try {\r\n var flag = FileFlag.getFileFlag(options['flag']);\r\n if (!flag.isReadable()) {\r\n return newCb(new ApiError(ErrorCode.EINVAL, 'Flag passed to readFile must allow for reading.'));\r\n }\r\n return this.root.readFile(normalizePath(filename), options.encoding, flag, newCb);\r\n } catch (e) {\r\n return newCb(e, null);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronously reads the entire contents of a file.\r\n * @param [String] filename\r\n * @param [Object?] options\r\n * @option options [String] encoding The string encoding for the file contents. Defaults to `null`.\r\n * @option options [String] flag Defaults to `'r'`.\r\n * @return [String | BrowserFS.node.Buffer]\r\n */\r\n public readFileSync(filename: string, options?: { flag?: string; }): Buffer;\r\n public readFileSync(filename: string, options: { encoding: string; flag?: string; }): string;\r\n public readFileSync(filename: string, encoding: string): string;\r\n public readFileSync(filename: string, arg2: any = {}): any {\r\n var options = normalizeOptions(arg2, null, 'r', null);\r\n var flag = FileFlag.getFileFlag(options.flag);\r\n if (!flag.isReadable()) {\r\n throw new ApiError(ErrorCode.EINVAL, 'Flag passed to readFile must allow for reading.');\r\n }\r\n return this.root.readFileSync(normalizePath(filename), options.encoding, flag);\r\n }\r\n\r\n /**\r\n * Asynchronously writes data to a file, replacing the file if it already\r\n * exists.\r\n *\r\n * The encoding option is ignored if data is a buffer.\r\n *\r\n * @example Usage example\r\n * fs.writeFile('message.txt', 'Hello Node', function (err) {\r\n * if (err) throw err;\r\n * console.log('It\\'s saved!');\r\n * });\r\n * @param [String] filename\r\n * @param [String | BrowserFS.node.Buffer] data\r\n * @param [Object?] options\r\n * @option options [String] encoding Defaults to `'utf8'`.\r\n * @option options [Number] mode Defaults to `0644`.\r\n * @option options [String] flag Defaults to `'w'`.\r\n * @param [Function(BrowserFS.ApiError)] callback\r\n */\r\n public writeFile(filename: string, data: any, cb?: (err?: ApiError) => void): void;\r\n public writeFile(filename: string, data: any, encoding?: string, cb?: (err?: ApiError) => void): void;\r\n public writeFile(filename: string, data: any, options?: { encoding?: string; mode?: string | number; flag?: string; }, cb?: (err?: ApiError) => void): void;\r\n public writeFile(filename: string, data: any, arg3: any = {}, cb: (err?: ApiError) => void = nopCb): void {\r\n var options = normalizeOptions(arg3, 'utf8', 'w', 0x1a4);\r\n cb = typeof arg3 === 'function' ? arg3 : cb;\r\n var newCb = wrapCb(cb, 1);\r\n try {\r\n var flag = FileFlag.getFileFlag(options.flag);\r\n if (!flag.isWriteable()) {\r\n return newCb(new ApiError(ErrorCode.EINVAL, 'Flag passed to writeFile must allow for writing.'));\r\n }\r\n return this.root.writeFile(normalizePath(filename), data, options.encoding, flag, options.mode, newCb);\r\n } catch (e) {\r\n return newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronously writes data to a file, replacing the file if it already\r\n * exists.\r\n *\r\n * The encoding option is ignored if data is a buffer.\r\n * @param [String] filename\r\n * @param [String | BrowserFS.node.Buffer] data\r\n * @param [Object?] options\r\n * @option options [String] encoding Defaults to `'utf8'`.\r\n * @option options [Number] mode Defaults to `0644`.\r\n * @option options [String] flag Defaults to `'w'`.\r\n */\r\n public writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number | string; flag?: string; }): void;\r\n public writeFileSync(filename: string, data: any, encoding?: string): void;\r\n public writeFileSync(filename: string, data: any, arg3?: any): void {\r\n var options = normalizeOptions(arg3, 'utf8', 'w', 0x1a4);\r\n var flag = FileFlag.getFileFlag(options.flag);\r\n if (!flag.isWriteable()) {\r\n throw new ApiError(ErrorCode.EINVAL, 'Flag passed to writeFile must allow for writing.');\r\n }\r\n return this.root.writeFileSync(normalizePath(filename), data, options.encoding, flag, options.mode);\r\n }\r\n\r\n /**\r\n * Asynchronously append data to a file, creating the file if it not yet\r\n * exists.\r\n *\r\n * @example Usage example\r\n * fs.appendFile('message.txt', 'data to append', function (err) {\r\n * if (err) throw err;\r\n * console.log('The \"data to append\" was appended to file!');\r\n * });\r\n * @param [String] filename\r\n * @param [String | BrowserFS.node.Buffer] data\r\n * @param [Object?] options\r\n * @option options [String] encoding Defaults to `'utf8'`.\r\n * @option options [Number] mode Defaults to `0644`.\r\n * @option options [String] flag Defaults to `'a'`.\r\n * @param [Function(BrowserFS.ApiError)] callback\r\n */\r\n public appendFile(filename: string, data: any, cb?: (err: ApiError) => void): void;\r\n public appendFile(filename: string, data: any, options?: { encoding?: string; mode?: number|string; flag?: string; }, cb?: (err: ApiError) => void): void;\r\n public appendFile(filename: string, data: any, encoding?: string, cb?: (err: ApiError) => void): void;\r\n public appendFile(filename: string, data: any, arg3?: any, cb: (err: ApiError) => void = nopCb): void {\r\n var options = normalizeOptions(arg3, 'utf8', 'a', 0x1a4);\r\n cb = typeof arg3 === 'function' ? arg3 : cb;\r\n var newCb = wrapCb(cb, 1);\r\n try {\r\n var flag = FileFlag.getFileFlag(options.flag);\r\n if (!flag.isAppendable()) {\r\n return newCb(new ApiError(ErrorCode.EINVAL, 'Flag passed to appendFile must allow for appending.'));\r\n }\r\n this.root.appendFile(normalizePath(filename), data, options.encoding, flag, options.mode, newCb);\r\n } catch (e) {\r\n newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Asynchronously append data to a file, creating the file if it not yet\r\n * exists.\r\n *\r\n * @example Usage example\r\n * fs.appendFile('message.txt', 'data to append', function (err) {\r\n * if (err) throw err;\r\n * console.log('The \"data to append\" was appended to file!');\r\n * });\r\n * @param [String] filename\r\n * @param [String | BrowserFS.node.Buffer] data\r\n * @param [Object?] options\r\n * @option options [String] encoding Defaults to `'utf8'`.\r\n * @option options [Number] mode Defaults to `0644`.\r\n * @option options [String] flag Defaults to `'a'`.\r\n */\r\n public appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number | string; flag?: string; }): void;\r\n public appendFileSync(filename: string, data: any, encoding?: string): void;\r\n public appendFileSync(filename: string, data: any, arg3?: any): void {\r\n var options = normalizeOptions(arg3, 'utf8', 'a', 0x1a4);\r\n var flag = FileFlag.getFileFlag(options.flag);\r\n if (!flag.isAppendable()) {\r\n throw new ApiError(ErrorCode.EINVAL, 'Flag passed to appendFile must allow for appending.');\r\n }\r\n return this.root.appendFileSync(normalizePath(filename), data, options.encoding, flag, options.mode);\r\n }\r\n\r\n // FILE DESCRIPTOR METHODS\r\n\r\n /**\r\n * Asynchronous `fstat`.\r\n * `fstat()` is identical to `stat()`, except that the file to be stat-ed is\r\n * specified by the file descriptor `fd`.\r\n * @param [BrowserFS.File] fd\r\n * @param [Function(BrowserFS.ApiError, BrowserFS.node.fs.Stats)] callback\r\n */\r\n public fstat(fd: number, cb: (err: ApiError, stats?: Stats) => any = nopCb): void {\r\n var newCb = wrapCb(cb, 2);\r\n try {\r\n let file = this.fd2file(fd);\r\n file.stat(newCb);\r\n } catch (e) {\r\n newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous `fstat`.\r\n * `fstat()` is identical to `stat()`, except that the file to be stat-ed is\r\n * specified by the file descriptor `fd`.\r\n * @param [BrowserFS.File] fd\r\n * @return [BrowserFS.node.fs.Stats]\r\n */\r\n public fstatSync(fd: number): Stats {\r\n return this.fd2file(fd).statSync();\r\n }\r\n\r\n /**\r\n * Asynchronous close.\r\n * @param [BrowserFS.File] fd\r\n * @param [Function(BrowserFS.ApiError)] callback\r\n */\r\n public close(fd: number, cb: (e?: ApiError) => void = nopCb): void {\r\n var newCb = wrapCb(cb, 1);\r\n try {\r\n this.fd2file(fd).close((e: ApiError) => {\r\n if (!e) {\r\n this.closeFd(fd);\r\n }\r\n newCb(e);\r\n });\r\n } catch (e) {\r\n newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous close.\r\n * @param [BrowserFS.File] fd\r\n */\r\n public closeSync(fd: number): void {\r\n this.fd2file(fd).closeSync();\r\n this.closeFd(fd);\r\n }\r\n\r\n /**\r\n * Asynchronous ftruncate.\r\n * @param [BrowserFS.File] fd\r\n * @param [Number] len\r\n * @param [Function(BrowserFS.ApiError)] callback\r\n */\r\n public ftruncate(fd: number, cb?: (err?: ApiError) => void): void;\r\n public ftruncate(fd: number, len?: number, cb?: (err?: ApiError) => void): void;\r\n public ftruncate(fd: number, arg2?: any, cb: (err?: ApiError) => void = nopCb): void {\r\n var length = typeof arg2 === 'number' ? arg2 : 0;\r\n cb = typeof arg2 === 'function' ? arg2 : cb;\r\n var newCb = wrapCb(cb, 1);\r\n try {\r\n let file = this.fd2file(fd);\r\n if (length < 0) {\r\n throw new ApiError(ErrorCode.EINVAL);\r\n }\r\n file.truncate(length, newCb);\r\n } catch (e) {\r\n newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous ftruncate.\r\n * @param [BrowserFS.File] fd\r\n * @param [Number] len\r\n */\r\n public ftruncateSync(fd: number, len: number = 0): void {\r\n let file = this.fd2file(fd);\r\n if (len < 0) {\r\n throw new ApiError(ErrorCode.EINVAL);\r\n }\r\n file.truncateSync(len);\r\n }\r\n\r\n /**\r\n * Asynchronous fsync.\r\n * @param [BrowserFS.File] fd\r\n * @param [Function(BrowserFS.ApiError)] callback\r\n */\r\n public fsync(fd: number, cb: (err?: ApiError) => void = nopCb): void {\r\n var newCb = wrapCb(cb, 1);\r\n try {\r\n this.fd2file(fd).sync(newCb);\r\n } catch (e) {\r\n newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous fsync.\r\n * @param [BrowserFS.File] fd\r\n */\r\n public fsyncSync(fd: number): void {\r\n this.fd2file(fd).syncSync();\r\n }\r\n\r\n /**\r\n * Asynchronous fdatasync.\r\n * @param [BrowserFS.File] fd\r\n * @param [Function(BrowserFS.ApiError)] callback\r\n */\r\n public fdatasync(fd: number, cb: (err?: ApiError) => void = nopCb): void {\r\n var newCb = wrapCb(cb, 1);\r\n try {\r\n this.fd2file(fd).datasync(newCb);\r\n } catch (e) {\r\n newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous fdatasync.\r\n * @param [BrowserFS.File] fd\r\n */\r\n public fdatasyncSync(fd: number): void {\r\n this.fd2file(fd).datasyncSync();\r\n }\r\n\r\n /**\r\n * Write buffer to the file specified by `fd`.\r\n * Note that it is unsafe to use fs.write multiple times on the same file\r\n * without waiting for the callback.\r\n * @param [BrowserFS.File] fd\r\n * @param [BrowserFS.node.Buffer] buffer Buffer containing the data to write to\r\n * the file.\r\n * @param [Number] offset Offset in the buffer to start reading data from.\r\n * @param [Number] length The amount of bytes to write to the file.\r\n * @param [Number] position Offset from the beginning of the file where this\r\n * data should be written. If position is null, the data will be written at\r\n * the current position.\r\n * @param [Function(BrowserFS.ApiError, Number, BrowserFS.node.Buffer)]\r\n * callback The number specifies the number of bytes written into the file.\r\n */\r\n public write(fd: number, buffer: Buffer, offset: number, length: number, cb?: (err: ApiError, written: number, buffer: Buffer) => void): void;\r\n public write(fd: number, buffer: Buffer, offset: number, length: number, position: number, cb?: (err: ApiError, written: number, buffer: Buffer) => void): void;\r\n public write(fd: number, data: any, cb?: (err: ApiError, written: number, str: string) => any): void;\r\n public write(fd: number, data: any, position: number, cb?: (err: ApiError, written: number, str: string) => any): void;\r\n public write(fd: number, data: any, position: number, encoding: string, cb?: (err: ApiError, written: number, str: string) => void): void;\r\n public write(fd: number, arg2: any, arg3?: any, arg4?: any, arg5?: any, cb: (err: ApiError, written?: number, buffer?: Buffer) => void = nopCb): void {\r\n var buffer: Buffer, offset: number, length: number, position: number = null;\r\n if (typeof arg2 === 'string') {\r\n // Signature 1: (fd, string, [position?, [encoding?]], cb?)\r\n var encoding = 'utf8';\r\n switch (typeof arg3) {\r\n case 'function':\r\n // (fd, string, cb)\r\n cb = arg3;\r\n break;\r\n case 'number':\r\n // (fd, string, position, encoding?, cb?)\r\n position = arg3;\r\n encoding = typeof arg4 === 'string' ? arg4 : 'utf8';\r\n cb = typeof arg5 === 'function' ? arg5 : cb;\r\n break;\r\n default:\r\n // ...try to find the callback and get out of here!\r\n cb = typeof arg4 === 'function' ? arg4 : typeof arg5 === 'function' ? arg5 : cb;\r\n return cb(new ApiError(ErrorCode.EINVAL, 'Invalid arguments.'));\r\n }\r\n buffer = new Buffer(arg2, encoding);\r\n offset = 0;\r\n length = buffer.length;\r\n } else {\r\n // Signature 2: (fd, buffer, offset, length, position?, cb?)\r\n buffer = arg2;\r\n offset = arg3;\r\n length = arg4;\r\n position = typeof arg5 === 'number' ? arg5 : null;\r\n cb = typeof arg5 === 'function' ? arg5 : cb;\r\n }\r\n\r\n var newCb = wrapCb(cb, 3);\r\n try {\r\n let file = this.fd2file(fd);\r\n if (position == null) {\r\n position = file.getPos();\r\n }\r\n file.write(buffer, offset, length, position, newCb);\r\n } catch (e) {\r\n newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Write buffer to the file specified by `fd`.\r\n * Note that it is unsafe to use fs.write multiple times on the same file\r\n * without waiting for it to return.\r\n * @param [BrowserFS.File] fd\r\n * @param [BrowserFS.node.Buffer] buffer Buffer containing the data to write to\r\n * the file.\r\n * @param [Number] offset Offset in the buffer to start reading data from.\r\n * @param [Number] length The amount of bytes to write to the file.\r\n * @param [Number] position Offset from the beginning of the file where this\r\n * data should be written. If position is null, the data will be written at\r\n * the current position.\r\n * @return [Number]\r\n */\r\n public writeSync(fd: number, buffer: Buffer, offset: number, length: number, position?: number): number;\r\n public writeSync(fd: number, data: string, position?: number, encoding?: string): number;\r\n public writeSync(fd: number, arg2: any, arg3?: any, arg4?: any, arg5?: any): number {\r\n var buffer: Buffer, offset: number = 0, length: number, position: number;\r\n if (typeof arg2 === 'string') {\r\n // Signature 1: (fd, string, [position?, [encoding?]])\r\n position = typeof arg3 === 'number' ? arg3 : null;\r\n var encoding = typeof arg4 === 'string' ? arg4 : 'utf8';\r\n offset = 0;\r\n buffer = new Buffer(arg2, encoding);\r\n length = buffer.length;\r\n } else {\r\n // Signature 2: (fd, buffer, offset, length, position?)\r\n buffer = arg2;\r\n offset = arg3;\r\n length = arg4;\r\n position = typeof arg5 === 'number' ? arg5 : null;\r\n }\r\n\r\n let file = this.fd2file(fd);\r\n if (position == null) {\r\n position = file.getPos();\r\n }\r\n return file.writeSync(buffer, offset, length, position);\r\n }\r\n\r\n /**\r\n * Read data from the file specified by `fd`.\r\n * @param [BrowserFS.File] fd\r\n * @param [BrowserFS.node.Buffer] buffer The buffer that the data will be\r\n * written to.\r\n * @param [Number] offset The offset within the buffer where writing will\r\n * start.\r\n * @param [Number] length An integer specifying the number of bytes to read.\r\n * @param [Number] position An integer specifying where to begin reading from\r\n * in the file. If position is null, data will be read from the current file\r\n * position.\r\n * @param [Function(BrowserFS.ApiError, Number, BrowserFS.node.Buffer)]\r\n * callback The number is the number of bytes read\r\n */\r\n public read(fd: number, length: number, position: number, encoding: string, cb?: (err: ApiError, data?: string, bytesRead?: number) => void): void;\r\n public read(fd: number, buffer: Buffer, offset: number, length: number, position: number, cb?: (err: ApiError, bytesRead?: number, buffer?: Buffer) => void): void;\r\n public read(fd: number, arg2: any, arg3: any, arg4: any, arg5?: any, cb: (err: ApiError, arg2?: any, arg3?: any) => void = nopCb): void {\r\n var position: number, offset: number, length: number, buffer: Buffer, newCb: (err: ApiError, bytesRead?: number, buffer?: Buffer) => void;\r\n if (typeof arg2 === 'number') {\r\n // legacy interface\r\n // (fd, length, position, encoding, callback)\r\n length = arg2;\r\n position = arg3;\r\n var encoding = arg4;\r\n cb = typeof arg5 === 'function' ? arg5 : cb;\r\n offset = 0;\r\n buffer = new Buffer(length);\r\n // XXX: Inefficient.\r\n // Wrap the cb so we shelter upper layers of the API from these\r\n // shenanigans.\r\n newCb = wrapCb((function(err: any, bytesRead: number, buf: Buffer) {\r\n if (err) {\r\n return cb(err);\r\n }\r\n cb(err, buf.toString(encoding), bytesRead);\r\n }), 3);\r\n } else {\r\n buffer = arg2;\r\n offset = arg3;\r\n length = arg4;\r\n position = arg5;\r\n newCb = wrapCb(cb, 3);\r\n }\r\n\r\n try {\r\n let file = this.fd2file(fd);\r\n if (position == null) {\r\n position = file.getPos();\r\n }\r\n file.read(buffer, offset, length, position, newCb);\r\n } catch (e) {\r\n newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Read data from the file specified by `fd`.\r\n * @param [BrowserFS.File] fd\r\n * @param [BrowserFS.node.Buffer] buffer The buffer that the data will be\r\n * written to.\r\n * @param [Number] offset The offset within the buffer where writing will\r\n * start.\r\n * @param [Number] length An integer specifying the number of bytes to read.\r\n * @param [Number] position An integer specifying where to begin reading from\r\n * in the file. If position is null, data will be read from the current file\r\n * position.\r\n * @return [Number]\r\n */\r\n public readSync(fd: number, length: number, position: number, encoding: string): string;\r\n public readSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number;\r\n public readSync(fd: number, arg2: any, arg3: any, arg4: any, arg5?: any): any {\r\n var shenanigans = false;\r\n var buffer: Buffer, offset: number, length: number, position: number;\r\n if (typeof arg2 === 'number') {\r\n length = arg2;\r\n position = arg3;\r\n var encoding = arg4;\r\n offset = 0;\r\n buffer = new Buffer(length);\r\n shenanigans = true;\r\n } else {\r\n buffer = arg2;\r\n offset = arg3;\r\n length = arg4;\r\n position = arg5;\r\n }\r\n let file = this.fd2file(fd);\r\n if (position == null) {\r\n position = file.getPos();\r\n }\r\n\r\n var rv = file.readSync(buffer, offset, length, position);\r\n if (!shenanigans) {\r\n return rv;\r\n } else {\r\n return [buffer.toString(encoding), rv];\r\n }\r\n }\r\n\r\n /**\r\n * Asynchronous `fchown`.\r\n * @param [BrowserFS.File] fd\r\n * @param [Number] uid\r\n * @param [Number] gid\r\n * @param [Function(BrowserFS.ApiError)] callback\r\n */\r\n public fchown(fd: number, uid: number, gid: number, callback: (e?: ApiError) => void = nopCb): void {\r\n var newCb = wrapCb(callback, 1);\r\n try {\r\n this.fd2file(fd).chown(uid, gid, newCb);\r\n } catch (e) {\r\n newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous `fchown`.\r\n * @param [BrowserFS.File] fd\r\n * @param [Number] uid\r\n * @param [Number] gid\r\n */\r\n public fchownSync(fd: number, uid: number, gid: number): void {\r\n this.fd2file(fd).chownSync(uid, gid);\r\n }\r\n\r\n /**\r\n * Asynchronous `fchmod`.\r\n * @param [BrowserFS.File] fd\r\n * @param [Number] mode\r\n * @param [Function(BrowserFS.ApiError)] callback\r\n */\r\n public fchmod(fd: number, mode: string | number, cb?: (e?: ApiError) => void): void {\r\n var newCb = wrapCb(cb, 1);\r\n try {\r\n let numMode = typeof mode === 'string' ? parseInt(mode, 8) : mode;\r\n this.fd2file(fd).chmod(numMode, newCb);\r\n } catch (e) {\r\n newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous `fchmod`.\r\n * @param [BrowserFS.File] fd\r\n * @param [Number] mode\r\n */\r\n public fchmodSync(fd: number, mode: number | string): void {\r\n let numMode = typeof mode === 'string' ? parseInt(mode, 8) : mode;\r\n this.fd2file(fd).chmodSync(numMode);\r\n }\r\n\r\n /**\r\n * Change the file timestamps of a file referenced by the supplied file\r\n * descriptor.\r\n * @param [BrowserFS.File] fd\r\n * @param [Date] atime\r\n * @param [Date] mtime\r\n * @param [Function(BrowserFS.ApiError)] callback\r\n */\r\n public futimes(fd: number, atime: number, mtime: number, cb: (e?: ApiError) => void): void;\r\n public futimes(fd: number, atime: Date, mtime: Date, cb: (e?: ApiError) => void): void;\r\n public futimes(fd: number, atime: any, mtime: any, cb: (e?: ApiError) => void = nopCb): void {\r\n var newCb = wrapCb(cb, 1);\r\n try {\r\n let file = this.fd2file(fd);\r\n if (typeof atime === 'number') {\r\n atime = new Date(atime * 1000);\r\n }\r\n if (typeof mtime === 'number') {\r\n mtime = new Date(mtime * 1000);\r\n }\r\n file.utimes(atime, mtime, newCb);\r\n } catch (e) {\r\n newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Change the file timestamps of a file referenced by the supplied file\r\n * descriptor.\r\n * @param [BrowserFS.File] fd\r\n * @param [Date] atime\r\n * @param [Date] mtime\r\n */\r\n public futimesSync(fd: number, atime: number | Date, mtime: number | Date): void {\r\n this.fd2file(fd).utimesSync(normalizeTime(atime), normalizeTime(mtime));\r\n }\r\n\r\n // DIRECTORY-ONLY METHODS\r\n\r\n /**\r\n * Asynchronous `rmdir`.\r\n * @param [String] path\r\n * @param [Function(BrowserFS.ApiError)] callback\r\n */\r\n public rmdir(path: string, cb: (e?: ApiError) => void = nopCb): void {\r\n var newCb = wrapCb(cb, 1);\r\n try {\r\n path = normalizePath(path);\r\n this.root.rmdir(path, newCb);\r\n } catch (e) {\r\n newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous `rmdir`.\r\n * @param [String] path\r\n */\r\n public rmdirSync(path: string): void {\r\n path = normalizePath(path);\r\n return this.root.rmdirSync(path);\r\n }\r\n\r\n /**\r\n * Asynchronous `mkdir`.\r\n * @param [String] path\r\n * @param [Number?] mode defaults to `0777`\r\n * @param [Function(BrowserFS.ApiError)] callback\r\n */\r\n public mkdir(path: string, mode?: any, cb: (e?: ApiError) => void = nopCb): void {\r\n if (typeof mode === 'function') {\r\n cb = mode;\r\n mode = 0x1ff;\r\n }\r\n var newCb = wrapCb(cb, 1);\r\n try {\r\n path = normalizePath(path);\r\n this.root.mkdir(path, mode, newCb);\r\n } catch (e) {\r\n newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous `mkdir`.\r\n * @param [String] path\r\n * @param [Number?] mode defaults to `0777`\r\n */\r\n public mkdirSync(path: string, mode?: number | string): void {\r\n this.root.mkdirSync(normalizePath(path), normalizeMode(mode, 0x1ff));\r\n }\r\n\r\n /**\r\n * Asynchronous `readdir`. Reads the contents of a directory.\r\n * The callback gets two arguments `(err, files)` where `files` is an array of\r\n * the names of the files in the directory excluding `'.'` and `'..'`.\r\n * @param [String] path\r\n * @param [Function(BrowserFS.ApiError, String[])] callback\r\n */\r\n public readdir(path: string, cb: (err: ApiError, files?: string[]) => void = nopCb): void {\r\n var newCb = <(err: ApiError, files?: string[]) => void> wrapCb(cb, 2);\r\n try {\r\n path = normalizePath(path);\r\n this.root.readdir(path, newCb);\r\n } catch (e) {\r\n newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous `readdir`. Reads the contents of a directory.\r\n * @param [String] path\r\n * @return [String[]]\r\n */\r\n public readdirSync(path: string): string[] {\r\n path = normalizePath(path);\r\n return this.root.readdirSync(path);\r\n }\r\n\r\n // SYMLINK METHODS\r\n\r\n /**\r\n * Asynchronous `link`.\r\n * @param [String] srcpath\r\n * @param [String] dstpath\r\n * @param [Function(BrowserFS.ApiError)] callback\r\n */\r\n public link(srcpath: string, dstpath: string, cb: (e?: ApiError) => void = nopCb): void {\r\n var newCb = wrapCb(cb, 1);\r\n try {\r\n srcpath = normalizePath(srcpath);\r\n dstpath = normalizePath(dstpath);\r\n this.root.link(srcpath, dstpath, newCb);\r\n } catch (e) {\r\n newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous `link`.\r\n * @param [String] srcpath\r\n * @param [String] dstpath\r\n */\r\n public linkSync(srcpath: string, dstpath: string): void {\r\n srcpath = normalizePath(srcpath);\r\n dstpath = normalizePath(dstpath);\r\n return this.root.linkSync(srcpath, dstpath);\r\n }\r\n\r\n /**\r\n * Asynchronous `symlink`.\r\n * @param [String] srcpath\r\n * @param [String] dstpath\r\n * @param [String?] type can be either `'dir'` or `'file'` (default is `'file'`)\r\n * @param [Function(BrowserFS.ApiError)] callback\r\n */\r\n public symlink(srcpath: string, dstpath: string, cb?: (e?: ApiError) => void): void;\r\n public symlink(srcpath: string, dstpath: string, type?: string, cb?: (e?: ApiError) => void): void;\r\n public symlink(srcpath: string, dstpath: string, arg3?: any, cb: (e?: ApiError) => void = nopCb): void {\r\n var type = typeof arg3 === 'string' ? arg3 : 'file';\r\n cb = typeof arg3 === 'function' ? arg3 : cb;\r\n var newCb = wrapCb(cb, 1);\r\n try {\r\n if (type !== 'file' && type !== 'dir') {\r\n return newCb(new ApiError(ErrorCode.EINVAL, \"Invalid type: \" + type));\r\n }\r\n srcpath = normalizePath(srcpath);\r\n dstpath = normalizePath(dstpath);\r\n this.root.symlink(srcpath, dstpath, type, newCb);\r\n } catch (e) {\r\n newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous `symlink`.\r\n * @param [String] srcpath\r\n * @param [String] dstpath\r\n * @param [String?] type can be either `'dir'` or `'file'` (default is `'file'`)\r\n */\r\n public symlinkSync(srcpath: string, dstpath: string, type?: string): void {\r\n if (type == null) {\r\n type = 'file';\r\n } else if (type !== 'file' && type !== 'dir') {\r\n throw new ApiError(ErrorCode.EINVAL, \"Invalid type: \" + type);\r\n }\r\n srcpath = normalizePath(srcpath);\r\n dstpath = normalizePath(dstpath);\r\n return this.root.symlinkSync(srcpath, dstpath, type);\r\n }\r\n\r\n /**\r\n * Asynchronous readlink.\r\n * @param [String] path\r\n * @param [Function(BrowserFS.ApiError, String)] callback\r\n */\r\n public readlink(path: string, cb: (err: ApiError, linkString?: string) => any = nopCb): void {\r\n var newCb = wrapCb(cb, 2);\r\n try {\r\n path = normalizePath(path);\r\n this.root.readlink(path, newCb);\r\n } catch (e) {\r\n newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous readlink.\r\n * @param [String] path\r\n * @return [String]\r\n */\r\n public readlinkSync(path: string): string {\r\n path = normalizePath(path);\r\n return this.root.readlinkSync(path);\r\n }\r\n\r\n // PROPERTY OPERATIONS\r\n\r\n /**\r\n * Asynchronous `chown`.\r\n * @param [String] path\r\n * @param [Number] uid\r\n * @param [Number] gid\r\n * @param [Function(BrowserFS.ApiError)] callback\r\n */\r\n public chown(path: string, uid: number, gid: number, cb: (e?: ApiError) => void = nopCb): void {\r\n var newCb = wrapCb(cb, 1);\r\n try {\r\n path = normalizePath(path);\r\n this.root.chown(path, false, uid, gid, newCb);\r\n } catch (e) {\r\n newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous `chown`.\r\n * @param [String] path\r\n * @param [Number] uid\r\n * @param [Number] gid\r\n */\r\n public chownSync(path: string, uid: number, gid: number): void {\r\n path = normalizePath(path);\r\n this.root.chownSync(path, false, uid, gid);\r\n }\r\n\r\n /**\r\n * Asynchronous `lchown`.\r\n * @param [String] path\r\n * @param [Number] uid\r\n * @param [Number] gid\r\n * @param [Function(BrowserFS.ApiError)] callback\r\n */\r\n public lchown(path: string, uid: number, gid: number, cb: (e?: ApiError) => void = nopCb): void {\r\n var newCb = wrapCb(cb, 1);\r\n try {\r\n path = normalizePath(path);\r\n this.root.chown(path, true, uid, gid, newCb);\r\n } catch (e) {\r\n newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous `lchown`.\r\n * @param [String] path\r\n * @param [Number] uid\r\n * @param [Number] gid\r\n */\r\n public lchownSync(path: string, uid: number, gid: number): void {\r\n path = normalizePath(path);\r\n this.root.chownSync(path, true, uid, gid);\r\n }\r\n\r\n /**\r\n * Asynchronous `chmod`.\r\n * @param [String] path\r\n * @param [Number] mode\r\n * @param [Function(BrowserFS.ApiError)] callback\r\n */\r\n public chmod(path: string, mode: number | string, cb: (e?: ApiError) => void = nopCb): void {\r\n var newCb = wrapCb(cb, 1);\r\n try {\r\n let numMode = normalizeMode(mode, -1);\r\n if (numMode < 0) {\r\n throw new ApiError(ErrorCode.EINVAL, `Invalid mode.`);\r\n }\r\n this.root.chmod(normalizePath(path), false, numMode, newCb);\r\n } catch (e) {\r\n newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous `chmod`.\r\n * @param [String] path\r\n * @param [Number] mode\r\n */\r\n public chmodSync(path: string, mode: string|number): void {\r\n let numMode = normalizeMode(mode, -1);\r\n if (numMode < 0) {\r\n throw new ApiError(ErrorCode.EINVAL, `Invalid mode.`);\r\n }\r\n path = normalizePath(path);\r\n this.root.chmodSync(path, false, numMode);\r\n }\r\n\r\n /**\r\n * Asynchronous `lchmod`.\r\n * @param [String] path\r\n * @param [Number] mode\r\n * @param [Function(BrowserFS.ApiError)] callback\r\n */\r\n public lchmod(path: string, mode: number|string, cb: Function = nopCb): void {\r\n var newCb = wrapCb(cb, 1);\r\n try {\r\n let numMode = normalizeMode(mode, -1);\r\n if (numMode < 0) {\r\n throw new ApiError(ErrorCode.EINVAL, `Invalid mode.`);\r\n }\r\n this.root.chmod(normalizePath(path), true, numMode, newCb);\r\n } catch (e) {\r\n newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous `lchmod`.\r\n * @param [String] path\r\n * @param [Number] mode\r\n */\r\n public lchmodSync(path: string, mode: number|string): void {\r\n let numMode = normalizeMode(mode, -1);\r\n if (numMode < 1) {\r\n throw new ApiError(ErrorCode.EINVAL, `Invalid mode.`);\r\n }\r\n this.root.chmodSync(normalizePath(path), true, numMode);\r\n }\r\n\r\n /**\r\n * Change file timestamps of the file referenced by the supplied path.\r\n * @param [String] path\r\n * @param [Date] atime\r\n * @param [Date] mtime\r\n * @param [Function(BrowserFS.ApiError)] callback\r\n */\r\n public utimes(path: string, atime: number|Date, mtime: number|Date, cb: (e?: ApiError) => void = nopCb): void {\r\n var newCb = wrapCb(cb, 1);\r\n try {\r\n this.root.utimes(normalizePath(path), normalizeTime(atime), normalizeTime(mtime), newCb);\r\n } catch (e) {\r\n newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Change file timestamps of the file referenced by the supplied path.\r\n * @param [String] path\r\n * @param [Date] atime\r\n * @param [Date] mtime\r\n */\r\n public utimesSync(path: string, atime: number|Date, mtime: number|Date): void {\r\n this.root.utimesSync(normalizePath(path), normalizeTime(atime), normalizeTime(mtime));\r\n }\r\n\r\n /**\r\n * Asynchronous `realpath`. The callback gets two arguments\r\n * `(err, resolvedPath)`. May use `process.cwd` to resolve relative paths.\r\n *\r\n * @example Usage example\r\n * var cache = {'/etc':'/private/etc'};\r\n * fs.realpath('/etc/passwd', cache, function (err, resolvedPath) {\r\n * if (err) throw err;\r\n * console.log(resolvedPath);\r\n * });\r\n *\r\n * @param [String] path\r\n * @param [Object?] cache An object literal of mapped paths that can be used to\r\n * force a specific path resolution or avoid additional `fs.stat` calls for\r\n * known real paths.\r\n * @param [Function(BrowserFS.ApiError, String)] callback\r\n */\r\n public realpath(path: string, cb?: (err: ApiError, resolvedPath?: string) =>any): void;\r\n public realpath(path: string, cache: {[path: string]: string}, cb: (err: ApiError, resolvedPath?: string) =>any): void;\r\n public realpath(path: string, arg2?: any, cb: (err: ApiError, resolvedPath?: string) => any = nopCb): void {\r\n var cache = typeof arg2 === 'object' ? arg2 : {};\r\n cb = typeof arg2 === 'function' ? arg2 : nopCb;\r\n var newCb = <(err: ApiError, resolvedPath?: string) =>any> wrapCb(cb, 2);\r\n try {\r\n path = normalizePath(path);\r\n this.root.realpath(path, cache, newCb);\r\n } catch (e) {\r\n newCb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous `realpath`.\r\n * @param [String] path\r\n * @param [Object?] cache An object literal of mapped paths that can be used to\r\n * force a specific path resolution or avoid additional `fs.stat` calls for\r\n * known real paths.\r\n * @return [String]\r\n */\r\n public realpathSync(path: string, cache: {[path: string]: string} = {}): string {\r\n path = normalizePath(path);\r\n return this.root.realpathSync(path, cache);\r\n }\r\n\r\n public watchFile(filename: string, listener: (curr: Stats, prev: Stats) => void): void;\r\n public watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: (curr: Stats, prev: Stats) => void): void;\r\n public watchFile(filename: string, arg2: any, listener: (curr: Stats, prev: Stats) => void = nopCb): void {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n\r\n public unwatchFile(filename: string, listener: (curr: Stats, prev: Stats) => void = nopCb): void {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n\r\n public watch(filename: string, listener?: (event: string, filename: string) => any): _fs.FSWatcher;\r\n public watch(filename: string, options: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): _fs.FSWatcher;\r\n public watch(filename: string, arg2: any, listener: (event: string, filename: string) => any = nopCb): _fs.FSWatcher {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n\r\n public F_OK: number = 0;\r\n public R_OK: number = 4;\r\n public W_OK: number = 2;\r\n public X_OK: number = 1;\r\n\r\n public access(path: string, callback: (err: ApiError) => void): void;\r\n public access(path: string, mode: number, callback: (err: ApiError) => void): void;\r\n public access(path: string, arg2: any, cb: (e: ApiError) => void = nopCb): void {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n\r\n public accessSync(path: string, mode?: number): void {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n\r\n public createReadStream(path: string, options?: {\r\n flags?: string;\r\n encoding?: string;\r\n fd?: number;\r\n mode?: number;\r\n autoClose?: boolean;\r\n }): _fs.ReadStream {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n\r\n public createWriteStream(path: string, options?: {\r\n flags?: string;\r\n encoding?: string;\r\n fd?: number;\r\n mode?: number;\r\n }): _fs.WriteStream {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n\r\n public _wrapCb: (cb: Function, args: number) => Function = wrapCb;\r\n}\r\n\r\n// Type checking.\r\nvar _: typeof _fs = new FS();\r\n\r\nexport interface FSModule extends FS {\r\n /**\r\n * Retrieve the FS object backing the fs module.\r\n */\r\n getFSModule(): FS;\r\n /**\r\n * Set the FS object backing the fs module.\r\n */\r\n changeFSModule(newFs: FS): void;\r\n /**\r\n * The FS constructor.\r\n */\r\n FS: typeof FS;\r\n}\r\n",
|
||
"/**\r\n * Standard libc error codes. Add more to this enum and ErrorStrings as they are\r\n * needed.\r\n * @url http://www.gnu.org/software/libc/manual/html_node/Error-Codes.html\r\n */\r\nexport enum ErrorCode {\r\n EPERM, ENOENT, EIO, EBADF, EACCES, EBUSY, EEXIST, ENOTDIR, EISDIR, EINVAL,\r\n EFBIG, ENOSPC, EROFS, ENOTEMPTY, ENOTSUP\r\n}\r\n/**\r\n * Strings associated with each error code.\r\n */\r\nvar ErrorStrings: {[code: string]: string} = {};\r\nErrorStrings[ErrorCode.EPERM] = 'Operation not permitted.';\r\nErrorStrings[ErrorCode.ENOENT] = 'No such file or directory.';\r\nErrorStrings[ErrorCode.EIO] = 'Input/output error.';\r\nErrorStrings[ErrorCode.EBADF] = 'Bad file descriptor.';\r\nErrorStrings[ErrorCode.EACCES] = 'Permission denied.';\r\nErrorStrings[ErrorCode.EBUSY] = 'Resource busy or locked.';\r\nErrorStrings[ErrorCode.EEXIST] = 'File exists.';\r\nErrorStrings[ErrorCode.ENOTDIR] = 'File is not a directory.';\r\nErrorStrings[ErrorCode.EISDIR] = 'File is a directory.';\r\nErrorStrings[ErrorCode.EINVAL] = 'Invalid argument.';\r\nErrorStrings[ErrorCode.EFBIG] = 'File is too big.';\r\nErrorStrings[ErrorCode.ENOSPC] = 'No space left on disk.';\r\nErrorStrings[ErrorCode.EROFS] = 'Cannot modify a read-only file system.';\r\nErrorStrings[ErrorCode.ENOTEMPTY] = 'Directory is not empty.';\r\nErrorStrings[ErrorCode.ENOTSUP] = 'Operation is not supported.';\r\n\r\n/**\r\n * Represents a BrowserFS error. Passed back to applications after a failed\r\n * call to the BrowserFS API.\r\n * errno?: number;\r\n code?: string;\r\n path?: string;\r\n syscall?: string;\r\n stack?: string;\r\n */\r\nexport class ApiError extends Error implements NodeJS.ErrnoException {\r\n public errno: ErrorCode;\r\n public code: string;\r\n public path: string;\r\n // Unsupported.\r\n public syscall: string = \"\";\r\n public stack: string;\r\n\r\n /**\r\n * Represents a BrowserFS error. Passed back to applications after a failed\r\n * call to the BrowserFS API.\r\n *\r\n * Error codes mirror those returned by regular Unix file operations, which is\r\n * what Node returns.\r\n * @constructor ApiError\r\n * @param type The type of the error.\r\n * @param [message] A descriptive error message.\r\n */\r\n constructor(type: ErrorCode, message: string = ErrorStrings[type], path: string = null) {\r\n super(message);\r\n this.errno = type;\r\n this.code = ErrorCode[type];\r\n this.path = path;\r\n this.stack = (<any>new Error()).stack;\r\n this.message = `Error: ${this.code}: ${message}${this.path ? `, '${this.path}'` : ''}`;\r\n }\r\n\r\n /**\r\n * @return A friendly error message.\r\n */\r\n public toString(): string {\r\n return this.message;\r\n }\r\n\r\n public toJSON(): any {\r\n return {\r\n errno: this.errno,\r\n code: this.code,\r\n path: this.path,\r\n stack: this.stack,\r\n message: this.message\r\n };\r\n }\r\n\r\n public static fromJSON(json: any): ApiError {\r\n var err = new ApiError(0);\r\n err.errno = json.errno;\r\n err.code = json.code;\r\n err.path = json.path;\r\n err.stack = json.stack;\r\n err.message = json.message;\r\n return err;\r\n }\r\n\r\n /**\r\n * Writes the API error into a buffer.\r\n */\r\n public writeToBuffer(buffer: Buffer = new Buffer(this.bufferSize()), i: number = 0): Buffer {\r\n var bytesWritten = buffer.write(JSON.stringify(this.toJSON()), i + 4);\r\n buffer.writeUInt32LE(bytesWritten, i);\r\n return buffer;\r\n }\r\n\r\n /**\r\n * Creates an ApiError object from a buffer.\r\n */\r\n public static fromBuffer(buffer: Buffer, i: number = 0): ApiError {\r\n return ApiError.fromJSON(JSON.parse(buffer.toString('utf8', i + 4, i + 4 + buffer.readUInt32LE(i))));\r\n }\r\n\r\n /**\r\n * The size of the API error in buffer-form in bytes.\r\n */\r\n public bufferSize(): number {\r\n // 4 bytes for string length.\r\n return 4 + Buffer.byteLength(JSON.stringify(this.toJSON()));\r\n }\r\n\r\n public static FileError(code: ErrorCode, p: string): ApiError {\r\n return new ApiError(code, ErrorStrings[code], p);\r\n }\r\n public static ENOENT(path: string): ApiError {\r\n return this.FileError(ErrorCode.ENOENT, path);\r\n }\r\n\r\n public static EEXIST(path: string): ApiError {\r\n return this.FileError(ErrorCode.EEXIST, path);\r\n }\r\n\r\n public static EISDIR(path: string): ApiError {\r\n return this.FileError(ErrorCode.EISDIR, path);\r\n }\r\n\r\n public static ENOTDIR(path: string): ApiError {\r\n return this.FileError(ErrorCode.ENOTDIR, path);\r\n }\r\n\r\n public static EPERM(path: string): ApiError {\r\n return this.FileError(ErrorCode.EPERM, path);\r\n }\r\n\r\n public static ENOTEMPTY(path: string): ApiError {\r\n return this.FileError(ErrorCode.ENOTEMPTY, path);\r\n }\r\n}\r\n",
|
||
"import AsyncMirror from '../backend/AsyncMirror';\nimport Dropbox from '../backend/Dropbox';\nimport FolderAdapter from '../backend/FolderAdapter';\nimport HTML5FS from '../backend/HTML5FS';\nimport IndexedDB from '../backend/IndexedDB';\nimport InMemory from '../backend/InMemory';\nimport LocalStorage from '../backend/LocalStorage';\nimport MountableFileSystem from '../backend/MountableFileSystem';\nimport OverlayFS from '../backend/OverlayFS';\nimport WorkerFS from '../backend/WorkerFS';\nimport XmlHttpRequest from '../backend/XmlHttpRequest';\nimport ZipFS from '../backend/ZipFS';\nexport {AsyncMirror, Dropbox, FolderAdapter, HTML5FS, IndexedDB, InMemory, LocalStorage, MountableFileSystem, OverlayFS, WorkerFS, XmlHttpRequest, ZipFS};\n",
|
||
"/**\r\n * BrowserFS's main module. This is exposed in the browser via the BrowserFS global.\r\n */\r\n\r\nimport buffer = require('buffer');\r\nimport fs = require('./node_fs');\r\nimport path = require('path');\r\nimport file_system = require('./file_system');\r\nimport EmscriptenFS from '../generic/emscripten_fs';\r\nimport * as FileSystem from './backends';\r\nimport * as BFSUtils from './util';\r\n\r\nif (process['initializeTTYs']) {\r\n process['initializeTTYs']();\r\n}\r\n\r\n/**\r\n * Installs BrowserFS onto the given object.\r\n * We recommend that you run install with the 'window' object to make things\r\n * global, as in Node.\r\n *\r\n * Properties installed:\r\n *\r\n * * Buffer\r\n * * process\r\n * * require (we monkey-patch it)\r\n *\r\n * This allows you to write code as if you were running inside Node.\r\n * @param {object} obj - The object to install things onto (e.g. window)\r\n */\r\nexport function install(obj: any) {\r\n obj.Buffer = Buffer;\r\n obj.process = process;\r\n var oldRequire = obj.require != null ? obj.require : null;\r\n // Monkey-patch require for Node-style code.\r\n obj.require = function(arg: string) {\r\n var rv = BFSRequire(arg);\r\n if (rv == null) {\r\n return oldRequire.apply(null, Array.prototype.slice.call(arguments, 0))\r\n } else {\r\n return rv;\r\n }\r\n };\r\n}\r\n\r\nexport function registerFileSystem(name: string, fs: file_system.FileSystemConstructor) {\r\n (<any> FileSystem)[name] = fs;\r\n}\r\n\r\nexport function BFSRequire(module: 'fs'): typeof fs;\r\nexport function BFSRequire(module: 'path'): typeof path;\r\nexport function BFSRequire(module: 'buffer'): typeof buffer;\r\nexport function BFSRequire(module: 'process'): typeof process;\r\nexport function BFSRequire(module: 'bfs_utils'): typeof BFSUtils;\r\nexport function BFSRequire(module: string): any;\r\nexport function BFSRequire(module: string): any {\r\n switch(module) {\r\n case 'fs':\r\n return fs;\r\n case 'path':\r\n return path;\r\n case 'buffer':\r\n // The 'buffer' module has 'Buffer' as a property.\r\n return buffer;\r\n case 'process':\r\n return process;\r\n case 'bfs_utils':\r\n return BFSUtils;\r\n default:\r\n return FileSystem[module];\r\n }\r\n}\r\n\r\n/**\r\n * You must call this function with a properly-instantiated root file system\r\n * before using any file system API method.\r\n * @param {BrowserFS.FileSystem} rootFS - The root filesystem to use for the\r\n * entire BrowserFS file system.\r\n */\r\nexport function initialize(rootfs: file_system.FileSystem) {\r\n return fs.initialize(rootfs);\r\n}\r\n\r\nexport {EmscriptenFS, FileSystem};\r\n",
|
||
"import {ApiError, ErrorCode} from './api_error';\r\nimport Stats from './node_fs_stats';\r\n\r\nexport interface File {\r\n /**\r\n * **Core**: Get the current file position.\r\n * @return [Number]\r\n */\r\n getPos(): number;\r\n /**\r\n * **Core**: Asynchronous `stat`.\r\n * @param [Function(BrowserFS.ApiError, BrowserFS.node.fs.Stats)] cb\r\n */\r\n stat(cb: (err: ApiError, stats?: Stats) => any): void;\r\n /**\r\n * **Core**: Synchronous `stat`.\r\n * @param [Function(BrowserFS.ApiError, BrowserFS.node.fs.Stats)] cb\r\n */\r\n statSync(): Stats;\r\n /**\r\n * **Core**: Asynchronous close.\r\n * @param [Function(BrowserFS.ApiError)] cb\r\n */\r\n close(cb: Function): void;\r\n /**\r\n * **Core**: Synchronous close.\r\n */\r\n closeSync(): void;\r\n /**\r\n * **Core**: Asynchronous truncate.\r\n * @param [Number] len\r\n * @param [Function(BrowserFS.ApiError)] cb\r\n */\r\n truncate(len: number, cb: Function): void;\r\n /**\r\n * **Core**: Synchronous truncate.\r\n * @param [Number] len\r\n */\r\n truncateSync(len: number): void;\r\n /**\r\n * **Core**: Asynchronous sync.\r\n * @param [Function(BrowserFS.ApiError)] cb\r\n */\r\n sync(cb: (e?: ApiError) => void): void;\r\n /**\r\n * **Core**: Synchronous sync.\r\n */\r\n syncSync(): void;\r\n /**\r\n * **Core**: Write buffer to the file.\r\n * Note that it is unsafe to use fs.write multiple times on the same file\r\n * without waiting for the callback.\r\n * @param [BrowserFS.node.Buffer] buffer Buffer containing the data to write to\r\n * the file.\r\n * @param [Number] offset Offset in the buffer to start reading data from.\r\n * @param [Number] length The amount of bytes to write to the file.\r\n * @param [Number] position Offset from the beginning of the file where this\r\n * data should be written. If position is null, the data will be written at\r\n * the current position.\r\n * @param [Function(BrowserFS.ApiError, Number, BrowserFS.node.Buffer)]\r\n * cb The number specifies the number of bytes written into the file.\r\n */\r\n write(buffer: NodeBuffer, offset: number, length: number, position: number, cb: (err: ApiError, written?: number, buffer?: NodeBuffer) => any): void;\r\n /**\r\n * **Core**: Write buffer to the file.\r\n * Note that it is unsafe to use fs.writeSync multiple times on the same file\r\n * without waiting for it to return.\r\n * @param [BrowserFS.node.Buffer] buffer Buffer containing the data to write to\r\n * the file.\r\n * @param [Number] offset Offset in the buffer to start reading data from.\r\n * @param [Number] length The amount of bytes to write to the file.\r\n * @param [Number] position Offset from the beginning of the file where this\r\n * data should be written. If position is null, the data will be written at\r\n * the current position.\r\n * @return [Number]\r\n */\r\n writeSync(buffer: NodeBuffer, offset: number, length: number, position: number): number;\r\n /**\r\n * **Core**: Read data from the file.\r\n * @param [BrowserFS.node.Buffer] buffer The buffer that the data will be\r\n * written to.\r\n * @param [Number] offset The offset within the buffer where writing will\r\n * start.\r\n * @param [Number] length An integer specifying the number of bytes to read.\r\n * @param [Number] position An integer specifying where to begin reading from\r\n * in the file. If position is null, data will be read from the current file\r\n * position.\r\n * @param [Function(BrowserFS.ApiError, Number, BrowserFS.node.Buffer)] cb The\r\n * number is the number of bytes read\r\n */\r\n read(buffer: NodeBuffer, offset: number, length: number, position: number, cb: (err: ApiError, bytesRead?: number, buffer?: NodeBuffer) => void): void;\r\n /**\r\n * **Core**: Read data from the file.\r\n * @param [BrowserFS.node.Buffer] buffer The buffer that the data will be\r\n * written to.\r\n * @param [Number] offset The offset within the buffer where writing will\r\n * start.\r\n * @param [Number] length An integer specifying the number of bytes to read.\r\n * @param [Number] position An integer specifying where to begin reading from\r\n * in the file. If position is null, data will be read from the current file\r\n * position.\r\n * @return [Number]\r\n */\r\n readSync(buffer: NodeBuffer, offset: number, length: number, position: number): number;\r\n /**\r\n * **Supplementary**: Asynchronous `datasync`.\r\n *\r\n * Default implementation maps to `sync`.\r\n * @param [Function(BrowserFS.ApiError)] cb\r\n */\r\n datasync(cb: (e?: ApiError) => void): void;\r\n /**\r\n * **Supplementary**: Synchronous `datasync`.\r\n *\r\n * Default implementation maps to `syncSync`.\r\n */\r\n datasyncSync(): void;\r\n /**\r\n * **Optional**: Asynchronous `chown`.\r\n * @param [Number] uid\r\n * @param [Number] gid\r\n * @param [Function(BrowserFS.ApiError)] cb\r\n */\r\n chown(uid: number, gid: number, cb: (e?: ApiError) => void): void;\r\n /**\r\n * **Optional**: Synchronous `chown`.\r\n * @param [Number] uid\r\n * @param [Number] gid\r\n */\r\n chownSync(uid: number, gid: number): void;\r\n /**\r\n * **Optional**: Asynchronous `fchmod`.\r\n * @param [Number] mode\r\n * @param [Function(BrowserFS.ApiError)] cb\r\n */\r\n chmod(mode: number, cb: (e?: ApiError) => void): void;\r\n /**\r\n * **Optional**: Synchronous `fchmod`.\r\n * @param [Number] mode\r\n */\r\n chmodSync(mode: number): void;\r\n /**\r\n * **Optional**: Change the file timestamps of the file.\r\n * @param [Date] atime\r\n * @param [Date] mtime\r\n * @param [Function(BrowserFS.ApiError)] cb\r\n */\r\n utimes(atime: Date, mtime: Date, cb: (e?: ApiError) => void): void;\r\n /**\r\n * **Optional**: Change the file timestamps of the file.\r\n * @param [Date] atime\r\n * @param [Date] mtime\r\n */\r\n utimesSync(atime: Date, mtime: Date): void;\r\n}\r\n\r\n/**\r\n * Base class that contains shared implementations of functions for the file\r\n * object.\r\n * @class\r\n */\r\nexport class BaseFile {\r\n public sync(cb: (e?: ApiError) => void): void {\r\n cb(new ApiError(ErrorCode.ENOTSUP));\r\n }\r\n public syncSync(): void {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n public datasync(cb: (e?: ApiError) => void): void {\r\n this.sync(cb);\r\n }\r\n public datasyncSync(): void {\r\n return this.syncSync();\r\n }\r\n public chown(uid: number, gid: number, cb: (e?: ApiError) => void): void {\r\n cb(new ApiError(ErrorCode.ENOTSUP));\r\n }\r\n public chownSync(uid: number, gid: number): void {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n public chmod(mode: number, cb: (e?: ApiError) => void): void {\r\n cb(new ApiError(ErrorCode.ENOTSUP));\r\n }\r\n public chmodSync(mode: number): void {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n public utimes(atime: Date, mtime: Date, cb: (e?: ApiError) => void): void {\r\n cb(new ApiError(ErrorCode.ENOTSUP));\r\n }\r\n public utimesSync(atime: Date, mtime: Date): void {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n}\r\n",
|
||
"import api_error = require('./api_error');\r\n\r\n/**\r\n * @class\r\n */\r\nexport enum ActionType {\r\n // Indicates that the code should not do anything.\r\n NOP = 0,\r\n // Indicates that the code should throw an exception.\r\n THROW_EXCEPTION = 1,\r\n // Indicates that the code should truncate the file, but only if it is a file.\r\n TRUNCATE_FILE = 2,\r\n // Indicates that the code should create the file.\r\n CREATE_FILE = 3\r\n}\r\n\r\n/**\r\n * Represents one of the following file flags. A convenience object.\r\n *\r\n * * `'r'` - Open file for reading. An exception occurs if the file does not exist.\r\n * * `'r+'` - Open file for reading and writing. An exception occurs if the file does not exist.\r\n * * `'rs'` - Open file for reading in synchronous mode. Instructs the filesystem to not cache writes.\r\n * * `'rs+'` - Open file for reading and writing, and opens the file in synchronous mode.\r\n * * `'w'` - Open file for writing. The file is created (if it does not exist) or truncated (if it exists).\r\n * * `'wx'` - Like 'w' but opens the file in exclusive mode.\r\n * * `'w+'` - Open file for reading and writing. The file is created (if it does not exist) or truncated (if it exists).\r\n * * `'wx+'` - Like 'w+' but opens the file in exclusive mode.\r\n * * `'a'` - Open file for appending. The file is created if it does not exist.\r\n * * `'ax'` - Like 'a' but opens the file in exclusive mode.\r\n * * `'a+'` - Open file for reading and appending. The file is created if it does not exist.\r\n * * `'ax+'` - Like 'a+' but opens the file in exclusive mode.\r\n *\r\n * Exclusive mode ensures that the file path is newly created.\r\n * @class\r\n */\r\nexport class FileFlag {\r\n // Contains cached FileMode instances.\r\n private static flagCache: { [mode: string]: FileFlag } = {};\r\n // Array of valid mode strings.\r\n private static validFlagStrs = ['r', 'r+', 'rs', 'rs+', 'w', 'wx', 'w+', 'wx+', 'a', 'ax', 'a+', 'ax+'];\r\n\r\n /**\r\n * Get an object representing the given file mode.\r\n * @param [String] modeStr The string representing the mode\r\n * @return [BrowserFS.FileMode] The FileMode object representing the mode\r\n * @throw [BrowserFS.ApiError] when the mode string is invalid\r\n */\r\n public static getFileFlag(flagStr: string): FileFlag {\r\n // Check cache first.\r\n if (FileFlag.flagCache.hasOwnProperty(flagStr)) {\r\n return FileFlag.flagCache[flagStr];\r\n }\r\n return FileFlag.flagCache[flagStr] = new FileFlag(flagStr);\r\n }\r\n\r\n private flagStr: string;\r\n /**\r\n * This should never be called directly.\r\n * @param [String] modeStr The string representing the mode\r\n * @throw [BrowserFS.ApiError] when the mode string is invalid\r\n */\r\n constructor(flagStr: string) {\r\n this.flagStr = flagStr;\r\n if (FileFlag.validFlagStrs.indexOf(flagStr) < 0) {\r\n throw new api_error.ApiError(api_error.ErrorCode.EINVAL, \"Invalid flag: \" + flagStr);\r\n }\r\n }\r\n\r\n /**\r\n * Get the underlying flag string for this flag.\r\n */\r\n public getFlagString(): string {\r\n return this.flagStr;\r\n }\r\n\r\n /**\r\n * Returns true if the file is readable.\r\n * @return [Boolean]\r\n */\r\n public isReadable(): boolean {\r\n return this.flagStr.indexOf('r') !== -1 || this.flagStr.indexOf('+') !== -1;\r\n }\r\n /**\r\n * Returns true if the file is writeable.\r\n * @return [Boolean]\r\n */\r\n public isWriteable(): boolean {\r\n return this.flagStr.indexOf('w') !== -1 || this.flagStr.indexOf('a') !== -1 || this.flagStr.indexOf('+') !== -1;\r\n }\r\n /**\r\n * Returns true if the file mode should truncate.\r\n * @return [Boolean]\r\n */\r\n public isTruncating(): boolean {\r\n return this.flagStr.indexOf('w') !== -1;\r\n }\r\n /**\r\n * Returns true if the file is appendable.\r\n * @return [Boolean]\r\n */\r\n public isAppendable(): boolean {\r\n return this.flagStr.indexOf('a') !== -1;\r\n }\r\n /**\r\n * Returns true if the file is open in synchronous mode.\r\n * @return [Boolean]\r\n */\r\n public isSynchronous(): boolean {\r\n return this.flagStr.indexOf('s') !== -1;\r\n }\r\n /**\r\n * Returns true if the file is open in exclusive mode.\r\n * @return [Boolean]\r\n */\r\n public isExclusive(): boolean {\r\n return this.flagStr.indexOf('x') !== -1;\r\n }\r\n /**\r\n * Returns one of the static fields on this object that indicates the\r\n * appropriate response to the path existing.\r\n * @return [Number]\r\n */\r\n public pathExistsAction(): ActionType {\r\n if (this.isExclusive()) {\r\n return ActionType.THROW_EXCEPTION;\r\n } else if (this.isTruncating()) {\r\n return ActionType.TRUNCATE_FILE;\r\n } else {\r\n return ActionType.NOP;\r\n }\r\n }\r\n /**\r\n * Returns one of the static fields on this object that indicates the\r\n * appropriate response to the path not existing.\r\n * @return [Number]\r\n */\r\n public pathNotExistsAction(): ActionType {\r\n if ((this.isWriteable() || this.isAppendable()) && this.flagStr !== 'r+') {\r\n return ActionType.CREATE_FILE;\r\n } else {\r\n return ActionType.THROW_EXCEPTION;\r\n }\r\n }\r\n}\r\n",
|
||
"import {ApiError, ErrorCode} from './api_error';\r\nimport Stats from './node_fs_stats';\r\nimport file = require('./file');\r\nimport {FileFlag, ActionType} from './file_flag';\r\nimport path = require('path');\r\n\r\n/**\r\n * Interface for a filesystem. **All** BrowserFS FileSystems should implement\r\n * this interface.\r\n *\r\n * Below, we denote each API method as **Core**, **Supplemental**, or\r\n * **Optional**.\r\n *\r\n * ### Core Methods\r\n *\r\n * **Core** API methods *need* to be implemented for basic read/write\r\n * functionality.\r\n *\r\n * Note that read-only FileSystems can choose to not implement core methods\r\n * that mutate files or metadata. The default implementation will pass a\r\n * NOT_SUPPORTED error to the callback.\r\n *\r\n * ### Supplemental Methods\r\n *\r\n * **Supplemental** API methods do not need to be implemented by a filesystem.\r\n * The default implementation implements all of the supplemental API methods in\r\n * terms of the **core** API methods.\r\n *\r\n * Note that a file system may choose to implement supplemental methods for\r\n * efficiency reasons.\r\n *\r\n * The code for some supplemental methods was adapted directly from NodeJS's\r\n * fs.js source code.\r\n *\r\n * ### Optional Methods\r\n *\r\n * **Optional** API methods provide functionality that may not be available in\r\n * all filesystems. For example, all symlink/hardlink-related API methods fall\r\n * under this category.\r\n *\r\n * The default implementation will pass a NOT_SUPPORTED error to the callback.\r\n *\r\n * ### Argument Assumptions\r\n *\r\n * You can assume the following about arguments passed to each API method:\r\n *\r\n * * **Every path is an absolute path.** Meaning, `.`, `..`, and other items\r\n * are resolved into an absolute form.\r\n * * **All arguments are present.** Any optional arguments at the Node API level\r\n * have been passed in with their default values.\r\n * * **The callback will reset the stack depth.** When your filesystem calls the\r\n * callback with the requested information, it will use `setImmediate` to\r\n * reset the JavaScript stack depth before calling the user-supplied callback.\r\n * @class FileSystem\r\n */\r\nexport interface FileSystem {\r\n /**\r\n * **Optional**: Returns the name of the file system.\r\n * @method FileSystem#getName\r\n * @return {string}\r\n */\r\n getName(): string;\r\n /**\r\n * **Optional**: Passes the following information to the callback:\r\n *\r\n * * Total number of bytes available on this file system.\r\n * * number of free bytes available on this file system.\r\n *\r\n * @method FileSystem#diskSpace\r\n * @todo This info is not available through the Node API. Perhaps we could do a\r\n * polyfill of diskspace.js, or add a new Node API function.\r\n * @param {string} path The path to the location that is being queried. Only\r\n * useful for filesystems that support mount points.\r\n * @param {FileSystem~diskSpaceCallback} cb\r\n */\r\n diskSpace(p: string, cb: (total: number, free: number) => any): void;\r\n /**\r\n * **Core**: Is this filesystem read-only?\r\n * @method FileSystem#isReadOnly\r\n * @return {boolean} True if this FileSystem is inherently read-only.\r\n */\r\n isReadOnly(): boolean;\r\n /**\r\n * **Core**: Does the filesystem support optional symlink/hardlink-related\r\n * commands?\r\n * @method FileSystem#supportsLinks\r\n * @return {boolean} True if the FileSystem supports the optional\r\n * symlink/hardlink-related commands.\r\n */\r\n supportsLinks(): boolean;\r\n /**\r\n * **Core**: Does the filesystem support optional property-related commands?\r\n * @method FileSystem#supportsProps\r\n * @return {boolean} True if the FileSystem supports the optional\r\n * property-related commands (permissions, utimes, etc).\r\n */\r\n supportsProps(): boolean;\r\n /**\r\n * **Core**: Does the filesystem support the optional synchronous interface?\r\n * @method FileSystem#supportsSynch\r\n * @return {boolean} True if the FileSystem supports synchronous operations.\r\n */\r\n supportsSynch(): boolean;\r\n // **CORE API METHODS**\r\n // File or directory operations\r\n /**\r\n * **Core**: Asynchronous rename. No arguments other than a possible exception\r\n * are given to the completion callback.\r\n * @method FileSystem#rename\r\n * @param {string} oldPath\r\n * @param {string} newPath\r\n * @param {FileSystem~nodeCallback} cb\r\n */\r\n rename(oldPath: string, newPath: string, cb: (err?: ApiError) => void): void;\r\n /**\r\n * **Core**: Synchronous rename.\r\n * @method FileSystem#renameSync\r\n * @param {string} oldPath\r\n * @param {string} newPath\r\n */\r\n renameSync(oldPath: string, newPath: string): void;\r\n /**\r\n * **Core**: Asynchronous `stat` or `lstat`.\r\n * @method FileSystem#stat\r\n * @param {string} path\r\n * @param {boolean} isLstat True if this is `lstat`, false if this is regular\r\n * `stat`.\r\n * @param {FileSystem~nodeStatsCallback} cb\r\n */\r\n stat(p: string, isLstat: boolean, cb: (err: ApiError, stat?: Stats) => void): void;\r\n /**\r\n * **Core**: Synchronous `stat` or `lstat`.\r\n * @method FileSystem#statSync\r\n * @param {string} path\r\n * @param {boolean} isLstat True if this is `lstat`, false if this is regular\r\n * `stat`.\r\n * @return {BrowserFS.node.fs.Stats}\r\n */\r\n statSync(p: string, isLstat: boolean): Stats;\r\n // File operations\r\n /**\r\n * **Core**: Asynchronous file open.\r\n * @see http://www.manpagez.com/man/2/open/\r\n * @method FileSystem#open\r\n * @param {string} path\r\n * @param {BrowserFS.FileMode} flags Handles the complexity of the various file\r\n * modes. See its API for more details.\r\n * @param {number} mode Mode to use to open the file. Can be ignored if the\r\n * filesystem doesn't support permissions.\r\n * @param {FileSystem~fileCallback} cb\r\n */\r\n open(p: string, flag:FileFlag, mode: number, cb: (err: ApiError, fd?: file.File) => any): void;\r\n /**\r\n * **Core**: Synchronous file open.\r\n * @see http://www.manpagez.com/man/2/open/\r\n * @method FileSystem#openSync\r\n * @param {string} path\r\n * @param {BrowserFS.FileMode} flags Handles the complexity of the various file\r\n * modes. See its API for more details.\r\n * @param {number} mode Mode to use to open the file. Can be ignored if the\r\n * filesystem doesn't support permissions.\r\n * @return {BrowserFS.File}\r\n */\r\n openSync(p: string, flag: FileFlag, mode: number): file.File;\r\n /**\r\n * **Core**: Asynchronous `unlink`.\r\n * @method FileSystem#unlink\r\n * @param [string] path\r\n * @param [FileSystem~nodeCallback] cb\r\n */\r\n unlink(p: string, cb: Function): void;\r\n /**\r\n * **Core**: Synchronous `unlink`.\r\n * @method FileSystem#unlinkSync\r\n * @param {string} path\r\n */\r\n unlinkSync(p: string): void;\r\n // Directory operations\r\n /**\r\n * **Core**: Asynchronous `rmdir`.\r\n * @method FileSystem#rmdir\r\n * @param {string} path\r\n * @param {FileSystem~nodeCallback} cb\r\n */\r\n rmdir(p: string, cb: Function): void;\r\n /**\r\n * **Core**: Synchronous `rmdir`.\r\n * @method FileSystem#rmdirSync\r\n * @param {string} path\r\n */\r\n rmdirSync(p: string): void;\r\n /**\r\n * **Core**: Asynchronous `mkdir`.\r\n * @method FileSystem#mkdir\r\n * @param {string} path\r\n * @param {number?} mode Mode to make the directory using. Can be ignored if\r\n * the filesystem doesn't support permissions.\r\n * @param {FileSystem~nodeCallback} cb\r\n */\r\n mkdir(p: string, mode: number, cb: Function): void;\r\n /**\r\n * **Core**: Synchronous `mkdir`.\r\n * @method FileSystem#mkdirSync\r\n * @param {string} path\r\n * @param {number} mode Mode to make the directory using. Can be ignored if\r\n * the filesystem doesn't support permissions.\r\n */\r\n mkdirSync(p: string, mode: number): void;\r\n /**\r\n * **Core**: Asynchronous `readdir`. Reads the contents of a directory.\r\n *\r\n * The callback gets two arguments `(err, files)` where `files` is an array of\r\n * the names of the files in the directory excluding `'.'` and `'..'`.\r\n * @method FileSystem#readdir\r\n * @param {string} path\r\n * @param {FileSystem~readdirCallback} cb\r\n */\r\n readdir(p: string, cb: (err: ApiError, files?: string[]) => void): void;\r\n /**\r\n * **Core**: Synchronous `readdir`. Reads the contents of a directory.\r\n * @method FileSystem#readdirSync\r\n * @param {string} path\r\n * @return {string[]}\r\n */\r\n readdirSync(p: string): string[];\r\n // **SUPPLEMENTAL INTERFACE METHODS**\r\n // File or directory operations\r\n /**\r\n * **Supplemental**: Test whether or not the given path exists by checking with\r\n * the file system. Then call the callback argument with either true or false.\r\n * @method FileSystem#exists\r\n * @param {string} path\r\n * @param {FileSystem~existsCallback} cb\r\n */\r\n exists(p: string, cb: (exists: boolean) => void): void;\r\n /**\r\n * **Supplemental**: Test whether or not the given path exists by checking with\r\n * the file system.\r\n * @method FileSystem#existsSync\r\n * @param {string} path\r\n * @return {boolean}\r\n */\r\n existsSync(p: string): boolean;\r\n /**\r\n * **Supplemental**: Asynchronous `realpath`. The callback gets two arguments\r\n * `(err, resolvedPath)`.\r\n *\r\n * Note that the Node API will resolve `path` to an absolute path.\r\n * @method FileSystem#realpath\r\n * @param {string} path\r\n * @param {Object} cache An object literal of mapped paths that can be used to\r\n * force a specific path resolution or avoid additional `fs.stat` calls for\r\n * known real paths. If not supplied by the user, it'll be an empty object.\r\n * @param {FileSystem~pathCallback} cb\r\n */\r\n realpath(p: string, cache: {[path: string]: string}, cb: (err: ApiError, resolvedPath?: string) => any): void;\r\n /**\r\n * **Supplemental**: Synchronous `realpath`.\r\n *\r\n * Note that the Node API will resolve `path` to an absolute path.\r\n * @method FileSystem#realpathSync\r\n * @param {string} path\r\n * @param {Object} cache An object literal of mapped paths that can be used to\r\n * force a specific path resolution or avoid additional `fs.stat` calls for\r\n * known real paths. If not supplied by the user, it'll be an empty object.\r\n * @return {string}\r\n */\r\n realpathSync(p: string, cache: {[path: string]: string}): string;\r\n // File operations\r\n /**\r\n *\r\n * **Supplemental**: Asynchronous `truncate`.\r\n * @method FileSystem#truncate\r\n * @param {string} path\r\n * @param {number} len\r\n * @param {FileSystem~nodeCallback} cb\r\n */\r\n truncate(p: string, len: number, cb: Function): void;\r\n /**\r\n * **Supplemental**: Synchronous `truncate`.\r\n * @method FileSystem#truncateSync\r\n * @param {string} path\r\n * @param {number} len\r\n */\r\n truncateSync(p: string, len: number): void;\r\n /**\r\n * **Supplemental**: Asynchronously reads the entire contents of a file.\r\n * @method FileSystem#readFile\r\n * @param {string} filename\r\n * @param {string} encoding If non-null, the file's contents should be decoded\r\n * into a string using that encoding. Otherwise, if encoding is null, fetch\r\n * the file's contents as a Buffer.\r\n * @param {BrowserFS.FileMode} flag\r\n * @param {FileSystem~readCallback} cb If no encoding is specified, then the\r\n * raw buffer is returned.\r\n */\r\n readFile(fname: string, encoding: string, flag: FileFlag, cb: (err: ApiError, data?: any) => void): void;\r\n /**\r\n * **Supplemental**: Synchronously reads the entire contents of a file.\r\n * @method FileSystem#readFileSync\r\n * @param {string} filename\r\n * @param {string} encoding If non-null, the file's contents should be decoded\r\n * into a string using that encoding. Otherwise, if encoding is null, fetch\r\n * the file's contents as a Buffer.\r\n * @param {BrowserFS.FileMode} flag\r\n * @return {(string|BrowserFS.Buffer)}\r\n */\r\n readFileSync(fname: string, encoding: string, flag: FileFlag): any;\r\n /**\r\n * **Supplemental**: Asynchronously writes data to a file, replacing the file\r\n * if it already exists.\r\n *\r\n * The encoding option is ignored if data is a buffer.\r\n * @method FileSystem#writeFile\r\n * @param {string} filename\r\n * @param {(string | BrowserFS.node.Buffer)} data\r\n * @param {string} encoding\r\n * @param {BrowserFS.FileMode} flag\r\n * @param {number} mode\r\n * @param {FileSystem~nodeCallback} cb\r\n */\r\n writeFile(fname: string, data: any, encoding: string, flag: FileFlag, mode: number, cb: (err: ApiError) => void): void;\r\n /**\r\n * **Supplemental**: Synchronously writes data to a file, replacing the file\r\n * if it already exists.\r\n *\r\n * The encoding option is ignored if data is a buffer.\r\n * @method FileSystem#writeFileSync\r\n * @param {string} filename\r\n * @param {(string | BrowserFS.node.Buffer)} data\r\n * @param {string} encoding\r\n * @param {BrowserFS.FileMode} flag\r\n * @param {number} mode\r\n */\r\n writeFileSync(fname: string, data: any, encoding: string, flag: FileFlag, mode: number): void;\r\n /**\r\n * **Supplemental**: Asynchronously append data to a file, creating the file if\r\n * it not yet exists.\r\n * @method FileSystem#appendFile\r\n * @param {string} filename\r\n * @param {(string | BrowserFS.node.Buffer)} data\r\n * @param {string} encoding\r\n * @param {BrowserFS.FileMode} flag\r\n * @param {number} mode\r\n * @param {FileSystem~nodeCallback} cb\r\n */\r\n appendFile(fname: string, data: any, encoding: string, flag: FileFlag, mode: number, cb: (err: ApiError) => void): void;\r\n /**\r\n * **Supplemental**: Synchronously append data to a file, creating the file if\r\n * it not yet exists.\r\n * @method FileSystem#appendFileSync\r\n * @param {string} filename\r\n * @param {(string | BrowserFS.node.Buffer)} data\r\n * @param {string} encoding\r\n * @param {BrowserFS.FileMode} flag\r\n * @param {number} mode\r\n */\r\n appendFileSync(fname: string, data: any, encoding: string, flag: FileFlag, mode: number): void;\r\n // **OPTIONAL INTERFACE METHODS**\r\n // Property operations\r\n // This isn't always possible on some filesystem types (e.g. Dropbox).\r\n /**\r\n * **Optional**: Asynchronous `chmod` or `lchmod`.\r\n * @method FileSystem#chmod\r\n * @param {string} path\r\n * @param {boolean} isLchmod `True` if `lchmod`, false if `chmod`. Has no\r\n * bearing on result if links aren't supported.\r\n * @param {number} mode\r\n * @param {FileSystem~nodeCallback} cb\r\n */\r\n chmod(p: string, isLchmod: boolean, mode: number, cb: Function): void;\r\n /**\r\n * **Optional**: Synchronous `chmod` or `lchmod`.\r\n * @method FileSystem#chmodSync\r\n * @param {string} path\r\n * @param {boolean} isLchmod `True` if `lchmod`, false if `chmod`. Has no\r\n * bearing on result if links aren't supported.\r\n * @param {number} mode\r\n */\r\n chmodSync(p: string, isLchmod: boolean, mode: number): void;\r\n /**\r\n * **Optional**: Asynchronous `chown` or `lchown`.\r\n * @method FileSystem#chown\r\n * @param {string} path\r\n * @param {boolean} isLchown `True` if `lchown`, false if `chown`. Has no\r\n * bearing on result if links aren't supported.\r\n * @param {number} uid\r\n * @param {number} gid\r\n * @param {FileSystem~nodeCallback} cb\r\n */\r\n chown(p: string, isLchown: boolean, uid: number, gid: number, cb: Function): void;\r\n /**\r\n * **Optional**: Synchronous `chown` or `lchown`.\r\n * @method FileSystem#chownSync\r\n * @param {string} path\r\n * @param {boolean} isLchown `True` if `lchown`, false if `chown`. Has no\r\n * bearing on result if links aren't supported.\r\n * @param {number} uid\r\n * @param {number} gid\r\n */\r\n chownSync(p: string, isLchown: boolean, uid: number, gid: number): void;\r\n /**\r\n * **Optional**: Change file timestamps of the file referenced by the supplied\r\n * path.\r\n * @method FileSystem#utimes\r\n * @param {string} path\r\n * @param {Date} atime\r\n * @param {Date} mtime\r\n * @param {FileSystem~nodeCallback} cb\r\n */\r\n utimes(p: string, atime: Date, mtime: Date, cb: Function): void;\r\n /**\r\n * **Optional**: Change file timestamps of the file referenced by the supplied\r\n * path.\r\n * @method FileSystem#utimesSync\r\n * @param {string} path\r\n * @param {Date} atime\r\n * @param {Date} mtime\r\n */\r\n utimesSync(p: string, atime: Date, mtime: Date): void;\r\n // Symlink operations\r\n // Symlinks aren't always supported.\r\n /**\r\n * **Optional**: Asynchronous `link`.\r\n * @method FileSystem#link\r\n * @param {string} srcpath\r\n * @param {string} dstpath\r\n * @param {FileSystem~nodeCallback} cb\r\n */\r\n link(srcpath: string, dstpath: string, cb: Function): void;\r\n /**\r\n * **Optional**: Synchronous `link`.\r\n * @method FileSystem#linkSync\r\n * @param {string} srcpath\r\n * @param {string} dstpath\r\n */\r\n linkSync(srcpath: string, dstpath: string): void;\r\n /**\r\n * **Optional**: Asynchronous `symlink`.\r\n * @method FileSystem#symlink\r\n * @param {string} srcpath\r\n * @param {string} dstpath\r\n * @param {string} type can be either `'dir'` or `'file'`\r\n * @param {FileSystem~nodeCallback} cb\r\n */\r\n symlink(srcpath: string, dstpath: string, type: string, cb: Function): void;\r\n /**\r\n * **Optional**: Synchronous `symlink`.\r\n * @method FileSystem#symlinkSync\r\n * @param {string} srcpath\r\n * @param {string} dstpath\r\n * @param {string} type can be either `'dir'` or `'file'`\r\n */\r\n symlinkSync(srcpath: string, dstpath: string, type: string): void;\r\n /**\r\n * **Optional**: Asynchronous readlink.\r\n * @method FileSystem#readlink\r\n * @param {string} path\r\n * @param {FileSystem~pathCallback} callback\r\n */\r\n readlink(p: string, cb: Function): void;\r\n /**\r\n * **Optional**: Synchronous readlink.\r\n * @method FileSystem#readlinkSync\r\n * @param {string} path\r\n */\r\n readlinkSync(p: string): string;\r\n}\r\n\r\n/**\r\n * Contains typings for static functions on the file system constructor.\r\n */\r\nexport interface FileSystemConstructor {\r\n /**\r\n * **Core**: Returns 'true' if this filesystem is available in the current\r\n * environment. For example, a `localStorage`-backed filesystem will return\r\n * 'false' if the browser does not support that API.\r\n *\r\n * Defaults to 'false', as the FileSystem base class isn't usable alone.\r\n * @method FileSystem.isAvailable\r\n * @return {boolean}\r\n */\r\n isAvailable(): boolean;\r\n}\r\n\r\n/**\r\n * Basic filesystem class. Most filesystems should extend this class, as it\r\n * provides default implementations for a handful of methods.\r\n */\r\nexport class BaseFileSystem {\r\n public supportsLinks(): boolean {\r\n return false;\r\n }\r\n public diskSpace(p: string, cb: (total: number, free: number) => any): void {\r\n cb(0, 0);\r\n }\r\n /**\r\n * Opens the file at path p with the given flag. The file must exist.\r\n * @param p The path to open.\r\n * @param flag The flag to use when opening the file.\r\n */\r\n public openFile(p: string, flag: FileFlag, cb: (e: ApiError, file?: file.File) => void): void {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n /**\r\n * Create the file at path p with the given mode. Then, open it with the given\r\n * flag.\r\n */\r\n public createFile(p: string, flag: FileFlag, mode: number, cb: (e: ApiError, file?: file.File) => void): void {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n public open(p: string, flag:FileFlag, mode: number, cb: (err: ApiError, fd?: file.BaseFile) => any): void {\r\n var must_be_file = (e: ApiError, stats?: Stats): void => {\r\n if (e) {\r\n // File does not exist.\r\n switch (flag.pathNotExistsAction()) {\r\n case ActionType.CREATE_FILE:\r\n // Ensure parent exists.\r\n return this.stat(path.dirname(p), false, (e: ApiError, parentStats?: Stats) => {\r\n if (e) {\r\n cb(e);\r\n } else if (!parentStats.isDirectory()) {\r\n cb(ApiError.ENOTDIR(path.dirname(p)));\r\n } else {\r\n this.createFile(p, flag, mode, cb);\r\n }\r\n });\r\n case ActionType.THROW_EXCEPTION:\r\n return cb(ApiError.ENOENT(p));\r\n default:\r\n return cb(new ApiError(ErrorCode.EINVAL, 'Invalid FileFlag object.'));\r\n }\r\n } else {\r\n // File exists.\r\n if (stats.isDirectory()) {\r\n return cb(ApiError.EISDIR(p));\r\n }\r\n switch (flag.pathExistsAction()) {\r\n case ActionType.THROW_EXCEPTION:\r\n return cb(ApiError.EEXIST(p));\r\n case ActionType.TRUNCATE_FILE:\r\n // NOTE: In a previous implementation, we deleted the file and\r\n // re-created it. However, this created a race condition if another\r\n // asynchronous request was trying to read the file, as the file\r\n // would not exist for a small period of time.\r\n return this.openFile(p, flag, (e: ApiError, fd?: file.File): void => {\r\n if (e) {\r\n cb(e);\r\n } else {\r\n fd.truncate(0, () => {\r\n fd.sync(() => {\r\n cb(null, fd);\r\n });\r\n });\r\n }\r\n });\r\n case ActionType.NOP:\r\n return this.openFile(p, flag, cb);\r\n default:\r\n return cb(new ApiError(ErrorCode.EINVAL, 'Invalid FileFlag object.'));\r\n }\r\n }\r\n };\r\n this.stat(p, false, must_be_file);\r\n }\r\n public rename(oldPath: string, newPath: string, cb: (err?: ApiError) => void): void {\r\n cb(new ApiError(ErrorCode.ENOTSUP));\r\n }\r\n public renameSync(oldPath: string, newPath: string): void {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n public stat(p: string, isLstat: boolean, cb: (err: ApiError, stat?: Stats) => void): void {\r\n cb(new ApiError(ErrorCode.ENOTSUP));\r\n }\r\n public statSync(p: string, isLstat: boolean): Stats {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n /**\r\n * Opens the file at path p with the given flag. The file must exist.\r\n * @param p The path to open.\r\n * @param flag The flag to use when opening the file.\r\n * @return A File object corresponding to the opened file.\r\n */\r\n public openFileSync(p: string, flag: FileFlag): file.File {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n /**\r\n * Create the file at path p with the given mode. Then, open it with the given\r\n * flag.\r\n */\r\n public createFileSync(p: string, flag: FileFlag, mode: number): file.File {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n public openSync(p: string, flag: FileFlag, mode: number): file.File {\r\n // Check if the path exists, and is a file.\r\n var stats: Stats;\r\n try {\r\n stats = this.statSync(p, false);\r\n } catch (e) {\r\n // File does not exist.\r\n switch (flag.pathNotExistsAction()) {\r\n case ActionType.CREATE_FILE:\r\n // Ensure parent exists.\r\n var parentStats = this.statSync(path.dirname(p), false);\r\n if (!parentStats.isDirectory()) {\r\n throw ApiError.ENOTDIR(path.dirname(p));\r\n }\r\n return this.createFileSync(p, flag, mode);\r\n case ActionType.THROW_EXCEPTION:\r\n throw ApiError.ENOENT(p);\r\n default:\r\n throw new ApiError(ErrorCode.EINVAL, 'Invalid FileFlag object.');\r\n }\r\n }\r\n\r\n // File exists.\r\n if (stats.isDirectory()) {\r\n throw ApiError.EISDIR(p);\r\n }\r\n switch (flag.pathExistsAction()) {\r\n case ActionType.THROW_EXCEPTION:\r\n throw ApiError.EEXIST(p);\r\n case ActionType.TRUNCATE_FILE:\r\n // Delete file.\r\n this.unlinkSync(p);\r\n // Create file. Use the same mode as the old file.\r\n // Node itself modifies the ctime when this occurs, so this action\r\n // will preserve that behavior if the underlying file system\r\n // supports those properties.\r\n return this.createFileSync(p, flag, stats.mode);\r\n case ActionType.NOP:\r\n return this.openFileSync(p, flag);\r\n default:\r\n throw new ApiError(ErrorCode.EINVAL, 'Invalid FileFlag object.');\r\n }\r\n }\r\n public unlink(p: string, cb: Function): void {\r\n cb(new ApiError(ErrorCode.ENOTSUP));\r\n }\r\n public unlinkSync(p: string): void {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n public rmdir(p: string, cb: Function): void {\r\n cb(new ApiError(ErrorCode.ENOTSUP));\r\n }\r\n public rmdirSync(p: string): void {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n public mkdir(p: string, mode: number, cb: Function): void {\r\n cb(new ApiError(ErrorCode.ENOTSUP));\r\n }\r\n public mkdirSync(p: string, mode: number): void {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n public readdir(p: string, cb: (err: ApiError, files?: string[]) => void): void {\r\n cb(new ApiError(ErrorCode.ENOTSUP));\r\n }\r\n public readdirSync(p: string): string[] {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n public exists(p: string, cb: (exists: boolean) => void): void {\r\n this.stat(p, null, function(err) {\r\n cb(err == null);\r\n });\r\n }\r\n public existsSync(p: string): boolean {\r\n try {\r\n this.statSync(p, true);\r\n return true;\r\n } catch (e) {\r\n return false;\r\n }\r\n }\r\n public realpath(p: string, cache: {[path: string]: string}, cb: (err: ApiError, resolvedPath?: string) => any): void {\r\n if (this.supportsLinks()) {\r\n // The path could contain symlinks. Split up the path,\r\n // resolve any symlinks, return the resolved string.\r\n var splitPath = p.split(path.sep);\r\n // TODO: Simpler to just pass through file, find sep and such.\r\n for (var i = 0; i < splitPath.length; i++) {\r\n var addPaths = splitPath.slice(0, i + 1);\r\n splitPath[i] = path.join.apply(null, addPaths);\r\n }\r\n } else {\r\n // No symlinks. We just need to verify that it exists.\r\n this.exists(p, function(doesExist) {\r\n if (doesExist) {\r\n cb(null, p);\r\n } else {\r\n cb(ApiError.ENOENT(p));\r\n }\r\n });\r\n }\r\n }\r\n public realpathSync(p: string, cache: {[path: string]: string}): string {\r\n if (this.supportsLinks()) {\r\n // The path could contain symlinks. Split up the path,\r\n // resolve any symlinks, return the resolved string.\r\n var splitPath = p.split(path.sep);\r\n // TODO: Simpler to just pass through file, find sep and such.\r\n for (var i = 0; i < splitPath.length; i++) {\r\n var addPaths = splitPath.slice(0, i + 1);\r\n splitPath[i] = path.join.apply(null, addPaths);\r\n }\r\n } else {\r\n // No symlinks. We just need to verify that it exists.\r\n if (this.existsSync(p)) {\r\n return p;\r\n } else {\r\n throw ApiError.ENOENT(p);\r\n }\r\n }\r\n }\r\n public truncate(p: string, len: number, cb: Function): void {\r\n this.open(p, FileFlag.getFileFlag('r+'), 0x1a4, (function(er: ApiError, fd?: file.File) {\r\n if (er) {\r\n return cb(er);\r\n }\r\n fd.truncate(len, (function(er: any) {\r\n fd.close((function(er2: any) {\r\n cb(er || er2);\r\n }));\r\n }));\r\n }));\r\n }\r\n public truncateSync(p: string, len: number): void {\r\n var fd = this.openSync(p, FileFlag.getFileFlag('r+'), 0x1a4);\r\n // Need to safely close FD, regardless of whether or not truncate succeeds.\r\n try {\r\n fd.truncateSync(len);\r\n } catch (e) {\r\n throw e;\r\n } finally {\r\n fd.closeSync();\r\n }\r\n }\r\n public readFile(fname: string, encoding: string, flag: FileFlag, cb: (err: ApiError, data?: any) => void): void {\r\n // Wrap cb in file closing code.\r\n var oldCb = cb;\r\n // Get file.\r\n this.open(fname, flag, 0x1a4, function(err: ApiError, fd?: file.File) {\r\n if (err) {\r\n return cb(err);\r\n }\r\n cb = function(err: ApiError, arg?: file.File) {\r\n fd.close(function(err2: any) {\r\n if (err == null) {\r\n err = err2;\r\n }\r\n return oldCb(err, arg);\r\n });\r\n };\r\n fd.stat(function(err: ApiError, stat?: Stats) {\r\n if (err != null) {\r\n return cb(err);\r\n }\r\n // Allocate buffer.\r\n var buf = new Buffer(stat.size);\r\n fd.read(buf, 0, stat.size, 0, function(err) {\r\n if (err != null) {\r\n return cb(err);\r\n } else if (encoding === null) {\r\n return cb(err, buf);\r\n }\r\n try {\r\n cb(null, buf.toString(encoding));\r\n } catch (e) {\r\n cb(e);\r\n }\r\n });\r\n });\r\n });\r\n }\r\n public readFileSync(fname: string, encoding: string, flag: FileFlag): any {\r\n // Get file.\r\n var fd = this.openSync(fname, flag, 0x1a4);\r\n try {\r\n var stat = fd.statSync();\r\n // Allocate buffer.\r\n var buf = new Buffer(stat.size);\r\n fd.readSync(buf, 0, stat.size, 0);\r\n fd.closeSync();\r\n if (encoding === null) {\r\n return buf;\r\n }\r\n return buf.toString(encoding);\r\n } finally {\r\n fd.closeSync();\r\n }\r\n }\r\n public writeFile(fname: string, data: any, encoding: string, flag: FileFlag, mode: number, cb: (err: ApiError) => void): void {\r\n // Wrap cb in file closing code.\r\n var oldCb = cb;\r\n // Get file.\r\n this.open(fname, flag, 0x1a4, function(err: ApiError, fd?:file.File) {\r\n if (err != null) {\r\n return cb(err);\r\n }\r\n cb = function(err: ApiError) {\r\n fd.close(function(err2: any) {\r\n oldCb(err != null ? err : err2);\r\n });\r\n };\r\n\r\n try {\r\n if (typeof data === 'string') {\r\n data = new Buffer(data, encoding);\r\n }\r\n } catch (e) {\r\n return cb(e);\r\n }\r\n // Write into file.\r\n fd.write(data, 0, data.length, 0, cb);\r\n });\r\n }\r\n public writeFileSync(fname: string, data: any, encoding: string, flag: FileFlag, mode: number): void {\r\n // Get file.\r\n var fd = this.openSync(fname, flag, mode);\r\n try {\r\n if (typeof data === 'string') {\r\n data = new Buffer(data, encoding);\r\n }\r\n // Write into file.\r\n fd.writeSync(data, 0, data.length, 0);\r\n } finally {\r\n fd.closeSync();\r\n }\r\n }\r\n public appendFile(fname: string, data: any, encoding: string, flag: FileFlag, mode: number, cb: (err: ApiError) => void): void {\r\n // Wrap cb in file closing code.\r\n var oldCb = cb;\r\n this.open(fname, flag, mode, function(err: ApiError, fd?: file.File) {\r\n if (err != null) {\r\n return cb(err);\r\n }\r\n cb = function(err: ApiError) {\r\n fd.close(function(err2: any) {\r\n oldCb(err != null ? err : err2);\r\n });\r\n };\r\n if (typeof data === 'string') {\r\n data = new Buffer(data, encoding);\r\n }\r\n fd.write(data, 0, data.length, null, cb);\r\n });\r\n }\r\n public appendFileSync(fname: string, data: any, encoding: string, flag: FileFlag, mode: number): void {\r\n var fd = this.openSync(fname, flag, mode);\r\n try {\r\n if (typeof data === 'string') {\r\n data = new Buffer(data, encoding);\r\n }\r\n fd.writeSync(data, 0, data.length, null);\r\n } finally {\r\n fd.closeSync();\r\n }\r\n }\r\n public chmod(p: string, isLchmod: boolean, mode: number, cb: Function): void {\r\n cb(new ApiError(ErrorCode.ENOTSUP));\r\n }\r\n public chmodSync(p: string, isLchmod: boolean, mode: number) {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n public chown(p: string, isLchown: boolean, uid: number, gid: number, cb: Function): void {\r\n cb(new ApiError(ErrorCode.ENOTSUP));\r\n }\r\n public chownSync(p: string, isLchown: boolean, uid: number, gid: number): void {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n public utimes(p: string, atime: Date, mtime: Date, cb: Function): void {\r\n cb(new ApiError(ErrorCode.ENOTSUP));\r\n }\r\n public utimesSync(p: string, atime: Date, mtime: Date): void {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n public link(srcpath: string, dstpath: string, cb: Function): void {\r\n cb(new ApiError(ErrorCode.ENOTSUP));\r\n }\r\n public linkSync(srcpath: string, dstpath: string): void {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n public symlink(srcpath: string, dstpath: string, type: string, cb: Function): void {\r\n cb(new ApiError(ErrorCode.ENOTSUP));\r\n }\r\n public symlinkSync(srcpath: string, dstpath: string, type: string): void {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n public readlink(p: string, cb: Function): void {\r\n cb(new ApiError(ErrorCode.ENOTSUP));\r\n }\r\n public readlinkSync(p: string): string {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n}\r\n\r\n/**\r\n * Implements the asynchronous API in terms of the synchronous API.\r\n * @class SynchronousFileSystem\r\n */\r\nexport class SynchronousFileSystem extends BaseFileSystem {\r\n public supportsSynch(): boolean {\r\n return true;\r\n }\r\n\r\n public rename(oldPath: string, newPath: string, cb: Function): void {\r\n try {\r\n this.renameSync(oldPath, newPath);\r\n cb();\r\n } catch (e) {\r\n cb(e);\r\n }\r\n }\r\n\r\n public stat(p: string, isLstat: boolean, cb: Function): void {\r\n try {\r\n cb(null, this.statSync(p, isLstat));\r\n } catch (e) {\r\n cb(e);\r\n }\r\n }\r\n\r\n public open(p: string, flags: FileFlag, mode: number, cb: Function): void {\r\n try {\r\n cb(null, this.openSync(p, flags, mode));\r\n } catch (e) {\r\n cb(e);\r\n }\r\n }\r\n\r\n public unlink(p: string, cb: Function): void {\r\n try {\r\n this.unlinkSync(p);\r\n cb();\r\n } catch (e) {\r\n cb(e);\r\n }\r\n }\r\n\r\n public rmdir(p: string, cb: Function): void {\r\n try {\r\n this.rmdirSync(p);\r\n cb();\r\n } catch (e) {\r\n cb(e);\r\n }\r\n }\r\n\r\n public mkdir(p: string, mode: number, cb: Function): void {\r\n try {\r\n this.mkdirSync(p, mode);\r\n cb();\r\n } catch (e) {\r\n cb(e);\r\n }\r\n }\r\n\r\n public readdir(p: string, cb: Function): void {\r\n try {\r\n cb(null, this.readdirSync(p));\r\n } catch (e) {\r\n cb(e);\r\n }\r\n }\r\n\r\n public chmod(p: string, isLchmod: boolean, mode: number, cb: Function): void {\r\n try {\r\n this.chmodSync(p, isLchmod, mode);\r\n cb();\r\n } catch (e) {\r\n cb(e);\r\n }\r\n }\r\n\r\n public chown(p: string, isLchown: boolean, uid: number, gid: number, cb: Function): void {\r\n try {\r\n this.chownSync(p, isLchown, uid, gid);\r\n cb();\r\n } catch (e) {\r\n cb(e);\r\n }\r\n }\r\n\r\n public utimes(p: string, atime: Date, mtime: Date, cb: Function): void {\r\n try {\r\n this.utimesSync(p, atime, mtime);\r\n cb();\r\n } catch (e) {\r\n cb(e);\r\n }\r\n }\r\n\r\n public link(srcpath: string, dstpath: string, cb: Function): void {\r\n try {\r\n this.linkSync(srcpath, dstpath);\r\n cb();\r\n } catch (e) {\r\n cb(e);\r\n }\r\n }\r\n\r\n public symlink(srcpath: string, dstpath: string, type: string, cb: Function): void {\r\n try {\r\n this.symlinkSync(srcpath, dstpath, type);\r\n cb();\r\n } catch (e) {\r\n cb(e);\r\n }\r\n }\r\n\r\n public readlink(p: string, cb: Function): void {\r\n try {\r\n cb(null, this.readlinkSync(p));\r\n } catch (e) {\r\n cb(e);\r\n }\r\n }\r\n}\r\n",
|
||
"/**\r\n * Exports the global scope variable.\r\n * In the main browser thread, this is \"window\".\r\n * In a WebWorker, this is \"self\".\r\n * In Node, this is \"global\".\r\n */\r\ndeclare var global: any;\r\nvar toExport: any;\r\nif (typeof(window) !== 'undefined') {\r\n toExport = window;\r\n} else if (typeof(self) !== 'undefined') {\r\n toExport = self;\r\n} else {\r\n toExport = global;\r\n}\r\nexport = toExport;",
|
||
"import {default as FS, FSModule} from './FS';\r\nimport {FileSystem} from './file_system';\r\nimport {ApiError} from './api_error';\r\nimport Stats from './node_fs_stats';\r\n\r\n// Manually export the individual public functions of fs.\r\n// Required because some code will invoke functions off of the module.\r\n// e.g.:\r\n// let writeFile = fs.writeFile;\r\n// writeFile(...)\r\n\r\nlet fs = new FS();\r\nlet _fsMock: FSModule = <any> {};\r\n\r\nlet FSProto = FS.prototype;\r\nObject.keys(FSProto).forEach((key) => {\r\n if (typeof fs[key] === 'function') {\r\n _fsMock[key] = function() {\r\n return (<Function> fs[key]).apply(fs, arguments);\r\n };\r\n } else {\r\n _fsMock[key] = fs[key];\r\n }\r\n});\r\n\r\n_fsMock['changeFSModule'] = function(newFs: FS): void {\r\n fs = newFs;\r\n}\r\n_fsMock['getFSModule'] = function(): FS {\r\n return fs;\r\n}\r\n_fsMock['_wrapCb'] = function(cb: Function, numArgs: number): Function {\r\n return fs._wrapCb(cb, numArgs);\r\n};\r\n_fsMock['FS'] = FS;\r\n\r\nexport = _fsMock;\r\n",
|
||
"import fs = require('fs');\r\nimport file = require('./file');\r\n\r\n/**\r\n * Indicates the type of the given file. Applied to 'mode'.\r\n */\r\nexport enum FileType {\r\n FILE = 0x8000,\r\n DIRECTORY = 0x4000,\r\n SYMLINK = 0xA000\r\n}\r\n\r\n/**\r\n * Emulation of Node's `fs.Stats` object.\r\n *\r\n * Attribute descriptions are from `man 2 stat'\r\n * @see http://nodejs.org/api/fs.html#fs_class_fs_stats\r\n * @see http://man7.org/linux/man-pages/man2/stat.2.html\r\n * @class\r\n */\r\nexport default class Stats implements fs.Stats {\r\n public blocks: number;\r\n /**\r\n * UNSUPPORTED ATTRIBUTES\r\n * I assume no one is going to need these details, although we could fake\r\n * appropriate values if need be.\r\n */\r\n // ID of device containing file\r\n public dev: number = 0;\r\n // inode number\r\n public ino: number = 0;\r\n // device ID (if special file)\r\n public rdev: number = 0;\r\n // number of hard links\r\n public nlink: number = 1;\r\n // blocksize for file system I/O\r\n public blksize: number = 4096;\r\n // @todo Maybe support these? atm, it's a one-user filesystem.\r\n // user ID of owner\r\n public uid: number = 0;\r\n // group ID of owner\r\n public gid: number = 0;\r\n // time file was created (currently unsupported)\r\n public birthtime: Date = new Date(0);\r\n // XXX: Some file systems stash data on stats objects.\r\n public file_data: NodeBuffer = null;\r\n\r\n /**\r\n * Provides information about a particular entry in the file system.\r\n * @param [Number] item_type type of the item (FILE, DIRECTORY, SYMLINK, or SOCKET)\r\n * @param [Number] size Size of the item in bytes. For directories/symlinks,\r\n * this is normally the size of the struct that represents the item.\r\n * @param [Number] mode Unix-style file mode (e.g. 0o644)\r\n * @param [Date?] atime time of last access\r\n * @param [Date?] mtime time of last modification\r\n * @param [Date?] ctime time of creation\r\n */\r\n constructor(\r\n item_type: FileType,\r\n public size: number,\r\n public mode?: number,\r\n public atime: Date = new Date(),\r\n public mtime: Date = new Date(),\r\n public ctime: Date = new Date()) {\r\n if (this.mode == null) {\r\n switch(item_type) {\r\n case FileType.FILE:\r\n this.mode = 0x1a4;\r\n break;\r\n case FileType.DIRECTORY:\r\n default:\r\n this.mode = 0x1ff;\r\n }\r\n }\r\n // number of 512B blocks allocated\r\n this.blocks = Math.ceil(size / 512);\r\n // Check if mode also includes top-most bits, which indicate the file's\r\n // type.\r\n if (this.mode < 0x1000) {\r\n this.mode |= item_type;\r\n }\r\n }\r\n\r\n public toBuffer(): Buffer {\r\n var buffer = new Buffer(32);\r\n buffer.writeUInt32LE(this.size, 0);\r\n buffer.writeUInt32LE(this.mode, 4);\r\n buffer.writeDoubleLE(this.atime.getTime(), 8);\r\n buffer.writeDoubleLE(this.mtime.getTime(), 16);\r\n buffer.writeDoubleLE(this.ctime.getTime(), 24);\r\n return buffer;\r\n }\r\n\r\n public static fromBuffer(buffer: Buffer): Stats {\r\n var size = buffer.readUInt32LE(0),\r\n mode = buffer.readUInt32LE(4),\r\n atime = buffer.readDoubleLE(8),\r\n mtime = buffer.readDoubleLE(16),\r\n ctime = buffer.readDoubleLE(24);\r\n\r\n return new Stats(mode & 0xF000, size, mode & 0xFFF, new Date(atime), new Date(mtime), new Date(ctime));\r\n }\r\n\r\n /**\r\n * **Nonstandard**: Clone the stats object.\r\n * @return [BrowserFS.node.fs.Stats]\r\n */\r\n public clone(): Stats {\r\n return new Stats(this.mode & 0xF000, this.size, this.mode & 0xFFF, this.atime, this.mtime, this.ctime);\r\n }\r\n\r\n /**\r\n * @return [Boolean] True if this item is a file.\r\n */\r\n public isFile(): boolean {\r\n return (this.mode & 0xF000) === FileType.FILE;\r\n }\r\n\r\n /**\r\n * @return [Boolean] True if this item is a directory.\r\n */\r\n public isDirectory(): boolean {\r\n return (this.mode & 0xF000) === FileType.DIRECTORY;\r\n }\r\n\r\n /**\r\n * @return [Boolean] True if this item is a symbolic link (only valid through lstat)\r\n */\r\n public isSymbolicLink(): boolean {\r\n return (this.mode & 0xF000) === FileType.SYMLINK;\r\n }\r\n\r\n /**\r\n * Change the mode of the file. We use this helper function to prevent messing\r\n * up the type of the file, which is encoded in mode.\r\n */\r\n public chmod(mode: number): void {\r\n this.mode = (this.mode & 0xF000) | mode;\r\n }\r\n\r\n // We don't support the following types of files.\r\n\r\n public isSocket(): boolean {\r\n return false;\r\n }\r\n\r\n public isBlockDevice(): boolean {\r\n return false;\r\n }\r\n\r\n public isCharacterDevice(): boolean {\r\n return false;\r\n }\r\n\r\n public isFIFO(): boolean {\r\n return false;\r\n }\r\n}\r\n",
|
||
"/**\r\n * Grab bag of utility functions used across the code.\r\n */\r\nimport {FileSystem} from './file_system';\r\nimport path = require('path');\r\n\r\nconst SUPPORTS_TYPED_ARRAYS = typeof(ArrayBuffer) !== 'undefined';\r\n\r\n/**\r\n * Checks for any IE version, including IE11 which removed MSIE from the\r\n * userAgent string.\r\n */\r\nexport var isIE: boolean = typeof navigator !== \"undefined\" && (/(msie) ([\\w.]+)/.exec(navigator.userAgent.toLowerCase()) != null || navigator.userAgent.indexOf('Trident') !== -1);\r\n\r\n/**\r\n * Check if we're in a web worker.\r\n */\r\nexport var isWebWorker: boolean = typeof window === \"undefined\";\r\n\r\nexport interface Arrayish<T> {\r\n [idx: number]: T;\r\n length: number;\r\n}\r\n\r\n/**\r\n * Synchronous recursive makedir.\r\n */\r\nexport function mkdirpSync(p: string, mode: number, fs: FileSystem): void {\r\n if (!fs.existsSync(p)) {\r\n mkdirpSync(path.dirname(p), mode, fs);\r\n fs.mkdirSync(p, mode);\r\n }\r\n}\r\n\r\n/**\r\n * Converts a buffer into an array buffer. Attempts to do so in a\r\n * zero-copy manner, e.g. the array references the same memory.\r\n */\r\nexport function buffer2ArrayBuffer(buff: Buffer): ArrayBuffer {\r\n var u8 = buffer2Uint8array(buff),\r\n u8offset = u8.byteOffset,\r\n u8Len = u8.byteLength;\r\n if (u8offset === 0 && u8Len === u8.buffer.byteLength) {\r\n return u8.buffer;\r\n } else {\r\n return u8.buffer.slice(u8offset, u8offset + u8Len)\r\n }\r\n}\r\n\r\n/**\r\n * Converts a buffer into a Uint8Array. Attempts to do so in a\r\n * zero-copy manner, e.g. the array references the same memory.\r\n */\r\nexport function buffer2Uint8array(buff: Buffer): Uint8Array {\r\n if (buff['toUint8Array']) {\r\n return (<any> buff).toUint8Array();\r\n } else if (buff instanceof Uint8Array) {\r\n // Node v4.0 buffers *are* Uint8Arrays.\r\n return <any> buff;\r\n } else {\r\n // Uint8Arrays can be constructed from arrayish numbers.\r\n // At this point, we assume this isn't a BFS array.\r\n return new Uint8Array(buff);\r\n }\r\n}\r\n\r\n/**\r\n * Converts the given buffer into a Uint8 arrayish form. Attempts\r\n * to be zero-copy.\r\n *\r\n * Required for BrowserFS buffers, which do not support indexing.\r\n */\r\nexport function buffer2Arrayish(buff: Buffer): Arrayish<number> {\r\n if (typeof(buff[0]) === 'number') {\r\n return buff;\r\n } else if (SUPPORTS_TYPED_ARRAYS) {\r\n return buffer2Uint8array(buff);\r\n } else {\r\n return buff.toJSON().data;\r\n }\r\n}\r\n\r\n/**\r\n * Converts the given arrayish object into a Buffer. Attempts to\r\n * be zero-copy.\r\n */\r\nexport function arrayish2Buffer(arr: Arrayish<number>): Buffer {\r\n if (SUPPORTS_TYPED_ARRAYS && arr instanceof Uint8Array) {\r\n return uint8Array2Buffer(arr);\r\n } else if (arr instanceof Buffer) {\r\n return arr;\r\n } else {\r\n return new Buffer(<number[]> arr);\r\n }\r\n}\r\n\r\n/**\r\n * Converts the given Uint8Array into a Buffer. Attempts to be zero-copy.\r\n */\r\nexport function uint8Array2Buffer(u8: Uint8Array): Buffer {\r\n if (u8.byteOffset === 0 && u8.byteLength === u8.buffer.byteLength) {\r\n return arrayBuffer2Buffer(u8);\r\n } else {\r\n return new Buffer(u8);\r\n }\r\n}\r\n\r\n/**\r\n * Converts the given array buffer into a Buffer. Attempts to be\r\n * zero-copy.\r\n */\r\nexport function arrayBuffer2Buffer(ab: ArrayBuffer): Buffer {\r\n try {\r\n // Works in BFS and Node v4.2.\r\n return new Buffer(<any> ab);\r\n } catch (e) {\r\n // I believe this copies, but there's no avoiding it in Node < v4.2\r\n return new Buffer(new Uint8Array(ab));\r\n }\r\n}\r\n\r\n// Polyfill for Uint8Array.prototype.slice.\r\n// Safari and some other browsers do not define it.\r\nif (typeof(ArrayBuffer) !== 'undefined' && typeof(Uint8Array) !== 'undefined') {\r\n if (!Uint8Array.prototype['slice']) {\r\n Uint8Array.prototype.slice = function(start: number = 0, end: number = this.length): Uint8Array {\r\n let self: Uint8Array = this;\r\n if (start < 0) {\r\n start = this.length + start;\r\n if (start < 0) {\r\n start = 0;\r\n }\r\n }\r\n if (end < 0) {\r\n end = this.length + end;\r\n if (end < 0) {\r\n end = 0;\r\n }\r\n }\r\n if (end < start) {\r\n end = start;\r\n }\r\n return new Uint8Array(self.buffer, self.byteOffset + start, end - start);\r\n };\r\n }\r\n}\r\n\r\n/**\r\n * Copies a slice of the given buffer\r\n */\r\nexport function copyingSlice(buff: Buffer, start: number = 0, end = buff.length): Buffer {\r\n if (start < 0 || end < 0 || end > buff.length || start > end) {\r\n throw new TypeError(`Invalid slice bounds on buffer of length ${buff.length}: [${start}, ${end}]`);\r\n }\r\n if (buff.length === 0) {\r\n // Avoid s0 corner case in ArrayBuffer case.\r\n return new Buffer(0);\r\n } else if (SUPPORTS_TYPED_ARRAYS) {\r\n var u8 = buffer2Uint8array(buff),\r\n s0 = buff.readUInt8(0),\r\n newS0 = (s0 + 1) % 0xFF;\r\n\r\n buff.writeUInt8(newS0, 0);\r\n if (u8[0] === newS0) {\r\n // Same memory. Revert & copy.\r\n u8[0] = s0;\r\n return uint8Array2Buffer(u8.slice(start, end));\r\n } else {\r\n // Revert.\r\n buff.writeUInt8(s0, 0);\r\n return uint8Array2Buffer(u8.subarray(start, end));\r\n }\r\n } else {\r\n var buffSlice = new Buffer(end - start);\r\n buff.copy(buffSlice, 0, start, end);\r\n return buffSlice;\r\n }\r\n}\r\n",
|
||
"/**\r\n * Defines an Emscripten file system object for use in the Emscripten virtual\r\n * filesystem. Allows you to use synchronous BrowserFS file systems from within\r\n * Emscripten.\r\n *\r\n * You can construct a BFSEmscriptenFS, mount it using its mount command,\r\n * and then mount it into Emscripten.\r\n *\r\n * Adapted from Emscripten's NodeFS:\r\n * https://raw.github.com/kripken/emscripten/master/src/library_nodefs.js\r\n */\r\nimport BrowserFS = require('../core/browserfs');\r\nimport FS from '../core/FS';\r\nimport fs = require('../core/node_fs');\r\nimport NodeStats from '../core/node_fs_stats';\r\nimport {uint8Array2Buffer} from '../core/util';\r\n\r\nexport interface Stats {\r\n dev: number;\r\n ino: number;\r\n mode: number;\r\n nlink: number;\r\n uid: number;\r\n gid: number;\r\n rdev: number;\r\n size: number;\r\n blksize: number;\r\n blocks: number;\r\n atime: Date;\r\n mtime: Date;\r\n ctime: Date;\r\n timestamp?: number;\r\n}\r\n\r\nexport interface EmscriptenFSNode {\r\n name: string;\r\n mode: number;\r\n parent: EmscriptenFSNode;\r\n mount: {opts: {root: string}};\r\n stream_ops: EmscriptenStreamOps;\r\n node_ops: EmscriptenNodeOps;\r\n}\r\n\r\nexport interface EmscriptenStream {\r\n node: EmscriptenFSNode;\r\n nfd: any;\r\n flags: string;\r\n position: number;\r\n}\r\n\r\nexport interface EmscriptenNodeOps {\r\n getattr(node: EmscriptenFSNode): Stats;\r\n setattr(node: EmscriptenFSNode, attr: Stats): void;\r\n lookup(parent: EmscriptenFSNode, name: string): EmscriptenFSNode;\r\n mknod(parent: EmscriptenFSNode, name: string, mode: number, dev: any): EmscriptenFSNode;\r\n rename(oldNode: EmscriptenFSNode, newDir: EmscriptenFSNode, newName: string): void;\r\n unlink(parent: EmscriptenFSNode, name: string): void;\r\n rmdir(parent: EmscriptenFSNode, name: string): void;\r\n readdir(node: EmscriptenFSNode): string[];\r\n symlink(parent: EmscriptenFSNode, newName: string, oldPath: string): void;\r\n readlink(node: EmscriptenFSNode): string;\r\n}\r\n\r\nexport interface EmscriptenStreamOps {\r\n open(stream: EmscriptenStream): void;\r\n close(stream: EmscriptenStream): void;\r\n read(stream: EmscriptenStream, buffer: Uint8Array, offset: number, length: number, position: number): number;\r\n write(stream: EmscriptenStream, buffer: Uint8Array, offset: number, length: number, position: number): number;\r\n llseek(stream: EmscriptenStream, offset: number, whence: number): number;\r\n}\r\n\r\nexport interface EmscriptenFS {\r\n mount(mount: {opts: {root: string}}): EmscriptenFSNode;\r\n createNode(parent: EmscriptenFSNode, name: string, mode: number, dev?: any): EmscriptenFSNode;\r\n getMode(path: string): number;\r\n realPath(node: EmscriptenFSNode): string;\r\n node_ops: EmscriptenNodeOps;\r\n stream_ops: EmscriptenStreamOps;\r\n}\r\n\r\nclass BFSEmscriptenStreamOps implements EmscriptenStreamOps {\r\n private FS: any;\r\n private PATH: any;\r\n private ERRNO_CODES: any;\r\n private nodefs: FS;\r\n\r\n constructor(private fs: BFSEmscriptenFS) {\r\n this.nodefs = fs.getNodeFS();\r\n this.FS = fs.getFS();\r\n this.PATH = fs.getPATH();\r\n this.ERRNO_CODES = fs.getERRNO_CODES();\r\n }\r\n\r\n public open(stream: EmscriptenStream): void {\r\n var path = this.fs.realPath(stream.node),\r\n FS = this.FS;\r\n try {\r\n if (FS.isFile(stream.node.mode)) {\r\n stream.nfd = this.nodefs.openSync(path, this.fs.flagsToPermissionString(stream.flags));\r\n }\r\n } catch (e) {\r\n if (!e.code) throw e;\r\n throw new FS.ErrnoError(this.ERRNO_CODES[e.code]);\r\n }\r\n }\r\n\r\n public close(stream: EmscriptenStream): void {\r\n var FS = this.FS;\r\n try {\r\n if (FS.isFile(stream.node.mode) && stream.nfd) {\r\n this.nodefs.closeSync(stream.nfd);\r\n }\r\n } catch (e) {\r\n if (!e.code) throw e;\r\n throw new FS.ErrnoError(this.ERRNO_CODES[e.code]);\r\n }\r\n }\r\n\r\n public read(stream: EmscriptenStream, buffer: Uint8Array, offset: number, length: number, position: number): number {\r\n // Avoid copying overhead by reading directly into buffer.\r\n try {\r\n return this.nodefs.readSync(stream.nfd, uint8Array2Buffer(buffer), offset, length, position);\r\n } catch (e) {\r\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\r\n }\r\n }\r\n\r\n public write(stream: EmscriptenStream, buffer: Uint8Array, offset: number, length: number, position: number): number {\r\n // Avoid copying overhead.\r\n try {\r\n return this.nodefs.writeSync(stream.nfd, uint8Array2Buffer(buffer), offset, length, position);\r\n } catch (e) {\r\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\r\n }\r\n }\r\n\r\n public llseek(stream: EmscriptenStream, offset: number, whence: number): number {\r\n var position = offset;\r\n if (whence === 1) { // SEEK_CUR.\r\n position += stream.position;\r\n } else if (whence === 2) { // SEEK_END.\r\n if (this.FS.isFile(stream.node.mode)) {\r\n try {\r\n var stat = this.nodefs.fstatSync(stream.nfd);\r\n position += stat.size;\r\n } catch (e) {\r\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\r\n }\r\n }\r\n }\r\n\r\n if (position < 0) {\r\n throw new this.FS.ErrnoError(this.ERRNO_CODES.EINVAL);\r\n }\r\n\r\n stream.position = position;\r\n return position;\r\n }\r\n}\r\n\r\nclass BFSEmscriptenNodeOps implements EmscriptenNodeOps {\r\n private FS: any;\r\n private PATH: any;\r\n private ERRNO_CODES: any;\r\n private nodefs: FS;\r\n\r\n constructor(private fs: BFSEmscriptenFS) {\r\n this.nodefs = fs.getNodeFS();\r\n this.FS = fs.getFS();\r\n this.PATH = fs.getPATH();\r\n this.ERRNO_CODES = fs.getERRNO_CODES();\r\n }\r\n\r\n public getattr(node: EmscriptenFSNode): Stats {\r\n var path = this.fs.realPath(node);\r\n var stat: NodeStats;\r\n try {\r\n stat = this.nodefs.lstatSync(path);\r\n } catch (e) {\r\n if (!e.code) throw e;\r\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\r\n }\r\n return {\r\n dev: stat.dev,\r\n ino: stat.ino,\r\n mode: stat.mode,\r\n nlink: stat.nlink,\r\n uid: stat.uid,\r\n gid: stat.gid,\r\n rdev: stat.rdev,\r\n size: stat.size,\r\n atime: stat.atime,\r\n mtime: stat.mtime,\r\n ctime: stat.ctime,\r\n blksize: stat.blksize,\r\n blocks: stat.blocks\r\n };\r\n }\r\n\r\n public setattr(node: EmscriptenFSNode, attr: Stats): void {\r\n var path = this.fs.realPath(node);\r\n try {\r\n if (attr.mode !== undefined) {\r\n this.nodefs.chmodSync(path, attr.mode);\r\n // update the common node structure mode as well\r\n node.mode = attr.mode;\r\n }\r\n if (attr.timestamp !== undefined) {\r\n var date = new Date(attr.timestamp);\r\n this.nodefs.utimesSync(path, date, date);\r\n }\r\n } catch (e) {\r\n if (!e.code) throw e;\r\n // Ignore not supported errors. Emscripten does utimesSync when it\r\n // writes files, but never really requires the value to be set.\r\n if (e.code !== \"ENOTSUP\") {\r\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\r\n }\r\n }\r\n if (attr.size !== undefined) {\r\n try {\r\n this.nodefs.truncateSync(path, attr.size);\r\n } catch (e) {\r\n if (!e.code) throw e;\r\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\r\n }\r\n }\r\n }\r\n\r\n public lookup(parent: EmscriptenFSNode, name: string): EmscriptenFSNode {\r\n var path = this.PATH.join2(this.fs.realPath(parent), name);\r\n var mode = this.fs.getMode(path);\r\n return this.fs.createNode(parent, name, mode);\r\n }\r\n\r\n public mknod(parent: EmscriptenFSNode, name: string, mode: number, dev: any): EmscriptenFSNode {\r\n var node = this.fs.createNode(parent, name, mode, dev);\r\n // create the backing node for this in the fs root as well\r\n var path = this.fs.realPath(node);\r\n try {\r\n if (this.FS.isDir(node.mode)) {\r\n this.nodefs.mkdirSync(path, node.mode);\r\n } else {\r\n this.nodefs.writeFileSync(path, '', { mode: node.mode });\r\n }\r\n } catch (e) {\r\n if (!e.code) throw e;\r\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\r\n }\r\n return node;\r\n }\r\n\r\n public rename(oldNode: EmscriptenFSNode, newDir: EmscriptenFSNode, newName: string): void {\r\n var oldPath = this.fs.realPath(oldNode);\r\n var newPath = this.PATH.join2(this.fs.realPath(newDir), newName);\r\n try {\r\n this.nodefs.renameSync(oldPath, newPath);\r\n } catch (e) {\r\n if (!e.code) throw e;\r\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\r\n }\r\n }\r\n\r\n public unlink(parent: EmscriptenFSNode, name: string): void {\r\n var path = this.PATH.join2(this.fs.realPath(parent), name);\r\n try {\r\n this.nodefs.unlinkSync(path);\r\n } catch (e) {\r\n if (!e.code) throw e;\r\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\r\n }\r\n }\r\n\r\n public rmdir(parent: EmscriptenFSNode, name: string) {\r\n var path = this.PATH.join2(this.fs.realPath(parent), name);\r\n try {\r\n this.nodefs.rmdirSync(path);\r\n } catch (e) {\r\n if (!e.code) throw e;\r\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\r\n }\r\n }\r\n\r\n public readdir(node: EmscriptenFSNode): string[] {\r\n var path = this.fs.realPath(node);\r\n try {\r\n return this.nodefs.readdirSync(path);\r\n } catch (e) {\r\n if (!e.code) throw e;\r\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\r\n }\r\n }\r\n\r\n public symlink(parent: EmscriptenFSNode, newName: string, oldPath: string): void {\r\n var newPath = this.PATH.join2(this.fs.realPath(parent), newName);\r\n try {\r\n this.nodefs.symlinkSync(oldPath, newPath);\r\n } catch (e) {\r\n if (!e.code) throw e;\r\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\r\n }\r\n }\r\n\r\n public readlink(node: EmscriptenFSNode): string {\r\n var path = this.fs.realPath(node);\r\n try {\r\n return this.nodefs.readlinkSync(path);\r\n } catch (e) {\r\n if (!e.code) throw e;\r\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\r\n }\r\n }\r\n}\r\n\r\nexport default class BFSEmscriptenFS implements EmscriptenFS {\r\n private FS: any;\r\n private PATH: any;\r\n private ERRNO_CODES: any;\r\n private nodefs: FS;\r\n constructor(_FS = (<any> self)['FS'], _PATH = (<any> self)['PATH'], _ERRNO_CODES = (<any> self)['ERRNO_CODES'], nodefs: FS = fs) {\r\n if (typeof BrowserFS === 'undefined') {\r\n throw new Error(\"BrowserFS is not loaded. Please load it before this library.\");\r\n }\r\n this.nodefs = nodefs;\r\n this.FS = _FS;\r\n this.PATH = _PATH;\r\n this.ERRNO_CODES = _ERRNO_CODES;\r\n this.node_ops = new BFSEmscriptenNodeOps(this);\r\n this.stream_ops = new BFSEmscriptenStreamOps(this);\r\n }\r\n\r\n public mount(mount: {opts: {root: string}}): EmscriptenFSNode {\r\n return this.createNode(null, '/', this.getMode(mount.opts.root), 0);\r\n }\r\n\r\n public createNode(parent: EmscriptenFSNode, name: string, mode: number, dev?: any): EmscriptenFSNode {\r\n var FS = this.FS;\r\n if (!FS.isDir(mode) && !FS.isFile(mode) && !FS.isLink(mode)) {\r\n throw new FS.ErrnoError(this.ERRNO_CODES.EINVAL);\r\n }\r\n var node = FS.createNode(parent, name, mode);\r\n node.node_ops = this.node_ops;\r\n node.stream_ops = this.stream_ops;\r\n return node;\r\n }\r\n\r\n public getMode(path: string): number {\r\n var stat: NodeStats;\r\n try {\r\n stat = this.nodefs.lstatSync(path);\r\n } catch (e) {\r\n if (!e.code) throw e;\r\n throw new this.FS.ErrnoError(this.ERRNO_CODES[e.code]);\r\n }\r\n return stat.mode;\r\n }\r\n\r\n public realPath(node: EmscriptenFSNode): string {\r\n var parts: string[] = [];\r\n while (node.parent !== node) {\r\n parts.push(node.name);\r\n node = node.parent;\r\n }\r\n parts.push(node.mount.opts.root);\r\n parts.reverse();\r\n return this.PATH.join.apply(null, parts);\r\n }\r\n // This maps the integer permission modes from http://linux.die.net/man/3/open\r\n // to node.js-specific file open permission strings at http://nodejs.org/api/fs.html#fs_fs_open_path_flags_mode_callback\r\n public flagsToPermissionStringMap = {\r\n 0/*O_RDONLY*/: 'r',\r\n 1/*O_WRONLY*/: 'r+',\r\n 2/*O_RDWR*/: 'r+',\r\n 64/*O_CREAT*/: 'r',\r\n 65/*O_WRONLY|O_CREAT*/: 'r+',\r\n 66/*O_RDWR|O_CREAT*/: 'r+',\r\n 129/*O_WRONLY|O_EXCL*/: 'rx+',\r\n 193/*O_WRONLY|O_CREAT|O_EXCL*/: 'rx+',\r\n 514/*O_RDWR|O_TRUNC*/: 'w+',\r\n 577/*O_WRONLY|O_CREAT|O_TRUNC*/: 'w',\r\n 578/*O_CREAT|O_RDWR|O_TRUNC*/: 'w+',\r\n 705/*O_WRONLY|O_CREAT|O_EXCL|O_TRUNC*/: 'wx',\r\n 706/*O_RDWR|O_CREAT|O_EXCL|O_TRUNC*/: 'wx+',\r\n 1024/*O_APPEND*/: 'a',\r\n 1025/*O_WRONLY|O_APPEND*/: 'a',\r\n 1026/*O_RDWR|O_APPEND*/: 'a+',\r\n 1089/*O_WRONLY|O_CREAT|O_APPEND*/: 'a',\r\n 1090/*O_RDWR|O_CREAT|O_APPEND*/: 'a+',\r\n 1153/*O_WRONLY|O_EXCL|O_APPEND*/: 'ax',\r\n 1154/*O_RDWR|O_EXCL|O_APPEND*/: 'ax+',\r\n 1217/*O_WRONLY|O_CREAT|O_EXCL|O_APPEND*/: 'ax',\r\n 1218/*O_RDWR|O_CREAT|O_EXCL|O_APPEND*/: 'ax+',\r\n 4096/*O_RDONLY|O_DSYNC*/: 'rs',\r\n 4098/*O_RDWR|O_DSYNC*/: 'rs+'\r\n }\r\n\r\n public flagsToPermissionString(flags: string): string {\r\n var parsedFlags = (typeof flags === \"string\") ? parseInt(flags, 10) : <number><any> flags;\r\n parsedFlags &= 0x1FFF;\r\n if (parsedFlags in this.flagsToPermissionStringMap) {\r\n return (<any> this.flagsToPermissionStringMap)[parsedFlags];\r\n } else {\r\n return flags;\r\n }\r\n }\r\n\r\n public getNodeFS() {\r\n return this.nodefs;\r\n }\r\n\r\n public getFS() {\r\n return this.FS;\r\n }\r\n\r\n public getPATH() {\r\n return this.PATH;\r\n }\r\n\r\n public getERRNO_CODES() {\r\n return this.ERRNO_CODES;\r\n }\r\n\r\n public node_ops: EmscriptenNodeOps;\r\n public stream_ops: EmscriptenStreamOps;\r\n}\r\n",
|
||
"import {default as Stats, FileType} from '../core/node_fs_stats';\r\nimport path = require('path');\r\n\r\n/**\r\n * A simple class for storing a filesystem index. Assumes that all paths passed\r\n * to it are *absolute* paths.\r\n *\r\n * Can be used as a partial or a full index, although care must be taken if used\r\n * for the former purpose, especially when directories are concerned.\r\n */\r\nexport class FileIndex<T> {\r\n // Maps directory paths to directory inodes, which contain files.\r\n private _index: {[path: string]: DirInode<T>}\r\n\r\n /**\r\n * Constructs a new FileIndex.\r\n */\r\n constructor() {\r\n // _index is a single-level key,value store that maps *directory* paths to\r\n // DirInodes. File information is only contained in DirInodes themselves.\r\n this._index = {};\r\n // Create the root directory.\r\n this.addPath('/', new DirInode());\r\n }\r\n\r\n /**\r\n * Split into a (directory path, item name) pair\r\n */\r\n private _split_path(p: string): string[] {\r\n var dirpath = path.dirname(p);\r\n var itemname = p.substr(dirpath.length + (dirpath === \"/\" ? 0 : 1));\r\n return [dirpath, itemname];\r\n }\r\n\r\n /**\r\n * Runs the given function over all files in the index.\r\n */\r\n public fileIterator<T>(cb: (file: T) => void): void {\r\n for (var path in this._index) {\r\n var dir = this._index[path];\r\n var files = dir.getListing();\r\n for (var i = 0; i < files.length; i++) {\r\n var item = dir.getItem(files[i]);\r\n if (isFileInode<T>(item)) {\r\n cb(item.getData());\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Adds the given absolute path to the index if it is not already in the index.\r\n * Creates any needed parent directories.\r\n * @param [String] path The path to add to the index.\r\n * @param [BrowserFS.FileInode | BrowserFS.DirInode] inode The inode for the\r\n * path to add.\r\n * @return [Boolean] 'True' if it was added or already exists, 'false' if there\r\n * was an issue adding it (e.g. item in path is a file, item exists but is\r\n * different).\r\n * @todo If adding fails and implicitly creates directories, we do not clean up\r\n * the new empty directories.\r\n */\r\n public addPath(path: string, inode: Inode): boolean {\r\n if (inode == null) {\r\n throw new Error('Inode must be specified');\r\n }\r\n if (path[0] !== '/') {\r\n throw new Error('Path must be absolute, got: ' + path);\r\n }\r\n\r\n // Check if it already exists.\r\n if (this._index.hasOwnProperty(path)) {\r\n return this._index[path] === inode;\r\n }\r\n\r\n var splitPath = this._split_path(path);\r\n var dirpath = splitPath[0];\r\n var itemname = splitPath[1];\r\n // Try to add to its parent directory first.\r\n var parent = this._index[dirpath];\r\n if (parent === undefined && path !== '/') {\r\n // Create parent.\r\n parent = new DirInode<T>();\r\n if (!this.addPath(dirpath, parent)) {\r\n return false;\r\n }\r\n }\r\n // Add myself to my parent.\r\n if (path !== '/') {\r\n if (!parent.addItem(itemname, inode)) {\r\n return false;\r\n }\r\n }\r\n // If I'm a directory, add myself to the index.\r\n if (isDirInode<T>(inode)) {\r\n this._index[path] = inode;\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n * Adds the given absolute path to the index if it is not already in the index.\r\n * The path is added without special treatment (no joining of adjacent separators, etc).\r\n * Creates any needed parent directories.\r\n * @param [String] path The path to add to the index.\r\n * @param [BrowserFS.FileInode | BrowserFS.DirInode] inode The inode for the\r\n * path to add.\r\n * @return [Boolean] 'True' if it was added or already exists, 'false' if there\r\n * was an issue adding it (e.g. item in path is a file, item exists but is\r\n * different).\r\n * @todo If adding fails and implicitly creates directories, we do not clean up\r\n * the new empty directories.\r\n */\r\n public addPathFast(path: string, inode: Inode): boolean {\r\n\r\n const itemNameMark = path.lastIndexOf('/');\r\n const parentPath = itemNameMark == 0 ? \"/\" : path.substring(0, itemNameMark);\r\n const itemName = path.substring(itemNameMark+1);\r\n\r\n // Try to add to its parent directory first.\r\n let parent = this._index[parentPath];\r\n if (parent === undefined) {\r\n // Create parent.\r\n parent = new DirInode<T>();\r\n this.addPathFast(parentPath, parent);\r\n }\r\n\r\n if (!parent.addItem(itemName, inode)) {\r\n return false;\r\n }\r\n\r\n // If adding a directory, add to the index as well.\r\n if (inode.isDir()) {\r\n this._index[path] = <DirInode<T>> inode;\r\n }\r\n return true;\r\n }\r\n\r\n /**\r\n * Removes the given path. Can be a file or a directory.\r\n * @return [BrowserFS.FileInode | BrowserFS.DirInode | null] The removed item,\r\n * or null if it did not exist.\r\n */\r\n public removePath(path: string): Inode {\r\n var splitPath = this._split_path(path);\r\n var dirpath = splitPath[0];\r\n var itemname = splitPath[1];\r\n\r\n // Try to remove it from its parent directory first.\r\n var parent = this._index[dirpath];\r\n if (parent === undefined) {\r\n return null;\r\n }\r\n // Remove myself from my parent.\r\n var inode = parent.remItem(itemname);\r\n if (inode === null) {\r\n return null;\r\n }\r\n // If I'm a directory, remove myself from the index, and remove my children.\r\n if (isDirInode(inode)) {\r\n var children = inode.getListing();\r\n for (var i = 0; i < children.length; i++) {\r\n this.removePath(path + '/' + children[i]);\r\n }\r\n\r\n // Remove the directory from the index, unless it's the root.\r\n if (path !== '/') {\r\n delete this._index[path];\r\n }\r\n }\r\n return inode;\r\n }\r\n\r\n /**\r\n * Retrieves the directory listing of the given path.\r\n * @return [String[]] An array of files in the given path, or 'null' if it does\r\n * not exist.\r\n */\r\n public ls(path: string): string[] {\r\n var item = this._index[path];\r\n if (item === undefined) {\r\n return null;\r\n }\r\n return item.getListing();\r\n }\r\n\r\n /**\r\n * Returns the inode of the given item.\r\n * @param [String] path\r\n * @return [BrowserFS.FileInode | BrowserFS.DirInode | null] Returns null if\r\n * the item does not exist.\r\n */\r\n public getInode(path: string): Inode {\r\n var splitPath = this._split_path(path);\r\n var dirpath = splitPath[0];\r\n var itemname = splitPath[1];\r\n // Retrieve from its parent directory.\r\n var parent = this._index[dirpath];\r\n if (parent === undefined) {\r\n return null;\r\n }\r\n // Root case\r\n if (dirpath === path) {\r\n return parent;\r\n }\r\n return parent.getItem(itemname);\r\n }\r\n\r\n /**\r\n * Static method for constructing indices from a JSON listing.\r\n * @param [Object] listing Directory listing generated by tools/XHRIndexer.coffee\r\n * @return [BrowserFS.FileIndex] A new FileIndex object.\r\n */\r\n public static fromListing<T>(listing): FileIndex<T> {\r\n var idx = new FileIndex<T>();\r\n // Add a root DirNode.\r\n var rootInode = new DirInode<T>();\r\n idx._index['/'] = rootInode;\r\n var queue = [['', listing, rootInode]];\r\n while (queue.length > 0) {\r\n var inode;\r\n var next = queue.pop();\r\n var pwd = next[0];\r\n var tree = next[1];\r\n var parent = next[2];\r\n for (var node in tree) {\r\n var children = tree[node];\r\n var name = \"\" + pwd + \"/\" + node;\r\n if (children != null) {\r\n idx._index[name] = inode = new DirInode<T>();\r\n queue.push([name, children, inode]);\r\n } else {\r\n // This inode doesn't have correct size information, noted with -1.\r\n inode = new FileInode<Stats>(new Stats(FileType.FILE, -1, 0x16D));\r\n }\r\n if (parent != null) {\r\n parent._ls[node] = inode;\r\n }\r\n }\r\n }\r\n return idx;\r\n }\r\n}\r\n\r\n/**\r\n * Generic interface for file/directory inodes.\r\n * Note that Stats objects are what we use for file inodes.\r\n */\r\nexport interface Inode {\r\n // Is this an inode for a file?\r\n isFile(): boolean;\r\n // Is this an inode for a directory?\r\n isDir(): boolean;\r\n}\r\n\r\n/**\r\n * Inode for a file. Stores an arbitrary (filesystem-specific) data payload.\r\n */\r\nexport class FileInode<T> implements Inode {\r\n constructor(private data: T) { }\r\n public isFile(): boolean { return true; }\r\n public isDir(): boolean { return false; }\r\n public getData(): T { return this.data; }\r\n public setData(data: T): void { this.data = data; }\r\n}\r\n\r\n/**\r\n * Inode for a directory. Currently only contains the directory listing.\r\n */\r\nexport class DirInode<T> implements Inode {\r\n private _ls: {[path: string]: Inode} = {};\r\n /**\r\n * Constructs an inode for a directory.\r\n */\r\n constructor(private data: T = null) {}\r\n public isFile(): boolean {\r\n return false;\r\n }\r\n public isDir(): boolean {\r\n return true;\r\n }\r\n public getData(): T { return this.data; }\r\n\r\n /**\r\n * Return a Stats object for this inode.\r\n * @todo Should probably remove this at some point. This isn't the\r\n * responsibility of the FileIndex.\r\n * @return [BrowserFS.node.fs.Stats]\r\n */\r\n public getStats(): Stats {\r\n return new Stats(FileType.DIRECTORY, 4096, 0x16D);\r\n }\r\n /**\r\n * Returns the directory listing for this directory. Paths in the directory are\r\n * relative to the directory's path.\r\n * @return [String[]] The directory listing for this directory.\r\n */\r\n public getListing(): string[] {\r\n return Object.keys(this._ls);\r\n }\r\n /**\r\n * Returns the inode for the indicated item, or null if it does not exist.\r\n * @param [String] p Name of item in this directory.\r\n * @return [BrowserFS.FileInode | BrowserFS.DirInode | null]\r\n */\r\n public getItem(p: string): Inode {\r\n var _ref;\r\n return (_ref = this._ls[p]) != null ? _ref : null;\r\n }\r\n /**\r\n * Add the given item to the directory listing. Note that the given inode is\r\n * not copied, and will be mutated by the DirInode if it is a DirInode.\r\n * @param [String] p Item name to add to the directory listing.\r\n * @param [BrowserFS.FileInode | BrowserFS.DirInode] inode The inode for the\r\n * item to add to the directory inode.\r\n * @return [Boolean] True if it was added, false if it already existed.\r\n */\r\n public addItem(p: string, inode: Inode): boolean {\r\n if (p in this._ls) {\r\n return false;\r\n }\r\n this._ls[p] = inode;\r\n return true;\r\n }\r\n /**\r\n * Removes the given item from the directory listing.\r\n * @param [String] p Name of item to remove from the directory listing.\r\n * @return [BrowserFS.FileInode | BrowserFS.DirInode | null] Returns the item\r\n * removed, or null if the item did not exist.\r\n */\r\n public remItem(p: string): Inode {\r\n var item = this._ls[p];\r\n if (item === undefined) {\r\n return null;\r\n }\r\n delete this._ls[p];\r\n return item;\r\n }\r\n}\r\n\r\nexport function isFileInode<T>(inode: Inode): inode is FileInode<T> {\r\n return inode && inode.isFile();\r\n}\r\n\r\nexport function isDirInode<T>(inode: Inode): inode is DirInode<T> {\r\n return inode && inode.isDir();\r\n}\r\n",
|
||
"import {default as Stats, FileType} from '../core/node_fs_stats';\r\n\r\n/**\r\n * Generic inode definition that can easily be serialized.\r\n */\r\nclass Inode {\r\n constructor(public id: string,\r\n public size: number,\r\n public mode: number,\r\n public atime: number,\r\n public mtime: number,\r\n public ctime: number) { }\r\n\r\n /**\r\n * Handy function that converts the Inode to a Node Stats object.\r\n */\r\n public toStats(): Stats {\r\n return new Stats(\r\n (this.mode & 0xF000) === FileType.DIRECTORY ? FileType.DIRECTORY : FileType.FILE,\r\n this.size, this.mode, new Date(this.atime), new Date(this.mtime), new Date(this.ctime));\r\n }\r\n\r\n /**\r\n * Get the size of this Inode, in bytes.\r\n */\r\n public getSize(): number {\r\n // ASSUMPTION: ID is ASCII (1 byte per char).\r\n return 30 + this.id.length;\r\n }\r\n\r\n /**\r\n * Writes the inode into the start of the buffer.\r\n */\r\n public toBuffer(buff: NodeBuffer = new Buffer(this.getSize())): NodeBuffer {\r\n buff.writeUInt32LE(this.size, 0);\r\n buff.writeUInt16LE(this.mode, 4);\r\n buff.writeDoubleLE(this.atime, 6);\r\n buff.writeDoubleLE(this.mtime, 14);\r\n buff.writeDoubleLE(this.ctime, 22);\r\n buff.write(this.id, 30, this.id.length, 'ascii');\r\n return buff;\r\n }\r\n\r\n /**\r\n * Updates the Inode using information from the stats object. Used by file\r\n * systems at sync time, e.g.:\r\n * - Program opens file and gets a File object.\r\n * - Program mutates file. File object is responsible for maintaining\r\n * metadata changes locally -- typically in a Stats object.\r\n * - Program closes file. File object's metadata changes are synced with the\r\n * file system.\r\n * @return True if any changes have occurred.\r\n */\r\n public update(stats: Stats): boolean {\r\n var hasChanged = false;\r\n if (this.size !== stats.size) {\r\n this.size = stats.size;\r\n hasChanged = true;\r\n }\r\n\r\n if (this.mode !== stats.mode) {\r\n this.mode = stats.mode;\r\n hasChanged = true;\r\n }\r\n\r\n var atimeMs = stats.atime.getTime();\r\n if (this.atime !== atimeMs) {\r\n this.atime = atimeMs;\r\n hasChanged = true;\r\n }\r\n\r\n var mtimeMs = stats.mtime.getTime();\r\n if (this.mtime !== mtimeMs) {\r\n this.mtime = mtimeMs;\r\n hasChanged = true;\r\n }\r\n\r\n var ctimeMs = stats.ctime.getTime();\r\n if (this.ctime !== ctimeMs) {\r\n this.ctime = ctimeMs;\r\n hasChanged = true;\r\n }\r\n\r\n return hasChanged;\r\n }\r\n\r\n /**\r\n * Converts the buffer into an Inode.\r\n */\r\n public static fromBuffer(buffer: NodeBuffer): Inode {\r\n if (buffer === undefined) {\r\n throw new Error(\"NO\");\r\n }\r\n return new Inode(buffer.toString('ascii', 30),\r\n buffer.readUInt32LE(0),\r\n buffer.readUInt16LE(4),\r\n buffer.readDoubleLE(6),\r\n buffer.readDoubleLE(14),\r\n buffer.readDoubleLE(22)\r\n );\r\n }\r\n\r\n // XXX: Copied from Stats. Should reconcile these two into something more\r\n // compact.\r\n\r\n /**\r\n * @return [Boolean] True if this item is a file.\r\n */\r\n public isFile(): boolean {\r\n return (this.mode & 0xF000) === FileType.FILE;\r\n }\r\n\r\n /**\r\n * @return [Boolean] True if this item is a directory.\r\n */\r\n public isDirectory(): boolean {\r\n return (this.mode & 0xF000) === FileType.DIRECTORY;\r\n }\r\n}\r\n\r\nexport = Inode;\r\n",
|
||
"import file_system = require('../core/file_system');\r\nimport {ApiError, ErrorCode} from '../core/api_error';\r\nimport {default as Stats, FileType} from '../core/node_fs_stats';\r\nimport file = require('../core/file');\r\nimport file_flag = require('../core/file_flag');\r\nimport path = require('path');\r\nimport Inode = require('../generic/inode');\r\nimport preload_file = require('../generic/preload_file');\r\nvar ROOT_NODE_ID: string = \"/\";\r\n\r\n/**\r\n * Generates a random ID.\r\n */\r\nfunction GenerateRandomID(): string {\r\n // From http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript\r\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\r\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\r\n return v.toString(16);\r\n });\r\n}\r\n\r\n/**\r\n * Helper function. Checks if 'e' is defined. If so, it triggers the callback\r\n * with 'e' and returns false. Otherwise, returns true.\r\n */\r\nfunction noError(e: ApiError, cb: (e: ApiError) => void): boolean {\r\n if (e) {\r\n cb(e);\r\n return false;\r\n }\r\n return true;\r\n}\r\n\r\n/**\r\n * Helper function. Checks if 'e' is defined. If so, it aborts the transaction,\r\n * triggers the callback with 'e', and returns false. Otherwise, returns true.\r\n */\r\nfunction noErrorTx(e: ApiError, tx: AsyncKeyValueRWTransaction, cb: (e: ApiError) => void): boolean {\r\n if (e) {\r\n tx.abort(() => {\r\n cb(e);\r\n });\r\n return false;\r\n }\r\n return true;\r\n}\r\n\r\n/**\r\n * Represents a *synchronous* key-value store.\r\n */\r\nexport interface SyncKeyValueStore {\r\n /**\r\n * The name of the key-value store.\r\n */\r\n name(): string;\r\n /**\r\n * Empties the key-value store completely.\r\n */\r\n clear(): void;\r\n /**\r\n * Begins a new read-only transaction.\r\n */\r\n beginTransaction(type: \"readonly\"): SyncKeyValueROTransaction;\r\n /**\r\n * Begins a new read-write transaction.\r\n */\r\n beginTransaction(type: \"readwrite\"): SyncKeyValueRWTransaction;\r\n beginTransaction(type: string): SyncKeyValueROTransaction;\r\n}\r\n\r\n/**\r\n * A read-only transaction for a synchronous key value store.\r\n */\r\nexport interface SyncKeyValueROTransaction {\r\n /**\r\n * Retrieves the data at the given key. Throws an ApiError if an error occurs\r\n * or if the key does not exist.\r\n * @param key The key to look under for data.\r\n * @return The data stored under the key, or undefined if not present.\r\n */\r\n get(key: string): NodeBuffer;\r\n}\r\n\r\n/**\r\n * A read-write transaction for a synchronous key value store.\r\n */\r\nexport interface SyncKeyValueRWTransaction extends SyncKeyValueROTransaction {\r\n /**\r\n * Adds the data to the store under the given key.\r\n * @param key The key to add the data under.\r\n * @param data The data to add to the store.\r\n * @param overwrite If 'true', overwrite any existing data. If 'false',\r\n * avoids storing the data if the key exists.\r\n * @return True if storage succeeded, false otherwise.\r\n */\r\n put(key: string, data: NodeBuffer, overwrite: boolean): boolean;\r\n /**\r\n * Deletes the data at the given key.\r\n * @param key The key to delete from the store.\r\n */\r\n del(key: string): void;\r\n /**\r\n * Commits the transaction.\r\n */\r\n commit(): void;\r\n /**\r\n * Aborts and rolls back the transaction.\r\n */\r\n abort(): void;\r\n}\r\n\r\n/**\r\n * An interface for simple synchronous key-value stores that don't have special\r\n * support for transactions and such.\r\n */\r\nexport interface SimpleSyncStore {\r\n get(key: string): NodeBuffer;\r\n put(key: string, data: NodeBuffer, overwrite: boolean): boolean;\r\n del(key: string): void;\r\n}\r\n\r\n/**\r\n * A simple RW transaction for simple synchronous key-value stores.\r\n */\r\nexport class SimpleSyncRWTransaction implements SyncKeyValueRWTransaction {\r\n constructor(private store: SimpleSyncStore) { }\r\n /**\r\n * Stores data in the keys we modify prior to modifying them.\r\n * Allows us to roll back commits.\r\n */\r\n private originalData: { [key: string]: NodeBuffer } = {};\r\n /**\r\n * List of keys modified in this transaction, if any.\r\n */\r\n private modifiedKeys: string[] = [];\r\n /**\r\n * Stashes given key value pair into `originalData` if it doesn't already\r\n * exist. Allows us to stash values the program is requesting anyway to\r\n * prevent needless `get` requests if the program modifies the data later\r\n * on during the transaction.\r\n */\r\n private stashOldValue(key: string, value: NodeBuffer) {\r\n // Keep only the earliest value in the transaction.\r\n if (!this.originalData.hasOwnProperty(key)) {\r\n this.originalData[key] = value\r\n }\r\n }\r\n /**\r\n * Marks the given key as modified, and stashes its value if it has not been\r\n * stashed already.\r\n */\r\n private markModified(key: string) {\r\n if (this.modifiedKeys.indexOf(key) === -1) {\r\n this.modifiedKeys.push(key);\r\n if (!this.originalData.hasOwnProperty(key)) {\r\n this.originalData[key] = this.store.get(key);\r\n }\r\n }\r\n }\r\n\r\n public get(key: string): NodeBuffer {\r\n var val = this.store.get(key);\r\n this.stashOldValue(key, val);\r\n return val;\r\n }\r\n\r\n public put(key: string, data: NodeBuffer, overwrite: boolean): boolean {\r\n this.markModified(key);\r\n return this.store.put(key, data, overwrite);\r\n }\r\n\r\n public del(key: string): void {\r\n this.markModified(key);\r\n this.store.del(key);\r\n }\r\n\r\n public commit(): void {/* NOP */}\r\n public abort(): void {\r\n // Rollback old values.\r\n var i: number, key: string, value: NodeBuffer;\r\n for (i = 0; i < this.modifiedKeys.length; i++) {\r\n key = this.modifiedKeys[i];\r\n value = this.originalData[key];\r\n if (value === null) {\r\n // Key didn't exist.\r\n this.store.del(key);\r\n } else {\r\n // Key existed. Store old value.\r\n this.store.put(key, value, true);\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport interface SyncKeyValueFileSystemOptions {\r\n /**\r\n * The actual key-value store to read from/write to.\r\n */\r\n store: SyncKeyValueStore;\r\n /**\r\n * Should the file system support properties (mtime/atime/ctime/chmod/etc)?\r\n * Enabling this slightly increases the storage space per file, and adds\r\n * atime updates every time a file is accessed, mtime updates every time\r\n * a file is modified, and permission checks on every operation.\r\n *\r\n * Defaults to *false*.\r\n */\r\n //supportProps?: boolean;\r\n /**\r\n * Should the file system support links?\r\n */\r\n //supportLinks?: boolean;\r\n}\r\n\r\nexport class SyncKeyValueFile extends preload_file.PreloadFile<SyncKeyValueFileSystem> implements file.File {\r\n constructor(_fs: SyncKeyValueFileSystem, _path: string, _flag: file_flag.FileFlag, _stat: Stats, contents?: NodeBuffer) {\r\n super(_fs, _path, _flag, _stat, contents);\r\n }\r\n\r\n public syncSync(): void {\r\n if (this.isDirty()) {\r\n this._fs._syncSync(this.getPath(), this.getBuffer(), this.getStats());\r\n this.resetDirty();\r\n }\r\n }\r\n\r\n public closeSync(): void {\r\n this.syncSync();\r\n }\r\n}\r\n\r\n/**\r\n * A \"Synchronous key-value file system\". Stores data to/retrieves data from an\r\n * underlying key-value store.\r\n *\r\n * We use a unique ID for each node in the file system. The root node has a\r\n * fixed ID.\r\n * @todo Introduce Node ID caching.\r\n * @todo Check modes.\r\n */\r\nexport class SyncKeyValueFileSystem extends file_system.SynchronousFileSystem {\r\n private store: SyncKeyValueStore;\r\n constructor(options: SyncKeyValueFileSystemOptions) {\r\n super();\r\n this.store = options.store;\r\n // INVARIANT: Ensure that the root exists.\r\n this.makeRootDirectory();\r\n }\r\n\r\n public static isAvailable(): boolean { return true; }\r\n public getName(): string { return this.store.name(); }\r\n public isReadOnly(): boolean { return false; }\r\n public supportsSymlinks(): boolean { return false; }\r\n public supportsProps(): boolean { return false; }\r\n public supportsSynch(): boolean { return true; }\r\n\r\n /**\r\n * Checks if the root directory exists. Creates it if it doesn't.\r\n */\r\n private makeRootDirectory() {\r\n var tx = this.store.beginTransaction('readwrite');\r\n if (tx.get(ROOT_NODE_ID) === undefined) {\r\n // Create new inode.\r\n var currTime = (new Date()).getTime(),\r\n // Mode 0666\r\n dirInode = new Inode(GenerateRandomID(), 4096, 511 | FileType.DIRECTORY, currTime, currTime, currTime);\r\n // If the root doesn't exist, the first random ID shouldn't exist,\r\n // either.\r\n tx.put(dirInode.id, new Buffer(\"{}\"), false);\r\n tx.put(ROOT_NODE_ID, dirInode.toBuffer(), false);\r\n tx.commit();\r\n }\r\n }\r\n\r\n /**\r\n * Helper function for findINode.\r\n * @param parent The parent directory of the file we are attempting to find.\r\n * @param filename The filename of the inode we are attempting to find, minus\r\n * the parent.\r\n * @return string The ID of the file's inode in the file system.\r\n */\r\n private _findINode(tx: SyncKeyValueROTransaction, parent: string, filename: string): string {\r\n var read_directory = (inode: Inode): string => {\r\n // Get the root's directory listing.\r\n var dirList = this.getDirListing(tx, parent, inode);\r\n // Get the file's ID.\r\n if (dirList[filename]) {\r\n return dirList[filename];\r\n } else {\r\n throw ApiError.ENOENT(path.resolve(parent, filename));\r\n }\r\n };\r\n if (parent === '/') {\r\n if (filename === '') {\r\n // BASE CASE #1: Return the root's ID.\r\n return ROOT_NODE_ID;\r\n } else {\r\n // BASE CASE #2: Find the item in the root ndoe.\r\n return read_directory(this.getINode(tx, parent, ROOT_NODE_ID));\r\n }\r\n } else {\r\n return read_directory(this.getINode(tx, parent + path.sep + filename,\r\n this._findINode(tx, path.dirname(parent), path.basename(parent))));\r\n }\r\n }\r\n\r\n /**\r\n * Finds the Inode of the given path.\r\n * @param p The path to look up.\r\n * @return The Inode of the path p.\r\n * @todo memoize/cache\r\n */\r\n private findINode(tx: SyncKeyValueROTransaction, p: string): Inode {\r\n return this.getINode(tx, p, this._findINode(tx, path.dirname(p), path.basename(p)));\r\n }\r\n\r\n /**\r\n * Given the ID of a node, retrieves the corresponding Inode.\r\n * @param tx The transaction to use.\r\n * @param p The corresponding path to the file (used for error messages).\r\n * @param id The ID to look up.\r\n */\r\n private getINode(tx: SyncKeyValueROTransaction, p: string, id: string): Inode {\r\n var inode = tx.get(id);\r\n if (inode === undefined) {\r\n throw ApiError.ENOENT(p);\r\n }\r\n return Inode.fromBuffer(inode);\r\n }\r\n\r\n /**\r\n * Given the Inode of a directory, retrieves the corresponding directory\r\n * listing.\r\n */\r\n private getDirListing(tx: SyncKeyValueROTransaction, p: string, inode: Inode): { [fileName: string]: string } {\r\n if (!inode.isDirectory()) {\r\n throw ApiError.ENOTDIR(p);\r\n }\r\n var data = tx.get(inode.id);\r\n if (data === undefined) {\r\n throw ApiError.ENOENT(p);\r\n }\r\n return JSON.parse(data.toString());\r\n }\r\n\r\n /**\r\n * Creates a new node under a random ID. Retries 5 times before giving up in\r\n * the exceedingly unlikely chance that we try to reuse a random GUID.\r\n * @return The GUID that the data was stored under.\r\n */\r\n private addNewNode(tx: SyncKeyValueRWTransaction, data: NodeBuffer): string {\r\n var retries = 0, currId: string;\r\n while (retries < 5) {\r\n try {\r\n currId = GenerateRandomID();\r\n tx.put(currId, data, false);\r\n return currId;\r\n } catch (e) {\r\n // Ignore and reroll.\r\n }\r\n }\r\n throw new ApiError(ErrorCode.EIO, 'Unable to commit data to key-value store.');\r\n }\r\n\r\n /**\r\n * Commits a new file (well, a FILE or a DIRECTORY) to the file system with\r\n * the given mode.\r\n * Note: This will commit the transaction.\r\n * @param p The path to the new file.\r\n * @param type The type of the new file.\r\n * @param mode The mode to create the new file with.\r\n * @param data The data to store at the file's data node.\r\n * @return The Inode for the new file.\r\n */\r\n private commitNewFile(tx: SyncKeyValueRWTransaction, p: string, type: FileType, mode: number, data: NodeBuffer): Inode {\r\n var parentDir = path.dirname(p),\r\n fname = path.basename(p),\r\n parentNode = this.findINode(tx, parentDir),\r\n dirListing = this.getDirListing(tx, parentDir, parentNode),\r\n currTime = (new Date()).getTime();\r\n\r\n // Invariant: The root always exists.\r\n // If we don't check this prior to taking steps below, we will create a\r\n // file with name '' in root should p == '/'.\r\n if (p === '/') {\r\n throw ApiError.EEXIST(p);\r\n }\r\n\r\n // Check if file already exists.\r\n if (dirListing[fname]) {\r\n throw ApiError.EEXIST(p);\r\n }\r\n\r\n try {\r\n // Commit data.\r\n var dataId = this.addNewNode(tx, data),\r\n fileNode = new Inode(dataId, data.length, mode | type, currTime, currTime, currTime),\r\n // Commit file node.\r\n fileNodeId = this.addNewNode(tx, fileNode.toBuffer());\r\n // Update and commit parent directory listing.\r\n dirListing[fname] = fileNodeId;\r\n tx.put(parentNode.id, new Buffer(JSON.stringify(dirListing)), true);\r\n } catch (e) {\r\n tx.abort();\r\n throw e;\r\n }\r\n tx.commit();\r\n return fileNode;\r\n }\r\n\r\n /**\r\n * Delete all contents stored in the file system.\r\n */\r\n public empty(): void {\r\n this.store.clear();\r\n // INVARIANT: Root always exists.\r\n this.makeRootDirectory();\r\n }\r\n\r\n public renameSync(oldPath: string, newPath: string): void {\r\n var tx = this.store.beginTransaction('readwrite'),\r\n oldParent = path.dirname(oldPath), oldName = path.basename(oldPath),\r\n newParent = path.dirname(newPath), newName = path.basename(newPath),\r\n // Remove oldPath from parent's directory listing.\r\n oldDirNode = this.findINode(tx, oldParent),\r\n oldDirList = this.getDirListing(tx, oldParent, oldDirNode);\r\n\r\n if (!oldDirList[oldName]) {\r\n throw ApiError.ENOENT(oldPath);\r\n }\r\n var nodeId: string = oldDirList[oldName];\r\n delete oldDirList[oldName];\r\n\r\n // Invariant: Can't move a folder inside itself.\r\n // This funny little hack ensures that the check passes only if oldPath\r\n // is a subpath of newParent. We append '/' to avoid matching folders that\r\n // are a substring of the bottom-most folder in the path.\r\n if ((newParent + '/').indexOf(oldPath + '/') === 0) {\r\n throw new ApiError(ErrorCode.EBUSY, oldParent);\r\n }\r\n\r\n // Add newPath to parent's directory listing.\r\n var newDirNode: Inode, newDirList: typeof oldDirList;\r\n if (newParent === oldParent) {\r\n // Prevent us from re-grabbing the same directory listing, which still\r\n // contains oldName.\r\n newDirNode = oldDirNode;\r\n newDirList = oldDirList;\r\n } else {\r\n newDirNode = this.findINode(tx, newParent);\r\n newDirList = this.getDirListing(tx, newParent, newDirNode);\r\n }\r\n\r\n if (newDirList[newName]) {\r\n // If it's a file, delete it.\r\n var newNameNode = this.getINode(tx, newPath, newDirList[newName]);\r\n if (newNameNode.isFile()) {\r\n try {\r\n tx.del(newNameNode.id);\r\n tx.del(newDirList[newName]);\r\n } catch (e) {\r\n tx.abort();\r\n throw e;\r\n }\r\n } else {\r\n // If it's a directory, throw a permissions error.\r\n throw ApiError.EPERM(newPath);\r\n }\r\n }\r\n newDirList[newName] = nodeId;\r\n\r\n // Commit the two changed directory listings.\r\n try {\r\n tx.put(oldDirNode.id, new Buffer(JSON.stringify(oldDirList)), true);\r\n tx.put(newDirNode.id, new Buffer(JSON.stringify(newDirList)), true);\r\n } catch (e) {\r\n tx.abort();\r\n throw e;\r\n }\r\n\r\n tx.commit();\r\n }\r\n\r\n public statSync(p: string, isLstat: boolean): Stats {\r\n // Get the inode to the item, convert it into a Stats object.\r\n return this.findINode(this.store.beginTransaction('readonly'), p).toStats();\r\n }\r\n\r\n public createFileSync(p: string, flag: file_flag.FileFlag, mode: number): file.File {\r\n var tx = this.store.beginTransaction('readwrite'),\r\n data = new Buffer(0),\r\n newFile = this.commitNewFile(tx, p, FileType.FILE, mode, data);\r\n // Open the file.\r\n return new SyncKeyValueFile(this, p, flag, newFile.toStats(), data);\r\n }\r\n\r\n public openFileSync(p: string, flag: file_flag.FileFlag): file.File {\r\n var tx = this.store.beginTransaction('readonly'),\r\n node = this.findINode(tx, p),\r\n data = tx.get(node.id);\r\n if (data === undefined) {\r\n throw ApiError.ENOENT(p);\r\n }\r\n return new SyncKeyValueFile(this, p, flag, node.toStats(), data);\r\n }\r\n\r\n /**\r\n * Remove all traces of the given path from the file system.\r\n * @param p The path to remove from the file system.\r\n * @param isDir Does the path belong to a directory, or a file?\r\n * @todo Update mtime.\r\n */\r\n private removeEntry(p: string, isDir: boolean): void {\r\n var tx = this.store.beginTransaction('readwrite'),\r\n parent: string = path.dirname(p),\r\n parentNode = this.findINode(tx, parent),\r\n parentListing = this.getDirListing(tx, parent, parentNode),\r\n fileName: string = path.basename(p);\r\n\r\n if (!parentListing[fileName]) {\r\n throw ApiError.ENOENT(p);\r\n }\r\n\r\n // Remove from directory listing of parent.\r\n var fileNodeId = parentListing[fileName];\r\n delete parentListing[fileName];\r\n\r\n // Get file inode.\r\n var fileNode = this.getINode(tx, p, fileNodeId);\r\n if (!isDir && fileNode.isDirectory()) {\r\n throw ApiError.EISDIR(p);\r\n } else if (isDir && !fileNode.isDirectory()) {\r\n throw ApiError.ENOTDIR(p);\r\n }\r\n\r\n try {\r\n // Delete data.\r\n tx.del(fileNode.id);\r\n // Delete node.\r\n tx.del(fileNodeId);\r\n // Update directory listing.\r\n tx.put(parentNode.id, new Buffer(JSON.stringify(parentListing)), true);\r\n } catch (e) {\r\n tx.abort();\r\n throw e;\r\n }\r\n // Success.\r\n tx.commit();\r\n }\r\n\r\n public unlinkSync(p: string): void {\r\n this.removeEntry(p, false);\r\n }\r\n\r\n public rmdirSync(p: string): void {\r\n // Check first if directory is empty.\r\n if (this.readdirSync(p).length > 0) {\r\n throw ApiError.ENOTEMPTY(p);\r\n } else {\r\n this.removeEntry(p, true);\r\n }\r\n }\r\n\r\n public mkdirSync(p: string, mode: number): void {\r\n var tx = this.store.beginTransaction('readwrite'),\r\n data = new Buffer('{}');\r\n this.commitNewFile(tx, p, FileType.DIRECTORY, mode, data);\r\n }\r\n\r\n public readdirSync(p: string): string[]{\r\n var tx = this.store.beginTransaction('readonly');\r\n return Object.keys(this.getDirListing(tx, p, this.findINode(tx, p)));\r\n }\r\n\r\n public _syncSync(p: string, data: NodeBuffer, stats: Stats): void {\r\n // @todo Ensure mtime updates properly, and use that to determine if a data\r\n // update is required.\r\n var tx = this.store.beginTransaction('readwrite'),\r\n // We use the _findInode helper because we actually need the INode id.\r\n fileInodeId = this._findINode(tx, path.dirname(p), path.basename(p)),\r\n fileInode = this.getINode(tx, p, fileInodeId),\r\n inodeChanged = fileInode.update(stats);\r\n\r\n try {\r\n // Sync data.\r\n tx.put(fileInode.id, data, true);\r\n // Sync metadata.\r\n if (inodeChanged) {\r\n tx.put(fileInodeId, fileInode.toBuffer(), true);\r\n }\r\n } catch (e) {\r\n tx.abort();\r\n throw e;\r\n }\r\n tx.commit();\r\n }\r\n}\r\n\r\n/**\r\n * Represents an *asynchronous* key-value store.\r\n */\r\nexport interface AsyncKeyValueStore {\r\n /**\r\n * The name of the key-value store.\r\n */\r\n name(): string;\r\n /**\r\n * Empties the key-value store completely.\r\n */\r\n clear(cb: (e?: ApiError) => void): void;\r\n /**\r\n * Begins a read-write transaction.\r\n */\r\n beginTransaction(type: 'readwrite'): AsyncKeyValueRWTransaction;\r\n /**\r\n * Begins a read-only transaction.\r\n */\r\n beginTransaction(type: 'readonly'): AsyncKeyValueROTransaction;\r\n beginTransaction(type: string): AsyncKeyValueROTransaction;\r\n}\r\n\r\n/**\r\n * Represents an asynchronous read-only transaction.\r\n */\r\nexport interface AsyncKeyValueROTransaction {\r\n /**\r\n * Retrieves the data at the given key.\r\n * @param key The key to look under for data.\r\n */\r\n get(key: string, cb: (e: ApiError, data?: NodeBuffer) => void): void;\r\n}\r\n\r\n/**\r\n * Represents an asynchronous read-write transaction.\r\n */\r\nexport interface AsyncKeyValueRWTransaction extends AsyncKeyValueROTransaction {\r\n /**\r\n * Adds the data to the store under the given key. Overwrites any existing\r\n * data.\r\n * @param key The key to add the data under.\r\n * @param data The data to add to the store.\r\n * @param overwrite If 'true', overwrite any existing data. If 'false',\r\n * avoids writing the data if the key exists.\r\n * @param cb Triggered with an error and whether or not the value was\r\n * committed.\r\n */\r\n put(key: string, data: NodeBuffer, overwrite: boolean, cb: (e: ApiError,\r\n committed?: boolean) => void): void;\r\n /**\r\n * Deletes the data at the given key.\r\n * @param key The key to delete from the store.\r\n */\r\n del(key: string, cb: (e?: ApiError) => void): void;\r\n /**\r\n * Commits the transaction.\r\n */\r\n commit(cb: (e?: ApiError) => void): void;\r\n /**\r\n * Aborts and rolls back the transaction.\r\n */\r\n abort(cb: (e?: ApiError) => void): void;\r\n}\r\n\r\nexport class AsyncKeyValueFile extends preload_file.PreloadFile<AsyncKeyValueFileSystem> implements file.File {\r\n constructor(_fs: AsyncKeyValueFileSystem, _path: string, _flag: file_flag.FileFlag, _stat: Stats, contents?: NodeBuffer) {\r\n super(_fs, _path, _flag, _stat, contents);\r\n }\r\n\r\n public sync(cb: (e?: ApiError) => void): void {\r\n if (this.isDirty()) {\r\n this._fs._sync(this.getPath(), this.getBuffer(), this.getStats(), (e?: ApiError) => {\r\n if (!e) {\r\n this.resetDirty();\r\n }\r\n cb(e);\r\n });\r\n } else {\r\n cb();\r\n }\r\n }\r\n\r\n public close(cb: (e?: ApiError) => void): void {\r\n this.sync(cb);\r\n }\r\n}\r\n\r\n/**\r\n * An \"Asynchronous key-value file system\". Stores data to/retrieves data from\r\n * an underlying asynchronous key-value store.\r\n */\r\nexport class AsyncKeyValueFileSystem extends file_system.BaseFileSystem {\r\n private store: AsyncKeyValueStore;\r\n\r\n /**\r\n * Initializes the file system. Typically called by subclasses' async\r\n * constructors.\r\n */\r\n public init(store: AsyncKeyValueStore, cb: (e?: ApiError) => void) {\r\n this.store = store;\r\n // INVARIANT: Ensure that the root exists.\r\n this.makeRootDirectory(cb);\r\n }\r\n\r\n public static isAvailable(): boolean { return true; }\r\n public getName(): string { return this.store.name(); }\r\n public isReadOnly(): boolean { return false; }\r\n public supportsSymlinks(): boolean { return false; }\r\n public supportsProps(): boolean { return false; }\r\n public supportsSynch(): boolean { return false; }\r\n\r\n /**\r\n * Checks if the root directory exists. Creates it if it doesn't.\r\n */\r\n private makeRootDirectory(cb: (e?: ApiError) => void) {\r\n var tx = this.store.beginTransaction('readwrite');\r\n tx.get(ROOT_NODE_ID, (e: ApiError, data?: NodeBuffer) => {\r\n if (e || data === undefined) {\r\n // Create new inode.\r\n var currTime = (new Date()).getTime(),\r\n // Mode 0666\r\n dirInode = new Inode(GenerateRandomID(), 4096, 511 | FileType.DIRECTORY, currTime, currTime, currTime);\r\n // If the root doesn't exist, the first random ID shouldn't exist,\r\n // either.\r\n tx.put(dirInode.id, new Buffer(\"{}\"), false, (e?: ApiError) => {\r\n if (noErrorTx(e, tx, cb)) {\r\n tx.put(ROOT_NODE_ID, dirInode.toBuffer(), false, (e?: ApiError) => {\r\n if (e) {\r\n tx.abort(() => { cb(e); });\r\n } else {\r\n tx.commit(cb);\r\n }\r\n });\r\n }\r\n });\r\n } else {\r\n // We're good.\r\n tx.commit(cb);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Helper function for findINode.\r\n * @param parent The parent directory of the file we are attempting to find.\r\n * @param filename The filename of the inode we are attempting to find, minus\r\n * the parent.\r\n * @param cb Passed an error or the ID of the file's inode in the file system.\r\n */\r\n private _findINode(tx: AsyncKeyValueROTransaction, parent: string, filename: string, cb: (e: ApiError, id?: string) => void): void {\r\n var handle_directory_listings = (e: ApiError, inode?: Inode, dirList?: {[name: string]: string}): void => {\r\n if (e) {\r\n cb(e)\r\n } else if (dirList[filename]) {\r\n cb(null, dirList[filename]);\r\n } else {\r\n cb(ApiError.ENOENT(path.resolve(parent, filename)));\r\n }\r\n };\r\n\r\n if (parent === '/') {\r\n if (filename === '') {\r\n // BASE CASE #1: Return the root's ID.\r\n cb(null, ROOT_NODE_ID);\r\n } else {\r\n // BASE CASE #2: Find the item in the root node.\r\n this.getINode(tx, parent, ROOT_NODE_ID, (e: ApiError, inode?: Inode): void => {\r\n if (noError(e, cb)) {\r\n this.getDirListing(tx, parent, inode, (e: ApiError, dirList?: {[name: string]: string}): void => {\r\n // handle_directory_listings will handle e for us.\r\n handle_directory_listings(e, inode, dirList);\r\n });\r\n }\r\n });\r\n }\r\n } else {\r\n // Get the parent directory's INode, and find the file in its directory\r\n // listing.\r\n this.findINodeAndDirListing(tx, parent, handle_directory_listings);\r\n }\r\n }\r\n\r\n /**\r\n * Finds the Inode of the given path.\r\n * @param p The path to look up.\r\n * @param cb Passed an error or the Inode of the path p.\r\n * @todo memoize/cache\r\n */\r\n private findINode(tx: AsyncKeyValueROTransaction, p: string, cb: (e: ApiError, inode?: Inode) => void): void {\r\n this._findINode(tx, path.dirname(p), path.basename(p), (e: ApiError, id?: string): void => {\r\n if (noError(e, cb)) {\r\n this.getINode(tx, p, id, cb);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Given the ID of a node, retrieves the corresponding Inode.\r\n * @param tx The transaction to use.\r\n * @param p The corresponding path to the file (used for error messages).\r\n * @param id The ID to look up.\r\n * @param cb Passed an error or the inode under the given id.\r\n */\r\n private getINode(tx: AsyncKeyValueROTransaction, p: string, id: string, cb: (e: ApiError, inode?: Inode) => void): void {\r\n tx.get(id, (e: ApiError, data?: NodeBuffer): void => {\r\n if (noError(e, cb)) {\r\n if (data === undefined) {\r\n cb(ApiError.ENOENT(p));\r\n } else {\r\n cb(null, Inode.fromBuffer(data));\r\n }\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Given the Inode of a directory, retrieves the corresponding directory\r\n * listing.\r\n */\r\n private getDirListing(tx: AsyncKeyValueROTransaction, p: string, inode: Inode, cb: (e: ApiError, listing?: { [fileName: string]: string }) => void): void {\r\n if (!inode.isDirectory()) {\r\n cb(ApiError.ENOTDIR(p));\r\n } else {\r\n tx.get(inode.id, (e: ApiError, data?: NodeBuffer): void => {\r\n if (noError(e, cb)) {\r\n try {\r\n cb(null, JSON.parse(data.toString()));\r\n } catch (e) {\r\n // Occurs when data is undefined, or corresponds to something other\r\n // than a directory listing. The latter should never occur unless\r\n // the file system is corrupted.\r\n cb(ApiError.ENOENT(p));\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Given a path to a directory, retrieves the corresponding INode and\r\n * directory listing.\r\n */\r\n private findINodeAndDirListing(tx: AsyncKeyValueROTransaction, p: string, cb: (e: ApiError, inode?: Inode, listing?: { [fileName: string]: string }) => void): void {\r\n this.findINode(tx, p, (e: ApiError, inode?: Inode): void => {\r\n if (noError(e, cb)) {\r\n this.getDirListing(tx, p, inode, (e, listing?) => {\r\n if (noError(e, cb)) {\r\n cb(null, inode, listing);\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Adds a new node under a random ID. Retries 5 times before giving up in\r\n * the exceedingly unlikely chance that we try to reuse a random GUID.\r\n * @param cb Passed an error or the GUID that the data was stored under.\r\n */\r\n private addNewNode(tx: AsyncKeyValueRWTransaction, data: NodeBuffer, cb: (e: ApiError, guid?: string) => void): void {\r\n var retries = 0, currId: string,\r\n reroll = () => {\r\n if (++retries === 5) {\r\n // Max retries hit. Return with an error.\r\n cb(new ApiError(ErrorCode.EIO, 'Unable to commit data to key-value store.'));\r\n } else {\r\n // Try again.\r\n currId = GenerateRandomID();\r\n tx.put(currId, data, false, (e: ApiError, committed?: boolean) => {\r\n if (e || !committed) {\r\n reroll();\r\n } else {\r\n // Successfully stored under 'currId'.\r\n cb(null, currId);\r\n }\r\n });\r\n }\r\n };\r\n reroll();\r\n }\r\n\r\n /**\r\n * Commits a new file (well, a FILE or a DIRECTORY) to the file system with\r\n * the given mode.\r\n * Note: This will commit the transaction.\r\n * @param p The path to the new file.\r\n * @param type The type of the new file.\r\n * @param mode The mode to create the new file with.\r\n * @param data The data to store at the file's data node.\r\n * @param cb Passed an error or the Inode for the new file.\r\n */\r\n private commitNewFile(tx: AsyncKeyValueRWTransaction, p: string, type: FileType, mode: number, data: NodeBuffer, cb: (e: ApiError, inode?: Inode) => void): void {\r\n var parentDir = path.dirname(p),\r\n fname = path.basename(p),\r\n currTime = (new Date()).getTime();\r\n\r\n // Invariant: The root always exists.\r\n // If we don't check this prior to taking steps below, we will create a\r\n // file with name '' in root should p == '/'.\r\n if (p === '/') {\r\n return cb(ApiError.EEXIST(p));\r\n }\r\n\r\n // Let's build a pyramid of code!\r\n\r\n // Step 1: Get the parent directory's inode and directory listing\r\n this.findINodeAndDirListing(tx, parentDir, (e: ApiError, parentNode?: Inode, dirListing?: {[name: string]: string}): void => {\r\n if (noErrorTx(e, tx, cb)) {\r\n if (dirListing[fname]) {\r\n // File already exists.\r\n tx.abort(() => {\r\n cb(ApiError.EEXIST(p));\r\n });\r\n } else {\r\n // Step 2: Commit data to store.\r\n this.addNewNode(tx, data, (e: ApiError, dataId?: string): void => {\r\n if (noErrorTx(e, tx, cb)) {\r\n // Step 3: Commit the file's inode to the store.\r\n var fileInode = new Inode(dataId, data.length, mode | type, currTime, currTime, currTime);\r\n this.addNewNode(tx, fileInode.toBuffer(), (e: ApiError, fileInodeId?: string): void => {\r\n if (noErrorTx(e, tx, cb)) {\r\n // Step 4: Update parent directory's listing.\r\n dirListing[fname] = fileInodeId;\r\n tx.put(parentNode.id, new Buffer(JSON.stringify(dirListing)), true, (e: ApiError): void => {\r\n if (noErrorTx(e, tx, cb)) {\r\n // Step 5: Commit and return the new inode.\r\n tx.commit((e?: ApiError): void => {\r\n if (noErrorTx(e, tx, cb)) {\r\n cb(null, fileInode);\r\n }\r\n });\r\n }\r\n });\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Delete all contents stored in the file system.\r\n */\r\n public empty(cb: (e?: ApiError) => void): void {\r\n this.store.clear((e?) => {\r\n if (noError(e, cb)) {\r\n // INVARIANT: Root always exists.\r\n this.makeRootDirectory(cb);\r\n }\r\n });\r\n }\r\n\r\n public rename(oldPath: string, newPath: string, cb: (e?: ApiError) => void): void {\r\n var tx = this.store.beginTransaction('readwrite'),\r\n oldParent = path.dirname(oldPath), oldName = path.basename(oldPath),\r\n newParent = path.dirname(newPath), newName = path.basename(newPath),\r\n inodes: { [path: string]: Inode } = {},\r\n lists: {\r\n [path: string]: { [file: string]: string }\r\n } = {},\r\n errorOccurred: boolean = false;\r\n\r\n // Invariant: Can't move a folder inside itself.\r\n // This funny little hack ensures that the check passes only if oldPath\r\n // is a subpath of newParent. We append '/' to avoid matching folders that\r\n // are a substring of the bottom-most folder in the path.\r\n if ((newParent + '/').indexOf(oldPath + '/') === 0) {\r\n return cb(new ApiError(ErrorCode.EBUSY, oldParent));\r\n }\r\n\r\n /**\r\n * Responsible for Phase 2 of the rename operation: Modifying and\r\n * committing the directory listings. Called once we have successfully\r\n * retrieved both the old and new parent's inodes and listings.\r\n */\r\n var theOleSwitcharoo = (): void => {\r\n // Sanity check: Ensure both paths are present, and no error has occurred.\r\n if (errorOccurred || !lists.hasOwnProperty(oldParent) || !lists.hasOwnProperty(newParent)) {\r\n return;\r\n }\r\n var oldParentList = lists[oldParent], oldParentINode = inodes[oldParent],\r\n newParentList = lists[newParent], newParentINode = inodes[newParent];\r\n\r\n // Delete file from old parent.\r\n if (!oldParentList[oldName]) {\r\n cb(ApiError.ENOENT(oldPath));\r\n } else {\r\n var fileId = oldParentList[oldName];\r\n delete oldParentList[oldName];\r\n\r\n // Finishes off the renaming process by adding the file to the new\r\n // parent.\r\n var completeRename = () => {\r\n newParentList[newName] = fileId;\r\n // Commit old parent's list.\r\n tx.put(oldParentINode.id, new Buffer(JSON.stringify(oldParentList)), true, (e: ApiError) => {\r\n if (noErrorTx(e, tx, cb)) {\r\n if (oldParent === newParent) {\r\n // DONE!\r\n tx.commit(cb);\r\n } else {\r\n // Commit new parent's list.\r\n tx.put(newParentINode.id, new Buffer(JSON.stringify(newParentList)), true, (e: ApiError) => {\r\n if (noErrorTx(e, tx, cb)) {\r\n tx.commit(cb);\r\n }\r\n });\r\n }\r\n }\r\n });\r\n };\r\n\r\n if (newParentList[newName]) {\r\n // 'newPath' already exists. Check if it's a file or a directory, and\r\n // act accordingly.\r\n this.getINode(tx, newPath, newParentList[newName], (e: ApiError, inode?: Inode) => {\r\n if (noErrorTx(e, tx, cb)) {\r\n if (inode.isFile()) {\r\n // Delete the file and continue.\r\n tx.del(inode.id, (e?: ApiError) => {\r\n if (noErrorTx(e, tx, cb)) {\r\n tx.del(newParentList[newName], (e?: ApiError) => {\r\n if (noErrorTx(e, tx, cb)) {\r\n completeRename();\r\n }\r\n });\r\n }\r\n });\r\n } else {\r\n // Can't overwrite a directory using rename.\r\n tx.abort((e?) => {\r\n cb(ApiError.EPERM(newPath));\r\n });\r\n }\r\n }\r\n });\r\n } else {\r\n completeRename();\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Grabs a path's inode and directory listing, and shoves it into the\r\n * inodes and lists hashes.\r\n */\r\n var processInodeAndListings = (p: string): void => {\r\n this.findINodeAndDirListing(tx, p, (e: ApiError, node?: Inode, dirList?: {[name: string]: string}): void => {\r\n if (e) {\r\n if (!errorOccurred) {\r\n errorOccurred = true;\r\n tx.abort(() => {\r\n cb(e);\r\n });\r\n }\r\n // If error has occurred already, just stop here.\r\n } else {\r\n inodes[p] = node;\r\n lists[p] = dirList;\r\n theOleSwitcharoo();\r\n }\r\n });\r\n };\r\n\r\n processInodeAndListings(oldParent);\r\n if (oldParent !== newParent) {\r\n processInodeAndListings(newParent);\r\n }\r\n }\r\n\r\n public stat(p: string, isLstat: boolean, cb: (err: ApiError, stat?: Stats) => void): void {\r\n var tx = this.store.beginTransaction('readonly');\r\n this.findINode(tx, p, (e: ApiError, inode?: Inode): void => {\r\n if (noError(e, cb)) {\r\n cb(null, inode.toStats());\r\n }\r\n });\r\n }\r\n\r\n public createFile(p: string, flag: file_flag.FileFlag, mode: number, cb: (e: ApiError, file?: file.File) => void): void {\r\n var tx = this.store.beginTransaction('readwrite'),\r\n data = new Buffer(0);\r\n\r\n this.commitNewFile(tx, p, FileType.FILE, mode, data, (e: ApiError, newFile?: Inode): void => {\r\n if (noError(e, cb)) {\r\n cb(null, new AsyncKeyValueFile(this, p, flag, newFile.toStats(), data));\r\n }\r\n });\r\n }\r\n\r\n public openFile(p: string, flag: file_flag.FileFlag, cb: (e: ApiError, file?: file.File) => void): void {\r\n var tx = this.store.beginTransaction('readonly');\r\n // Step 1: Grab the file's inode.\r\n this.findINode(tx, p, (e: ApiError, inode?: Inode) => {\r\n if (noError(e, cb)) {\r\n // Step 2: Grab the file's data.\r\n tx.get(inode.id, (e: ApiError, data?: NodeBuffer): void => {\r\n if (noError(e, cb)) {\r\n if (data === undefined) {\r\n cb(ApiError.ENOENT(p));\r\n } else {\r\n cb(null, new AsyncKeyValueFile(this, p, flag, inode.toStats(), data));\r\n }\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Remove all traces of the given path from the file system.\r\n * @param p The path to remove from the file system.\r\n * @param isDir Does the path belong to a directory, or a file?\r\n * @todo Update mtime.\r\n */\r\n private removeEntry(p: string, isDir: boolean, cb: (e?: ApiError) => void): void {\r\n var tx = this.store.beginTransaction('readwrite'),\r\n parent: string = path.dirname(p), fileName: string = path.basename(p);\r\n // Step 1: Get parent directory's node and directory listing.\r\n this.findINodeAndDirListing(tx, parent, (e: ApiError, parentNode?: Inode, parentListing?: {[name: string]: string}): void => {\r\n if (noErrorTx(e, tx, cb)) {\r\n if (!parentListing[fileName]) {\r\n tx.abort(() => {\r\n cb(ApiError.ENOENT(p));\r\n });\r\n } else {\r\n // Remove from directory listing of parent.\r\n var fileNodeId = parentListing[fileName];\r\n delete parentListing[fileName];\r\n // Step 2: Get file inode.\r\n this.getINode(tx, p, fileNodeId, (e: ApiError, fileNode?: Inode): void => {\r\n if (noErrorTx(e, tx, cb)) {\r\n if (!isDir && fileNode.isDirectory()) {\r\n tx.abort(() => {\r\n cb(ApiError.EISDIR(p));\r\n });\r\n } else if (isDir && !fileNode.isDirectory()) {\r\n tx.abort(() => {\r\n cb(ApiError.ENOTDIR(p));\r\n });\r\n } else {\r\n // Step 3: Delete data.\r\n tx.del(fileNode.id, (e?: ApiError): void => {\r\n if (noErrorTx(e, tx, cb)) {\r\n // Step 4: Delete node.\r\n tx.del(fileNodeId, (e?: ApiError): void => {\r\n if (noErrorTx(e, tx, cb)) {\r\n // Step 5: Update directory listing.\r\n tx.put(parentNode.id, new Buffer(JSON.stringify(parentListing)), true, (e: ApiError): void => {\r\n if (noErrorTx(e, tx, cb)) {\r\n tx.commit(cb);\r\n }\r\n });\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n });\r\n }\r\n }\r\n });\r\n }\r\n\r\n public unlink(p: string, cb: (e?: ApiError) => void): void {\r\n this.removeEntry(p, false, cb);\r\n }\r\n\r\n public rmdir(p: string, cb: (e?: ApiError) => void): void {\r\n // Check first if directory is empty.\r\n this.readdir(p, (err, files?) => {\r\n if (err) {\r\n cb(err);\r\n } else if (files.length > 0) {\r\n cb(ApiError.ENOTEMPTY(p));\r\n } else {\r\n this.removeEntry(p, true, cb);\r\n }\r\n });\r\n }\r\n\r\n public mkdir(p: string, mode: number, cb: (e?: ApiError) => void): void {\r\n var tx = this.store.beginTransaction('readwrite'),\r\n data = new Buffer('{}');\r\n this.commitNewFile(tx, p, FileType.DIRECTORY, mode, data, cb);\r\n }\r\n\r\n public readdir(p: string, cb: (err: ApiError, files?: string[]) => void): void {\r\n var tx = this.store.beginTransaction('readonly');\r\n this.findINode(tx, p, (e: ApiError, inode?: Inode) => {\r\n if (noError(e, cb)) {\r\n this.getDirListing(tx, p, inode, (e: ApiError, dirListing?: {[name: string]: string}) => {\r\n if (noError(e, cb)) {\r\n cb(null, Object.keys(dirListing));\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n public _sync(p: string, data: NodeBuffer, stats: Stats, cb: (e?: ApiError) => void): void {\r\n // @todo Ensure mtime updates properly, and use that to determine if a data\r\n // update is required.\r\n var tx = this.store.beginTransaction('readwrite');\r\n // Step 1: Get the file node's ID.\r\n this._findINode(tx, path.dirname(p), path.basename(p), (e: ApiError, fileInodeId?: string): void => {\r\n if (noErrorTx(e, tx, cb)) {\r\n // Step 2: Get the file inode.\r\n this.getINode(tx, p, fileInodeId, (e: ApiError, fileInode?: Inode): void => {\r\n if (noErrorTx(e, tx, cb)) {\r\n var inodeChanged: boolean = fileInode.update(stats);\r\n // Step 3: Sync the data.\r\n tx.put(fileInode.id, data, true, (e: ApiError): void => {\r\n if (noErrorTx(e, tx, cb)) {\r\n // Step 4: Sync the metadata (if it changed)!\r\n if (inodeChanged) {\r\n tx.put(fileInodeId, fileInode.toBuffer(), true, (e: ApiError): void => {\r\n if (noErrorTx(e, tx, cb)) {\r\n tx.commit(cb);\r\n }\r\n });\r\n } else {\r\n // No need to sync metadata; return.\r\n tx.commit(cb);\r\n }\r\n }\r\n });\r\n }\r\n });\r\n }\r\n });\r\n }\r\n}\r\n",
|
||
"import file = require('../core/file');\r\nimport file_system = require('../core/file_system');\r\nimport Stats from '../core/node_fs_stats';\r\nimport {FileFlag} from '../core/file_flag';\r\nimport {ApiError, ErrorCode} from '../core/api_error';\r\nimport fs = require('../core/node_fs');\r\n\r\n/**\r\n * An implementation of the File interface that operates on a file that is\r\n * completely in-memory. PreloadFiles are backed by a Buffer.\r\n *\r\n * This is also an abstract class, as it lacks an implementation of 'sync' and\r\n * 'close'. Each filesystem that wishes to use this file representation must\r\n * extend this class and implement those two methods.\r\n * @todo 'close' lever that disables functionality once closed.\r\n */\r\nexport class PreloadFile<T extends file_system.FileSystem> extends file.BaseFile {\r\n private _pos: number = 0;\r\n private _path: string;\r\n protected _fs: T;\r\n private _stat: Stats;\r\n private _flag: FileFlag;\r\n private _buffer: NodeBuffer;\r\n private _dirty: boolean = false;\r\n /**\r\n * Creates a file with the given path and, optionally, the given contents. Note\r\n * that, if contents is specified, it will be mutated by the file!\r\n * @param [BrowserFS.FileSystem] _fs The file system that created the file.\r\n * @param [String] _path\r\n * @param [BrowserFS.FileMode] _mode The mode that the file was opened using.\r\n * Dictates permissions and where the file pointer starts.\r\n * @param [BrowserFS.node.fs.Stats] _stat The stats object for the given file.\r\n * PreloadFile will mutate this object. Note that this object must contain\r\n * the appropriate mode that the file was opened as.\r\n * @param [BrowserFS.node.Buffer?] contents A buffer containing the entire\r\n * contents of the file. PreloadFile will mutate this buffer. If not\r\n * specified, we assume it is a new file.\r\n */\r\n constructor(_fs: T, _path: string, _flag: FileFlag, _stat: Stats, contents?: NodeBuffer) {\r\n super();\r\n this._fs = _fs;\r\n this._path = _path;\r\n this._flag = _flag;\r\n this._stat = _stat;\r\n if (contents != null) {\r\n this._buffer = contents;\r\n } else {\r\n // Empty buffer. It'll expand once we write stuff to it.\r\n this._buffer = new Buffer(0);\r\n }\r\n // Note: This invariant is *not* maintained once the file starts getting\r\n // modified.\r\n // Note: Only actually matters if file is readable, as writeable modes may\r\n // truncate/append to file.\r\n if (this._stat.size !== this._buffer.length && this._flag.isReadable()) {\r\n throw new Error(\"Invalid buffer: Buffer is \" + this._buffer.length + \" long, yet Stats object specifies that file is \" + this._stat.size + \" long.\");\r\n }\r\n }\r\n\r\n protected isDirty(): boolean {\r\n return this._dirty;\r\n }\r\n\r\n /**\r\n * Resets the dirty bit. Should only be called after a sync has completed successfully.\r\n */\r\n protected resetDirty() {\r\n this._dirty = false;\r\n }\r\n\r\n /**\r\n * NONSTANDARD: Get the underlying buffer for this file. !!DO NOT MUTATE!! Will mess up dirty tracking.\r\n */\r\n public getBuffer(): NodeBuffer {\r\n return this._buffer;\r\n }\r\n\r\n /**\r\n * NONSTANDARD: Get underlying stats for this file. !!DO NOT MUTATE!!\r\n */\r\n public getStats(): Stats {\r\n return this._stat;\r\n }\r\n\r\n public getFlag(): FileFlag {\r\n return this._flag;\r\n }\r\n\r\n /**\r\n * Get the path to this file.\r\n * @return [String] The path to the file.\r\n */\r\n public getPath(): string {\r\n return this._path;\r\n }\r\n\r\n /**\r\n * Get the current file position.\r\n *\r\n * We emulate the following bug mentioned in the Node documentation:\r\n * > On Linux, positional writes don't work when the file is opened in append\r\n * mode. The kernel ignores the position argument and always appends the data\r\n * to the end of the file.\r\n * @return [Number] The current file position.\r\n */\r\n public getPos(): number {\r\n if (this._flag.isAppendable()) {\r\n return this._stat.size;\r\n }\r\n return this._pos;\r\n }\r\n\r\n /**\r\n * Advance the current file position by the indicated number of positions.\r\n * @param [Number] delta\r\n */\r\n public advancePos(delta: number): number {\r\n return this._pos += delta;\r\n }\r\n\r\n /**\r\n * Set the file position.\r\n * @param [Number] newPos\r\n */\r\n public setPos(newPos: number): number {\r\n return this._pos = newPos;\r\n }\r\n\r\n /**\r\n * **Core**: Asynchronous sync. Must be implemented by subclasses of this\r\n * class.\r\n * @param [Function(BrowserFS.ApiError)] cb\r\n */\r\n public sync(cb: (e?: ApiError) => void): void {\r\n try {\r\n this.syncSync();\r\n cb();\r\n } catch (e) {\r\n cb(e);\r\n }\r\n }\r\n\r\n /**\r\n * **Core**: Synchronous sync.\r\n */\r\n public syncSync(): void {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n\r\n /**\r\n * **Core**: Asynchronous close. Must be implemented by subclasses of this\r\n * class.\r\n * @param [Function(BrowserFS.ApiError)] cb\r\n */\r\n public close(cb: (e?: ApiError) => void): void {\r\n try {\r\n this.closeSync();\r\n cb();\r\n } catch (e) {\r\n cb(e);\r\n }\r\n }\r\n\r\n /**\r\n * **Core**: Synchronous close.\r\n */\r\n public closeSync(): void {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n\r\n /**\r\n * Asynchronous `stat`.\r\n * @param [Function(BrowserFS.ApiError, BrowserFS.node.fs.Stats)] cb\r\n */\r\n public stat(cb: (e: ApiError, stat?: Stats) => void): void {\r\n try {\r\n cb(null, this._stat.clone());\r\n } catch (e) {\r\n cb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous `stat`.\r\n */\r\n public statSync(): Stats {\r\n return this._stat.clone();\r\n }\r\n\r\n /**\r\n * Asynchronous truncate.\r\n * @param [Number] len\r\n * @param [Function(BrowserFS.ApiError)] cb\r\n */\r\n public truncate(len: number, cb: (e?: ApiError) => void): void {\r\n try {\r\n this.truncateSync(len);\r\n if (this._flag.isSynchronous() && !fs.getRootFS().supportsSynch()) {\r\n this.sync(cb);\r\n }\r\n cb();\r\n } catch (e) {\r\n return cb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Synchronous truncate.\r\n * @param [Number] len\r\n */\r\n public truncateSync(len: number): void {\r\n this._dirty = true;\r\n if (!this._flag.isWriteable()) {\r\n throw new ApiError(ErrorCode.EPERM, 'File not opened with a writeable mode.');\r\n }\r\n this._stat.mtime = new Date();\r\n if (len > this._buffer.length) {\r\n var buf = new Buffer(len - this._buffer.length);\r\n buf.fill(0);\r\n // Write will set @_stat.size for us.\r\n this.writeSync(buf, 0, buf.length, this._buffer.length);\r\n if (this._flag.isSynchronous() && fs.getRootFS().supportsSynch()) {\r\n this.syncSync();\r\n }\r\n return;\r\n }\r\n this._stat.size = len;\r\n // Truncate buffer to 'len'.\r\n var newBuff = new Buffer(len);\r\n this._buffer.copy(newBuff, 0, 0, len);\r\n this._buffer = newBuff;\r\n if (this._flag.isSynchronous() && fs.getRootFS().supportsSynch()) {\r\n this.syncSync();\r\n }\r\n }\r\n\r\n /**\r\n * Write buffer to the file.\r\n * Note that it is unsafe to use fs.write multiple times on the same file\r\n * without waiting for the callback.\r\n * @param [BrowserFS.node.Buffer] buffer Buffer containing the data to write to\r\n * the file.\r\n * @param [Number] offset Offset in the buffer to start reading data from.\r\n * @param [Number] length The amount of bytes to write to the file.\r\n * @param [Number] position Offset from the beginning of the file where this\r\n * data should be written. If position is null, the data will be written at\r\n * the current position.\r\n * @param [Function(BrowserFS.ApiError, Number, BrowserFS.node.Buffer)]\r\n * cb The number specifies the number of bytes written into the file.\r\n */\r\n public write(buffer: NodeBuffer, offset: number, length: number, position: number, cb: (e: ApiError, len?: number, buff?: NodeBuffer) => void): void {\r\n try {\r\n cb(null, this.writeSync(buffer, offset, length, position), buffer);\r\n } catch (e) {\r\n cb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Write buffer to the file.\r\n * Note that it is unsafe to use fs.writeSync multiple times on the same file\r\n * without waiting for the callback.\r\n * @param [BrowserFS.node.Buffer] buffer Buffer containing the data to write to\r\n * the file.\r\n * @param [Number] offset Offset in the buffer to start reading data from.\r\n * @param [Number] length The amount of bytes to write to the file.\r\n * @param [Number] position Offset from the beginning of the file where this\r\n * data should be written. If position is null, the data will be written at\r\n * the current position.\r\n * @return [Number]\r\n */\r\n public writeSync(buffer: NodeBuffer, offset: number, length: number, position: number): number {\r\n this._dirty = true;\r\n if (position == null) {\r\n position = this.getPos();\r\n }\r\n if (!this._flag.isWriteable()) {\r\n throw new ApiError(ErrorCode.EPERM, 'File not opened with a writeable mode.');\r\n }\r\n var endFp = position + length;\r\n if (endFp > this._stat.size) {\r\n this._stat.size = endFp;\r\n if (endFp > this._buffer.length) {\r\n // Extend the buffer!\r\n var newBuff = new Buffer(endFp);\r\n this._buffer.copy(newBuff);\r\n this._buffer = newBuff;\r\n }\r\n }\r\n var len = buffer.copy(this._buffer, position, offset, offset + length);\r\n this._stat.mtime = new Date();\r\n if (this._flag.isSynchronous()) {\r\n this.syncSync();\r\n return len;\r\n }\r\n this.setPos(position + len);\r\n return len;\r\n }\r\n\r\n /**\r\n * Read data from the file.\r\n * @param [BrowserFS.node.Buffer] buffer The buffer that the data will be\r\n * written to.\r\n * @param [Number] offset The offset within the buffer where writing will\r\n * start.\r\n * @param [Number] length An integer specifying the number of bytes to read.\r\n * @param [Number] position An integer specifying where to begin reading from\r\n * in the file. If position is null, data will be read from the current file\r\n * position.\r\n * @param [Function(BrowserFS.ApiError, Number, BrowserFS.node.Buffer)] cb The\r\n * number is the number of bytes read\r\n */\r\n public read(buffer: NodeBuffer, offset: number, length: number, position: number, cb: (e: ApiError, len?: number, buff?: NodeBuffer) => void): void {\r\n try {\r\n cb(null, this.readSync(buffer, offset, length, position), buffer);\r\n } catch (e) {\r\n cb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Read data from the file.\r\n * @param [BrowserFS.node.Buffer] buffer The buffer that the data will be\r\n * written to.\r\n * @param [Number] offset The offset within the buffer where writing will\r\n * start.\r\n * @param [Number] length An integer specifying the number of bytes to read.\r\n * @param [Number] position An integer specifying where to begin reading from\r\n * in the file. If position is null, data will be read from the current file\r\n * position.\r\n * @return [Number]\r\n */\r\n public readSync(buffer: NodeBuffer, offset: number, length: number, position: number): number {\r\n if (!this._flag.isReadable()) {\r\n throw new ApiError(ErrorCode.EPERM, 'File not opened with a readable mode.');\r\n }\r\n if (position == null) {\r\n position = this.getPos();\r\n }\r\n var endRead = position + length;\r\n if (endRead > this._stat.size) {\r\n length = this._stat.size - position;\r\n }\r\n var rv = this._buffer.copy(buffer, offset, position, position + length);\r\n this._stat.atime = new Date();\r\n this._pos = position + length;\r\n return rv;\r\n }\r\n\r\n /**\r\n * Asynchronous `fchmod`.\r\n * @param [Number|String] mode\r\n * @param [Function(BrowserFS.ApiError)] cb\r\n */\r\n public chmod(mode: number, cb: (e?: ApiError) => void): void {\r\n try {\r\n this.chmodSync(mode);\r\n cb();\r\n } catch (e) {\r\n cb(e);\r\n }\r\n }\r\n\r\n /**\r\n * Asynchronous `fchmod`.\r\n * @param [Number] mode\r\n */\r\n public chmodSync(mode: number): void {\r\n if (!this._fs.supportsProps()) {\r\n throw new ApiError(ErrorCode.ENOTSUP);\r\n }\r\n this._dirty = true;\r\n this._stat.chmod(mode);\r\n this.syncSync();\r\n }\r\n}\r\n\r\n/**\r\n * File class for the InMemory and XHR file systems.\r\n * Doesn't sync to anything, so it works nicely for memory-only files.\r\n */\r\nexport class NoSyncFile<T extends file_system.FileSystem> extends PreloadFile<T> implements file.File {\r\n constructor(_fs: T, _path: string, _flag: FileFlag, _stat: Stats, contents?: NodeBuffer) {\r\n super(_fs, _path, _flag, _stat, contents);\r\n }\r\n /**\r\n * Asynchronous sync. Doesn't do anything, simply calls the cb.\r\n * @param [Function(BrowserFS.ApiError)] cb\r\n */\r\n public sync(cb: (e?: ApiError) => void): void {\r\n cb();\r\n }\r\n /**\r\n * Synchronous sync. Doesn't do anything.\r\n */\r\n public syncSync(): void {}\r\n /**\r\n * Asynchronous close. Doesn't do anything, simply calls the cb.\r\n * @param [Function(BrowserFS.ApiError)] cb\r\n */\r\n public close(cb: (e?: ApiError) => void): void {\r\n cb();\r\n }\r\n /**\r\n * Synchronous close. Doesn't do anything.\r\n */\r\n public closeSync(): void {}\r\n}\r\n",
|
||
"/**\r\n * Contains utility methods for performing a variety of tasks with\r\n * XmlHttpRequest across browsers.\r\n */\r\n\r\nimport util = require('../core/util');\r\nimport {ApiError, ErrorCode} from '../core/api_error';\r\n\r\n// See core/polyfills for the VBScript definition of these functions.\r\ndeclare var IEBinaryToArray_ByteStr: (vbarr: any) => string;\r\ndeclare var IEBinaryToArray_ByteStr_Last: (vbarr: any) => string;\r\n// Converts 'responseBody' in IE into the equivalent 'responseText' that other\r\n// browsers would generate.\r\nfunction getIEByteArray(IEByteArray: any): number[] {\r\n var rawBytes = IEBinaryToArray_ByteStr(IEByteArray);\r\n var lastChr = IEBinaryToArray_ByteStr_Last(IEByteArray);\r\n var data_str = rawBytes.replace(/[\\s\\S]/g, function(match) {\r\n var v = match.charCodeAt(0)\r\n return String.fromCharCode(v&0xff, v>>8)\r\n }) + lastChr;\r\n var data_array = new Array(data_str.length);\r\n for (var i = 0; i < data_str.length; i++) {\r\n data_array[i] = data_str.charCodeAt(i);\r\n }\r\n return data_array;\r\n}\r\n\r\nfunction downloadFileIE(async: boolean, p: string, type: string, cb: (err: ApiError, data?: any) => void): void {\r\n switch(type) {\r\n case 'buffer':\r\n // Fallthrough\r\n case 'json':\r\n break;\r\n default:\r\n return cb(new ApiError(ErrorCode.EINVAL, \"Invalid download type: \" + type));\r\n }\r\n\r\n var req = new XMLHttpRequest();\r\n req.open('GET', p, async);\r\n req.setRequestHeader(\"Accept-Charset\", \"x-user-defined\");\r\n req.onreadystatechange = function(e) {\r\n var data_array;\r\n if (req.readyState === 4) {\r\n if (req.status === 200) {\r\n switch(type) {\r\n case 'buffer':\r\n data_array = getIEByteArray(req.responseBody);\r\n return cb(null, new Buffer(data_array));\r\n case 'json':\r\n return cb(null, JSON.parse(req.responseText));\r\n }\r\n } else {\r\n return cb(new ApiError(req.status, \"XHR error.\"));\r\n }\r\n }\r\n };\r\n req.send();\r\n}\r\n\r\nfunction asyncDownloadFileIE(p: string, type: 'buffer', cb: (err: ApiError, data?: NodeBuffer) => void): void;\r\nfunction asyncDownloadFileIE(p: string, type: 'json', cb: (err: ApiError, data?: any) => void): void;\r\nfunction asyncDownloadFileIE(p: string, type: string, cb: (err: ApiError, data?: any) => void): void;\r\nfunction asyncDownloadFileIE(p: string, type: string, cb: (err: ApiError, data?: any) => void): void {\r\n downloadFileIE(true, p, type, cb);\r\n}\r\n\r\nfunction syncDownloadFileIE(p: string, type: 'buffer'): NodeBuffer;\r\nfunction syncDownloadFileIE(p: string, type: 'json'): any;\r\nfunction syncDownloadFileIE(p: string, type: string): any;\r\nfunction syncDownloadFileIE(p: string, type: string): any {\r\n var rv;\r\n downloadFileIE(false, p, type, function(err: ApiError, data?: any) {\r\n if (err) throw err;\r\n rv = data;\r\n });\r\n return rv;\r\n}\r\n\r\nfunction asyncDownloadFileModern(p: string, type: 'buffer', cb: (err: ApiError, data?: NodeBuffer) => void): void;\r\nfunction asyncDownloadFileModern(p: string, type: 'json', cb: (err: ApiError, data?: any) => void): void;\r\nfunction asyncDownloadFileModern(p: string, type: string, cb: (err: ApiError, data?: any) => void): void;\r\nfunction asyncDownloadFileModern(p: string, type: string, cb: (err: ApiError, data?: any) => void): void {\r\n var req = new XMLHttpRequest();\r\n req.open('GET', p, true);\r\n var jsonSupported = true;\r\n switch(type) {\r\n case 'buffer':\r\n req.responseType = 'arraybuffer';\r\n break;\r\n case 'json':\r\n // Some browsers don't support the JSON response type.\r\n // They either reset responseType, or throw an exception.\r\n // @see https://github.com/Modernizr/Modernizr/blob/master/src/testXhrType.js\r\n try {\r\n req.responseType = 'json';\r\n jsonSupported = req.responseType === 'json';\r\n } catch (e) {\r\n jsonSupported = false;\r\n }\r\n break;\r\n default:\r\n return cb(new ApiError(ErrorCode.EINVAL, \"Invalid download type: \" + type));\r\n }\r\n req.onreadystatechange = function(e) {\r\n if (req.readyState === 4) {\r\n if (req.status === 200) {\r\n switch(type) {\r\n case 'buffer':\r\n // XXX: WebKit-based browsers return *null* when XHRing an empty file.\r\n return cb(null, new Buffer(req.response ? req.response : 0));\r\n case 'json':\r\n if (jsonSupported) {\r\n return cb(null, req.response);\r\n } else {\r\n return cb(null, JSON.parse(req.responseText));\r\n }\r\n }\r\n } else {\r\n return cb(new ApiError(req.status, \"XHR error.\"));\r\n }\r\n }\r\n };\r\n req.send();\r\n}\r\n\r\nfunction syncDownloadFileModern(p: string, type: 'buffer'): NodeBuffer;\r\nfunction syncDownloadFileModern(p: string, type: 'json'): any;\r\nfunction syncDownloadFileModern(p: string, type: string): any;\r\nfunction syncDownloadFileModern(p: string, type: string): any {\r\n var req = new XMLHttpRequest();\r\n req.open('GET', p, false);\r\n\r\n // On most platforms, we cannot set the responseType of synchronous downloads.\r\n // @todo Test for this; IE10 allows this, as do older versions of Chrome/FF.\r\n var data = null;\r\n var err = null;\r\n // Classic hack to download binary data as a string.\r\n req.overrideMimeType('text/plain; charset=x-user-defined');\r\n req.onreadystatechange = function(e) {\r\n if (req.readyState === 4) {\r\n if (req.status === 200) {\r\n switch(type) {\r\n case 'buffer':\r\n // Convert the text into a buffer.\r\n var text = req.responseText;\r\n data = new Buffer(text.length);\r\n // Throw away the upper bits of each character.\r\n for (var i = 0; i < text.length; i++) {\r\n // This will automatically throw away the upper bit of each\r\n // character for us.\r\n data.writeUInt8(text.charCodeAt(i), i);\r\n }\r\n return;\r\n case 'json':\r\n data = JSON.parse(req.responseText);\r\n return;\r\n }\r\n } else {\r\n err = new ApiError(req.status, \"XHR error.\");\r\n return;\r\n }\r\n }\r\n };\r\n req.send();\r\n if (err) {\r\n throw err;\r\n }\r\n return data;\r\n}\r\n\r\n/**\r\n * IE10 allows us to perform synchronous binary file downloads.\r\n * @todo Feature detect this, as older versions of FF/Chrome do too!\r\n */\r\nfunction syncDownloadFileIE10(p: string, type: 'buffer'): NodeBuffer;\r\nfunction syncDownloadFileIE10(p: string, type: 'json'): any;\r\nfunction syncDownloadFileIE10(p: string, type: string): any;\r\nfunction syncDownloadFileIE10(p: string, type: string): any {\r\n var req = new XMLHttpRequest();\r\n req.open('GET', p, false);\r\n switch(type) {\r\n case 'buffer':\r\n req.responseType = 'arraybuffer';\r\n break;\r\n case 'json':\r\n // IE10 does not support the JSON type.\r\n break;\r\n default:\r\n throw new ApiError(ErrorCode.EINVAL, \"Invalid download type: \" + type);\r\n }\r\n var data;\r\n var err;\r\n req.onreadystatechange = function(e) {\r\n if (req.readyState === 4) {\r\n if (req.status === 200) {\r\n switch(type) {\r\n case 'buffer':\r\n data = new Buffer(req.response);\r\n break;\r\n case 'json':\r\n data = JSON.parse(req.response);\r\n break;\r\n }\r\n } else {\r\n err = new ApiError(req.status, \"XHR error.\");\r\n }\r\n }\r\n };\r\n req.send();\r\n if (err) {\r\n throw err;\r\n }\r\n return data;\r\n}\r\n\r\nfunction getFileSize(async: boolean, p: string, cb: (err: ApiError, size?: number) => void): void {\r\n var req = new XMLHttpRequest();\r\n req.open('HEAD', p, async);\r\n req.onreadystatechange = function(e) {\r\n if (req.readyState === 4) {\r\n if (req.status == 200) {\r\n try {\r\n return cb(null, parseInt(req.getResponseHeader('Content-Length'), 10));\r\n } catch(e) {\r\n // In the event that the header isn't present or there is an error...\r\n return cb(new ApiError(ErrorCode.EIO, \"XHR HEAD error: Could not read content-length.\"));\r\n }\r\n } else {\r\n return cb(new ApiError(req.status, \"XHR HEAD error.\"));\r\n }\r\n }\r\n };\r\n req.send();\r\n}\r\n\r\n/**\r\n * Asynchronously download a file as a buffer or a JSON object.\r\n * Note that the third function signature with a non-specialized type is\r\n * invalid, but TypeScript requires it when you specialize string arguments to\r\n * constants.\r\n */\r\nexport var asyncDownloadFile: {\r\n (p: string, type: 'buffer', cb: (err: ApiError, data?: NodeBuffer) => void): void;\r\n (p: string, type: 'json', cb: (err: ApiError, data?: any) => void): void;\r\n (p: string, type: string, cb: (err: ApiError, data?: any) => void): void;\r\n} = (util.isIE && typeof Blob === 'undefined') ? asyncDownloadFileIE : asyncDownloadFileModern;\r\n\r\n/**\r\n * Synchronously download a file as a buffer or a JSON object.\r\n * Note that the third function signature with a non-specialized type is\r\n * invalid, but TypeScript requires it when you specialize string arguments to\r\n * constants.\r\n */\r\nexport var syncDownloadFile: {\r\n (p: string, type: 'buffer'): NodeBuffer;\r\n (p: string, type: 'json'): any;\r\n (p: string, type: string): any;\r\n} = (util.isIE && typeof Blob === 'undefined') ? syncDownloadFileIE : (util.isIE && typeof Blob !== 'undefined') ? syncDownloadFileIE10 : syncDownloadFileModern;\r\n\r\n/**\r\n * Synchronously retrieves the size of the given file in bytes.\r\n */\r\nexport function getFileSizeSync(p: string): number {\r\n var rv: number;\r\n getFileSize(false, p, function(err: ApiError, size?: number) {\r\n if (err) {\r\n throw err;\r\n }\r\n rv = size;\r\n });\r\n return rv;\r\n}\r\n\r\n/**\r\n * Asynchronously retrieves the size of the given file in bytes.\r\n */\r\nexport function getFileSizeAsync(p: string, cb: (err: ApiError, size?: number) => void): void {\r\n getFileSize(true, p, cb);\r\n}\r\n",
|
||
"/**\r\n * BrowserFS's main entry point.\r\n * It installs all of the needed polyfills, and requires() the main module.\r\n */\r\nimport global = require('./core/global');\r\n\r\n// IE < 9 does not define this function.\r\nif (!Date.now) {\r\n Date.now = function now() {\r\n return new Date().getTime();\r\n };\r\n}\r\n\r\n// IE < 9 does not define this function.\r\nif(!Array.isArray) {\r\n Array.isArray = function (vArg): vArg is any[] {\r\n return Object.prototype.toString.call(vArg) === \"[object Array]\";\r\n };\r\n}\r\n\r\n// IE < 9 does not define this function.\r\n// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys\r\nif (!Object.keys) {\r\n Object.keys = (function () {\r\n 'use strict';\r\n var hasOwnProperty = Object.prototype.hasOwnProperty,\r\n hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),\r\n dontEnums = [\r\n 'toString',\r\n 'toLocaleString',\r\n 'valueOf',\r\n 'hasOwnProperty',\r\n 'isPrototypeOf',\r\n 'propertyIsEnumerable',\r\n 'constructor'\r\n ],\r\n dontEnumsLength = dontEnums.length;\r\n\r\n return function (obj: any) {\r\n if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {\r\n throw new TypeError('Object.keys called on non-object');\r\n }\r\n\r\n var result: string[] = [], prop: string, i: number;\r\n\r\n for (prop in obj) {\r\n if (hasOwnProperty.call(obj, prop)) {\r\n result.push(prop);\r\n }\r\n }\r\n\r\n if (hasDontEnumBug) {\r\n for (i = 0; i < dontEnumsLength; i++) {\r\n if (hasOwnProperty.call(obj, dontEnums[i])) {\r\n result.push(dontEnums[i]);\r\n }\r\n }\r\n }\r\n return result;\r\n };\r\n }());\r\n}\r\n\r\n// IE substr does not support negative indices\r\nif ('ab'.substr(-1) !== 'b') {\r\n String.prototype.substr = function(substr: (start: number, length?: number) => string) {\r\n return function(start: number, length?: number): string {\r\n // did we get a negative start, calculate how much it is from the\r\n // beginning of the string\r\n if (start < 0) start = this.length + start;\r\n // call the original function\r\n return substr.call(this, start, length);\r\n }\r\n }(String.prototype.substr);\r\n}\r\n\r\n// IE < 9 does not support forEach\r\nif (!Array.prototype.forEach) {\r\n Array.prototype.forEach = function(fn: (value: string, index: number, array: string[]) => void, scope?: any): void {\r\n for (var i = 0; i < this.length; ++i) {\r\n if (i in this) {\r\n fn.call(scope, this[i], i, this);\r\n }\r\n }\r\n };\r\n}\r\n\r\n// IE < 9 does not support filter\r\n// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter\r\nif (!Array.prototype.filter) {\r\n Array.prototype.filter = function(fun/*, thisArg*/) {\r\n 'use strict';\r\n\r\n if (this === void 0 || this === null) {\r\n throw new TypeError();\r\n }\r\n\r\n var t = Object(this);\r\n var len = t.length >>> 0;\r\n if (typeof fun !== 'function') {\r\n throw new TypeError();\r\n }\r\n\r\n var res = [];\r\n var thisArg = arguments.length >= 2 ? arguments[1] : void 0;\r\n for (var i = 0; i < len; i++) {\r\n if (i in t) {\r\n var val = t[i];\r\n\r\n // NOTE: Technically this should Object.defineProperty at\r\n // the next index, as push can be affected by\r\n // properties on Object.prototype and Array.prototype.\r\n // But that method's new, and collisions should be\r\n // rare, so use the more-compatible alternative.\r\n if (fun.call(thisArg, val, i, t)) {\r\n res.push(val);\r\n }\r\n }\r\n }\r\n\r\n return res;\r\n };\r\n}\r\n\r\n// Only IE10 has setImmediate.\r\n// @todo: Determine viability of switching to the 'proper' polyfill for this.\r\nif (typeof setImmediate === 'undefined') {\r\n var gScope = global;\r\n var timeouts: (() => void)[] = [];\r\n var messageName = \"zero-timeout-message\";\r\n var canUsePostMessage = function() {\r\n if (typeof gScope.importScripts !== 'undefined' || !gScope.postMessage) {\r\n return false;\r\n }\r\n var postMessageIsAsync = true;\r\n var oldOnMessage = gScope.onmessage;\r\n gScope.onmessage = function() {\r\n postMessageIsAsync = false;\r\n };\r\n gScope.postMessage('', '*');\r\n gScope.onmessage = oldOnMessage;\r\n return postMessageIsAsync;\r\n };\r\n if (canUsePostMessage()) {\r\n gScope.setImmediate = function(fn: () => void) {\r\n timeouts.push(fn);\r\n gScope.postMessage(messageName, \"*\");\r\n };\r\n var handleMessage = function(event: MessageEvent) {\r\n if (event.source === self && event.data === messageName) {\r\n if (event.stopPropagation) {\r\n event.stopPropagation();\r\n } else {\r\n event.cancelBubble = true;\r\n }\r\n if (timeouts.length > 0) {\r\n var fn = timeouts.shift();\r\n return fn();\r\n }\r\n }\r\n };\r\n if (gScope.addEventListener) {\r\n gScope.addEventListener('message', handleMessage, true);\r\n } else {\r\n gScope.attachEvent('onmessage', handleMessage);\r\n }\r\n } else if (gScope.MessageChannel) {\r\n // WebWorker MessageChannel\r\n var channel = new gScope.MessageChannel();\r\n channel.port1.onmessage = (event: any) => {\r\n if (timeouts.length > 0) {\r\n return timeouts.shift()();\r\n }\r\n };\r\n gScope.setImmediate = (fn: () => void) => {\r\n timeouts.push(fn);\r\n channel.port2.postMessage('');\r\n };\r\n } else {\r\n gScope.setImmediate = function(fn: () => void) {\r\n return setTimeout(fn, 0);\r\n };\r\n }\r\n}\r\n\r\n// IE<9 does not define indexOf.\r\n// From: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf\r\nif (!Array.prototype.indexOf) {\r\n Array.prototype.indexOf = function(searchElement: any, fromIndex: number = 0): number {\r\n if (!this) {\r\n throw new TypeError();\r\n }\r\n\r\n var length = this.length;\r\n if (length === 0 || pivot >= length) {\r\n return -1;\r\n }\r\n\r\n var pivot = fromIndex;\r\n if (pivot < 0) {\r\n pivot = length + pivot;\r\n }\r\n\r\n for (var i = pivot; i < length; i++) {\r\n if (this[i] === searchElement) {\r\n return i;\r\n }\r\n }\r\n return -1;\r\n };\r\n}\r\n\r\n// IE<9 does not support forEach\r\n// From: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach\r\nif (!Array.prototype.forEach) {\r\n Array.prototype.forEach = function(fn: (value: string, index: number, array: string[]) => void, scope?: any) {\r\n var i: number, len: number;\r\n for (i = 0, len = this.length; i < len; ++i) {\r\n if (i in this) {\r\n fn.call(scope, this[i], i, this);\r\n }\r\n }\r\n };\r\n}\r\n\r\n// IE<9 does not support map\r\n// From: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map\r\nif (!Array.prototype.map) {\r\n Array.prototype.map = function(callback: (value: string, index: number, array: string[]) => any, thisArg?: any): any[] {\r\n var T: any, A: any, k: any;\r\n if (this == null) {\r\n throw new TypeError(\" this is null or not defined\");\r\n }\r\n // 1. Let O be the result of calling ToObject passing the |this| value as the argument.\r\n var O = Object(this);\r\n // 2. Let lenValue be the result of calling the Get internal method of O with the argument \"length\".\r\n // 3. Let len be ToUint32(lenValue).\r\n var len = O.length >>> 0;\r\n // 4. If IsCallable(callback) is false, throw a TypeError exception.\r\n // See: http://es5.github.com/#x9.11\r\n if (typeof callback !== \"function\") {\r\n throw new TypeError(callback + \" is not a function\");\r\n }\r\n // 5. If thisArg was supplied, let T be thisArg; else let T be undefined.\r\n if (thisArg) {\r\n T = thisArg;\r\n }\r\n // 6. Let A be a new array created as if by the expression new Array(len) where Array is\r\n // the standard built-in constructor with that name and len is the value of len.\r\n A = new Array(len);\r\n // 7. Let k be 0\r\n k = 0;\r\n // 8. Repeat, while k < len\r\n while(k < len) {\r\n var kValue: any, mappedValue: any;\r\n // a. Let Pk be ToString(k).\r\n // This is implicit for LHS operands of the in operator\r\n // b. Let kPresent be the result of calling the HasProperty internal method of O with argument Pk.\r\n // This step can be combined with c\r\n // c. If kPresent is true, then\r\n if (k in O) {\r\n // i. Let kValue be the result of calling the Get internal method of O with argument Pk.\r\n kValue = O[k];\r\n // ii. Let mappedValue be the result of calling the Call internal method of callback\r\n // with T as the this value and argument list containing kValue, k, and O.\r\n mappedValue = callback.call(T, kValue, k, O);\r\n // iii. Call the DefineOwnProperty internal method of A with arguments\r\n // Pk, Property Descriptor {Value: mappedValue, : true, Enumerable: true, Configurable: true},\r\n // and false.\r\n // In browsers that support Object.defineProperty, use the following:\r\n // Object.defineProperty(A, Pk, { value: mappedValue, writable: true, enumerable: true, configurable: true });\r\n // For best browser support, use the following:\r\n A[k] = mappedValue;\r\n }\r\n // d. Increase k by 1.\r\n k++;\r\n }\r\n // 9. return A\r\n return A;\r\n };\r\n}\r\n\r\n/**\r\n * IE9 and below only: Injects a VBScript function that converts the\r\n * 'responseBody' attribute of an XMLHttpRequest into a bytestring.\r\n * From: http://miskun.com/javascript/internet-explorer-and-binary-files-data-access/#comment-17\r\n *\r\n * This must be performed *before* the page finishes loading, otherwise\r\n * document.write will refresh the page. :(\r\n *\r\n * This is harmless to inject into non-IE browsers.\r\n */\r\nif (typeof(document) !== 'undefined' && typeof(window) !== 'undefined' && (<any> window)['chrome'] === undefined) {\r\n document.write(\"<!-- IEBinaryToArray_ByteStr -->\\r\\n\"+\r\n \"<script type='text/vbscript'>\\r\\n\"+\r\n \"Function IEBinaryToArray_ByteStr(Binary)\\r\\n\"+\r\n \" IEBinaryToArray_ByteStr = CStr(Binary)\\r\\n\"+\r\n \"End Function\\r\\n\"+\r\n \"Function IEBinaryToArray_ByteStr_Last(Binary)\\r\\n\"+\r\n \" Dim lastIndex\\r\\n\"+\r\n \" lastIndex = LenB(Binary)\\r\\n\"+\r\n \" if lastIndex mod 2 Then\\r\\n\"+\r\n \" IEBinaryToArray_ByteStr_Last = Chr( AscB( MidB( Binary, lastIndex, 1 ) ) )\\r\\n\"+\r\n \" Else\\r\\n\"+\r\n \" IEBinaryToArray_ByteStr_Last = \"+'\"\"'+\"\\r\\n\"+\r\n \" End If\\r\\n\"+\r\n \"End Function\\r\\n\"+\r\n \"</script>\\r\\n\");\r\n}\r\n\r\nimport bfs = require('./core/browserfs');\r\nexport = bfs;"
|
||
]
|
||
} |