Skip to content

Commit 3a9ee47

Browse files
Copilotstreamich
andcommitted
feat: move internal files to vendor/node/internal and cleanup unused error codes
Co-authored-by: streamich <[email protected]>
1 parent 2820559 commit 3a9ee47

19 files changed

+134
-278
lines changed

demo/throw-error.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const errors = require('../src/internal/errors');
1+
const errors = require('../lib/vendor/node/internal/errors');
22

3-
const err = new errors.TypeError('ENOENT', 'Test');
3+
const err = new errors.TypeError('ERR_INVALID_OPT_VALUE_ENCODING', 'Test');
44
console.log(err);

src/core/File.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { constants } from '../constants';
2-
import { Buffer } from '../internal/buffer';
2+
import { Buffer } from '../vendor/node/internal/buffer';
33
import type { Link } from './Link';
44
import type { Node } from './Node';
55

src/core/Node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { FanOut } from 'thingies/lib/fanout';
22
import process from '../process';
3-
import { Buffer, bufferAllocUnsafe, bufferFrom } from '../internal/buffer';
3+
import { Buffer, bufferAllocUnsafe, bufferFrom } from '../vendor/node/internal/buffer';
44
import { constants, S } from '../constants';
55

66
export type NodeEventModify = [type: 'modify'];

src/core/Superblock.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { sep, relative, join, dirname, isAbsolute, basename, posix } from '../ve
22
import { Node } from './Node';
33
import { Link } from './Link';
44
import { File } from './File';
5-
import { Buffer } from '../internal/buffer';
5+
import { Buffer } from '../vendor/node/internal/buffer';
66
import process from '../process';
77
import { constants } from '../constants';
88
import { ERRSTR, FLAGS, MODE } from '../node/constants';

src/core/json.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Buffer } from '../internal/buffer';
1+
import { Buffer } from '../vendor/node/internal/buffer';
22
import { join, posix } from '../vendor/node/path';
33

44
const pathJoin = posix ? posix.join : join;

src/core/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { resolve as pathResolve, sep, posix } from '../vendor/node/path';
2-
import { Buffer, bufferFrom } from '../internal/buffer';
2+
import { Buffer, bufferFrom } from '../vendor/node/internal/buffer';
33
import process from '../process';
44
import { TDataOut, TEncodingExtended, ENCODING_UTF8 } from '../encoding';
55
import { ERRSTR } from '../node/constants';

src/encoding.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Buffer } from './internal/buffer';
2-
import * as errors from './internal/errors';
1+
import { Buffer } from './vendor/node/internal/buffer';
2+
import * as errors from './vendor/node/internal/errors';
33

44
export type TDataOut = string | Buffer; // Data formats we give back to users.
55
export type TEncodingExtended = BufferEncoding | 'buffer';

src/fsa-to-node/FsaNodeFs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as optHelpers from '../node/options';
22
import * as util from '../node/util';
3-
import { Buffer } from '../internal/buffer';
3+
import { Buffer } from '../vendor/node/internal/buffer';
44
import { FsPromises } from '../node/FsPromises';
55
import { pathToLocation } from './util';
66
import { ERRSTR, MODE } from '../node/constants';

src/fsa/CoreFileSystemDirectoryHandle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import type {
2121
import type { Superblock } from '../core/Superblock';
2222
import { ERROR_CODE } from '../core/constants';
2323
import { filenameToSteps } from '../core/util';
24-
import { Buffer } from '../internal/buffer';
24+
import { Buffer } from '../vendor/node/internal/buffer';
2525
import { MODE, FLAGS } from '../node/constants';
2626

2727
/**

src/fsa/CoreFileSystemSyncAccessHandle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { IFileSystemSyncAccessHandle, FileSystemReadWriteOptions, CoreFsaContext } from './types';
22
import type { Superblock } from '../core/Superblock';
3-
import { Buffer } from '../internal/buffer';
3+
import { Buffer } from '../vendor/node/internal/buffer';
44
import { ERROR_CODE } from '../core/constants';
55
import { newNotAllowedError } from './util';
66
import { FLAGS } from '../node/constants';

0 commit comments

Comments
 (0)