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

Commit

Permalink
Remove use of nodejs util module (#4521)
Browse files Browse the repository at this point in the history
* Remove use of nodejs util module

* Fix comment typo
  • Loading branch information
nwmac committed Aug 21, 2020
1 parent 286d508 commit 9a70ea6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
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;
}

0 comments on commit 9a70ea6

Please sign in to comment.