dependency upgrades, server and platform module updates, linting wip

This commit is contained in:
William Welling
2017-07-12 14:33:16 -05:00
parent afc39022f8
commit c08f5c672b
190 changed files with 6321 additions and 4703 deletions

View File

@@ -9,82 +9,82 @@ import { ResourceType } from "./resource-type";
*/
export abstract class DSpaceObject implements CacheableObject {
self: string;
self: string;
/**
* The human-readable identifier of this DSpaceObject
*/
id: string;
/**
* The human-readable identifier of this DSpaceObject
*/
id: string;
/**
* The universally unique identifier of this DSpaceObject
*/
uuid: string;
/**
* The universally unique identifier of this DSpaceObject
*/
uuid: string;
/**
* A string representing the kind of DSpaceObject, e.g. community, item, …
*/
type: ResourceType;
/**
* A string representing the kind of DSpaceObject, e.g. community, item, …
*/
type: ResourceType;
/**
* The name for this DSpaceObject
*/
name: string;
/**
* The name for this DSpaceObject
*/
name: string;
/**
* An array containing all metadata of this DSpaceObject
*/
metadata: Array<Metadatum>;
/**
* An array containing all metadata of this DSpaceObject
*/
metadata: Array<Metadatum>;
/**
* An array of DSpaceObjects that are direct parents of this DSpaceObject
*/
parents: RemoteData<DSpaceObject[]>;
/**
* An array of DSpaceObjects that are direct parents of this DSpaceObject
*/
parents: RemoteData<DSpaceObject[]>;
/**
* The DSpaceObject that owns this DSpaceObject
*/
owner: RemoteData<DSpaceObject>;
/**
* The DSpaceObject that owns this DSpaceObject
*/
owner: RemoteData<DSpaceObject>;
/**
* Find a metadata field by key and language
*
* This method returns the value of the first element
* in the metadata array that matches the provided
* key and language
*
* @param key
* @param language
* @return string
*/
findMetadata(key: string, language?: string): string {
const metadatum = this.metadata
.find((metadatum: Metadatum) => {
return metadatum.key === key &&
(isEmpty(language) || metadatum.language === language)
});
if (isNotEmpty(metadatum)) {
return metadatum.value;
}
else {
return undefined;
}
/**
* Find a metadata field by key and language
*
* This method returns the value of the first element
* in the metadata array that matches the provided
* key and language
*
* @param key
* @param language
* @return string
*/
findMetadata(key: string, language?: string): string {
const metadatum = this.metadata
.find((metadatum: Metadatum) => {
return metadatum.key === key &&
(isEmpty(language) || metadatum.language === language)
});
if (isNotEmpty(metadatum)) {
return metadatum.value;
}
/**
* Find metadata by an array of keys
*
* This method returns the values of the element
* in the metadata array that match the provided
* key(s)
*
* @param key(s)
* @return Array<Metadatum>
*/
filterMetadata(keys: string[]): Array<Metadatum> {
return this.metadata
.filter((metadatum: Metadatum) => {
return keys.some(key => key === metadatum.key);
});
else {
return undefined;
}
}
/**
* Find metadata by an array of keys
*
* This method returns the values of the element
* in the metadata array that match the provided
* key(s)
*
* @param key(s)
* @return Array<Metadatum>
*/
filterMetadata(keys: string[]): Array<Metadatum> {
return this.metadata
.filter((metadatum: Metadatum) => {
return keys.some(key => key === metadatum.key);
});
}
}