Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Remove use of nodejs util module #4521

Merged
merged 2 commits into from
Aug 21, 2020
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { isNullOrUndefined } from 'util';

import { BaseEntityRequestAction } from '../../entity-catalog/action-orchestrator/action-orchestrator';
import { IFailedRequestAction } from '../../types/request.types';
import { isNullOrUndefined } from '../../utils';
import { getEntityRequestState, mergeUpdatingState, setEntityRequestState } from './request-helpers';

export function failRequest(state, action: IFailedRequestAction) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { isNullOrUndefined } from 'util';

import { BaseEntityRequestAction } from '../../entity-catalog/action-orchestrator/action-orchestrator';
import { IStartRequestAction } from '../../types/request.types';
import { isNullOrUndefined } from '../../utils';
import {
getEntityRequestState,
mergeUpdatingState,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { isNullOrUndefined } from 'util';

import { BaseRequestState } from '../../app-state';
import { BaseEntityRequestAction } from '../../entity-catalog/action-orchestrator/action-orchestrator';
import { mergeState } from '../../helpers/reducer.helper';
import { ISuccessRequestAction, WrapperRequestActionSuccess } from '../../types/request.types';
import { isNullOrUndefined } from '../../utils';
import {
createRequestStateFromResponse,
getEntityRequestState,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { isNullOrUndefined } from 'util';

import { BaseEntityRequestAction } from '../../entity-catalog/action-orchestrator/action-orchestrator';
import { BaseRequestState } from '../../app-state';
import { BaseEntityRequestAction } from '../../entity-catalog/action-orchestrator/action-orchestrator';
import { IUpdateRequestAction } from '../../types/request.types';
import { isNullOrUndefined } from '../../utils';
import { getEntityRequestState, mergeUpdatingState, setEntityRequestState } from './request-helpers';

export function updateRequest(state: BaseRequestState, action: IUpdateRequestAction) {
Expand Down
6 changes: 6 additions & 0 deletions src/frontend/packages/store/src/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// We don't want to bring in the utils package from nodejs
// We only use this one function:

export function isNullOrUndefined(obj: any): boolean {
return typeof obj === 'undefined' || obj === null;
}