spread-diff-patch
Version:
Diff & patch SpreadSheet files
1 lines • 2.19 kB
Source Map (JSON)
{"version":3,"sources":["../../src/formatter/index.ts","../../src/formatter/json.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\r\n\r\nimport DiffAOA from \"../DiffAOA\"\r\n\r\n/**\r\n * Represents a Formatter class.\r\n * @template T - The type parameter for the Formatter class.\r\n */\r\nexport default class Formatter<T> {\r\n patch: (actual: string | null, expected: string | null) => string\r\n\r\n /**\r\n * Creates an instance of Formatter.\r\n * @param {Function} patcher - The patcher function used to generate the patched string.\r\n */\r\n constructor(\r\n patcher = (actual: string | null, expected: string | null) => {\r\n let patchedString = \"\"\r\n if (actual)\r\n patchedString += `[-][${actual}]`\r\n if (actual && expected)\r\n patchedString += \" \"\r\n if (expected)\r\n patchedString += `[+][${expected}]`\r\n return patchedString\r\n }\r\n ) {\r\n this.patch = patcher\r\n }\r\n\r\n /**\r\n * Formats the diff array of arrays.\r\n * @param diffAOA - The diff array of arrays to be formatted.\r\n * @returns The formatted string.\r\n */\r\n format(diffAOA: DiffAOA<T>): string {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n}","/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport Formatter from \".\"\r\n\r\ntype DiffAOA = (string | (string | null)[])[][]\r\n\r\nexport class JSON extends Formatter<string> {\r\n format(diffAOA: DiffAOA): string {\r\n // TODO: Implement JSON formatting\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n}"],"mappings":";AAQA,IAAqB,YAArB,MAAkC;AAAA;AAAA;AAAA;AAAA;AAAA,EAO9B,YACI,UAAU,CAAC,QAAuB,aAA4B;AAC1D,QAAI,gBAAgB;AACpB,QAAI;AACA,uBAAiB,OAAO,MAAM;AAClC,QAAI,UAAU;AACV,uBAAiB;AACrB,QAAI;AACA,uBAAiB,OAAO,QAAQ;AACpC,WAAO;AAAA,EACX,GACF;AACE,SAAK,QAAQ;AAAA,EACjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,OAAO,SAA6B;AAChC,UAAM,IAAI,MAAM,yBAAyB;AAAA,EAC7C;AACJ;;;ACjCO,IAAM,OAAN,cAAmB,UAAkB;AAAA,EACxC,OAAO,SAA0B;AAE7B,UAAM,IAAI,MAAM,yBAAyB;AAAA,EAC7C;AACJ;","names":[]}