Skip to content
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The library uses [`@gravity-ui/unipika`](https://github.com/gravity-ui/unipika)

- virtualization
- two scroll modes: window scroll and container scroll
- collaps/expand objects/arrays
- collapse/expand objects/arrays
- search substring of key/value (case-sensitive and case-insensitive)
- render one literal per line
- long strings are truncated by ellipsis
Expand Down Expand Up @@ -64,7 +64,7 @@ function renderJson(data: any) {
## YSON notice

The library does not support YSON-format "as is", i.e. it is impossible to use/parse YSON data.
But it provides the way to render JSON-objects as YSON, such JSON-objects has reserver field names like `$attributes`, `$value`.
But it provides the way to render JSON-objects as YSON, such JSON-objects has reserved field names like `$attributes`, `$value`.

See more examples in [storybook](https://preview.yandexcloud.dev/react-unipika).

Expand Down
6 changes: 3 additions & 3 deletions src/utils/flattenUnipika.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function flattenUnipikaJsonImpl(value: UnipikaValue, level = 0, ctx: FlatContext
const itemPathIndex = isObjectLike(type) ? beforeAttrs - 1 : ctx.dst.length;

const isCollapsed = isPathCollapsed(ctx);
const isContainerType = isValueContainenrType(value);
const isContainerType = isValueContainerType(value);

let containerSize = 0;

Expand Down Expand Up @@ -269,7 +269,7 @@ function flattenUnipikaYsonImpl(value: UnipikaValue, level = 0, ctx: FlatContext
let hasAttributes = false;
let valueLevel = level;

const isContainerType = isValueContainenrType(value);
const isContainerType = isValueContainerType(value);
let containerSize = 0;

const isCollapsed = isPathCollapsed(ctx);
Expand Down Expand Up @@ -350,7 +350,7 @@ function popPath(ctx: FlatContext) {
}
}

function isValueContainenrType(value: UnipikaValue) {
function isValueContainerType(value: UnipikaValue) {
return value.$type === 'map' || value.$type === 'list';
}

Expand Down
Loading