Skip to content

Commit f5ff550

Browse files
committed
feat: simplify helper functions and add eq helper
1 parent 1b3d18d commit f5ff550

File tree

4 files changed

+45
-53
lines changed

4 files changed

+45
-53
lines changed

.changeset/mean-buses-shake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@mcp-tool-kit/shared': patch
3+
---
4+
5+
feat: simplify helper functions and add eq helper

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
],
3838
"devDependencies": {
3939
"@changesets/changelog-github": "^0.5.1",
40-
"@changesets/cli": "^2.29.5",
40+
"@changesets/cli": "^2.29.6",
4141
"@commitlint/cli": "^19.8.1",
4242
"@commitlint/config-conventional": "^19.8.1",
4343
"@rollup/plugin-terser": "^0.4.4",
Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
import Handlebars from 'handlebars'
22

33
export function registerHandlebarsHelpers() {
4-
Handlebars.registerHelper('includes', function (array, value) {
5-
return array && Array.isArray(array) && array.includes(value)
6-
})
7-
8-
Handlebars.registerHelper('and', function (a, b) {
9-
return a && b
10-
})
11-
12-
Handlebars.registerHelper('or', function (a, b) {
13-
return a || b
14-
})
4+
Handlebars.registerHelper('includes', (array, value) => array && Array.isArray(array) && array.includes(value))
5+
Handlebars.registerHelper('and', (a, b) => a && b)
6+
Handlebars.registerHelper('or', (a, b) => a || b)
7+
Handlebars.registerHelper('eq', (a, b) => a === b)
158
}

pnpm-lock.yaml

Lines changed: 35 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)