From 367b25494da7cb5f82ab3f07bbc9189f47f2ae2c Mon Sep 17 00:00:00 2001 From: pixelzoom Date: Mon, 11 Jul 2022 17:13:47 -0600 Subject: [PATCH] factor out TANDEM_NAME_SUFFIX, https://github.com/phetsims/tandem/issues/267 --- js/util/ProfileColorProperty.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/util/ProfileColorProperty.ts b/js/util/ProfileColorProperty.ts index ff4259916..5783d7d74 100644 --- a/js/util/ProfileColorProperty.ts +++ b/js/util/ProfileColorProperty.ts @@ -31,6 +31,8 @@ export default class ProfileColorProperty extends ColorProperty { // Treat as private readonly name: string; + public static readonly TANDEM_NAME_SUFFIX = 'ColorProperty'; + /** * @param namespace - namespace that this color belongs to * @param colorName - name of the color, unique within namespace @@ -66,9 +68,9 @@ export default class ProfileColorProperty extends ColorProperty { super( Color.toColor( colorProfileMap[ colorProfileProperty.value ] || colorProfileMap[ SceneryConstants.DEFAULT_COLOR_PROFILE ] ), options ); assert && assert( !this.isPhetioInstrumented() || - tandem.name.endsWith( 'ColorProperty' ) || + tandem.name.endsWith( ProfileColorProperty.TANDEM_NAME_SUFFIX ) || tandem.name === 'colorProperty', - `Property tandem.name must end with ColorProperty: ${tandem.phetioID}` ); + `Property tandem.name must end with ${ProfileColorProperty.TANDEM_NAME_SUFFIX}: ${tandem.phetioID}` ); this.colorProfileMap = colorProfileMap;