Skip to content

Commit

Permalink
fix: 🐛 start using @jsonjoy.com/util package
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Apr 9, 2024
1 parent 5393bbe commit 922bfc9
Show file tree
Hide file tree
Showing 149 changed files with 67 additions and 4,712 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
},
"dependencies": {
"@jsonjoy.com/base64": "^1.1.1",
"@jsonjoy.com/util": "^1.0.0",
"hyperdyperid": "^1.2.0",
"thingies": "^1.20.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/__demos__/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import {JsonEncoder} from '../json/JsonEncoder';
import {JsonDecoder} from '../json/JsonDecoder';
import {Writer} from '../util/buffers/Writer';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';

const encoder = new JsonEncoder(new Writer());
const decoder = new JsonDecoder();
Expand Down
2 changes: 1 addition & 1 deletion src/__demos__/ubjson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import {UbjsonEncoder} from '../ubjson/UbjsonEncoder';
import {UbjsonDecoder} from '../ubjson/UbjsonDecoder';
import {Writer} from '../util/buffers/Writer';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';

const encoder = new UbjsonEncoder(new Writer());
const decoder = new UbjsonDecoder();
Expand Down
2 changes: 1 addition & 1 deletion src/bencode/BencodeDecoder.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Reader} from '../util/buffers/Reader';
import {Reader} from '@jsonjoy.com/util/lib/buffers/Reader';
import type {BinaryJsonDecoder, PackValue} from '../types';

