Compare commits
2 Commits
eeb3ba970c
...
6b85e63c14
Author | SHA1 | Date |
---|---|---|
Stephane-Scality | 6b85e63c14 | |
Jonathan Gramain | 1b4c946669 |
|
@ -106,10 +106,12 @@ class ObjectMD {
|
||||||
},
|
},
|
||||||
'key': '',
|
'key': '',
|
||||||
'location': null,
|
'location': null,
|
||||||
'isNull': '',
|
// versionId, isNull, nullVersionId and isDeleteMarker
|
||||||
'nullVersionId': '',
|
// should be undefined when not set explicitly
|
||||||
'isDeleteMarker': '',
|
'isNull': undefined,
|
||||||
'versionId': undefined, // If no versionId, it should be undefined
|
'nullVersionId': undefined,
|
||||||
|
'isDeleteMarker': undefined,
|
||||||
|
'versionId': undefined,
|
||||||
'tags': {},
|
'tags': {},
|
||||||
'replicationInfo': {
|
'replicationInfo': {
|
||||||
status: '',
|
status: '',
|
||||||
|
@ -605,7 +607,7 @@ class ObjectMD {
|
||||||
* @return {boolean} Whether new version is null or not
|
* @return {boolean} Whether new version is null or not
|
||||||
*/
|
*/
|
||||||
getIsNull() {
|
getIsNull() {
|
||||||
return this._data.isNull;
|
return this._data.isNull || false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -622,7 +624,7 @@ class ObjectMD {
|
||||||
/**
|
/**
|
||||||
* Get metadata nullVersionId value
|
* Get metadata nullVersionId value
|
||||||
*
|
*
|
||||||
* @return {string} The version id of the null version
|
* @return {string|undefined} The version id of the null version
|
||||||
*/
|
*/
|
||||||
getNullVersionId() {
|
getNullVersionId() {
|
||||||
return this._data.nullVersionId;
|
return this._data.nullVersionId;
|
||||||
|
@ -645,7 +647,7 @@ class ObjectMD {
|
||||||
* @return {boolean} Whether object is a delete marker
|
* @return {boolean} Whether object is a delete marker
|
||||||
*/
|
*/
|
||||||
getIsDeleteMarker() {
|
getIsDeleteMarker() {
|
||||||
return this._data.isDeleteMarker;
|
return this._data.isDeleteMarker || false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -662,7 +664,7 @@ class ObjectMD {
|
||||||
/**
|
/**
|
||||||
* Get metadata versionId value
|
* Get metadata versionId value
|
||||||
*
|
*
|
||||||
* @return {string} The object versionId
|
* @return {string|undefined} The object versionId
|
||||||
*/
|
*/
|
||||||
getVersionId() {
|
getVersionId() {
|
||||||
return this._data.versionId;
|
return this._data.versionId;
|
||||||
|
@ -672,7 +674,7 @@ class ObjectMD {
|
||||||
* Get metadata versionId value in encoded form (the one visible
|
* Get metadata versionId value in encoded form (the one visible
|
||||||
* to the S3 API user)
|
* to the S3 API user)
|
||||||
*
|
*
|
||||||
* @return {string} The encoded object versionId
|
* @return {string|undefined} The encoded object versionId
|
||||||
*/
|
*/
|
||||||
getEncodedVersionId() {
|
getEncodedVersionId() {
|
||||||
return VersionIDUtils.encode(this.getVersionId());
|
return VersionIDUtils.encode(this.getVersionId());
|
||||||
|
|
|
@ -60,11 +60,11 @@ describe('ObjectMD class setters/getters', () => {
|
||||||
['Key', 'key'],
|
['Key', 'key'],
|
||||||
['Location', null, []],
|
['Location', null, []],
|
||||||
['Location', ['location1']],
|
['Location', ['location1']],
|
||||||
['IsNull', null, ''],
|
['IsNull', null, false],
|
||||||
['IsNull', true],
|
['IsNull', true],
|
||||||
['NullVersionId', null, ''],
|
['NullVersionId', null, undefined],
|
||||||
['NullVersionId', '111111'],
|
['NullVersionId', '111111'],
|
||||||
['IsDeleteMarker', null, ''],
|
['IsDeleteMarker', null, false],
|
||||||
['IsDeleteMarker', true],
|
['IsDeleteMarker', true],
|
||||||
['VersionId', null, undefined],
|
['VersionId', null, undefined],
|
||||||
['VersionId', '111111'],
|
['VersionId', '111111'],
|
||||||
|
|
Loading…
Reference in New Issue