@hasnaxyz/hook-checktasks 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -147,10 +147,15 @@ function run() {
147
147
  if (hookInput?.transcript_path) {
148
148
  sessionName = getSessionName(hookInput.transcript_path);
149
149
  }
150
- const nameToCheck = sessionName || config.taskListId || "";
151
150
  const keywords = config.keywords || ["dev"];
152
- const matchesKeyword = keywords.some((keyword) => nameToCheck.toLowerCase().includes(keyword.toLowerCase()));
153
- if (!matchesKeyword && keywords.length > 0 && nameToCheck) {
151
+ const sessionMatchesKeywords = () => {
152
+ if (keywords.length === 0)
153
+ return true;
154
+ if (!sessionName)
155
+ return false;
156
+ return keywords.some((keyword) => sessionName.toLowerCase().includes(keyword.toLowerCase()));
157
+ };
158
+ if (!sessionMatchesKeywords()) {
154
159
  approve();
155
160
  }
156
161
  let listsToCheck = [];
package/dist/hook.js CHANGED
@@ -143,10 +143,15 @@ function run() {
143
143
  if (hookInput?.transcript_path) {
144
144
  sessionName = getSessionName(hookInput.transcript_path);
145
145
  }
146
- const nameToCheck = sessionName || config.taskListId || "";
147
146
  const keywords = config.keywords || ["dev"];
148
- const matchesKeyword = keywords.some((keyword) => nameToCheck.toLowerCase().includes(keyword.toLowerCase()));
149
- if (!matchesKeyword && keywords.length > 0 && nameToCheck) {
147
+ const sessionMatchesKeywords = () => {
148
+ if (keywords.length === 0)
149
+ return true;
150
+ if (!sessionName)
151
+ return false;
152
+ return keywords.some((keyword) => sessionName.toLowerCase().includes(keyword.toLowerCase()));
153
+ };
154
+ if (!sessionMatchesKeywords()) {
150
155
  approve();
151
156
  }
152
157
  let listsToCheck = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasnaxyz/hook-checktasks",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Claude Code hook that prevents stopping when there are pending tasks",
5
5
  "type": "module",
6
6
  "bin": {