-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:GrimoireGL/GrimoireJS into develop
- Loading branch information
Showing
49 changed files
with
1,307 additions
and
623 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
import Identity from "../Core/Identity"; | ||
import Namespace from "../Core/Namespace"; | ||
import IAttributeConverterDeclaration from "../Interface/IAttributeConverterDeclaration"; | ||
import { IStandardConverterDeclaration } from "../Interface/IAttributeConverterDeclaration"; | ||
import { __NAMESPACE__ } from "../metaInfo"; | ||
import { Undef } from "../Tool/Types"; | ||
import { Name, Undef } from "../Tool/Types"; | ||
|
||
export default { | ||
export const StringConverter = { | ||
name: Namespace.define(__NAMESPACE__).for("String"), | ||
/** | ||
* convert to string | ||
* @param val | ||
*/ | ||
convert(val: any): Undef<string> { | ||
convert(val: any): string | undefined { | ||
if (typeof val === "string") { | ||
return val; | ||
} else if (!val) { | ||
return val; | ||
} else if (typeof val.toString === "function") { | ||
return val.toString(); | ||
} | ||
return undefined; | ||
}, | ||
} as IAttributeConverterDeclaration<string | null>; | ||
}; | ||
export default StringConverter; |
Oops, something went wrong.