fable 3.0.61 → 3.0.62

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": "fable",
3
- "version": "3.0.61",
3
+ "version": "3.0.62",
4
4
  "description": "An entity behavior management and API bundling library.",
5
5
  "main": "source/Fable.js",
6
6
  "scripts": {
@@ -28,9 +28,20 @@ class FableServiceUtility extends libFableServiceBase
28
28
 
29
29
  // Underscore and lodash have a behavior, _.extend, which merges objects.
30
30
  // Now that es6 gives us this, use the native thingy.
31
+ // Nevermind, the native thing is not stable enough across environments
32
+ // Basic shallow copy
31
33
  extend(pDestinationObject, ...pSourceObjects)
32
34
  {
33
- return Object.assign(pDestinationObject, ...pSourceObjects);
35
+ for (let i = 0; i < pSourceObjects.length; i++)
36
+ {
37
+ let tmpSourceObject = pSourceObjects[i];
38
+ let tmpObjectProperties = Object.keys(tmpSourceObject);
39
+ for (let k = 0; k < tmpObjectProperties.length; k++)
40
+ {
41
+ pDestinationObject[tmpObjectProperties[k]] = tmpSourceObject[tmpObjectProperties[k]];
42
+ }
43
+ }
44
+ return pDestinationObject;
34
45
  }
35
46
 
36
47
  // Underscore and lodash have a behavior, _.template, which compiles a
@@ -92,10 +103,15 @@ class FableServiceUtility extends libFableServiceBase
92
103
  {
93
104
 
94
105
  // Split the string into an array based on the digit groups.
95
- var tmpDateParts = pISOString.split( /\D+/ );
106
+ let tmpDateParts = pISOString.split( /\D+/ );
96
107
 
97
108
  // Set up a date object with the current time.
98
- var tmpReturnDate = new Date();
109
+ let tmpReturnDate = new Date();
110
+
111
+ // Track the number of hours we need to adjust the date by based on the timezone.
112
+ let tmpTimeZoneOffsetInHours = 0;
113
+ // Track the number of minutes we need to adjust the date by based on the timezone.
114
+ let tmpTimeZoneOffsetInMinutes = 0;
99
115
 
100
116
  // Manually parse the parts of the string and set each part for the
101
117
  // date. Note: Using the UTC versions of these functions is necessary
@@ -114,16 +130,9 @@ class FableServiceUtility extends libFableServiceBase
114
130
  tmpReturnDate.setUTCSeconds( parseInt( tmpDateParts[ 5 ] ) );
115
131
  tmpReturnDate.setUTCMilliseconds( parseInt( tmpDateParts[ 6 ] ) );
116
132
 
117
- // Track the number of hours we need to adjust the date by based on the timezone.
118
- var tmpTimeZoneOffsetInHours = 0;
119
-
120
133
  // If there's a value for either the hours or minutes offset.
121
134
  if (tmpDateParts[ 7 ] || tmpDateParts[ 8 ])
122
135
  {
123
-
124
- // Track the number of minutes we need to adjust the date by based on the timezone.
125
- var tmpTimeZoneOffsetInMinutes = 0;
126
-
127
136
  // If there's a value for the minutes offset.
128
137
  if (tmpDateParts[8])
129
138
  {
@@ -79,7 +79,7 @@ suite
79
79
  );
80
80
  test
81
81
  (
82
- 'Processed Template like Underscore Work With Variables and no scope leakage',
82
+ 'Processed Multiple Templates like Underscore Work With Variables and no scope leakage',
83
83
  function()
84
84
  {
85
85
  testFable = new libFable();
@@ -187,10 +187,12 @@ suite
187
187
  function(fDone)
188
188
  {
189
189
  testFable = new libFable();
190
- Expect(testFable.defaultServices.Utility.isoStringToDate('2022-11-04T11:34:45.000Z').getTime()).to.equal(1667561685000);
190
+ Expect(testFable.defaultServices.Utility.isoStringToDate('1986-06-11T09:34:46.012Z').getTime()).to.equal(518866486012);
191
191
  Expect(testFable.defaultServices.Utility.isoStringToDate('2022-11-04T11:34:46.000Z').getTime()).to.equal(1667561686000);
192
+ Expect(testFable.defaultServices.Utility.isoStringToDate('2022-11-04T11:34:45.000Z').getTime()).to.equal(1667561685000);
192
193
  Expect(testFable.defaultServices.Utility.isoStringToDate('1986-06-11T09:34:46.012Z').getTime()).to.equal(518866486012);
193
194
  Expect(testFable.defaultServices.Utility.isoStringToDate('1986-06-11T09:34:46.012Z+0200').getTime()).to.equal(519586486012);
195
+ Expect(testFable.defaultServices.Utility.isoStringToDate('1986-06-11T09:34:46.012Z+0200').getTime()).to.equal(519586486012);
194
196
  fDone();
195
197
  }
196
198
  )