@@ -2383,17 +2383,7 @@ Object.setUnsafe = function (obj, properties, value) {
23832383/////////////////////////// END ADVENTURE PACK CODE ////////////////////////////"
23842384`;
23852385
2386- exports[`App can equip single goody: JavaScript String.prototype.chars 1`] = `
2387- "////////////////////////// BEGIN ADVENTURE PACK CODE ///////////////////////////
2388- // Adventure Pack commit fake-commit-hash
2389- // Running at: https://example.com/
2390- 
2391- String.prototype.chars = String.prototype[Symbol.iterator];
2392- 
2393- /////////////////////////// END ADVENTURE PACK CODE ////////////////////////////"
2394- `;
2395- 
2396- exports[`App can equip single goody: JavaScript String.prototype.ord 1`] = `
2386+ exports[`App can equip single goody: JavaScript String.prototype.caesar 1`] = `
23972387"////////////////////////// BEGIN ADVENTURE PACK CODE ///////////////////////////
23982388// Adventure Pack commit fake-commit-hash
23992389// Running at: https://example.com/
@@ -2405,14 +2395,39 @@ function nullthrows(value, errorMessage = "Unexpected nullish value!") {
24052395  return value;
24062396}
24072397
2398+ Number.prototype.chr = function () {
2399+   return String.fromCodePoint(Number(this));
2400+ };
2401+ 
2402+ Number.prototype.positiveMod = function (modulo) {
2403+   return ((Number(this) % modulo) + Math.abs(modulo)) % modulo;
2404+ };
2405+ 
24082406String.prototype.ord = function () {
24092407  return nullthrows(this.codePointAt(0));
24102408};
24112409
2410+ String.prototype.caesar = function (delta = 1) {
2411+   return this.replaceAll(/([a-z])|[A-Z]/g, (letter, lower) => {
2412+     const offset = (lower == null ? "A" : "a").ord();
2413+     return ((letter.ord() - offset + delta).positiveMod(26) + offset).chr();
2414+   });
2415+ };
2416+ 
24122417/////////////////////////// END ADVENTURE PACK CODE ////////////////////////////"
24132418`;
24142419
2415- exports[`App can equip single goody: JavaScript String.prototype.rot 1`] = `
2420+ exports[`App can equip single goody: JavaScript String.prototype.chars 1`] = `
2421+ "////////////////////////// BEGIN ADVENTURE PACK CODE ///////////////////////////
2422+ // Adventure Pack commit fake-commit-hash
2423+ // Running at: https://example.com/
2424+ 
2425+ String.prototype.chars = String.prototype[Symbol.iterator];
2426+ 
2427+ /////////////////////////// END ADVENTURE PACK CODE ////////////////////////////"
2428+ `;
2429+ 
2430+ exports[`App can equip single goody: JavaScript String.prototype.ord 1`] = `
24162431"////////////////////////// BEGIN ADVENTURE PACK CODE ///////////////////////////
24172432// Adventure Pack commit fake-commit-hash
24182433// Running at: https://example.com/
@@ -2424,25 +2439,10 @@ function nullthrows(value, errorMessage = "Unexpected nullish value!") {
24242439  return value;
24252440}
24262441
2427- Number.prototype.chr = function () {
2428-   return String.fromCodePoint(Number(this));
2429- };
2430- 
2431- Number.prototype.positiveMod = function (modulo) {
2432-   return ((Number(this) % modulo) + Math.abs(modulo)) % modulo;
2433- };
2434- 
24352442String.prototype.ord = function () {
24362443  return nullthrows(this.codePointAt(0));
24372444};
24382445
2439- String.prototype.rot = function (delta = 1) {
2440-   return this.replaceAll(/([a-z])|([A-Z])/g, (letter, lower, upper) => {
2441-     const offset = (lower == null ? "A" : "a").ord();
2442-     return ((letter.ord() - offset + delta).positiveMod(26) + offset).chr();
2443-   });
2444- };
2445- 
24462446/////////////////////////// END ADVENTURE PACK CODE ////////////////////////////"
24472447`;
24482448
@@ -5000,29 +5000,22 @@ Object.setUnsafe = function (
50005000/////////////////////////// END ADVENTURE PACK CODE ////////////////////////////"
50015001`;
50025002
5003- exports[`App can equip single goody: TypeScript String.prototype.chars  1`] = `
5003+ exports[`App can equip single goody: TypeScript String.prototype.caesar  1`] = `
50045004"////////////////////////// BEGIN ADVENTURE PACK CODE ///////////////////////////
50055005// Adventure Pack commit fake-commit-hash
50065006// Running at: https://example.com/
50075007
50085008declare global {
5009-   interface String {
5010-     chars(this: String): IterableIterator<string>;
5011-   }
5012- }
5013- 
5014- String.prototype.chars = String.prototype[Symbol.iterator];
5015- 
5016- /////////////////////////// END ADVENTURE PACK CODE ////////////////////////////"
5017- `;
5009+   interface Number {
5010+     chr(this: Number): string;
50185011
5019- exports[`App can equip single goody: TypeScript String.prototype.ord 1`] = `
5020- "////////////////////////// BEGIN ADVENTURE PACK CODE ///////////////////////////
5021- // Adventure Pack commit fake-commit-hash
5022- // Running at: https://example.com/
5012+     positiveMod(this: Number, modulo: number): number;
5013+   }
50235014
5024- declare global {
50255015  interface String {
5016+     caesar(this: String): string;
5017+     caesar(this: String, delta: number): string;
5018+ 
50265019    ord(this: String): number;
50275020  }
50285021}
@@ -5037,30 +5030,55 @@ function nullthrows<T>(
50375030  return value;
50385031}
50395032
5033+ Number.prototype.chr = function (this: Number): string {
5034+   return String.fromCodePoint(Number(this));
5035+ };
5036+ 
5037+ Number.prototype.positiveMod = function (this: Number, modulo: number): number {
5038+   return ((Number(this) % modulo) + Math.abs(modulo)) % modulo;
5039+ };
5040+ 
50405041String.prototype.ord = function (this: String): number {
50415042  return nullthrows(this.codePointAt(0));
50425043};
50435044
5045+ String.prototype.caesar = function (this: String, delta: number = 1): string {
5046+   return this.replaceAll(
5047+     /([a-z])|[A-Z]/g,
5048+     (letter: string, lower: string | undefined) => {
5049+       const offset = (lower == null ? "A" : "a").ord();
5050+       return ((letter.ord() - offset + delta).positiveMod(26) + offset).chr();
5051+     },
5052+   );
5053+ };
5054+ 
50445055/////////////////////////// END ADVENTURE PACK CODE ////////////////////////////"
50455056`;
50465057
5047- exports[`App can equip single goody: TypeScript String.prototype.rot  1`] = `
5058+ exports[`App can equip single goody: TypeScript String.prototype.chars  1`] = `
50485059"////////////////////////// BEGIN ADVENTURE PACK CODE ///////////////////////////
50495060// Adventure Pack commit fake-commit-hash
50505061// Running at: https://example.com/
50515062
50525063declare global {
5053-   interface Number {
5054-     chr(this: Number): string;
5055- 
5056-     positiveMod(this: Number, modulo: number): number;
5064+   interface String {
5065+     chars(this: String): IterableIterator<string>;
50575066  }
5067+ }
5068+ 
5069+ String.prototype.chars = String.prototype[Symbol.iterator];
50585070
5071+ /////////////////////////// END ADVENTURE PACK CODE ////////////////////////////"
5072+ `;
5073+ 
5074+ exports[`App can equip single goody: TypeScript String.prototype.ord 1`] = `
5075+ "////////////////////////// BEGIN ADVENTURE PACK CODE ///////////////////////////
5076+ // Adventure Pack commit fake-commit-hash
5077+ // Running at: https://example.com/
5078+ 
5079+ declare global {
50595080  interface String {
50605081    ord(this: String): number;
5061- 
5062-     rot(this: String): string;
5063-     rot(this: String, delta: number): string;
50645082  }
50655083}
50665084
@@ -5074,28 +5092,10 @@ function nullthrows<T>(
50745092  return value;
50755093}
50765094
5077- Number.prototype.chr = function (this: Number): string {
5078-   return String.fromCodePoint(Number(this));
5079- };
5080- 
5081- Number.prototype.positiveMod = function (this: Number, modulo: number): number {
5082-   return ((Number(this) % modulo) + Math.abs(modulo)) % modulo;
5083- };
5084- 
50855095String.prototype.ord = function (this: String): number {
50865096  return nullthrows(this.codePointAt(0));
50875097};
50885098
5089- String.prototype.rot = function (this: String, delta: number = 1): string {
5090-   return this.replaceAll(
5091-     /([a-z])|([A-Z])/g,
5092-     (letter: string, lower: string | undefined, upper: string | undefined) => {
5093-       const offset = (lower == null ? "A" : "a").ord();
5094-       return ((letter.ord() - offset + delta).positiveMod(26) + offset).chr();
5095-     },
5096-   );
5097- };
5098- 
50995099/////////////////////////// END ADVENTURE PACK CODE ////////////////////////////"
51005100`;
51015101
0 commit comments