message: place string protype methods in SchemaFileLocater temporarily
diff: @@ -13,12 +13,13 @@ export class CandidateSchema extends Schema {
  public searchPath: string;
  }
  +// Temporary work around - need to add format method to string here for now....
  declare global {
  interface String {
  format(...params: string[]): string;
  + padStartEx(targetLength: number, padString: string): string;
  }
  }
  -
  String.prototype.format = function() {
  const args = arguments;
  return this.replace(/{(\d+)}/g, (match, theNumber) => {
  @@ -28,6 +29,23 @@ String.prototype.format = function() {
  });
  };
  +// Temporary work around - need to add padStart method to string here for now...
  +if (!String.prototype.padStartEx) {
  + String.prototype.padStartEx = function padStartEx(targetLength, padString) {
  + targetLength = targetLength >> 0; // truncate if number or convert non-number to 0;
  + padString = String((typeof padString !== "undefined" ? padString : " "));
  + if (this.length > targetLength) {
  + return String(this);
  + } else {
  + targetLength = targetLength - this.length;
  + if (targetLength > padString.length) {
  + padString += padString.repeat(targetLength / padString.length); // append to original to ensure we are longer than needed
  + }
  + return padString.slice(0, targetLength) + String(this);
  + }
  + };
  +}
  +
  export class SchemaXmlFileLocater {
  private _searchPaths: string[];
  private _knownSchemas: SchemaCache;
  @@ -195,15 +213,15 @@ export class SchemaXmlFileLocater {
  twoVersionSuffix = ".*.*.ecschema.xml";
  threeVersionSuffix = ".*.*.*.ecschema.xml";
  } else if (matchType === SchemaMatchType.LatestWriteCompatible) {
  - twoVersionSuffix = ".{0}.*.ecschema.xml".format(readVersion.padStart(2, "0"));
  - threeVersionSuffix = ".{0}.{1}.*.ecschema.xml".format(readVersion.padStart(2, "0"), writeVersion.padStart(2, "0"));
  + twoVersionSuffix = ".{0}.*.ecschema.xml".format(readVersion.padStartEx(2, "0"));
  + threeVersionSuffix = ".{0}.{1}.*.ecschema.xml".format(readVersion.padStartEx(2, "0"), writeVersion.padStartEx(2, "0"));
  } else if (matchType === SchemaMatchType.LatestReadCompatible) {
  - twoVersionSuffix = ".{0}.*.ecschema.xml".format(readVersion.padStart(2, "0"));
  - threeVersionSuffix = ".{0}.*.*.ecschema.xml".format(readVersion.padStart(2, "0"));
  + twoVersionSuffix = ".{0}.*.ecschema.xml".format(readVersion.padStartEx(2, "0"));
  + threeVersionSuffix = ".{0}.*.*.ecschema.xml".format(readVersion.padStartEx(2, "0"));
  } else {
  - twoVersionSuffix = ".{0}.{1}.ecschema.xml".format(readVersion.padStart(2, "0"), writeVersion.padStart(2, "0"));
  - threeVersionSuffix = ".{0}.{1}.{2}.ecschema.xml".format(readVersion.padStart(2, "0"), writeVersion.padStart(2, "0"),
  - minorVersion.padStart(2, "0"));
  + twoVersionSuffix = ".{0}.{1}.ecschema.xml".format(readVersion.padStartEx(2, "0"), writeVersion.padStartEx(2, "0"));
  + threeVersionSuffix = ".{0}.{1}.{2}.ecschema.xml".format(readVersion.padStartEx(2, "0"), writeVersion.padStartEx(2, "0"),
  + minorVersion.padStartEx(2, "0"));
  }
  const twoVersionExpression = desiredKey.name + twoVersionSuffix;
  