@dazn/kopytko-framework 2.1.2 → 2.1.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dazn/kopytko-framework",
3
- "version": "2.1.2",
3
+ "version": "2.1.4",
4
4
  "description": "A modern Roku's Brightscript framework",
5
5
  "keywords": [
6
6
  "brightscript",
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "@dazn/eslint-plugin-kopytko": "^2.1.0",
32
- "@dazn/kopytko-packager": "^1.2.4",
32
+ "@dazn/kopytko-packager": "^1.2.5",
33
33
  "@dazn/kopytko-unit-testing-framework": "^2.3.1",
34
34
  "eslint": "^8.21.0"
35
35
  },
@@ -148,7 +148,7 @@ function HttpRequest(options as Object, httpInterceptors = [] as Object) as Obje
148
148
 
149
149
  ' @returns {Boolean}
150
150
  prototype.isCachingEnabled = function () as Boolean
151
- return getProperty(m.options, "enableCaching", true)
151
+ return getProperty(m._options, "enableCaching", true)
152
152
  end function
153
153
 
154
154
  prototype.setHeader = sub (name as String, value as Dynamic)
@@ -1,8 +1,10 @@
1
+ ' @import /components/ternary.brs from @dazn/kopytko-utils
2
+
1
3
  sub initKopytkoRoot(dynamicProps as Object)
2
- m._dynamicProps = dynamicProps
4
+ m._dynamicProps = ternary(Type(dynamicProps) = "roArray", dynamicProps, [])
3
5
 
4
6
  dynamicPropsValues = {}
5
- for each prop in dynamicProps
7
+ for each prop in m._dynamicProps
6
8
  dynamicPropsValues[prop] = m.top[prop]
7
9
  end for
8
10
 
@@ -14,11 +16,14 @@ sub initKopytkoRoot(dynamicProps as Object)
14
16
  end sub
15
17
 
16
18
  sub destroyKopytkoRoot()
17
- for each prop in m._dynamicProps
18
- m.top.unobserveFieldScoped(prop)
19
- end for
19
+ if m._dynamicProps <> Invalid
20
+ for each prop in m._dynamicProps
21
+ m.top.unobserveFieldScoped(prop)
22
+ end for
23
+
24
+ m._dynamicProps = Invalid
25
+ end if
20
26
 
21
- m._dynamicProps = Invalid
22
27
  destroyKopytko()
23
28
  end sub
24
29