@ui5/webcomponents-localization 0.0.0-2f7664755 → 0.0.0-31ad69297

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.
Files changed (218) hide show
  1. package/.eslintignore +2 -1
  2. package/.npsrc.json +3 -0
  3. package/CHANGELOG.md +733 -0
  4. package/README.md +2 -1
  5. package/dist/.tsbuildinfo +1 -0
  6. package/dist/Assets-static.js.map +1 -1
  7. package/dist/Assets.js.map +1 -1
  8. package/dist/DateFormat.js.map +1 -1
  9. package/dist/LocaleData.js.map +1 -1
  10. package/dist/dates/CalendarDate.d.ts +7 -5
  11. package/dist/dates/CalendarDate.js +8 -7
  12. package/dist/dates/CalendarDate.js.map +1 -1
  13. package/dist/dates/ExtremeDates.d.ts +2 -2
  14. package/dist/dates/ExtremeDates.js.map +1 -1
  15. package/dist/dates/UI5Date.d.ts +6 -0
  16. package/dist/dates/UI5Date.js +7 -0
  17. package/dist/dates/UI5Date.js.map +1 -0
  18. package/dist/dates/UniversalDate.d.ts +2 -1
  19. package/dist/dates/UniversalDate.js.map +1 -1
  20. package/dist/dates/calculateWeekNumber.d.ts +3 -1
  21. package/dist/dates/calculateWeekNumber.js +6 -6
  22. package/dist/dates/calculateWeekNumber.js.map +1 -1
  23. package/dist/dates/convertMonthNumbersToMonthNames.d.ts +1 -1
  24. package/dist/dates/convertMonthNumbersToMonthNames.js.map +1 -1
  25. package/dist/dates/getDaysInMonth.js.map +1 -1
  26. package/dist/dates/getRoundedTimestamp.js +1 -0
  27. package/dist/dates/getRoundedTimestamp.js.map +1 -1
  28. package/dist/dates/getTodayUTCTimestamp.d.ts +1 -1
  29. package/dist/dates/getTodayUTCTimestamp.js +2 -1
  30. package/dist/dates/getTodayUTCTimestamp.js.map +1 -1
  31. package/dist/dates/modifyDateBy.d.ts +2 -1
  32. package/dist/dates/modifyDateBy.js +34 -19
  33. package/dist/dates/modifyDateBy.js.map +1 -1
  34. package/dist/dates/transformDateToSecondaryType.d.ts +1 -1
  35. package/dist/dates/transformDateToSecondaryType.js +3 -2
  36. package/dist/dates/transformDateToSecondaryType.js.map +1 -1
  37. package/dist/features/calendar/Buddhist.js.map +1 -1
  38. package/dist/features/calendar/Gregorian.js.map +1 -1
  39. package/dist/features/calendar/Islamic.js.map +1 -1
  40. package/dist/features/calendar/Japanese.js.map +1 -1
  41. package/dist/features/calendar/Persian.js.map +1 -1
  42. package/dist/generated/assets/cldr/ar.json +5571 -6704
  43. package/dist/generated/assets/cldr/ar_EG.json +5571 -6704
  44. package/dist/generated/assets/cldr/ar_SA.json +5570 -6704
  45. package/dist/generated/assets/cldr/bg.json +4491 -5742
  46. package/dist/generated/assets/cldr/ca.json +4478 -5793
  47. package/dist/generated/assets/cldr/cnr.json +4667 -0
  48. package/dist/generated/assets/cldr/cs.json +5067 -6294
  49. package/dist/generated/assets/cldr/cy.json +5479 -6612
  50. package/dist/generated/assets/cldr/da.json +4371 -5651
  51. package/dist/generated/assets/cldr/de.json +4420 -5713
  52. package/dist/generated/assets/cldr/de_AT.json +4421 -5714
  53. package/dist/generated/assets/cldr/de_CH.json +4419 -5712
  54. package/dist/generated/assets/cldr/el.json +4309 -5579
  55. package/dist/generated/assets/cldr/el_CY.json +4309 -5579
  56. package/dist/generated/assets/cldr/en.json +4342 -5732
  57. package/dist/generated/assets/cldr/en_AU.json +4382 -5724
  58. package/dist/generated/assets/cldr/en_GB.json +4373 -5733
  59. package/dist/generated/assets/cldr/en_HK.json +4382 -5739
  60. package/dist/generated/assets/cldr/en_IE.json +4373 -5733
  61. package/dist/generated/assets/cldr/en_IN.json +4378 -5734
  62. package/dist/generated/assets/cldr/en_NZ.json +4373 -5733
  63. package/dist/generated/assets/cldr/en_PG.json +4374 -5734
  64. package/dist/generated/assets/cldr/en_SG.json +4378 -5735
  65. package/dist/generated/assets/cldr/en_ZA.json +4374 -5734
  66. package/dist/generated/assets/cldr/es.json +4584 -5641
  67. package/dist/generated/assets/cldr/es_AR.json +4587 -5643
  68. package/dist/generated/assets/cldr/es_BO.json +4586 -5642
  69. package/dist/generated/assets/cldr/es_CL.json +4479 -5643
  70. package/dist/generated/assets/cldr/es_CO.json +4479 -5642
  71. package/dist/generated/assets/cldr/es_MX.json +4588 -5644
  72. package/dist/generated/assets/cldr/es_PE.json +4370 -5642
  73. package/dist/generated/assets/cldr/es_UY.json +4372 -5644
  74. package/dist/generated/assets/cldr/es_VE.json +4371 -5643
  75. package/dist/generated/assets/cldr/et.json +4373 -5729
  76. package/dist/generated/assets/cldr/fa.json +4429 -5647
  77. package/dist/generated/assets/cldr/fi.json +4514 -5804
  78. package/dist/generated/assets/cldr/fr.json +4383 -5741
  79. package/dist/generated/assets/cldr/fr_BE.json +4383 -5741
  80. package/dist/generated/assets/cldr/fr_CA.json +4377 -5735
  81. package/dist/generated/assets/cldr/fr_CH.json +4401 -5759
  82. package/dist/generated/assets/cldr/fr_LU.json +4383 -5741
  83. package/dist/generated/assets/cldr/he.json +4980 -6175
  84. package/dist/generated/assets/cldr/hi.json +4345 -5558
  85. package/dist/generated/assets/cldr/hr.json +4640 -5681
  86. package/dist/generated/assets/cldr/hu.json +4415 -5686
  87. package/dist/generated/assets/cldr/id.json +4132 -5420
  88. package/dist/generated/assets/cldr/it.json +4355 -5712
  89. package/dist/generated/assets/cldr/it_CH.json +4355 -5712
  90. package/dist/generated/assets/cldr/ja.json +4251 -5626
  91. package/dist/generated/assets/cldr/kk.json +4503 -5487
  92. package/dist/generated/assets/cldr/ko.json +4210 -5534
  93. package/dist/generated/assets/cldr/lt.json +4939 -6243
  94. package/dist/generated/assets/cldr/lv.json +4651 -5874
  95. package/dist/generated/assets/cldr/mk.json +4408 -0
  96. package/dist/generated/assets/cldr/ms.json +4093 -5245
  97. package/dist/generated/assets/cldr/nb.json +4403 -5740
  98. package/dist/generated/assets/cldr/nl.json +4542 -5613
  99. package/dist/generated/assets/cldr/nl_BE.json +4542 -5613
  100. package/dist/generated/assets/cldr/pl.json +4978 -5972
  101. package/dist/generated/assets/cldr/pt.json +4597 -5567
  102. package/dist/generated/assets/cldr/pt_PT.json +4648 -5702
  103. package/dist/generated/assets/cldr/ro.json +4633 -5852
  104. package/dist/generated/assets/cldr/ru.json +4947 -6169
  105. package/dist/generated/assets/cldr/ru_UA.json +4947 -6169
  106. package/dist/generated/assets/cldr/sk.json +4980 -6166
  107. package/dist/generated/assets/cldr/sl.json +4948 -6136
  108. package/dist/generated/assets/cldr/sr.json +4737 -5888
  109. package/dist/generated/assets/cldr/sr_Latn.json +4722 -5889
  110. package/dist/generated/assets/cldr/sv.json +4406 -5774
  111. package/dist/generated/assets/cldr/th.json +4234 -5627
  112. package/dist/generated/assets/cldr/tr.json +4451 -5809
  113. package/dist/generated/assets/cldr/uk.json +4908 -6115
  114. package/dist/generated/assets/cldr/vi.json +4094 -5435
  115. package/dist/generated/assets/cldr/zh_CN.json +4124 -5429
  116. package/dist/generated/assets/cldr/zh_HK.json +4132 -5437
  117. package/dist/generated/assets/cldr/zh_SG.json +4132 -5437
  118. package/dist/generated/assets/cldr/zh_TW.json +4155 -5525
  119. package/dist/generated/json-imports/LocaleData-static.d.ts +1 -0
  120. package/dist/generated/json-imports/LocaleData-static.js +11 -11
  121. package/dist/generated/json-imports/LocaleData-static.js.map +1 -0
  122. package/dist/generated/json-imports/LocaleData.d.ts +1 -0
  123. package/dist/generated/json-imports/LocaleData.js +88 -88
  124. package/dist/generated/json-imports/LocaleData.js.map +1 -0
  125. package/dist/getCachedLocaleDataInstance.js.map +1 -1
  126. package/dist/locale/getLocaleData.js.map +1 -1
  127. package/dist/sap/base/Event.js +59 -0
  128. package/dist/sap/base/Eventing.js +146 -0
  129. package/dist/sap/base/Log.js +2 -239
  130. package/dist/sap/base/assert.js +28 -1
  131. package/dist/sap/base/config/MemoryConfigurationProvider.js +20 -0
  132. package/dist/sap/base/config.js +17 -0
  133. package/dist/sap/base/i18n/Formatting.js +1133 -0
  134. package/dist/sap/base/i18n/LanguageTag.js +173 -0
  135. package/dist/sap/base/i18n/Localization.d.ts +4 -0
  136. package/dist/sap/base/i18n/Localization.js +12 -0
  137. package/dist/sap/base/i18n/Localization.js.map +1 -0
  138. package/dist/sap/base/i18n/date/CalendarType.js +43 -0
  139. package/dist/sap/base/i18n/date/CalendarWeekNumbering.js +105 -0
  140. package/dist/sap/base/i18n/date/TimezoneUtils.js +319 -0
  141. package/dist/sap/base/strings/camelize.js +30 -0
  142. package/dist/sap/base/strings/formatMessage.js +88 -15
  143. package/dist/sap/base/util/LoaderExtensions.js.map +1 -1
  144. package/dist/sap/base/util/ObjectPath.d.ts +4 -0
  145. package/dist/sap/base/util/ObjectPath.js +4 -33
  146. package/dist/sap/base/util/ObjectPath.js.map +1 -0
  147. package/dist/sap/base/util/Version.js +157 -0
  148. package/dist/sap/base/util/_merge.js +83 -26
  149. package/dist/sap/base/util/array/uniqueSort.js +37 -15
  150. package/dist/sap/base/util/deepClone.js +102 -0
  151. package/dist/sap/base/util/deepEqual.js +75 -51
  152. package/dist/sap/base/util/extend.js +58 -7
  153. package/dist/sap/base/util/isEmptyObject.js +34 -0
  154. package/dist/sap/base/util/isPlainObject.js +35 -1
  155. package/dist/sap/base/util/now.js +24 -3
  156. package/dist/sap/base/util/resolveReference.js +3 -0
  157. package/dist/sap/base/util/uid.js +27 -0
  158. package/dist/sap/ui/base/DataType.js +657 -0
  159. package/dist/sap/ui/base/Interface.js +47 -1
  160. package/dist/sap/ui/base/Metadata.js +435 -171
  161. package/dist/sap/ui/base/Object.js +284 -48
  162. package/dist/sap/ui/core/CalendarType.js +24 -8
  163. package/dist/sap/ui/core/Configuration.d.ts +2 -1
  164. package/dist/sap/ui/core/Configuration.js +4 -1
  165. package/dist/sap/ui/core/Configuration.js.map +1 -1
  166. package/dist/sap/ui/core/Core.d.ts +3 -2
  167. package/dist/sap/ui/core/Core.js.map +1 -1
  168. package/dist/sap/ui/core/FormatSettings.d.ts +1 -1
  169. package/dist/sap/ui/core/FormatSettings.js +2 -1
  170. package/dist/sap/ui/core/FormatSettings.js.map +1 -1
  171. package/dist/sap/ui/core/Locale.js +190 -155
  172. package/dist/sap/ui/core/LocaleData.js +2662 -1300
  173. package/dist/sap/ui/core/Supportability.js +5 -0
  174. package/dist/sap/ui/core/Theming.js +539 -0
  175. package/dist/sap/ui/core/date/Buddhist.js +162 -87
  176. package/dist/sap/ui/core/date/CalendarUtils.js +61 -32
  177. package/dist/sap/ui/core/date/CalendarWeekNumbering.js +30 -7
  178. package/dist/sap/ui/core/date/Gregorian.js +25 -10
  179. package/dist/sap/ui/core/date/Islamic.js +298 -185
  180. package/dist/sap/ui/core/date/Japanese.js +210 -115
  181. package/dist/sap/ui/core/date/Persian.js +324 -195
  182. package/dist/sap/ui/core/date/UI5Date.js +991 -0
  183. package/dist/sap/ui/core/date/UniversalDate.js +1238 -255
  184. package/dist/sap/ui/core/date/_Calendars.js +10 -1
  185. package/dist/sap/ui/core/format/DateFormat.js +3167 -2093
  186. package/dist/sap/ui/core/format/TimezoneUtil.js +24 -94
  187. package/package-scripts.cjs +28 -0
  188. package/package.json +14 -7
  189. package/tsconfig.json +12 -1
  190. package/used-modules.txt +25 -1
  191. package/dist/sap/ui/Device.js +0 -5
  192. package/package-scripts.js +0 -38
  193. package/src/Assets-static.ts +0 -2
  194. package/src/Assets.ts +0 -2
  195. package/src/DateFormat.ts +0 -8
  196. package/src/LocaleData.ts +0 -8
  197. package/src/dates/CalendarDate.ts +0 -232
  198. package/src/dates/ExtremeDates.ts +0 -40
  199. package/src/dates/UniversalDate.ts +0 -51
  200. package/src/dates/calculateWeekNumber.ts +0 -53
  201. package/src/dates/convertMonthNumbersToMonthNames.ts +0 -34
  202. package/src/dates/getDaysInMonth.ts +0 -11
  203. package/src/dates/getRoundedTimestamp.ts +0 -14
  204. package/src/dates/getTodayUTCTimestamp.ts +0 -10
  205. package/src/dates/modifyDateBy.ts +0 -42
  206. package/src/dates/transformDateToSecondaryType.ts +0 -21
  207. package/src/features/calendar/Buddhist.ts +0 -1
  208. package/src/features/calendar/Gregorian.ts +0 -1
  209. package/src/features/calendar/Islamic.ts +0 -1
  210. package/src/features/calendar/Japanese.ts +0 -1
  211. package/src/features/calendar/Persian.ts +0 -1
  212. package/src/getCachedLocaleDataInstance.ts +0 -15
  213. package/src/locale/getLocaleData.ts +0 -28
  214. package/src/sap/base/util/LoaderExtensions.ts +0 -17
  215. package/src/sap/ui/core/Configuration.ts +0 -22
  216. package/src/sap/ui/core/Core.ts +0 -15
  217. package/src/sap/ui/core/FormatSettings.ts +0 -15
  218. /package/{config/.eslintrc.js → .eslintrc.cjs} +0 -0
