Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: replace ajv usage [INS-145] #371

Merged
merged 3 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"chalk": "^4.1.2",
"event-stream": "4.0.1",
"form-data": "4.0.0",
"har-schema": "^2.0.0",
"har-validator-compiled": "^1.0.0",
"stringify-object": "3.3.0",
"yargs": "^17.4.0"
}
Expand Down
31 changes: 0 additions & 31 deletions src/helpers/har-validator.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/httpsnippet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('hTTPSnippet', () => {
// @ts-expect-error intentionally incorrect
const attempt = () => new HTTPSnippet({ ziltoid: 'the omniscient' });

expect(attempt).toThrow('validation failed');
expect(attempt).toThrow('Validation Failed');
});

it('should parse HAR file with multiple entries', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/httpsnippet.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { map as eventStreamMap } from 'event-stream';
import FormData from 'form-data';
import { Param, PostDataCommon, Request as NpmHarRequest } from 'har-format';
import { validateRequest } from 'har-validator-compiled';
import { stringify as queryStringify } from 'querystring';
import { format as urlFormat, parse as urlParse, UrlWithParsedQuery } from 'url';

import { formDataIterator, isBlob } from './helpers/form-data';
import { validateHarRequest } from './helpers/har-validator';
import { getHeaderName } from './helpers/headers';
import { ReducedHelperObject, reducer } from './helpers/reducer';
import { ClientId, TargetId, targets } from './targets/targets';
Expand Down Expand Up @@ -106,7 +106,7 @@ export class HTTPSnippet {
},
};

if (validateHarRequest(req)) {
if (validateRequest(req)) {
this.requests.push(this.prepare(req));
}
});
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export { CodeBuilder, CodeBuilderOptions, PostProcessor } from './helpers/code-builder';
export { EscapeOptions, escapeString } from './helpers/escape';
export { HARError, validateHarRequest } from './helpers/har-validator';
export { getHeader, getHeaderName } from './helpers/headers';
export { AvailableTarget, availableTargets, extname } from './helpers/utils';
export {
Expand Down
4 changes: 0 additions & 4 deletions src/targets/har-schema.d.ts

This file was deleted.

Loading