96252: Make existing lodash imports tree-shakeable

This commit is contained in:
Yury Bondarenko
2022-10-24 12:39:27 +02:00
parent be43fcb47f
commit 47ae04986d
52 changed files with 74 additions and 54 deletions

View File

@@ -26,7 +26,7 @@ import {
import { FormGroup } from '@angular/forms'; import { FormGroup } from '@angular/forms';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { DynamicCustomSwitchModel } from '../../shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.model'; import { DynamicCustomSwitchModel } from '../../shared/form/builder/ds-dynamic-form-ui/models/custom-switch/custom-switch.model';
import { cloneDeep } from 'lodash'; import cloneDeep from 'lodash/cloneDeep';
import { BitstreamDataService } from '../../core/data/bitstream-data.service'; import { BitstreamDataService } from '../../core/data/bitstream-data.service';
import { import {
getAllSucceededRemoteDataPayload, getAllSucceededRemoteDataPayload,

View File

@@ -23,7 +23,7 @@ import { RemoteData } from '../../../core/data/remote-data';
import { Collection } from '../../../core/shared/collection.model'; import { Collection } from '../../../core/shared/collection.model';
import { first, map, switchMap, take } from 'rxjs/operators'; import { first, map, switchMap, take } from 'rxjs/operators';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { cloneDeep } from 'lodash'; import cloneDeep from 'lodash/cloneDeep';
import { CollectionDataService } from '../../../core/data/collection-data.service'; import { CollectionDataService } from '../../../core/data/collection-data.service';
import { getFirstSucceededRemoteData, getFirstCompletedRemoteData } from '../../../core/shared/operators'; import { getFirstSucceededRemoteData, getFirstCompletedRemoteData } from '../../../core/shared/operators';
import { MetadataConfig } from '../../../core/shared/metadata-config.model'; import { MetadataConfig } from '../../../core/shared/metadata-config.model';

View File

@@ -3,7 +3,7 @@ import { ChangeAnalyzer } from './change-analyzer';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { DSpaceObject } from '../shared/dspace-object.model'; import { DSpaceObject } from '../shared/dspace-object.model';
import { MetadataMap } from '../shared/metadata.models'; import { MetadataMap } from '../shared/metadata.models';
import { cloneDeep } from 'lodash'; import cloneDeep from 'lodash/cloneDeep';
/** /**
* A class to determine what differs between two * A class to determine what differs between two

View File

@@ -4,7 +4,7 @@ import { HttpHeaders } from '@angular/common/http';
import { createSelector, MemoizedSelector, select, Store } from '@ngrx/store'; import { createSelector, MemoizedSelector, select, Store } from '@ngrx/store';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { filter, map, take, tap } from 'rxjs/operators'; import { filter, map, take, tap } from 'rxjs/operators';
import { cloneDeep } from 'lodash'; import cloneDeep from 'lodash/cloneDeep';
import { hasValue, isEmpty, isNotEmpty, hasNoValue } from '../../shared/empty.util'; import { hasValue, isEmpty, isNotEmpty, hasNoValue } from '../../shared/empty.util';
import { ObjectCacheEntry } from '../cache/object-cache.reducer'; import { ObjectCacheEntry } from '../cache/object-cache.reducer';
import { ObjectCacheService } from '../cache/object-cache.service'; import { ObjectCacheService } from '../cache/object-cache.service';

View File

@@ -4,7 +4,7 @@ import { ActivatedRoute, NavigationEnd, Params, Router, RouterStateSnapshot, } f
import { combineLatest, Observable } from 'rxjs'; import { combineLatest, Observable } from 'rxjs';
import { createSelector, MemoizedSelector, select, Store } from '@ngrx/store'; import { createSelector, MemoizedSelector, select, Store } from '@ngrx/store';
import { isEqual } from 'lodash'; import isEqual from 'lodash/isEqual';
import { AddParameterAction, SetParameterAction, SetParametersAction, SetQueryParameterAction, SetQueryParametersAction } from './route.actions'; import { AddParameterAction, SetParameterAction, SetParametersAction, SetQueryParameterAction, SetQueryParametersAction } from './route.actions';
import { coreSelector } from '../core.selectors'; import { coreSelector } from '../core.selectors';

View File

@@ -5,7 +5,8 @@ import {
MetadataValueFilter, MetadataValueFilter,
MetadatumViewModel MetadatumViewModel
} from './metadata.models'; } from './metadata.models';
import { groupBy, sortBy } from 'lodash'; import groupBy from 'lodash/groupBy';
import sortBy from 'lodash/sortBy';
/** /**
* Utility class for working with DSpace object metadata. * Utility class for working with DSpace object metadata.

View File

@@ -1,6 +1,6 @@
/* eslint-disable max-classes-per-file */ /* eslint-disable max-classes-per-file */
import { EquatableObject, excludeFromEquals, fieldsForEquals } from './equals.decorators'; import { EquatableObject, excludeFromEquals, fieldsForEquals } from './equals.decorators';
import { cloneDeep } from 'lodash'; import cloneDeep from 'lodash/cloneDeep';
class Dog extends EquatableObject<Dog> { class Dog extends EquatableObject<Dog> {
public name: string; public name: string;

View File

@@ -13,7 +13,7 @@ import { makeStateKey, TransferState } from '@angular/platform-browser';
import { APP_CONFIG, AppConfig } from '../config/app-config.interface'; import { APP_CONFIG, AppConfig } from '../config/app-config.interface';
import { environment } from '../environments/environment'; import { environment } from '../environments/environment';
import { AppState } from './app.reducer'; import { AppState } from './app.reducer';
import { isEqual } from 'lodash'; import isEqual from 'lodash/isEqual';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { LocaleService } from './core/locale/locale.service'; import { LocaleService } from './core/locale/locale.service';
import { Angulartics2DSpace } from './statistics/angulartics/dspace-provider'; import { Angulartics2DSpace } from './statistics/angulartics/dspace-provider';

View File

@@ -1,4 +1,4 @@
import { isEqual } from 'lodash'; import isEqual from 'lodash/isEqual';
import { DSONameService } from '../../../core/breadcrumbs/dso-name.service'; import { DSONameService } from '../../../core/breadcrumbs/dso-name.service';
import { Component, OnDestroy, OnInit } from '@angular/core'; import { Component, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';

View File

@@ -1,6 +1,6 @@
import { Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild, ViewContainerRef } from '@angular/core'; import { Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild, ViewContainerRef } from '@angular/core';
import { Bitstream } from '../../../../core/shared/bitstream.model'; import { Bitstream } from '../../../../core/shared/bitstream.model';
import { cloneDeep } from 'lodash'; import cloneDeep from 'lodash/cloneDeep';
import { ObjectUpdatesService } from '../../../../core/data/object-updates/object-updates.service'; import { ObjectUpdatesService } from '../../../../core/data/object-updates/object-updates.service';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model'; import { BitstreamFormat } from '../../../../core/shared/bitstream-format.model';

View File

@@ -5,7 +5,7 @@ import {
} from '../../../../core/shared/operators'; } from '../../../../core/shared/operators';
import { hasValue, isNotEmpty } from '../../../../shared/empty.util'; import { hasValue, isNotEmpty } from '../../../../shared/empty.util';
import { RegistryService } from '../../../../core/registry/registry.service'; import { RegistryService } from '../../../../core/registry/registry.service';
import { cloneDeep } from 'lodash'; import cloneDeep from 'lodash/cloneDeep';
import { BehaviorSubject, Observable, of as observableOf } from 'rxjs'; import { BehaviorSubject, Observable, of as observableOf } from 'rxjs';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
import { ObjectUpdatesService } from '../../../../core/data/object-updates/object-updates.service'; import { ObjectUpdatesService } from '../../../../core/data/object-updates/object-updates.service';

View File

@@ -3,7 +3,7 @@ import { Item } from '../../../core/shared/item.model';
import { ItemDataService } from '../../../core/data/item-data.service'; import { ItemDataService } from '../../../core/data/item-data.service';
import { ObjectUpdatesService } from '../../../core/data/object-updates/object-updates.service'; import { ObjectUpdatesService } from '../../../core/data/object-updates/object-updates.service';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { cloneDeep } from 'lodash'; import cloneDeep from 'lodash/cloneDeep';
import { first, switchMap } from 'rxjs/operators'; import { first, switchMap } from 'rxjs/operators';
import { getFirstCompletedRemoteData } from '../../../core/shared/operators'; import { getFirstCompletedRemoteData } from '../../../core/shared/operators';
import { RemoteData } from '../../../core/data/remote-data'; import { RemoteData } from '../../../core/data/remote-data';

View File

@@ -8,7 +8,7 @@ import { EPerson } from '../../core/eperson/models/eperson.model';
import { FormBuilderService } from '../../shared/form/builder/form-builder.service'; import { FormBuilderService } from '../../shared/form/builder/form-builder.service';
import { NotificationsService } from '../../shared/notifications/notifications.service'; import { NotificationsService } from '../../shared/notifications/notifications.service';
import { EPersonDataService } from '../../core/eperson/eperson-data.service'; import { EPersonDataService } from '../../core/eperson/eperson-data.service';
import { cloneDeep } from 'lodash'; import cloneDeep from 'lodash/cloneDeep';
import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils'; import { createSuccessfulRemoteDataObject$ } from '../../shared/remote-data.utils';
describe('ProfilePageMetadataFormComponent', () => { describe('ProfilePageMetadataFormComponent', () => {

View File

@@ -11,7 +11,7 @@ import { TranslateService } from '@ngx-translate/core';
import { hasValue, isNotEmpty } from '../../shared/empty.util'; import { hasValue, isNotEmpty } from '../../shared/empty.util';
import { LangConfig } from '../../../config/lang-config.interface'; import { LangConfig } from '../../../config/lang-config.interface';
import { EPersonDataService } from '../../core/eperson/eperson-data.service'; import { EPersonDataService } from '../../core/eperson/eperson-data.service';
import { cloneDeep } from 'lodash'; import cloneDeep from 'lodash/cloneDeep';
import { getRemoteDataPayload, getFirstSucceededRemoteData } from '../../core/shared/operators'; import { getRemoteDataPayload, getFirstSucceededRemoteData } from '../../core/shared/operators';
import { FormBuilderService } from '../../shared/form/builder/form-builder.service'; import { FormBuilderService } from '../../shared/form/builder/form-builder.service';
import { NotificationsService } from '../../shared/notifications/notifications.service'; import { NotificationsService } from '../../shared/notifications/notifications.service';

View File

@@ -11,7 +11,7 @@ import {
SimpleChanges SimpleChanges
} from '@angular/core'; } from '@angular/core';
import { findIndex } from 'lodash'; import findIndex from 'lodash/findIndex';
import { VocabularyEntry } from '../../core/submission/vocabularies/models/vocabulary-entry.model'; import { VocabularyEntry } from '../../core/submission/vocabularies/models/vocabulary-entry.model';
import { FormFieldMetadataValueObject } from '../form/builder/models/form-field-metadata-value.model'; import { FormFieldMetadataValueObject } from '../form/builder/models/form-field-metadata-value.model';

View File

@@ -1,7 +1,7 @@
import { ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, } from '@angular/core'; import { ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, } from '@angular/core';
import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap'; import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap';
import { isObject } from 'lodash'; import isObject from 'lodash/isObject';
import { Chips } from './models/chips.model'; import { Chips } from './models/chips.model';
import { ChipsItem } from './models/chips-item.model'; import { ChipsItem } from './models/chips-item.model';

View File

@@ -1,4 +1,5 @@
import { isObject, uniqueId } from 'lodash'; import isObject from 'lodash/isObject';
import uniqueId from 'lodash/uniqueId';
import { hasValue, isNotEmpty } from '../../empty.util'; import { hasValue, isNotEmpty } from '../../empty.util';
import { FormFieldMetadataValueObject } from '../../form/builder/models/form-field-metadata-value.model'; import { FormFieldMetadataValueObject } from '../../form/builder/models/form-field-metadata-value.model';
import { ConfidenceType } from '../../../core/shared/confidence-type'; import { ConfidenceType } from '../../../core/shared/confidence-type';

View File

@@ -1,4 +1,6 @@
import { findIndex, isEqual, isObject } from 'lodash'; import findIndex from 'lodash/findIndex';
import isEqual from 'lodash/isEqual';
import isObject from 'lodash/isObject';
import { BehaviorSubject } from 'rxjs'; import { BehaviorSubject } from 'rxjs';
import { ChipsItem, ChipsItemIcon } from './chips-item.model'; import { ChipsItem, ChipsItemIcon } from './chips-item.model';
import { hasValue, isNotEmpty } from '../../empty.util'; import { hasValue, isNotEmpty } from '../../empty.util';

View File

@@ -10,7 +10,8 @@ import { AuthService } from '../../core/auth/auth.service';
import { CookieService } from '../../core/services/cookie.service'; import { CookieService } from '../../core/services/cookie.service';
import { getTestScheduler } from 'jasmine-marbles'; import { getTestScheduler } from 'jasmine-marbles';
import { MetadataValue } from '../../core/shared/metadata.models'; import { MetadataValue } from '../../core/shared/metadata.models';
import { clone, cloneDeep } from 'lodash'; import clone from 'lodash/clone';
import cloneDeep from 'lodash/cloneDeep';
import { ConfigurationDataService } from '../../core/data/configuration-data.service'; import { ConfigurationDataService } from '../../core/data/configuration-data.service';
import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject$ } from '../remote-data.utils'; import { createFailedRemoteDataObject$, createSuccessfulRemoteDataObject$ } from '../remote-data.utils';
import { ConfigurationProperty } from '../../core/shared/configuration-property.model'; import { ConfigurationProperty } from '../../core/shared/configuration-property.model';

View File

@@ -10,7 +10,8 @@ import { KlaroService } from './klaro.service';
import { hasValue, isEmpty, isNotEmpty } from '../empty.util'; import { hasValue, isEmpty, isNotEmpty } from '../empty.util';
import { CookieService } from '../../core/services/cookie.service'; import { CookieService } from '../../core/services/cookie.service';
import { EPersonDataService } from '../../core/eperson/eperson-data.service'; import { EPersonDataService } from '../../core/eperson/eperson-data.service';
import { cloneDeep, debounce } from 'lodash'; import cloneDeep from 'lodash/cloneDeep';
import debounce from 'lodash/debounce';
import { ANONYMOUS_STORAGE_NAME_KLARO, klaroConfiguration } from './klaro-configuration'; import { ANONYMOUS_STORAGE_NAME_KLARO, klaroConfiguration } from './klaro-configuration';
import { Operation } from 'fast-json-patch'; import { Operation } from 'fast-json-patch';
import { getFirstCompletedRemoteData } from '../../core/shared/operators'; import { getFirstCompletedRemoteData } from '../../core/shared/operators';

View File

@@ -1,6 +1,6 @@
import { NgbDateStruct } from '@ng-bootstrap/ng-bootstrap'; import { NgbDateStruct } from '@ng-bootstrap/ng-bootstrap';
import { isObject } from 'lodash'; import isObject from 'lodash/isObject';
import * as moment from 'moment'; import * as moment from 'moment';
import { isNull, isUndefined } from './empty.util'; import { isNull, isUndefined } from './empty.util';

View File

@@ -1,5 +1,5 @@
import { Component, EventEmitter, HostListener, Input, OnInit, Output } from '@angular/core'; import { Component, EventEmitter, HostListener, Input, OnInit, Output } from '@angular/core';
import { uniqueId } from 'lodash'; import uniqueId from 'lodash/uniqueId';
import { FileUploader } from 'ng2-file-upload'; import { FileUploader } from 'ng2-file-upload';
import { Observable, of as observableOf } from 'rxjs'; import { Observable, of as observableOf } from 'rxjs';
import { UploaderOptions } from '../uploader/uploader-options.model'; import { UploaderOptions } from '../uploader/uploader-options.model';

View File

@@ -7,7 +7,7 @@ import {
DynamicFormLayoutService, DynamicFormLayoutService,
DynamicFormValidationService DynamicFormValidationService
} from '@ng-dynamic-forms/core'; } from '@ng-dynamic-forms/core';
import { findKey } from 'lodash'; import findKey from 'lodash/findKey';
import { hasValue, isNotEmpty } from '../../../../../empty.util'; import { hasValue, isNotEmpty } from '../../../../../empty.util';
import { DynamicListCheckboxGroupModel } from './dynamic-list-checkbox-group.model'; import { DynamicListCheckboxGroupModel } from './dynamic-list-checkbox-group.model';

View File

@@ -11,7 +11,8 @@ import {
DynamicFormValidationService, DynamicFormValidationService,
DynamicInputModel DynamicInputModel
} from '@ng-dynamic-forms/core'; } from '@ng-dynamic-forms/core';
import { isEqual, isObject } from 'lodash'; import isEqual from 'lodash/isEqual';
import isObject from 'lodash/isObject';
import { DynamicRelationGroupModel } from './dynamic-relation-group.model'; import { DynamicRelationGroupModel } from './dynamic-relation-group.model';
import { FormBuilderService } from '../../../form-builder.service'; import { FormBuilderService } from '../../../form-builder.service';

View File

@@ -5,7 +5,7 @@ import { DynamicFormLayoutService, DynamicFormValidationService } from '@ng-dyna
import { Observable, of as observableOf } from 'rxjs'; import { Observable, of as observableOf } from 'rxjs';
import { catchError, debounceTime, distinctUntilChanged, map, merge, switchMap, tap } from 'rxjs/operators'; import { catchError, debounceTime, distinctUntilChanged, map, merge, switchMap, tap } from 'rxjs/operators';
import { NgbTypeahead, NgbTypeaheadSelectItemEvent } from '@ng-bootstrap/ng-bootstrap'; import { NgbTypeahead, NgbTypeaheadSelectItemEvent } from '@ng-bootstrap/ng-bootstrap';
import { isEqual } from 'lodash'; import isEqual from 'lodash/isEqual';
import { VocabularyService } from '../../../../../../core/submission/vocabularies/vocabulary.service'; import { VocabularyService } from '../../../../../../core/submission/vocabularies/vocabulary.service';
import { DynamicTagModel } from './dynamic-tag.model'; import { DynamicTagModel } from './dynamic-tag.model';

View File

@@ -18,7 +18,9 @@ import {
DynamicPathable, DynamicPathable,
parseReviver, parseReviver,
} from '@ng-dynamic-forms/core'; } from '@ng-dynamic-forms/core';
import { isObject, isString, mergeWith } from 'lodash'; import isObject from 'lodash/isObject';
import isString from 'lodash/isString';
import mergeWith from 'lodash/mergeWith';
import { import {
hasNoValue, hasNoValue,

View File

@@ -1,4 +1,4 @@
import { isEqual } from 'lodash'; import isEqual from 'lodash/isEqual';
export class FormFieldPreviousValueObject { export class FormFieldPreviousValueObject {

View File

@@ -1,6 +1,6 @@
import {Inject, InjectionToken} from '@angular/core'; import {Inject, InjectionToken} from '@angular/core';
import { uniqueId } from 'lodash'; import uniqueId from 'lodash/uniqueId';
import {DynamicFormControlLayout, DynamicFormControlRelation, MATCH_VISIBLE, OR_OPERATOR} from '@ng-dynamic-forms/core'; import {DynamicFormControlLayout, DynamicFormControlRelation, MATCH_VISIBLE, OR_OPERATOR} from '@ng-dynamic-forms/core';
import { hasValue, isNotEmpty, isNotNull, isNotUndefined } from '../../../empty.util'; import { hasValue, isNotEmpty, isNotNull, isNotUndefined } from '../../../empty.util';

View File

@@ -1,7 +1,7 @@
import { Injectable, Injector } from '@angular/core'; import { Injectable, Injector } from '@angular/core';
import { DYNAMIC_FORM_CONTROL_TYPE_ARRAY, DynamicFormGroupModelConfig } from '@ng-dynamic-forms/core'; import { DYNAMIC_FORM_CONTROL_TYPE_ARRAY, DynamicFormGroupModelConfig } from '@ng-dynamic-forms/core';
import { uniqueId } from 'lodash'; import uniqueId from 'lodash/uniqueId';
import { isEmpty } from '../../../empty.util'; import { isEmpty } from '../../../empty.util';
import { DynamicRowGroupModel } from '../ds-dynamic-form-ui/models/ds-dynamic-row-group-model'; import { DynamicRowGroupModel } from '../ds-dynamic-form-ui/models/ds-dynamic-row-group-model';

View File

@@ -11,7 +11,7 @@ import {
DynamicFormLayout, DynamicFormLayout,
} from '@ng-dynamic-forms/core'; } from '@ng-dynamic-forms/core';
import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
import { findIndex } from 'lodash'; import findIndex from 'lodash/findIndex';
import { FormBuilderService } from './builder/form-builder.service'; import { FormBuilderService } from './builder/form-builder.service';
import { hasValue, isNotEmpty, isNotNull, isNull } from '../empty.util'; import { hasValue, isNotEmpty, isNotNull, isNull } from '../empty.util';

View File

@@ -11,7 +11,8 @@ import {
FormStatusChangeAction FormStatusChangeAction
} from './form.actions'; } from './form.actions';
import { hasValue } from '../empty.util'; import { hasValue } from '../empty.util';
import { isEqual, uniqWith } from 'lodash'; import isEqual from 'lodash/isEqual';
import uniqWith from 'lodash/uniqWith';
export interface FormError { export interface FormError {
message: string; message: string;

View File

@@ -9,7 +9,7 @@ import { formObjectFromIdSelector } from './selectors';
import { FormBuilderService } from './builder/form-builder.service'; import { FormBuilderService } from './builder/form-builder.service';
import { DynamicFormControlEvent, DynamicFormControlModel, DynamicFormGroupModel } from '@ng-dynamic-forms/core'; import { DynamicFormControlEvent, DynamicFormControlModel, DynamicFormGroupModel } from '@ng-dynamic-forms/core';
import { isEmpty, isNotUndefined } from '../empty.util'; import { isEmpty, isNotUndefined } from '../empty.util';
import { uniqueId } from 'lodash'; import uniqueId from 'lodash/uniqueId';
import { import {
FormAddError, FormAddError,
FormAddTouchedAction, FormAddTouchedAction,

View File

@@ -11,7 +11,7 @@ import { AppState } from '../../../app.reducer';
import { NotificationComponent } from '../notification/notification.component'; import { NotificationComponent } from '../notification/notification.component';
import { Notification } from '../models/notification.model'; import { Notification } from '../models/notification.model';
import { NotificationType } from '../models/notification-type'; import { NotificationType } from '../models/notification-type';
import { uniqueId } from 'lodash'; import uniqueId from 'lodash/uniqueId';
import { INotificationBoardOptions } from '../../../../config/notifications-config.interfaces'; import { INotificationBoardOptions } from '../../../../config/notifications-config.interfaces';
import { NotificationsServiceStub } from '../../testing/notifications-service.stub'; import { NotificationsServiceStub } from '../../testing/notifications-service.stub';
import { cold } from 'jasmine-marbles'; import { cold } from 'jasmine-marbles';

View File

@@ -10,7 +10,7 @@ import {
import { select, Store } from '@ngrx/store'; import { select, Store } from '@ngrx/store';
import { BehaviorSubject, Subscription } from 'rxjs'; import { BehaviorSubject, Subscription } from 'rxjs';
import { difference } from 'lodash'; import difference from 'lodash/difference';
import { NotificationsService } from '../notifications.service'; import { NotificationsService } from '../notifications.service';
import { AppState } from '../../../app.reducer'; import { AppState } from '../../../app.reducer';

View File

@@ -9,7 +9,7 @@ import { NotificationOptions } from './models/notification-options.model';
import { NotificationAnimationsType } from './models/notification-animations-type'; import { NotificationAnimationsType } from './models/notification-animations-type';
import { NotificationType } from './models/notification-type'; import { NotificationType } from './models/notification-type';
import { Notification } from './models/notification.model'; import { Notification } from './models/notification.model';
import { uniqueId } from 'lodash'; import uniqueId from 'lodash/uniqueId';
import { ChangeDetectorRef } from '@angular/core'; import { ChangeDetectorRef } from '@angular/core';
import { storeModuleConfig } from '../../app.reducer'; import { storeModuleConfig } from '../../app.reducer';

View File

@@ -4,7 +4,7 @@ import { of as observableOf } from 'rxjs';
import { first } from 'rxjs/operators'; import { first } from 'rxjs/operators';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { uniqueId } from 'lodash'; import uniqueId from 'lodash/uniqueId';
import { INotification, Notification } from './models/notification.model'; import { INotification, Notification } from './models/notification.model';
import { NotificationType } from './models/notification-type'; import { NotificationType } from './models/notification-type';

View File

@@ -1,5 +1,7 @@
import { isNotEmpty } from './empty.util'; import { isNotEmpty } from './empty.util';
import { isEqual, isObject, transform } from 'lodash'; import isEqual from 'lodash/isEqual';
import isObject from 'lodash/isObject';
import transform from 'lodash/transform';
/** /**
* Returns passed object without specified property * Returns passed object without specified property

View File

@@ -4,7 +4,7 @@ import { ChangeDetectorRef, Component, Injector, NO_ERRORS_SCHEMA } from '@angul
import { of as observableOf } from 'rxjs'; import { of as observableOf } from 'rxjs';
import { TranslateModule } from '@ngx-translate/core'; import { TranslateModule } from '@ngx-translate/core';
import { cold } from 'jasmine-marbles'; import { cold } from 'jasmine-marbles';
import { uniqueId } from 'lodash'; import uniqueId from 'lodash/uniqueId';
import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils'; import { createSuccessfulRemoteDataObject } from '../../../remote-data.utils';
import { createTestComponent } from '../../../testing/utils.test'; import { createTestComponent } from '../../../testing/utils.test';
@@ -19,10 +19,8 @@ import { PaginationComponentOptions } from '../../../pagination/pagination-compo
import { buildPaginatedList } from '../../../../core/data/paginated-list.model'; import { buildPaginatedList } from '../../../../core/data/paginated-list.model';
import { PageInfo } from '../../../../core/shared/page-info.model'; import { PageInfo } from '../../../../core/shared/page-info.model';
import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { SortDirection, SortOptions } from '../../../../core/cache/models/sort-options.model';
import { PaginationService } from '../../../../core/pagination/pagination.service'; import { PaginationService } from '../../../../core/pagination/pagination.service';
import { PaginationServiceStub } from '../../../testing/pagination-service.stub'; import { PaginationServiceStub } from '../../../testing/pagination-service.stub';
import { FindListOptions } from '../../../../core/data/find-list-options.model';
describe('EpersonGroupListComponent test suite', () => { describe('EpersonGroupListComponent test suite', () => {
let comp: EpersonGroupListComponent; let comp: EpersonGroupListComponent;

View File

@@ -2,7 +2,7 @@ import { Component, EventEmitter, Injector, Input, OnDestroy, OnInit, Output } f
import { BehaviorSubject, Observable, Subscription } from 'rxjs'; import { BehaviorSubject, Observable, Subscription } from 'rxjs';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
import { uniqueId } from 'lodash'; import uniqueId from 'lodash/uniqueId';
import { RemoteData } from '../../../../core/data/remote-data'; import { RemoteData } from '../../../../core/data/remote-data';
import { PaginatedList } from '../../../../core/data/paginated-list.model'; import { PaginatedList } from '../../../../core/data/paginated-list.model';

View File

@@ -10,7 +10,7 @@ import { MyDSpaceConfigurationValueType } from '../../../my-dspace-page/my-dspac
import { SearchConfigurationOption } from './search-configuration-option.model'; import { SearchConfigurationOption } from './search-configuration-option.model';
import { SearchService } from '../../../core/shared/search/search.service'; import { SearchService } from '../../../core/shared/search/search.service';
import { currentPath } from '../../utils/route.utils'; import { currentPath } from '../../utils/route.utils';
import { findIndex } from 'lodash'; import findIndex from 'lodash/findIndex';
@Component({ @Component({
selector: 'ds-search-switch-configuration', selector: 'ds-search-switch-configuration',

View File

@@ -3,7 +3,7 @@ import { Router } from '@angular/router';
import { BehaviorSubject, combineLatest, Observable, Subscription } from 'rxjs'; import { BehaviorSubject, combineLatest, Observable, Subscription } from 'rxjs';
import { debounceTime, distinctUntilChanged, filter, map, switchMap } from 'rxjs/operators'; import { debounceTime, distinctUntilChanged, filter, map, switchMap } from 'rxjs/operators';
import { uniqueId } from 'lodash'; import uniqueId from 'lodash/uniqueId';
import { PaginatedList } from '../../core/data/paginated-list.model'; import { PaginatedList } from '../../core/data/paginated-list.model';
import { RemoteData } from '../../core/data/remote-data'; import { RemoteData } from '../../core/data/remote-data';

View File

@@ -2,7 +2,7 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Ho
import { of as observableOf } from 'rxjs'; import { of as observableOf } from 'rxjs';
import { FileUploader } from 'ng2-file-upload'; import { FileUploader } from 'ng2-file-upload';
import { uniqueId } from 'lodash'; import uniqueId from 'lodash/uniqueId';
import { ScrollToService } from '@nicky-lenaers/ngx-scroll-to'; import { ScrollToService } from '@nicky-lenaers/ngx-scroll-to';
import { UploaderOptions } from './uploader-options.model'; import { UploaderOptions } from './uploader-options.model';

View File

@@ -62,7 +62,7 @@ export class MarkdownPipe implements PipeTransform {
let html: string; let html: string;
if (environment.markdown.mathjax) { if (environment.markdown.mathjax) {
md.use(await this.mathjax); md.use(await this.mathjax);
const sanitizeHtml = await this.sanitizeHtml const sanitizeHtml = await this.sanitizeHtml;
html = sanitizeHtml(md.render(value), { html = sanitizeHtml(md.render(value), {
// sanitize-html doesn't let through SVG by default, so we extend its allowlists to cover MathJax SVG // sanitize-html doesn't let through SVG by default, so we extend its allowlists to cover MathJax SVG
allowedTags: [ allowedTags: [
@@ -98,6 +98,6 @@ export class MarkdownPipe implements PipeTransform {
html = this.sanitizer.sanitize(SecurityContext.HTML, md.render(value)); html = this.sanitizer.sanitize(SecurityContext.HTML, md.render(value));
} }
return this.sanitizer.bypassSecurityTrustHtml(html) return this.sanitizer.bypassSecurityTrustHtml(html);
} }
} }

View File

@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { BehaviorSubject, Observable, of as observableOf } from 'rxjs'; import { BehaviorSubject, Observable, of as observableOf } from 'rxjs';
import { map, merge, mergeMap, scan } from 'rxjs/operators'; import { map, merge, mergeMap, scan } from 'rxjs/operators';
import { findIndex } from 'lodash'; import findIndex from 'lodash/findIndex';
import { import {
LOAD_MORE_NODE, LOAD_MORE_NODE,

View File

@@ -2,7 +2,7 @@ import { StatisticsService } from './statistics.service';
import { RequestService } from '../core/data/request.service'; import { RequestService } from '../core/data/request.service';
import { HALEndpointServiceStub } from '../shared/testing/hal-endpoint-service.stub'; import { HALEndpointServiceStub } from '../shared/testing/hal-endpoint-service.stub';
import { getMockRequestService } from '../shared/mocks/request.service.mock'; import { getMockRequestService } from '../shared/mocks/request.service.mock';
import { isEqual } from 'lodash'; import isEqual from 'lodash/isEqual';
import { DSpaceObjectType } from '../core/shared/dspace-object-type.model'; import { DSpaceObjectType } from '../core/shared/dspace-object-type.model';
import { SearchOptions } from '../shared/search/models/search-options.model'; import { SearchOptions } from '../shared/search/models/search-options.model';
import { RestRequest } from '../core/data/rest-request.model'; import { RestRequest } from '../core/data/rest-request.model';

View File

@@ -2,7 +2,9 @@ import { Injectable } from '@angular/core';
import { Actions, createEffect, ofType } from '@ngrx/effects'; import { Actions, createEffect, ofType } from '@ngrx/effects';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { findKey, isEqual, union } from 'lodash'; import findKey from 'lodash/findKey';
import isEqual from 'lodash/isEqual';
import union from 'lodash/union';
import { from as observableFrom, Observable, of as observableOf } from 'rxjs'; import { from as observableFrom, Observable, of as observableOf } from 'rxjs';
import { catchError, filter, map, mergeMap, switchMap, take, tap, withLatestFrom } from 'rxjs/operators'; import { catchError, filter, map, mergeMap, switchMap, take, tap, withLatestFrom } from 'rxjs/operators';

View File

@@ -1,5 +1,8 @@
import { hasValue, isEmpty, isNotEmpty, isNotNull, isUndefined } from '../../shared/empty.util'; import { hasValue, isEmpty, isNotEmpty, isNotNull, isUndefined } from '../../shared/empty.util';
import { differenceWith, findKey, isEqual, uniqWith } from 'lodash'; import differenceWith from 'lodash/differenceWith';
import findKey from 'lodash/findKey';
import isEqual from 'lodash/isEqual';
import uniqWith from 'lodash/uniqWith';
import { import {
ChangeSubmissionCollectionAction, ChangeSubmissionCollectionAction,

View File

@@ -1,6 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { isEqual, isObject } from 'lodash'; import isEqual from 'lodash/isEqual';
import isObject from 'lodash/isObject';
import { import {
DYNAMIC_FORM_CONTROL_TYPE_ARRAY, DYNAMIC_FORM_CONTROL_TYPE_ARRAY,
DYNAMIC_FORM_CONTROL_TYPE_GROUP, DYNAMIC_FORM_CONTROL_TYPE_GROUP,

View File

@@ -4,7 +4,8 @@ import { DynamicFormControlEvent, DynamicFormControlModel } from '@ng-dynamic-fo
import { combineLatest as observableCombineLatest, Observable, Subscription } from 'rxjs'; import { combineLatest as observableCombineLatest, Observable, Subscription } from 'rxjs';
import { distinctUntilChanged, filter, find, map, mergeMap, take, tap } from 'rxjs/operators'; import { distinctUntilChanged, filter, find, map, mergeMap, take, tap } from 'rxjs/operators';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { findIndex, isEqual } from 'lodash'; import findIndex from 'lodash/findIndex';
import isEqual from 'lodash/isEqual';
import { FormBuilderService } from '../../../shared/form/builder/form-builder.service'; import { FormBuilderService } from '../../../shared/form/builder/form-builder.service';
import { FormComponent } from '../../../shared/form/form.component'; import { FormComponent } from '../../../shared/form/form.component';

View File

@@ -2,7 +2,7 @@ import { ChangeDetectorRef, Directive, Input, OnDestroy, OnInit } from '@angular
import { Observable, Subscription } from 'rxjs'; import { Observable, Subscription } from 'rxjs';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
import { uniq } from 'lodash'; import uniq from 'lodash/uniq';
import { SectionsService } from './sections.service'; import { SectionsService } from './sections.service';
import { hasValue, isNotEmpty, isNotNull } from '../../shared/empty.util'; import { hasValue, isNotEmpty, isNotNull } from '../../shared/empty.util';

View File

@@ -5,7 +5,9 @@ import { distinctUntilChanged, filter, map, mergeMap, take } from 'rxjs/operator
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { ScrollToConfigOptions, ScrollToService } from '@nicky-lenaers/ngx-scroll-to'; import { ScrollToConfigOptions, ScrollToService } from '@nicky-lenaers/ngx-scroll-to';
import { findIndex, findKey, isEqual } from 'lodash'; import findIndex from 'lodash/findIndex';
import findKey from 'lodash/findKey';
import isEqual from 'lodash/isEqual';
import { SubmissionState } from '../submission.reducers'; import { SubmissionState } from '../submission.reducers';
import { hasValue, isEmpty, isNotEmpty, isNotUndefined } from '../../shared/empty.util'; import { hasValue, isEmpty, isNotEmpty, isNotUndefined } from '../../shared/empty.util';

View File

@@ -20,6 +20,7 @@
"strictNullChecks": false, "strictNullChecks": false,
"skipDefaultLibCheck": true, "skipDefaultLibCheck": true,
"pretty": true, "pretty": true,
"allowSyntheticDefaultImports": true,
"target": "es2015", "target": "es2015",
"typeRoots": [ "typeRoots": [
"node_modules/@types", "node_modules/@types",