export class BencodeDecoder implements BinaryJsonDecoder {
Expand Down
6 changes: 3 additions & 3 deletions src/bencode/BencodeEncoder.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {utf8Size} from '../util/strings/utf8';
import {sort} from '../util/sort/insertion';
import type {IWriter, IWriterGrowable} from '../util/buffers';
import {utf8Size} from '@jsonjoy.com/util/lib/strings/utf8';
import {sort} from '@jsonjoy.com/util/lib/sort/insertion';
import type {IWriter, IWriterGrowable} from '@jsonjoy.com/util/lib/buffers';
import type {BinaryJsonEncoder} from '../types';

export class BencodeEncoder implements BinaryJsonEncoder {
Expand Down
2 changes: 1 addition & 1 deletion src/bson/BsonEncoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
BsonObjectId,
BsonTimestamp,
} from './values';
import type {IWriter, IWriterGrowable} from '../util/buffers';
import type {IWriter, IWriterGrowable} from '@jsonjoy.com/util/lib/buffers';
import type {BinaryJsonEncoder} from '../types';

export class BsonEncoder implements BinaryJsonEncoder {
Expand Down
2 changes: 1 addition & 1 deletion src/cbor/CborDecoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {CONST, ERROR, MAJOR} from './constants';
import {CborDecoderBase} from './CborDecoderBase';
import {JsonPackValue} from '../JsonPackValue';
import type {Path} from '../json-pointer';
import type {IReader, IReaderResettable} from '../util/buffers';
import type {IReader, IReaderResettable} from '@jsonjoy.com/util/lib/buffers';

export class CborDecoder<
R extends IReader & IReaderResettable = IReader & IReaderResettable,
Expand Down
10 changes: 5 additions & 5 deletions src/cbor/CborDecoderBase.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {CONST, ERROR, MAJOR} from './constants';
import {decodeF16} from '../util/buffers/f16';
import {decodeF16} from '@jsonjoy.com/util/lib/buffers/f16';
import {JsonPackExtension} from '../JsonPackExtension';
import {JsonPackValue} from '../JsonPackValue';
import {Reader} from '../util/buffers/Reader';
import sharedCachedUtf8Decoder from '../util/buffers/utf8/sharedCachedUtf8Decoder';
import type {CachedUtf8Decoder} from '../util/buffers/utf8/CachedUtf8Decoder';
import type {IReader, IReaderResettable} from '../util/buffers';
import {Reader} from '@jsonjoy.com/util/lib/buffers/Reader';
import sharedCachedUtf8Decoder from '@jsonjoy.com/util/lib/buffers/utf8/sharedCachedUtf8Decoder';
import type {CachedUtf8Decoder} from '@jsonjoy.com/util/lib/buffers/utf8/CachedUtf8Decoder';
import type {IReader, IReaderResettable} from '@jsonjoy.com/util/lib/buffers';
import type {BinaryJsonDecoder, PackValue} from '../types';

export class CborDecoderBase<R extends IReader & IReaderResettable = IReader & IReaderResettable>
Expand Down
4 changes: 2 additions & 2 deletions src/cbor/CborEncoder.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {isFloat32} from '../util/buffers/isFloat32';
import {isFloat32} from '@jsonjoy.com/util/lib/buffers/isFloat32';
import {JsonPackExtension} from '../JsonPackExtension';
import {CborEncoderFast} from './CborEncoderFast';
import type {IWriter, IWriterGrowable} from '../util/buffers';
import {JsonPackValue} from '../JsonPackValue';
import type {IWriter, IWriterGrowable} from '@jsonjoy.com/util/lib/buffers';

export class CborEncoder<W extends IWriter & IWriterGrowable = IWriter & IWriterGrowable> extends CborEncoderFast<W> {
/**
Expand Down
6 changes: 3 additions & 3 deletions src/cbor/CborEncoderFast.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {Writer} from '../util/buffers/Writer';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import {CONST, MAJOR_OVERLAY} from './constants';
import type {IWriter, IWriterGrowable} from '../util/buffers';
import type {IWriter, IWriterGrowable} from '@jsonjoy.com/util/lib/buffers';
import type {BinaryJsonEncoder, StreamingBinaryJsonEncoder, TlvBinaryJsonEncoder} from '../types';
import type {Slice} from '../util/buffers/Slice';
import type {Slice} from '@jsonjoy.com/util/lib/buffers/Slice';

const isSafeInteger = Number.isSafeInteger;

Expand Down
4 changes: 2 additions & 2 deletions src/cbor/CborEncoderStable.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {CborEncoder} from './CborEncoder';
import {sort} from '../util/sort/insertion2';
import {sort} from '@jsonjoy.com/util/lib/sort/insertion2';
import {MAJOR_OVERLAY} from './constants';
import {objKeyCmp} from '../util/objKeyCmp';
import {objKeyCmp} from '@jsonjoy.com/util/lib/objKeyCmp';

const strHeaderLength = (strSize: number): 1 | 2 | 3 | 5 => {
if (strSize <= 23) return 1;
Expand Down
2 changes: 1 addition & 1 deletion src/codecs/Codecs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Writer} from '../util/buffers/Writer';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import {CborJsonValueCodec} from './cbor';
import {JsonJsonValueCodec} from './json';
import {MsgPackJsonValueCodec} from './msgpack';
Expand Down
2 changes: 1 addition & 1 deletion src/codecs/cbor.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {CborDecoder} from '../cbor/CborDecoder';
import {CborEncoder} from '../cbor/CborEncoder';
import {EncodingFormat} from '../constants';
import type {Writer} from '../util/buffers/Writer';
import type {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import type {JsonValueCodec} from './types';

export class CborJsonValueCodec implements JsonValueCodec {
Expand Down
2 changes: 1 addition & 1 deletion src/codecs/json.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {EncodingFormat} from '../constants';
import {JsonEncoder} from '../json/JsonEncoder';
import {JsonDecoder} from '../json/JsonDecoder';
import type {Writer} from '../util/buffers/Writer';
import type {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import type {JsonValueCodec} from './types';

export class JsonJsonValueCodec implements JsonValueCodec {
Expand Down
2 changes: 1 addition & 1 deletion src/codecs/msgpack.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {EncodingFormat} from '../constants';
import {MsgPackEncoder} from '../msgpack';
import {MsgPackDecoder} from '../msgpack/MsgPackDecoder';
import type {Writer} from '../util/buffers/Writer';
import type {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import type {JsonValueCodec} from './types';

export class MsgPackJsonValueCodec implements JsonValueCodec {
Expand Down
4 changes: 2 additions & 2 deletions src/ion/IonEncoderFast.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {IWriter, IWriterGrowable} from '../util/buffers';
import {Writer} from '../util/buffers/Writer';
import type {IWriter, IWriterGrowable} from '@jsonjoy.com/util/lib/buffers';
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
import {
AnnotationAstNode,
ArrAstNode,
Expand Down
2 changes: 1 addition & 1 deletion src/ion/ast.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {utf8Size} from '../util/strings/utf8';
import {utf8Size} from '@jsonjoy.com/util/lib/strings/utf8';
import {Import} from './Import';

export interface AstNode<T> {
Expand Down
2 changes: 1 addition & 1 deletion src/json-binary/codec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {JsonPackExtension, JsonPackValue} from '../msgpack';
import {fromBase64} from '@jsonjoy.com/base64/lib/fromBase64';
import {toBase64} from '@jsonjoy.com/base64/lib/toBase64';
import {isUint8Array} from '../util/buffers/isUint8Array';
import {isUint8Array} from '@jsonjoy.com/util/lib/buffers/isUint8Array';
import {binUriStart, msgPackExtStart, msgPackUriStart} from './constants';
import {binary_string} from './types';

Expand Down
2 changes: 1 addition & 1 deletion src/json-binary/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type {MsgPack} from '../msgpack';
import type {CborUint8Array} from '../cbor/types';
import type {Brand} from '../util/types';
import type {Brand} from '@jsonjoy.com/util/lib/types';

export type base64_string<T extends Uint8Array = Uint8Array> = Brand<string, T, 'base64_string'>;
export type binary_string<T extends Uint8Array = Uint8Array> = Brand<
Expand Down
12 changes: 0 additions & 12 deletions src/json-brand/README.md

This file was deleted.

7 changes: 0 additions & 7 deletions src/json-brand/global.d.ts

This file was deleted.

10 changes: 0 additions & 10 deletions src/json-brand/index.d.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/json-brand/index.ts

This file was deleted.

9 changes: 0 additions & 9 deletions src/json-brand/types.ts

This file was deleted.

22 changes: 0 additions & 22 deletions src/json-equal/$$deepEqual/__tests__/deepEqual.fuzzing.spec.ts

This file was deleted.

10 changes: 0 additions & 10 deletions src/json-equal/$$deepEqual/__tests__/deepEqual.spec.ts

This file was deleted.

55 changes: 0 additions & 55 deletions src/json-equal/$$deepEqual/__tests__/deepEqualCodegen.spec.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/json-equal/$$deepEqual/index.ts

This file was deleted.

62 changes: 0 additions & 62 deletions src/json-equal/$$deepEqual/v1.ts

This file was deleted.

Loading

0 comments on commit 922bfc9

Please sign in to comment.