Skip to content

Commit

Permalink
factor out TANDEM_NAME_SUFFIX, phetsims/tandem#267
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Jul 11, 2022
1 parent 19c7e20 commit 367b254
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/util/ProfileColorProperty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 367b254

Please sign in to comment.