forked from hazza/dspace-angular
ESLint: fix indentation
This commit is contained in:
@@ -33,7 +33,7 @@ export class Metadata {
|
||||
* @returns {MetadataValue[]} the matching values or an empty array.
|
||||
*/
|
||||
public static all(mapOrMaps: MetadataMapInterface | MetadataMapInterface[], keyOrKeys: string | string[],
|
||||
filter?: MetadataValueFilter): MetadataValue[] {
|
||||
filter?: MetadataValueFilter): MetadataValue[] {
|
||||
const mdMaps: MetadataMapInterface[] = mapOrMaps instanceof Array ? mapOrMaps : [mapOrMaps];
|
||||
const matches: MetadataValue[] = [];
|
||||
for (const mdMap of mdMaps) {
|
||||
@@ -64,7 +64,7 @@ export class Metadata {
|
||||
* @returns {string[]} the matching string values or an empty array.
|
||||
*/
|
||||
public static allValues(mapOrMaps: MetadataMapInterface | MetadataMapInterface[], keyOrKeys: string | string[],
|
||||
filter?: MetadataValueFilter): string[] {
|
||||
filter?: MetadataValueFilter): string[] {
|
||||
return Metadata.all(mapOrMaps, keyOrKeys, filter).map((mdValue) => mdValue.value);
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ export class Metadata {
|
||||
* @returns {MetadataValue} the first matching value, or `undefined`.
|
||||
*/
|
||||
public static first(mdMapOrMaps: MetadataMapInterface | MetadataMapInterface[], keyOrKeys: string | string[],
|
||||
filter?: MetadataValueFilter): MetadataValue {
|
||||
filter?: MetadataValueFilter): MetadataValue {
|
||||
const mdMaps: MetadataMapInterface[] = mdMapOrMaps instanceof Array ? mdMapOrMaps : [mdMapOrMaps];
|
||||
for (const mdMap of mdMaps) {
|
||||
for (const key of Metadata.resolveKeys(mdMap, keyOrKeys)) {
|
||||
@@ -98,7 +98,7 @@ export class Metadata {
|
||||
* @returns {string} the first matching string value, or `undefined`.
|
||||
*/
|
||||
public static firstValue(mdMapOrMaps: MetadataMapInterface | MetadataMapInterface[], keyOrKeys: string | string[],
|
||||
filter?: MetadataValueFilter): string {
|
||||
filter?: MetadataValueFilter): string {
|
||||
const value = Metadata.first(mdMapOrMaps, keyOrKeys, filter);
|
||||
return isUndefined(value) ? undefined : value.value;
|
||||
}
|
||||
@@ -112,7 +112,7 @@ export class Metadata {
|
||||
* @returns {boolean} whether a match is found.
|
||||
*/
|
||||
public static has(mdMapOrMaps: MetadataMapInterface | MetadataMapInterface[], keyOrKeys: string | string[],
|
||||
filter?: MetadataValueFilter): boolean {
|
||||
filter?: MetadataValueFilter): boolean {
|
||||
return isNotUndefined(Metadata.first(mdMapOrMaps, keyOrKeys, filter));
|
||||
}
|
||||
|
||||
@@ -209,11 +209,11 @@ export class Metadata {
|
||||
.forEach((key: string) => {
|
||||
const orderedValues = sortBy(groupedList[key], ['order']);
|
||||
metadataMap[key] = orderedValues.map((value: MetadatumViewModel) => {
|
||||
const val = Object.assign(new MetadataValue(), value);
|
||||
delete (val as any).order;
|
||||
delete (val as any).key;
|
||||
return val;
|
||||
}
|
||||
const val = Object.assign(new MetadataValue(), value);
|
||||
delete (val as any).order;
|
||||
delete (val as any).key;
|
||||
return val;
|
||||
}
|
||||
);
|
||||
});
|
||||
return metadataMap;
|
||||
|
Reference in New Issue
Block a user