Skip to content

Commit

Permalink
refactor: 💡 start using jsonjoy.com/base64 package
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Apr 9, 2024
1 parent b345e60 commit 078580f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/json-binary/codec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {JsonPackExtension, JsonPackValue} from '../msgpack';
import {fromBase64, toBase64} from '../util/base64';
import {fromBase64} from '@jsonjoy.com/base64/lib/fromBase64';
import {toBase64} from '@jsonjoy.com/base64/lib/toBase64';
import {isUint8Array} from '../util/buffers/isUint8Array';
import {binUriStart, msgPackExtStart, msgPackUriStart} from './constants';
import {binary_string} from './types';
Expand Down
2 changes: 1 addition & 1 deletion src/json/JsonDecoder.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {decodeUtf8} from '../util/buffers/utf8/decodeUtf8';
import {Reader} from '../util/buffers/Reader';
import {fromBase64Bin} from '../util/base64/fromBase64Bin';
import {fromBase64Bin} from '@jsonjoy.com/base64/lib/fromBase64Bin';
import {findEndingQuote} from './util';
import type {BinaryJsonDecoder, PackValue} from '../types';

Expand Down
2 changes: 1 addition & 1 deletion src/json/JsonDecoderDag.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {JsonDecoder} from './JsonDecoder';
import {findEndingQuote} from './util';
import type {PackValue} from '../types';
import {createFromBase64Bin} from '../util/base64/createFromBase64Bin';
import {createFromBase64Bin} from '@jsonjoy.com/base64/lib/createFromBase64Bin';

export const fromBase64Bin = createFromBase64Bin(undefined, '');

Expand Down
2 changes: 1 addition & 1 deletion src/json/JsonEncoder.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {toBase64Bin} from '../util/base64/toBase64Bin';
import {toBase64Bin} from '@jsonjoy.com/base64/lib/toBase64Bin';
import type {IWriter, IWriterGrowable} from '../util/buffers';
import type {BinaryJsonEncoder, StreamingBinaryJsonEncoder} from '../types';

Expand Down
2 changes: 1 addition & 1 deletion src/json/JsonEncoderDag.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {JsonEncoderStable} from './JsonEncoderStable';
import {createToBase64Bin} from '../util/base64/createToBase64Bin';
import {createToBase64Bin} from '@jsonjoy.com/base64/lib/createToBase64Bin';

const objBaseLength = '{"/":{"bytes":""}}'.length;
const cidBaseLength = '{"/":""}'.length;
Expand Down
2 changes: 1 addition & 1 deletion src/util/buffers/toDataUri.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {toBase64} from '../base64';
import {toBase64} from '@jsonjoy.com/base64/lib/toBase64';

export const toDataUri = (buf: Uint8Array, params?: Record<string, string | number>): string => {
let uri = 'data:application/octet-stream;base64';
Expand Down

0 comments on commit 078580f

Please sign in to comment.