@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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raydiant/playlist-window-manager",
3
- "version": "0.14.26",
3
+ "version": "0.14.27",
4
4
  "description": "Window manager for playlist playback.",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
@@ -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(
@@ -5,7 +5,7 @@ export default function createEmbeddedApp(
5
5
  applicationVersion: ApplicationVersion
6
6
  ) {
7
7
  // build matches
8
- const parameterRegex = /(:([\w]+))(.?$|[^\w])/gm;
8
+ const parameterRegex = /(:([\w-]+))(.?$|[^\w-])/gm;
9
9
  const matches = [];
10
10
  let match = null;
11
11
  do {