File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ import { validate as uuidValidate } from 'uuid';
1414
1515export const AUTHORITY_GENERATE = 'will be generated::' ;
1616export const AUTHORITY_REFERENCE = 'will be referenced::' ;
17+ export const PLACEHOLDER_VALUE = '#PLACEHOLDER_PARENT_METADATA_VALUE#' ;
18+
1719
1820/**
1921 * Utility class for working with DSpace object metadata.
@@ -29,7 +31,6 @@ export const AUTHORITY_REFERENCE = 'will be referenced::';
2931 * followed by any other (non-dc) metadata values.
3032 */
3133export class Metadata {
32-
3334 /**
3435 * Gets all matching metadata in the map(s).
3536 *
@@ -152,7 +153,7 @@ export class Metadata {
152153 * Returns true if this Metadatum's value is defined
153154 */
154155 public static hasValue ( value : MetadataValue | string ) : boolean {
155- if ( isEmpty ( value ) ) {
156+ if ( isEmpty ( value ) || value === PLACEHOLDER_VALUE ) {
156157 return false ;
157158 }
158159 if ( isObject ( value ) && value . hasOwnProperty ( 'value' ) ) {
@@ -169,7 +170,9 @@ export class Metadata {
169170 * @returns {boolean } whether the filter matches, or true if no filter is given.
170171 */
171172 public static valueMatches ( mdValue : MetadataValue , filter : MetadataValueFilter ) {
172- if ( ! filter ) {
173+ if ( mdValue . value === PLACEHOLDER_VALUE ) {
174+ return false ;
175+ } else if ( ! filter ) {
173176 return true ;
174177 } else if ( filter . language && filter . language !== mdValue . language ) {
175178 return false ;
You can’t perform that action at this time.
0 commit comments