Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
asmyshlyaev177 committed Jun 26, 2024
1 parent c9f981f commit 0e2485b
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 16 deletions.
4 changes: 0 additions & 4 deletions index.ts

This file was deleted.

File renamed without changes.
4 changes: 2 additions & 2 deletions packages/encoder/encoder.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { typeOf } from '../utils';
import { SYMBOLS, NULL, UNDEFINED } from '../constants';
import { typeOf } from './utils';
import { SYMBOLS, NULL, UNDEFINED } from './constants';

export const encode = (payload: unknown): string => {
const type = typeOf(payload);
Expand Down
2 changes: 2 additions & 0 deletions packages/encoder/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
import { encode, decode } from './encoder';
import type { Type } from './utils';
export { encode, decode };
export type { Type };
File renamed without changes.
10 changes: 1 addition & 9 deletions packages/utils.ts → packages/encoder/utils.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
// prettier-ignore
export const reservedRegexp = new RegExp(/["<>^]/, 'g');

export const sanitazeReserved = (str: string) =>
str.replaceAll(reservedRegexp, encodeURIComponent);

// export const sanitazeReserved = (str: string) => encodeURIComponent(str);

type Type =
export type Type =
| 'string'
| 'boolean'
| 'number'
Expand Down
1 change: 1 addition & 0 deletions packages/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { encode, decode, type Type } from './encoder';
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import typescript from '@rollup/plugin-typescript';
import filesize from 'rollup-plugin-filesize';
import pkg from './package.json';

const input = 'index.ts';
const input = 'packages/index.ts';

const isProduction = !process.env.IS_DEVELOPMENT;
const sourcemap = !isProduction;
Expand Down

0 comments on commit 0e2485b

Please sign in to comment.