is.js 914 B

12345678910111213141516171819202122232425
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const hooks_1 = require("./hooks");
  4. function isHusky(data) {
  5. // Husky v0.14 and prior used #husky as an identifier.
  6. // Just in case some previous hooks weren't correctly uninstalled,
  7. // and for a better transition this will allow v0.15+ to uninstall them as well.
  8. const previousHuskyIdentifier = '#husky';
  9. return (data.indexOf(hooks_1.huskyIdentifier) !== -1 ||
  10. data.indexOf(previousHuskyIdentifier) !== -1);
  11. }
  12. exports.isHusky = isHusky;
  13. function isYorkie(data) {
  14. return data.indexOf('#yorkie') !== -1;
  15. }
  16. exports.isYorkie = isYorkie;
  17. function isGhooks(data) {
  18. return data.indexOf('// Generated by ghooks. Do not edit this file.') !== -1;
  19. }
  20. exports.isGhooks = isGhooks;
  21. function isPreCommit(data) {
  22. return data.indexOf('./node_modules/pre-commit/hook') !== -1;
  23. }
  24. exports.isPreCommit = isPreCommit;