a zip code crypto-currency system good for red ONLY

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var tslint_1 = require("tslint");
  4. var typescript_1 = require("typescript");
  5. var util_1 = require("util");
  6. /**
  7. * Lint a file according to config
  8. * @param {Linter} linter
  9. * @param {LinterConfig} config
  10. * @param {string} filePath
  11. * @param {string} fileContents
  12. */
  13. function lint(linter, config, filePath, fileContents) {
  14. linter.lint(filePath, fileContents, config);
  15. }
  16. exports.lint = lint;
  17. /**
  18. * Get the linter result
  19. * @param {Linter} linter
  20. * @return {LintResult}
  21. */
  22. function getLintResult(linter) {
  23. return linter.getResult();
  24. }
  25. exports.getLintResult = getLintResult;
  26. /**
  27. * Type check a TS program
  28. * @param {BuildContext} context
  29. * @param {Program} program
  30. * @param {LinterOptions} linterOptions
  31. * @return {Promise<Diagnostic[]>}
  32. */
  33. function typeCheck(context, program, linterOptions) {
  34. if (util_1.isObject(linterOptions) && linterOptions.typeCheck) {
  35. return Promise.resolve(typescript_1.getPreEmitDiagnostics(program));
  36. }
  37. return Promise.resolve([]);
  38. }
  39. exports.typeCheck = typeCheck;
  40. /**
  41. * Create a TS program based on the BuildContext {rootDir} or TS config file path (if provided)
  42. * @param {BuildContext} context
  43. * @param {string} tsConfig
  44. * @return {Program}
  45. */
  46. function createProgram(context, tsConfig) {
  47. return tslint_1.Linter.createProgram(tsConfig, context.rootDir);
  48. }
  49. exports.createProgram = createProgram;
  50. /**
  51. * Get all files that are sourced in TS config
  52. * @param {BuildContext} context
  53. * @param {Program} program
  54. * @return {Array<string>}
  55. */
  56. function getFileNames(context, program) {
  57. return tslint_1.Linter.getFileNames(program);
  58. }
  59. exports.getFileNames = getFileNames;
  60. /**
  61. * Get lint configuration
  62. * @param {string} tsLintConfig
  63. * @param {LinterOptions} linterOptions
  64. * @return {Linter}
  65. */
  66. function getTsLintConfig(tsLintConfig, linterOptions) {
  67. var config = tslint_1.Configuration.loadConfigurationFromPath(tsLintConfig);
  68. Object.assign(config, util_1.isObject(linterOptions) ? { linterOptions: linterOptions } : {});
  69. return config;
  70. }
  71. exports.getTsLintConfig = getTsLintConfig;
  72. /**
  73. * Create a TS linter
  74. * @param {BuildContext} context
  75. * @param {Program} program
  76. * @return {Linter}
  77. */
  78. function createLinter(context, program) {
  79. return new tslint_1.Linter({
  80. fix: false
  81. }, program);
  82. }
  83. exports.createLinter = createLinter;