Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed ts-lint errors. #27

Merged
merged 1 commit into from May 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ts/AsyncAutoMapper.ts
Expand Up @@ -172,7 +172,7 @@ module AutoMapperJs {
if (childDestinationProperty) {
var childDestinationObject = destinationObject[destinationProperty.name];
if (!childDestinationObject) {
// no child source object? create.
// no child source object? create.
childDestinationObject = <any>{};
}

Expand Down
14 changes: 7 additions & 7 deletions src/ts/AutoMapper.ts
Expand Up @@ -305,7 +305,7 @@ module AutoMapperJs {
if (childDestinationProperty) {
var childDestinationObject = destinationObject[destinationProperty.name];
if (!childDestinationObject) {
// no child source object? create.
// no child source object? create.
childDestinationObject = <any>{};
}

Expand Down Expand Up @@ -543,15 +543,15 @@ module AutoMapperJs {
}

if (property.destinationPropertyName !== property.sourcePropertyName) {
// this is a mapFrom() registration. It is handled using the nested source properties,
// this is a mapFrom() registration. It is handled using the nested source properties,
// we only are responsible for syncing the name properties.
existing.name = property.name;
existing.sourcePropertyName = property.sourcePropertyName;
}
return true;
}

// existing is not (further) nested. this is always a mapFrom() situation.
// existing is not (further) nested. this is always a mapFrom() situation.
// if (property.sourcePropertyName !== existing.sourcePropertyName) {
let newDestination = this.getDestinationProperty(existing.destinationPropertyName, property);

Expand All @@ -577,8 +577,8 @@ module AutoMapperJs {
// }
}

/**
* handle property naming when the current property to merge is a mapFrom property
/**
* handle property naming when the current property to merge is a mapFrom property
*/
private handleMapFromProperties<TProperty extends IProperty>(property: TProperty, existingProperty: TProperty): boolean {
if (property.destinationPropertyName === property.sourcePropertyName ||
Expand Down Expand Up @@ -621,7 +621,7 @@ module AutoMapperJs {
return true;
}

// the current destination is not (further) nested. a destination property registration has one of both:
// the current destination is not (further) nested. a destination property registration has one of both:
// a) children or b) transformations. returning false will cause creating a duplicate source property entry instead.
return false;
}
Expand All @@ -640,7 +640,7 @@ module AutoMapperJs {
}

if (destination.ignore) {
// only set ignore when not yet set, once ignored is ignored forever.
// only set ignore when not yet set, once ignored is ignored forever.
existingDestination.ignore = destination.ignore;
}

Expand Down
4 changes: 2 additions & 2 deletions src/ts/AutoMapperBase.ts
Expand Up @@ -269,8 +269,8 @@ module AutoMapperJs {
sourcePropertyName: string,
transformFunction: (destinationProperty: IDestinationProperty, memberOptions: IDMCO) => void): void {
if (propertyMapping.children && propertyMapping.children.length > 0) {
// always pass child source object, even if source object does not exist =>
// constant transformations should always pass.
// always pass child source object, even if source object does not exist =>
// constant transformations should always pass.
var childSourceObject = sourceObject ? sourceObject[propertyMapping.name] : null;
for (let child of propertyMapping.children) {
this.processMappedProperty(mapping, child, childSourceObject, child.name, transformFunction);
Expand Down
10 changes: 5 additions & 5 deletions src/ts/AutoMapperValidator.ts
Expand Up @@ -10,11 +10,11 @@ module AutoMapperJs {
/**
* Validates mapping configuration by dry-running. Since JS does not
* fully support typing, it only checks if properties match on both
* sides. The function needs IMapping.sourceTypeClass and
* sides. The function needs IMapping.sourceTypeClass and
* IMapping.destinationTypeClass to function.
* @param {boolean} strictMode Whether or not to fail when properties
* sourceTypeClass or destinationTypeClass
* are unavailable.
* are unavailable.
*/
public static assertConfigurationIsValid(mappings: any, strictMode: boolean): void {
for (var key in mappings) {
Expand Down Expand Up @@ -92,7 +92,7 @@ module AutoMapperJs {
}
// /* tslint:disable */
// console.error(key);
// /* tslint:enable */
// /* tslint:enable */
}

private static validatePropertyMapping(propertyMapping: ISourceProperty, member: any, srcObj: any, dstObj: any): string {
Expand All @@ -115,7 +115,7 @@ module AutoMapperJs {
return `Source member '${member}' is configured, but does not exist on source type`;
}

// an ignored source member should not exist on the destination type.
// an ignored source member should not exist on the destination type.
if (destinationProperty.ignore) {
if (dstObj.hasOwnProperty(member)) {
return `Source member '${member}' is ignored, but does exist on destination type`;
Expand Down Expand Up @@ -144,7 +144,7 @@ module AutoMapperJs {
return `Destination member '${destinationProperty.destinationPropertyName}' is configured, but does not exist on destination type`;
}

// an ignored destination member should not exist on the source type.
// an ignored destination member should not exist on the source type.
if (destinationProperty.ignore) {
if (srcObj.hasOwnProperty(member)) {
return `Destination member '${member}' is ignored, but does exist on source type`;
Expand Down
2 changes: 1 addition & 1 deletion src/ts/Profile.ts
Expand Up @@ -19,7 +19,7 @@ module AutoMapperJs {

/**
* Implement this method in a derived class and call the CreateMap method to associate that map with this profile.
* Avoid calling the AutoMapper class / automapper instance from this method.
* Avoid calling the AutoMapper class / automapper instance from this method.
*/
public configure(): void {
// do nothing
Expand Down