SourceCode.ts 848 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { ISourceCode } from '../interfaces/source-code/ISourceCode';
  2. export class SourceCode implements ISourceCode {
  3. /**
  4. * @type {string}
  5. */
  6. private readonly sourceCode: string;
  7. /**
  8. * @type {string}
  9. */
  10. private readonly sourceMap: string;
  11. /**
  12. * @param {string} sourceCode
  13. * @param {string} sourceMap
  14. */
  15. constructor (sourceCode: string, sourceMap: string) {
  16. this.sourceCode = sourceCode;
  17. this.sourceMap = sourceMap;
  18. }
  19. /**
  20. * @returns {string}
  21. */
  22. public getSourceCode (): string {
  23. return this.sourceCode;
  24. }
  25. /**
  26. * @returns {string}
  27. */
  28. public getSourceMap (): string {
  29. return this.sourceMap;
  30. }
  31. /**
  32. * @returns {string}
  33. */
  34. public toString (): string {
  35. return this.sourceCode;
  36. }
  37. }