@@ -1,59 +1,83 @@
1
- import Log from '../Log.js';
1
+ /*!
2
+ * OpenUI5
3
+ * (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+ /*global Node */
7
+ //@evo-todo check isEqualNode dependency: not yet available...
8
+ //@evo-todo dependency to global name 'Node' contradicts sap/base package
9
+ import Log from "../Log.js";
10
+ /**
11
+ * Compares the two given values for equality, especially by comparing the content.
12
+ *
13
+ * <b>Note:</b> Function does not work with comparing XML objects.
14
+ *
15
+ * @function
16
+ * @since 1.58
17
+ * @param {any} a A value of any type
18
+ * @param {any} b A value of any type
19
+ * @param {int} [maxDepth=10] Maximum recursion depth
20
+ * @param {boolean} [contains] Whether all existing properties in a are equal as in b
21
+ * @alias module:sap/base/util/deepEqual
22
+ * @return {boolean} Whether a and b are equal
23
+ * @public
24
+ */
2
25
  var fnEqual = function (a, b, maxDepth, contains, depth) {
3
- if (typeof maxDepth == 'boolean') {
4
- contains = maxDepth;
5
- maxDepth = undefined;
6
- }
7
- if (!depth) {
8
- depth = 0;
26
+ // Optional parameter normalization
27
+ if (typeof maxDepth == "boolean") {
28
+ contains = maxDepth;
29
+ maxDepth = undefined;
30
+ }
31
+ if (!depth) {
32
+ depth = 0;
33
+ }
34
+ if (!maxDepth) {
35
+ maxDepth = 10;
36
+ }
37
+ if (depth > maxDepth) {
38
+ Log.warning("deepEqual comparison exceeded maximum recursion depth of " + maxDepth + ". Treating values as unequal");
39
+ return false;
40
+ }
41
+ if (a === b || Number.isNaN(a) && Number.isNaN(b)) {
42
+ return true;
43
+ }
44
+ if (Array.isArray(a) && Array.isArray(b)) {
45
+ if (!contains && a.length !== b.length) {
46
+ return false;
9
47
  }
10
- if (!maxDepth) {
11
- maxDepth = 10;
48
+ if (a.length > b.length) {
49
+ return false;
12
50
  }
13
- if (depth > maxDepth) {
14
- Log.warning('deepEqual comparison exceeded maximum recursion depth of ' + maxDepth + '. Treating values as unequal');
51
+ for (var i = 0; i < a.length; i++) {
52
+ if (!fnEqual(a[i], b[i], maxDepth, contains, depth + 1)) {
15
53
  return false;
54
+ }
16
55
  }
17
- if (a === b || Number.isNaN(a) && Number.isNaN(b)) {
18
- return true;
19
- }
20
- if (Array.isArray(a) && Array.isArray(b)) {
21
- if (!contains && a.length !== b.length) {
22
- return false;
23
- }
24
- if (a.length > b.length) {
25
- return false;
26
- }
27
- for (var i = 0; i < a.length; i++) {
28
- if (!fnEqual(a[i], b[i], maxDepth, contains, depth + 1)) {
29
- return false;
30
- }
31
- }
32
- return true;
33
- }
34
- if (typeof a == 'object' && typeof b == 'object') {
35
- if (!a || !b) {
36
- return false;
37
- }
38
- if (a.constructor !== b.constructor) {
39
- return false;
40
- }
41
- if (!contains && Object.keys(a).length !== Object.keys(b).length) {
42
- return false;
43
- }
44
- if (a instanceof Node) {
45
- return a.isEqualNode(b);
46
- }
47
- if (a instanceof Date) {
48
- return a.valueOf() === b.valueOf();
49
- }
50
- for (var i in a) {
51
- if (!fnEqual(a[i], b[i], maxDepth, contains, depth + 1)) {
52
- return false;
53
- }
54
- }
55
- return true;
56
+ return true;
57
+ }
58
+ if (typeof a == "object" && typeof b == "object") {
59
+ if (!a || !b) {
60
+ return false;
56
61
  }
57
- return false;
62
+ if (a.constructor !== b.constructor) {
63
+ return false;
64
+ }
65
+ if (!contains && Object.keys(a).length !== Object.keys(b).length) {
66
+ return false;
67
+ }
68
+ if (a instanceof Node) {
69
+ return a.isEqualNode(b);
70
+ }
71
+ if (a instanceof Date) {
72
+ return a.valueOf() === b.valueOf();
73
+ }
74
+ for (var i in a) {
75
+ if (!fnEqual(a[i], b[i], maxDepth, contains, depth + 1)) {
76
+ return false;
77
+ }
78
+ }
79
+ return true;
80
+ }
81
+ return false;
58
82
  };
59
83
  export default fnEqual;
@@ -1,10 +1,61 @@
1
- import _merge from './_merge.js';
1
+ /*!
2
+ * OpenUI5
3
+ * (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+ import _merge from "./_merge.js";
7
+ /**
8
+ * Performs object extension by merging source objects into a target object. Generates a shallow copy.
9
+ *
10
+ * If during merging a key in the target object exists it is overwritten with the source object's value.
11
+ * Usage is the same as <code>jQuery.extend(...)</code>.
12
+ * Values that are <code>undefined</code> are ignored.
13
+ *
14
+ * As alternative you may also use <code>Object.assign</code>, but note that <code>Object.assign</code>
15
+ * only copies enumerable and own properties and doesn't copy properties on the prototype and non-enumerable
16
+ * properties. Also, values that are <code>undefined</code> are NOT ignored.
17
+ *
18
+ * For deep copies, you may use {@link module:sap/base/util/deepExtend sap/base/util/deepExtend}.
19
+ *
20
+ * @example
21
+ * var oResult = extend({}, {
22
+ * prop1: {
23
+ * prop1a: "1a"
24
+ * }
25
+ * }, {
26
+ * prop2: {
27
+ * prop2a: "2a"
28
+ * }
29
+ * }, {
30
+ * prop1: {
31
+ * prop1b: "1b"
32
+ * }
33
+ * }, {
34
+ * prop2: undefined
35
+ * });
36
+ *
37
+ *
38
+ * console.log(oResult);
39
+ * {
40
+ * "prop1": {
41
+ * "prop1b": "1b"
42
+ * },
43
+ * "prop2": {
44
+ * "prop2a": "2a"
45
+ * }
46
+ * }
47
+ *
48
+ * @function
49
+ * @alias module:sap/base/util/extend
50
+ * @param {object} target The object that will receive new properties
51
+ * @param {...object} [source] One or more objects which get merged into the target object
52
+ * @return {object} the target object which is the result of the merge
53
+ * @public
54
+ * @since 1.71
55
+ */
2
56
  var fnExtend = function () {
3
- var args = [
4
- false,
5
- true
6
- ];
7
- args.push.apply(args, arguments);
8
- return _merge.apply(null, args);
57
+ var args = [false, true];
58
+ args.push.apply(args, arguments);
59
+ return _merge.apply(null, args);
9
60
  };
10
61
  export default fnExtend;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Validates if the given object is empty, that is that it has no enumerable properties.
3
+ *
4
+ * Note that <code>null</code> and <code>undefined</code> comply with this definition of 'empty'.
5
+ * The behavior for non-object values is undefined and might change in future.
6
+ *
7
+ * @example
8
+ * sap.ui.require(["sap/base/util/isEmptyObject"], function(isEmptyObject){
9
+ * isEmptyObject({}); // true
10
+ * isEmptyObject({test: '123'}); // false
11
+ * isEmptyObject(null); // true
12
+ * isEmptyObject(undefined); // true
13
+ * });
14
+ *
15
+ * @function
16
+ * @since 1.65
17
+ * @public
18
+ * @name module:sap/base/util/isEmptyObject
19
+ * @param {Object} obj the object which is checked
20
+ * @returns {boolean} whether or not the given object is empty
21
+ */ /*!
22
+ * OpenUI5
23
+ * (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
24
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
25
+ */
26
+
27
+ var fnIsEmptyObject = function isEmptyObject(obj) {
28
+ // eslint-disable-next-line no-unreachable-loop
29
+ for (var sName in obj) {
30
+ return false;
31
+ }
32
+ return true;
33
+ };
34
+ export default fnIsEmptyObject;
@@ -1,18 +1,52 @@
1
+ /*!
2
+ * OpenUI5
3
+ * (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+
1
7
  var class2type = {};
2
8
  var hasOwn = class2type.hasOwnProperty;
3
9
  var toString = class2type.toString;
4
10
  var fnToString = hasOwn.toString;
5
11
  var ObjectFunctionString = fnToString.call(Object);
12
+
13
+ /**
14
+ * Checks whether the object is a plain object (created using "{}" or "new Object").
15
+ *
16
+ * @function
17
+ * @since 1.58
18
+ * @public
19
+ * @alias module:sap/base/util/isPlainObject
20
+ * @param {Object} obj the object which is checked
21
+ * @returns {boolean} whether or not the object is a plain object (created using "{}" or "new Object").
22
+ */
6
23
  var fnIsPlainObject = function (obj) {
24
+ /*
25
+ * The code in this function is taken from jQuery 3.6.0 "jQuery.isPlainObject" and got modified.
26
+ *
27
+ * jQuery JavaScript Library v3.6.0
28
+ * http://jquery.com/
29
+ *
30
+ * Copyright OpenJS Foundation and other contributors
31
+ * Released under the MIT license
32
+ * http://jquery.org/license
33
+ */
7
34
  var proto, Ctor;
35
+
36
+ // Detect obvious negatives
37
+ // Use toString instead of jQuery.type to catch host objects
8
38
  if (!obj || toString.call(obj) !== "[object Object]") {
9
39
  return false;
10
40
  }
11
41
  proto = Object.getPrototypeOf(obj);
42
+
43
+ // Objects with no prototype (e.g., `Object.create( null )`) are plain
12
44
  if (!proto) {
13
45
  return true;
14
46
  }
47
+
48
+ // Objects with a prototype are considered plain only if they were constructed by a global Object function
15
49
  Ctor = hasOwn.call(proto, "constructor") && proto.constructor;
16
50
  return typeof Ctor === "function" && fnToString.call(Ctor) === ObjectFunctionString;
17
51
  };
18
- export default fnIsPlainObject;
52
+ export default fnIsPlainObject;
@@ -1,7 +1,28 @@
1
- var fnNow = !(typeof window != "undefined" && window.performance && performance.now && performance.timing) ? Date.now : (function () {
1
+ // @evo-todo window.performance does not exist on node.js, but there is a module performance-now. Maybe use it
2
+
3
+ /**
4
+ * Returns a high resolution timestamp in microseconds if supported by the environment, otherwise in milliseconds.
5
+ * The timestamp is based on 01/01/1970 00:00:00 (UNIX epoch) as float with microsecond precision or
6
+ * with millisecond precision, if high resolution timestamps are not available.
7
+ * The fractional part of the timestamp represents fractions of a millisecond.
8
+ * Converting to a <code>Date</code> is possible by using <code>require(["sap/base/util/now"], function(now){new Date(now());}</code>
9
+ *
10
+ * @function
11
+ * @since 1.58
12
+ * @public
13
+ * @alias module:sap/base/util/now
14
+ * @returns {float} timestamp in microseconds if supported by the environment otherwise in milliseconds
15
+ */ /*!
16
+ * OpenUI5
17
+ * (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
18
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
19
+ */
20
+ /*global performance */
21
+
22
+ var fnNow = !(typeof window != "undefined" && window.performance && performance.now && performance.timing) ? Date.now : function () {
2
23
  var iNavigationStart = performance.timing.navigationStart;
3
24
  return function perfnow() {
4
25
  return iNavigationStart + performance.now();
5
26
  };
6
- })();
7
- export default fnNow;
27
+ }();
28
+ export default fnNow;
@@ -0,0 +1,3 @@
1
+ export default (function () {
2
+ throw new Error("not implemented");
3
+ });
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Some private variable used for creation of (pseudo-)unique IDs.
3
+ * @type int
4
+ * @private
5
+ */ /*!
6
+ * OpenUI5
7
+ * (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
8
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
9
+ */
10
+
11
+ var iIdCounter = 0;
12
+
13
+ /**
14
+ * Creates and returns a pseudo-unique ID.
15
+ *
16
+ * No means for detection of overlap with already present or future UIDs.
17
+ *
18
+ * @function
19
+ * @since 1.58
20
+ * @alias module:sap/base/util/uid
21
+ * @return {string} A pseudo-unique id.
22
+ * @public
23
+ */
24
+ var fnUid = function uid() {
25
+ return "id-" + new Date().valueOf() + "-" + iIdCounter++;
26
+ };
27
+ export default fnUid;