handoff-app 1.1.2-0 → 1.1.2
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.
|
@@ -17,7 +17,7 @@ const registerHandlebarsHelpers = (data, injectFieldWrappers, extend) => {
|
|
|
17
17
|
handlebars_1.default.registerHelper('field', function (field, options) {
|
|
18
18
|
if (injectFieldWrappers) {
|
|
19
19
|
if (!field) {
|
|
20
|
-
// This
|
|
20
|
+
// This debugging isn't helpful in the context of the component library
|
|
21
21
|
// Logger.error(`Missing field declaration for ${data.id}`);
|
|
22
22
|
return options.fn(this);
|
|
23
23
|
}
|
|
@@ -44,12 +44,19 @@ const registerHandlebarsHelpers = (data, injectFieldWrappers, extend) => {
|
|
|
44
44
|
handlebars_1.default.registerHelper('eq', function (a, b) {
|
|
45
45
|
return a === b;
|
|
46
46
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
if (extend) {
|
|
48
|
+
try {
|
|
49
|
+
extend({
|
|
50
|
+
handlebars: handlebars_1.default,
|
|
51
|
+
componentId: data.id,
|
|
52
|
+
properties: data.properties,
|
|
53
|
+
injectFieldWrappers,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
logger_1.Logger.error(`registerHandlebarsHelpers hook failed for ${data.id}`, err);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
53
60
|
};
|
|
54
61
|
exports.registerHandlebarsHelpers = registerHandlebarsHelpers;
|
|
55
62
|
/**
|
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@ export const registerHandlebarsHelpers = (
|
|
|
19
19
|
Handlebars.registerHelper('field', function (field: string, options: any) {
|
|
20
20
|
if (injectFieldWrappers) {
|
|
21
21
|
if (!field) {
|
|
22
|
-
// This
|
|
22
|
+
// This debugging isn't helpful in the context of the component library
|
|
23
23
|
// Logger.error(`Missing field declaration for ${data.id}`);
|
|
24
24
|
return options.fn(this);
|
|
25
25
|
}
|
|
@@ -51,12 +51,18 @@ export const registerHandlebarsHelpers = (
|
|
|
51
51
|
return a === b;
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
extend
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
if (extend) {
|
|
55
|
+
try {
|
|
56
|
+
extend({
|
|
57
|
+
handlebars: Handlebars,
|
|
58
|
+
componentId: data.id,
|
|
59
|
+
properties: data.properties,
|
|
60
|
+
injectFieldWrappers,
|
|
61
|
+
});
|
|
62
|
+
} catch (err) {
|
|
63
|
+
Logger.error(`registerHandlebarsHelpers hook failed for ${data.id}`, err);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
60
66
|
};
|
|
61
67
|
|
|
62
68
|
/**
|