Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions io-fdk/comparision/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './isRefType';
1 change: 1 addition & 0 deletions io-fdk/comparision/isRefType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const isRefType = (value: any) => Array.isArray(value) || typeof value === 'object';
15 changes: 15 additions & 0 deletions io-fdk/comparision/tests/comparision.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { isRefType } from "..";

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should be named isRefType.test.ts

describe('isRefType()', () => {
it('validates', () => {
const _INVALID_PROBES_ = ['null', '17', '}', ''];
const _VALID_PROBES_ = ['{}', '{name: "Piotr"}', '[1]'];

_INVALID_PROBES_.forEach((probe) => {
expect(isRefType(probe)).toBe(false);
});
_VALID_PROBES_.forEach((probe) => {
expect(isRefType(probe)).toBe(true);
});
});
});
1 change: 1 addition & 0 deletions io-fdk/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './comparision';
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"utils": ["src/utils"],
"services*": ["src/services/*"],
"styles": ["src/styles"],
"comparision": ["io-fdk/comparision"]

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Path should be src/io-fdk
comparision key should be changed to io-fdk and also same for path

},
"plugins": [
{
Expand Down