DebugProtectionFunctionCallTemplate.ts 813 B

123456789101112131415161718192021222324
  1. /**
  2. * @returns {string}
  3. */
  4. export function DebugProtectionFunctionCallTemplate (): string {
  5. return `
  6. (function () {
  7. {singleNodeCallControllerFunctionName}(
  8. this,
  9. function () {
  10. const regExp1 = new RegExp('function *\\\\( *\\\\)');
  11. const regExp2 = new RegExp('\\\\+\\\\+ *\\(?:[a-zA-Z_$][0-9a-zA-Z_$]*\\)', 'i');
  12. const result = {debugProtectionFunctionName}('init');
  13. if (!regExp1.test(result + 'chain') || !regExp2.test(result + 'input')) {
  14. result('0');
  15. } else {
  16. {debugProtectionFunctionName}();
  17. }
  18. }
  19. )();
  20. })();
  21. `;
  22. }