@raydiant/playlist-window-manager 0.14.26 → 0.14.27
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/build/embeddedApps.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
function createEmbeddedApp(presentation, applicationVersion) {
|
|
4
4
|
// build matches
|
|
5
|
-
var parameterRegex = /(:([\w]+))(.?$|[^\w])/gm;
|
|
5
|
+
var parameterRegex = /(:([\w-]+))(.?$|[^\w-])/gm;
|
|
6
6
|
var matches = [];
|
|
7
7
|
var match = null;
|
|
8
8
|
do {
|
|
@@ -43,6 +43,11 @@ test('Replaces variable with underscore', function () {
|
|
|
43
43
|
embeddedUrlFormat: 'https://example.com/:foo_1'
|
|
44
44
|
}))).toBe('https://example.com/bar');
|
|
45
45
|
});
|
|
46
|
+
test('Replaces variable with hyphen', function () {
|
|
47
|
+
expect(embeddedApps_1.default(createPresentation({ applicationVariables: { 'foo-1': 'bar' } }), createApplicationVersion({
|
|
48
|
+
embeddedUrlFormat: 'https://example.com/:foo-1'
|
|
49
|
+
}))).toBe('https://example.com/bar');
|
|
50
|
+
});
|
|
46
51
|
test('Does not replace variable that is a number', function () {
|
|
47
52
|
expect(embeddedApps_1.default(createPresentation({ applicationVariables: { foo: 'bar' } }), createApplicationVersion({
|
|
48
53
|
embeddedUrlFormat: 'http://localhost:8080?foo=:foo'
|
package/package.json
CHANGED
package/src/embeddedApps.test.ts
CHANGED
|
@@ -77,6 +77,17 @@ test('Replaces variable with underscore', () => {
|
|
|
77
77
|
).toBe('https://example.com/bar');
|
|
78
78
|
});
|
|
79
79
|
|
|
80
|
+
test('Replaces variable with hyphen', () => {
|
|
81
|
+
expect(
|
|
82
|
+
createEmbeddedApp(
|
|
83
|
+
createPresentation({ applicationVariables: { 'foo-1': 'bar' } }),
|
|
84
|
+
createApplicationVersion({
|
|
85
|
+
embeddedUrlFormat: 'https://example.com/:foo-1'
|
|
86
|
+
})
|
|
87
|
+
)
|
|
88
|
+
).toBe('https://example.com/bar');
|
|
89
|
+
});
|
|
90
|
+
|
|
80
91
|
test('Does not replace variable that is a number', () => {
|
|
81
92
|
expect(
|
|
82
93
|
createEmbeddedApp(
|
package/src/embeddedApps.ts
CHANGED