Linux iad1-shared-b7-18 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
Apache
: 67.205.6.31 | : 216.73.216.13
Cant Read [ /etc/named.conf ]
8.2.29
fernandoquevedo
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
share /
nodejs /
fast-glob /
out /
readers /
[ HOME SHELL ]
Name
Size
Permission
Action
reader.d.ts
714
B
-rw-r--r--
reader.js
1.04
KB
-rw-r--r--
reader.spec.d.ts
11
B
-rw-r--r--
reader.spec.js
1.98
KB
-rw-r--r--
stream.d.ts
566
B
-rw-r--r--
stream.js
1.83
KB
-rw-r--r--
stream.spec.d.ts
11
B
-rw-r--r--
stream.spec.js
4.14
KB
-rw-r--r--
sync.d.ts
506
B
-rw-r--r--
sync.js
1.3
KB
-rw-r--r--
sync.spec.d.ts
11
B
-rw-r--r--
sync.spec.js
3.47
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : stream.spec.js
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const assert = require("assert"); const fs_macchiato_1 = require("@nodelib/fs.macchiato"); const sinon = require("sinon"); const settings_1 = require("../settings"); const tests = require("../tests"); const stream_1 = require("./stream"); class TestReader extends stream_1.default { constructor(options) { super(new settings_1.default(options)); this._walkStream = sinon.stub(); this._stat = sinon.stub(); } get walkStream() { return this._walkStream; } get stat() { return this._stat; } } function getReader(options) { return new TestReader(options); } function getReaderOptions(options = {}) { return Object.assign({}, options); } describe('Readers → ReaderStream', () => { describe('Constructor', () => { it('should create instance of class', () => { const reader = getReader(); assert.ok(reader instanceof TestReader); }); }); describe('.dynamic', () => { it('should call fs.walk method', () => { const reader = getReader(); const readerOptions = getReaderOptions(); reader.dynamic('root', readerOptions); assert.ok(reader.walkStream.called); }); }); describe('.static', () => { it('should return entries', (done) => { const reader = getReader(); const readerOptions = getReaderOptions({ entryFilter: () => true }); reader.stat.onFirstCall().yields(null, new fs_macchiato_1.Stats()); reader.stat.onSecondCall().yields(null, new fs_macchiato_1.Stats()); const entries = []; const stream = reader.static(['a.txt', 'b.txt'], readerOptions); stream.on('data', (entry) => entries.push(entry)); stream.once('end', () => { assert.strictEqual(entries[0].name, 'a.txt'); assert.strictEqual(entries[1].name, 'b.txt'); done(); }); }); it('should throw an error when the filter does not suppress the error', (done) => { const reader = getReader(); const readerOptions = getReaderOptions({ errorFilter: () => false, entryFilter: () => true }); reader.stat.onFirstCall().yields(tests.errno.getEperm()); reader.stat.onSecondCall().yields(null, new fs_macchiato_1.Stats()); const entries = []; const stream = reader.static(['a.txt', 'b.txt'], readerOptions); stream.on('data', (entry) => entries.push(entry)); stream.once('error', (error) => { assert.strictEqual(error.code, 'EPERM'); done(); }); }); it('should do not throw an error when the filter suppress the error', (done) => { const reader = getReader(); const readerOptions = getReaderOptions({ errorFilter: () => true, entryFilter: () => true }); reader.stat.onFirstCall().yields(tests.errno.getEnoent()); reader.stat.onSecondCall().yields(null, new fs_macchiato_1.Stats()); const entries = []; const stream = reader.static(['a.txt', 'b.txt'], readerOptions); stream.on('data', (entry) => entries.push(entry)); stream.once('end', () => { assert.strictEqual(entries.length, 1); assert.strictEqual(entries[0].name, 'b.txt'); done(); }); }); it('should do not include entry when the filter excludes it', (done) => { const reader = getReader(); const readerOptions = getReaderOptions({ entryFilter: () => false }); reader.stat.yields(null, new fs_macchiato_1.Stats()); const entries = []; const stream = reader.static(['a.txt'], readerOptions); stream.on('data', (entry) => entries.push(entry)); stream.once('end', () => { assert.strictEqual(entries.length, 0); done(); }); }); }); });
Close