Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sunriselink committed Mar 13, 2024
1 parent 624dbcd commit e86a114
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 29 deletions.
4 changes: 0 additions & 4 deletions src/app/components/json-viewer/segments/array-segment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import { Segment } from './base/segment';
import { SegmentBuilder } from './base/segment-builder';

export class ArraySegment extends Segment<JSONArray> {
constructor(key: string, value: JSONArray) {
super(key, value);
}

public override stringify(value: JSONArray): string {
return `Array[${value.length}] ${JSON.stringify(value)}`;
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/json-viewer/segments/base/segment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export abstract class Segment<T extends JSONValue = JSONValue> {
public readonly value: T;
public readonly stringValue: string;

protected constructor(fieldName: string, value: T) {
constructor(fieldName: string, value: T) {
this.fieldName = fieldName;
this.value = value;
this.stringValue = this.stringify(value);
Expand Down
4 changes: 0 additions & 4 deletions src/app/components/json-viewer/segments/boolean-segment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import { Segment } from './base/segment';
import { SegmentBuilder } from './base/segment-builder';

export class BooleanSegment extends Segment<boolean> {
constructor(key: string, value: boolean) {
super(key, value);
}

public override stringify(value: boolean): string {
return `${value}`;
}
Expand Down
4 changes: 0 additions & 4 deletions src/app/components/json-viewer/segments/null-segment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import { Segment } from './base/segment';
import { SegmentBuilder } from './base/segment-builder';

export class NullSegment extends Segment<null> {
constructor(key: string, value: null) {
super(key, value);
}

public override stringify(): string {
return 'null';
}
Expand Down
4 changes: 0 additions & 4 deletions src/app/components/json-viewer/segments/number-segment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import { Segment } from './base/segment';
import { SegmentBuilder } from './base/segment-builder';

export class NumberSegment extends Segment<number> {
constructor(key: string, value: number) {
super(key, value);
}

public override stringify(value: number): string {
return `${value}`;
}
Expand Down
4 changes: 0 additions & 4 deletions src/app/components/json-viewer/segments/object-segment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ import { Segment } from './base/segment';
import { SegmentBuilder } from './base/segment-builder';

export class ObjectSegment extends Segment<JSONObject> {
constructor(key: string, value: JSONObject) {
super(key, value);
}

public override stringify(value: JSONValue): string {
return `Object ${JSON.stringify(value)}`;
}
Expand Down
4 changes: 0 additions & 4 deletions src/app/components/json-viewer/segments/string-segment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ import { SegmentBuilder } from './base/segment-builder';
const STRING_LENGTH_LIMIT = 128;

export class StringSegment extends Segment<string> {
constructor(key: string, value: string) {
super(key, value);
}

public override stringify(value: string): string {
if (value.length > STRING_LENGTH_LIMIT) {
// 2 символа на кавычки
Expand Down
4 changes: 0 additions & 4 deletions src/app/components/json-viewer/segments/unknown-segment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import { Segment } from './base/segment';
import { SegmentBuilder } from './base/segment-builder';

export class UnknownSegment extends Segment {
constructor(key: string, value: JSONValue) {
super(key, value);
}

public override stringify(value: JSONValue): string {
let stringValue: string;

Expand Down

0 comments on commit e86a114

Please sign in to comment.