[Code Style] Run gulp fixstyle

...to apply code style settings from #142.
This commit is contained in:
Victor Woeltjen
2016-05-19 11:29:13 -07:00
parent f12b9704d9
commit fa77139077
440 changed files with 1885 additions and 1662 deletions

View File

@ -82,7 +82,7 @@ define(
parentContext =
parentObject && parentObject.getCapability('context'),
parentPath = parentContext ?
parentContext.getPath() : [ this.parentObject ];
parentContext.getPath() : [this.parentObject];
return parentPath.concat([this.domainObject]);
};

View File

@ -69,18 +69,18 @@ define(
* Checks if the value returned is falsey, and if so returns a
* rejected promise
*/
function rejectIfFalsey(value, $q){
if (!value){
function rejectIfFalsey(value, $q) {
if (!value) {
return $q.reject("Error persisting object");
} else {
return value;
}
}
function formatError(error){
function formatError(error) {
if (error && error.message) {
return error.message;
} else if (error && typeof error === "string"){
} else if (error && typeof error === "string") {
return error;
} else {
return "unknown error";
@ -91,7 +91,7 @@ define(
* Display a notification message if an error has occurred during
* persistence.
*/
function notifyOnError(error, domainObject, notificationService, $q){
function notifyOnError(error, domainObject, notificationService, $q) {
var errorMessage = "Unable to persist " + domainObject.getModel().name;
if (error) {
errorMessage += ": " + formatError(error);
@ -133,9 +133,9 @@ define(
this.getSpace(),
getKey(domainObject.getId()),
domainObject.getModel()
]).then(function(result){
]).then(function (result) {
return rejectIfFalsey(result, self.$q);
}).catch(function(error){
}).catch(function (error) {
return notifyOnError(error, domainObject, self.notificationService, self.$q);
});
};