Skip to content

Commit 7b0ef5d

Browse files
committed
πŸ“¦ v2.2.3
- πŸ‘¨β€πŸ’» Minor codebase enhancements - πŸ“” JSDoc highlight - 🀝 Compatibility with `[email protected]`
1 parent d5a6d2e commit 7b0ef5d

File tree

3 files changed

+50
-46
lines changed

3 files changed

+50
-46
lines changed

β€Ž.versions

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,65 @@
1-
2-
babel-compiler@7.5.2
1+
2+
babel-compiler@7.9.0
33
44
55
66
77
8-
boilerplate-generator@1.6.0
9-
8+
boilerplate-generator@1.7.1
9+
1010
11-
callback-hook@1.3.0
11+
callback-hook@1.4.0
1212
1313
14-
ddp-client@2.3.3
14+
ddp-client@2.5.0
1515
16-
ddp-server@2.3.0
16+
ddp-server@2.5.0
1717
1818
19-
dynamic-import@0.5.1
20-
ecmascript@0.14.2
21-
ecmascript-runtime@0.7.0
22-
ecmascript-runtime-client@0.10.0
23-
ecmascript-runtime-server@0.9.0
24-
19+
dynamic-import@0.7.2
20+
ecmascript@0.16.2
21+
ecmascript-runtime@0.8.0
22+
ecmascript-runtime-client@0.12.1
23+
ecmascript-runtime-server@0.11.0
24+
2525
2626
2727
2828
29-
30-
29+
30+
3131
32-
local-test:ostrio:[email protected].2
33-
logging@1.1.20
34-
meteor@1.9.3
35-
minimongo@1.4.5
36-
37-
modules@0.15.0
38-
modules-runtime@0.12.0
39-
mongo@1.8.0
40-
32+
local-test:ostrio:[email protected].3
33+
logging@1.3.1
34+
meteor@1.10.0
35+
minimongo@1.8.0
36+
37+
modules@0.18.0
38+
modules-runtime@0.13.0
39+
mongo@1.15.0
40+
4141
42-
43-
npm-mongo@3.3.0
42+
43+
npm-mongo@4.3.1
4444
4545
46-
47-
48-
46+
47+
48+
49+
4950
5051
51-
52+
5253
53-
54+
5455
55-
socket-stream-client@0.2.2
56+
socket-stream-client@0.5.0
5657
5758
5859
5960
60-
tinytest@1.1.0
61+
tinytest@1.2.1
6162
6263
63-
webapp@1.8.0
64-
webapp-hashing@1.0.9
64+
webapp@1.13.1
65+
webapp-hashing@1.1.0

β€Žpackage.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
Package.describe({
22
name: 'ostrio:templatehelpers',
3-
version: '2.2.2',
3+
version: '2.2.3',
44
summary: 'Template helpers for logical operations, variable comparison, Session, underscore and debugging',
55
git: 'https://github.com/VeliovGroup/Meteor-Template-helpers',
66
documentation: 'README.md'
77
});
88

9-
Package.onUse(function (api) {
9+
Package.onUse((api) => {
1010
api.versionsFrom('1.4');
1111
api.use(['templating', 'ecmascript'], 'client');
1212
api.use(['session', 'underscore'], 'client', {weak: true});
1313
api.mainModule('templatehelpers.js', 'client');
1414
});
1515

16-
Package.onTest(function (api) {
16+
Package.onTest((api) => {
1717
api.use(['templating', 'ecmascript', 'tinytest', 'underscore', 'session'], 'client');
1818
api.addFiles('templatehelpers-tests.js', 'client');
1919
});

β€Žtemplatehelpers.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Meteor } from 'meteor/meteor';
1+
import { Meteor } from 'meteor/meteor';
22
import { Template } from 'meteor/templating';
33

44
const andOperators = ['&&', 'and', '&!', '!&', '!&!', '!&&'];
@@ -70,7 +70,6 @@ class TemplateHelpers {
7070
}
7171

7272
log(...args) {
73-
console.log('arguments: ', args, 'this: ', this);
7473
const key = args.shift();
7574
try {
7675
return `${JSON.stringify(key, null, 2)} | ${JSON.stringify(args, null, 2)}`;
@@ -246,29 +245,33 @@ class TemplateHelpers {
246245

247246
const templatehelpers = new TemplateHelpers();
248247

249-
/*
248+
/**
250249
* @description Get or set session value from views via Session helper
251250
* @example
252251
* GET: {{Session 'key'}}
253252
* SET: {{Session 'key' set="new value"}}
254253
* SET Default: {{Session 'key' set="new value" action="setDefault"}}
255254
*/
256-
Template.registerHelper('Session', templatehelpers.session.bind(templatehelpers));
255+
if (Session) {
256+
Template.registerHelper('Session', templatehelpers.session.bind(templatehelpers));
257+
}
257258

258-
/*
259+
/**
259260
* @description Debug helper console log
260261
* and return passed objects as a string
261262
*/
262263
Template.registerHelper('log', templatehelpers.log);
263264

264-
/*
265+
/**
265266
* @description Compare two or more arguments in template
266267
*/
267268
Template.registerHelper('compare', templatehelpers.compare.bind(templatehelpers));
268269

269-
/*
270+
/**
270271
* @description Use underscore as a helper
271272
*/
272-
Template.registerHelper('_', templatehelpers.underscore.bind(templatehelpers));
273+
if (_) {
274+
Template.registerHelper('_', templatehelpers.underscore.bind(templatehelpers));
275+
}
273276

274277
export { templatehelpers };

0 commit comments

Comments
Β (0)