@jscrpt/common 1.2.0 → 2.0.0-beta.20211108120022

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 (238) hide show
  1. package/changelog.md +24 -0
  2. package/dist/es2015/decorators/bindThis.decorator.js +24 -24
  3. package/dist/es2015/decorators/bindThis.decorator.js.map +1 -0
  4. package/dist/es2015/decorators/callOnce.decorator.js +29 -28
  5. package/dist/es2015/decorators/callOnce.decorator.js.map +1 -0
  6. package/dist/es2015/decorators/debounceCall.decorator.js +25 -26
  7. package/dist/es2015/decorators/debounceCall.decorator.js.map +1 -0
  8. package/dist/es2015/decorators/index.js +4 -4
  9. package/dist/es2015/decorators/index.js.map +1 -0
  10. package/dist/es2015/encoder/encoder.js +220 -231
  11. package/dist/es2015/encoder/encoder.js.map +1 -0
  12. package/dist/es2015/enums/index.js +2 -2
  13. package/dist/es2015/enums/index.js.map +1 -0
  14. package/dist/es2015/enums/orderByDirection.js +15 -15
  15. package/dist/es2015/enums/orderByDirection.js.map +1 -0
  16. package/dist/es2015/index.js +10 -24
  17. package/dist/es2015/index.js.map +1 -0
  18. package/dist/es2015/indexNode.js +2 -2
  19. package/dist/es2015/indexNode.js.map +1 -0
  20. package/dist/es2015/initJsDevMode.js +8 -0
  21. package/dist/es2015/initJsDevMode.js.map +1 -0
  22. package/dist/es2015/jsDevMode.js +8 -8
  23. package/dist/es2015/jsDevMode.js.map +1 -0
  24. package/dist/es2015/normalizer/charMaps.js +20 -27
  25. package/dist/es2015/normalizer/charMaps.js.map +1 -0
  26. package/dist/es2015/normalizer/index.js +3 -3
  27. package/dist/es2015/normalizer/index.js.map +1 -0
  28. package/dist/es2015/normalizer/normalizer.js +14 -14
  29. package/dist/es2015/normalizer/normalizer.js.map +1 -0
  30. package/dist/es2015/paginator/paginator.js +230 -224
  31. package/dist/es2015/paginator/paginator.js.map +1 -0
  32. package/dist/es2015/types/dictionaries.js +2 -1
  33. package/dist/es2015/types/dictionaries.js.map +1 -0
  34. package/dist/es2015/types/enums.js +2 -0
  35. package/dist/es2015/types/enums.js.map +1 -0
  36. package/dist/es2015/types/functions.js +2 -0
  37. package/dist/es2015/types/functions.js.map +1 -0
  38. package/dist/es2015/types/index.js +5 -3
  39. package/dist/es2015/types/index.js.map +1 -0
  40. package/dist/es2015/types/valueNamePair.js +2 -1
  41. package/dist/es2015/types/valueNamePair.js.map +1 -0
  42. package/dist/es2015/utils/common.js +209 -215
  43. package/dist/es2015/utils/common.js.map +1 -0
  44. package/dist/es2015/utils/index.js +4 -4
  45. package/dist/es2015/utils/index.js.map +1 -0
  46. package/dist/es2015/utils/lang.js +79 -79
  47. package/dist/es2015/utils/lang.js.map +1 -0
  48. package/dist/es2015/utils/nameof.js +6 -6
  49. package/dist/es2015/utils/nameof.js.map +1 -0
  50. package/dist/es2020/decorators/bindThis.decorator.js +23 -0
  51. package/dist/es2020/decorators/bindThis.decorator.js.map +1 -0
  52. package/dist/es2020/decorators/callOnce.decorator.js +28 -0
  53. package/dist/es2020/decorators/callOnce.decorator.js.map +1 -0
  54. package/dist/es2020/decorators/debounceCall.decorator.js +24 -0
  55. package/dist/es2020/decorators/debounceCall.decorator.js.map +1 -0
  56. package/dist/es2020/decorators/index.js +4 -0
  57. package/dist/es2020/decorators/index.js.map +1 -0
  58. package/dist/es2020/encoder/encoder.js +220 -0
  59. package/dist/es2020/encoder/encoder.js.map +1 -0
  60. package/dist/es2020/enums/index.js +2 -0
  61. package/dist/es2020/enums/index.js.map +1 -0
  62. package/dist/es2020/enums/orderByDirection.js +15 -0
  63. package/dist/es2020/enums/orderByDirection.js.map +1 -0
  64. package/dist/es2020/index.js +10 -0
  65. package/dist/es2020/index.js.map +1 -0
  66. package/dist/es2020/indexNode.js +2 -0
  67. package/dist/es2020/indexNode.js.map +1 -0
  68. package/dist/es2020/initJsDevMode.js +8 -0
  69. package/dist/es2020/initJsDevMode.js.map +1 -0
  70. package/dist/es2020/jsDevMode.js +8 -0
  71. package/dist/es2020/jsDevMode.js.map +1 -0
  72. package/dist/es2020/normalizer/charMaps.js +20 -0
  73. package/dist/es2020/normalizer/charMaps.js.map +1 -0
  74. package/dist/es2020/normalizer/index.js +3 -0
  75. package/dist/es2020/normalizer/index.js.map +1 -0
  76. package/dist/es2020/normalizer/normalizer.js +14 -0
  77. package/dist/es2020/normalizer/normalizer.js.map +1 -0
  78. package/dist/es2020/paginator/paginator.js +230 -0
  79. package/dist/es2020/paginator/paginator.js.map +1 -0
  80. package/dist/es2020/types/dictionaries.js +2 -0
  81. package/dist/es2020/types/dictionaries.js.map +1 -0
  82. package/dist/es2020/types/enums.js +2 -0
  83. package/dist/es2020/types/enums.js.map +1 -0
  84. package/dist/es2020/types/functions.js +2 -0
  85. package/dist/es2020/types/functions.js.map +1 -0
  86. package/dist/es2020/types/index.js +5 -0
  87. package/dist/es2020/types/index.js.map +1 -0
  88. package/dist/es2020/types/valueNamePair.js +2 -0
  89. package/dist/es2020/types/valueNamePair.js.map +1 -0
  90. package/dist/es2020/utils/common.js +208 -0
  91. package/dist/es2020/utils/common.js.map +1 -0
  92. package/dist/es2020/utils/index.js +4 -0
  93. package/dist/es2020/utils/index.js.map +1 -0
  94. package/dist/es2020/utils/lang.js +79 -0
  95. package/dist/es2020/utils/lang.js.map +1 -0
  96. package/dist/es2020/utils/nameof.js +6 -0
  97. package/dist/es2020/utils/nameof.js.map +1 -0
  98. package/dist/es5/decorators/bindThis.decorator.js +24 -24
  99. package/dist/es5/decorators/bindThis.decorator.js.map +1 -0
  100. package/dist/es5/decorators/callOnce.decorator.js +33 -28
  101. package/dist/es5/decorators/callOnce.decorator.js.map +1 -0
  102. package/dist/es5/decorators/debounceCall.decorator.js +30 -27
  103. package/dist/es5/decorators/debounceCall.decorator.js.map +1 -0
  104. package/dist/es5/decorators/index.js +4 -4
  105. package/dist/es5/decorators/index.js.map +1 -0
  106. package/dist/es5/encoder/encoder.js +222 -233
  107. package/dist/es5/encoder/encoder.js.map +1 -0
  108. package/dist/es5/enums/index.js +2 -2
  109. package/dist/es5/enums/index.js.map +1 -0
  110. package/dist/es5/enums/orderByDirection.js +15 -15
  111. package/dist/es5/enums/orderByDirection.js.map +1 -0
  112. package/dist/es5/index.js +10 -24
  113. package/dist/es5/index.js.map +1 -0
  114. package/dist/es5/indexNode.js +2 -2
  115. package/dist/es5/indexNode.js.map +1 -0
  116. package/dist/es5/initJsDevMode.js +8 -0
  117. package/dist/es5/initJsDevMode.js.map +1 -0
  118. package/dist/es5/jsDevMode.js +8 -8
  119. package/dist/es5/jsDevMode.js.map +1 -0
  120. package/dist/es5/normalizer/charMaps.js +20 -35
  121. package/dist/es5/normalizer/charMaps.js.map +1 -0
  122. package/dist/es5/normalizer/index.js +3 -3
  123. package/dist/es5/normalizer/index.js.map +1 -0
  124. package/dist/es5/normalizer/normalizer.js +14 -14
  125. package/dist/es5/normalizer/normalizer.js.map +1 -0
  126. package/dist/es5/paginator/paginator.js +232 -226
  127. package/dist/es5/paginator/paginator.js.map +1 -0
  128. package/dist/es5/types/dictionaries.js +2 -1
  129. package/dist/es5/types/dictionaries.js.map +1 -0
  130. package/dist/es5/types/enums.js +2 -0
  131. package/dist/es5/types/enums.js.map +1 -0
  132. package/dist/es5/types/functions.js +2 -0
  133. package/dist/es5/types/functions.js.map +1 -0
  134. package/dist/es5/types/index.js +5 -3
  135. package/dist/es5/types/index.js.map +1 -0
  136. package/dist/es5/types/valueNamePair.js +2 -1
  137. package/dist/es5/types/valueNamePair.js.map +1 -0
  138. package/dist/es5/utils/common.js +220 -232
  139. package/dist/es5/utils/common.js.map +1 -0
  140. package/dist/es5/utils/index.js +4 -4
  141. package/dist/es5/utils/index.js.map +1 -0
  142. package/dist/es5/utils/lang.js +79 -79
  143. package/dist/es5/utils/lang.js.map +1 -0
  144. package/dist/es5/utils/nameof.js +6 -6
  145. package/dist/es5/utils/nameof.js.map +1 -0
  146. package/dist/module/decorators/bindThis.decorator.js +28 -28
  147. package/dist/module/decorators/bindThis.decorator.js.map +1 -0
  148. package/dist/module/decorators/callOnce.decorator.js +33 -32
  149. package/dist/module/decorators/callOnce.decorator.js.map +1 -0
  150. package/dist/module/decorators/debounceCall.decorator.js +29 -30
  151. package/dist/module/decorators/debounceCall.decorator.js.map +1 -0
  152. package/dist/module/decorators/index.js +7 -16
  153. package/dist/module/decorators/index.js.map +1 -0
  154. package/dist/module/encoder/encoder.js +224 -235
  155. package/dist/module/encoder/encoder.js.map +1 -0
  156. package/dist/module/enums/index.js +5 -14
  157. package/dist/module/enums/index.js.map +1 -0
  158. package/dist/module/enums/orderByDirection.js +18 -18
  159. package/dist/module/enums/orderByDirection.js.map +1 -0
  160. package/dist/module/index.js +13 -37
  161. package/dist/module/index.js.map +1 -0
  162. package/dist/module/indexNode.js +5 -14
  163. package/dist/module/indexNode.js.map +1 -0
  164. package/dist/module/initJsDevMode.js +10 -0
  165. package/dist/module/initJsDevMode.js.map +1 -0
  166. package/dist/module/jsDevMode.js +12 -12
  167. package/dist/module/jsDevMode.js.map +1 -0
  168. package/dist/module/normalizer/charMaps.js +23 -31
  169. package/dist/module/normalizer/charMaps.js.map +1 -0
  170. package/dist/module/normalizer/index.js +6 -15
  171. package/dist/module/normalizer/index.js.map +1 -0
  172. package/dist/module/normalizer/normalizer.js +18 -18
  173. package/dist/module/normalizer/normalizer.js.map +1 -0
  174. package/dist/module/paginator/paginator.js +234 -228
  175. package/dist/module/paginator/paginator.js.map +1 -0
  176. package/dist/module/types/dictionaries.js +3 -3
  177. package/dist/module/types/dictionaries.js.map +1 -0
  178. package/dist/module/types/enums.js +3 -0
  179. package/dist/module/types/enums.js.map +1 -0
  180. package/dist/module/types/functions.js +3 -0
  181. package/dist/module/types/functions.js.map +1 -0
  182. package/dist/module/types/index.js +8 -15
  183. package/dist/module/types/index.js.map +1 -0
  184. package/dist/module/types/valueNamePair.js +3 -3
  185. package/dist/module/types/valueNamePair.js.map +1 -0
  186. package/dist/module/utils/common.js +232 -240
  187. package/dist/module/utils/common.js.map +1 -0
  188. package/dist/module/utils/index.js +7 -16
  189. package/dist/module/utils/index.js.map +1 -0
  190. package/dist/module/utils/lang.js +99 -99
  191. package/dist/module/utils/lang.js.map +1 -0
  192. package/dist/module/utils/nameof.js +10 -9
  193. package/dist/module/utils/nameof.js.map +1 -0
  194. package/package.json +45 -16
  195. package/src/decorators/bindThis.decorator.d.ts +5 -7
  196. package/src/decorators/bindThis.decorator.d.ts.map +1 -1
  197. package/src/decorators/callOnce.decorator.d.ts +5 -5
  198. package/src/decorators/callOnce.decorator.d.ts.map +1 -1
  199. package/src/decorators/debounceCall.decorator.d.ts +5 -5
  200. package/src/decorators/debounceCall.decorator.d.ts.map +1 -1
  201. package/src/decorators/index.d.ts +3 -3
  202. package/src/encoder/encoder.d.ts +45 -45
  203. package/src/encoder/encoder.d.ts.map +1 -1
  204. package/src/enums/index.d.ts +1 -1
  205. package/src/enums/orderByDirection.d.ts +13 -13
  206. package/src/index.d.ts +9 -17
  207. package/src/index.d.ts.map +1 -1
  208. package/src/indexNode.d.ts +1 -1
  209. package/src/initJsDevMode.d.ts +2 -0
  210. package/src/initJsDevMode.d.ts.map +1 -0
  211. package/src/jsDevMode.d.ts +8 -8
  212. package/src/jsDevMode.d.ts.map +1 -1
  213. package/src/normalizer/charMaps.d.ts +5 -9
  214. package/src/normalizer/charMaps.d.ts.map +1 -1
  215. package/src/normalizer/index.d.ts +2 -2
  216. package/src/normalizer/normalizer.d.ts +7 -6
  217. package/src/normalizer/normalizer.d.ts.map +1 -1
  218. package/src/paginator/paginator.d.ts +129 -129
  219. package/src/paginator/paginator.d.ts.map +1 -1
  220. package/src/types/dictionaries.d.ts +15 -6
  221. package/src/types/dictionaries.d.ts.map +1 -1
  222. package/src/types/enums.d.ts +7 -0
  223. package/src/types/enums.d.ts.map +1 -0
  224. package/src/types/functions.d.ts +14 -0
  225. package/src/types/functions.d.ts.map +1 -0
  226. package/src/types/index.d.ts +4 -2
  227. package/src/types/index.d.ts.map +1 -1
  228. package/src/types/valueNamePair.d.ts +13 -13
  229. package/src/utils/common.d.ts +181 -122
  230. package/src/utils/common.d.ts.map +1 -1
  231. package/src/utils/index.d.ts +3 -3
  232. package/src/utils/lang.d.ts +41 -41
  233. package/src/utils/lang.d.ts.map +1 -1
  234. package/src/utils/nameof.d.ts +5 -5
  235. package/src/utils/nameof.d.ts.map +1 -1
  236. package/version.bak +1 -1
  237. package/.jsbeautifyrc +0 -7
  238. package/appveyor.yml +0 -67
@@ -1,79 +1,79 @@
1
- /**
2
- * Tests whether is object not `null` and not `undefined` at the same time
3
- * @param obj - Object to be tested
4
- */
5
- export function isPresent(obj) {
6
- return obj !== undefined && obj !== null;
7
- }
8
- /**
9
- * Tests whether is object `null` or `undefined`
10
- * @param obj - Object to be tested
11
- */
12
- export function isBlank(obj) {
13
- return obj === undefined || obj === null;
14
- }
15
- /**
16
- * Tests whether is object instance of `boolean`
17
- * @param obj - Object to be tested
18
- */
19
- export function isBoolean(obj) {
20
- return typeof obj === 'boolean';
21
- }
22
- /**
23
- * Tests whether is object instance of number
24
- * @param obj - Object to be tested
25
- */
26
- export function isNumber(obj) {
27
- return typeof obj === 'number';
28
- }
29
- /**
30
- * Tests whether is object instance of string
31
- * @param obj - Object to be tested
32
- */
33
- export function isString(obj) {
34
- return typeof obj === 'string';
35
- }
36
- /**
37
- * Tests whether is object instance of function
38
- * @param obj - Object to be tested
39
- */
40
- export function isFunction(obj) {
41
- return typeof obj === 'function';
42
- }
43
- export function isType(obj) {
44
- return isFunction(obj);
45
- }
46
- export function isStringMap(obj) {
47
- return typeof obj === 'object' && obj !== null;
48
- }
49
- const STRING_MAP_PROTO = Object.getPrototypeOf({});
50
- export function isStrictStringMap(obj) {
51
- return isStringMap(obj) && Object.getPrototypeOf(obj) === STRING_MAP_PROTO;
52
- }
53
- export function isArray(obj) {
54
- return Array.isArray(obj);
55
- }
56
- export function isDate(obj) {
57
- return obj instanceof Date && !isNaN(obj.valueOf());
58
- }
59
- export function noop() {
60
- }
61
- export function normalizeBlank(obj) {
62
- return isBlank(obj) ? null : obj;
63
- }
64
- export function isJsObject(o) {
65
- return o !== null && (typeof o === 'function' || typeof o === 'object');
66
- }
67
- export function isPrimitive(obj) {
68
- return !isJsObject(obj);
69
- }
70
- export function hasConstructor(value, type) {
71
- return value.constructor === type;
72
- }
73
- export function isEmptyObject(obj) {
74
- for (let _name in obj) {
75
- return false;
76
- }
77
- return true;
78
- }
79
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGFuZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy91dGlscy9sYW5nLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7R0FHRztBQUNILE1BQU0sVUFBVSxTQUFTLENBQU8sR0FBUztJQUVyQyxPQUFPLEdBQUcsS0FBSyxTQUFTLElBQUksR0FBRyxLQUFLLElBQUksQ0FBQztBQUM3QyxDQUFDO0FBRUQ7OztHQUdHO0FBQ0gsTUFBTSxVQUFVLE9BQU8sQ0FBQyxHQUFRO0lBRTVCLE9BQU8sR0FBRyxLQUFLLFNBQVMsSUFBSSxHQUFHLEtBQUssSUFBSSxDQUFDO0FBQzdDLENBQUM7QUFFRDs7O0dBR0c7QUFDSCxNQUFNLFVBQVUsU0FBUyxDQUFDLEdBQVE7SUFFOUIsT0FBTyxPQUFPLEdBQUcsS0FBSyxTQUFTLENBQUM7QUFDcEMsQ0FBQztBQUVEOzs7R0FHRztBQUNILE1BQU0sVUFBVSxRQUFRLENBQUMsR0FBUTtJQUU3QixPQUFPLE9BQU8sR0FBRyxLQUFLLFFBQVEsQ0FBQztBQUNuQyxDQUFDO0FBRUQ7OztHQUdHO0FBQ0gsTUFBTSxVQUFVLFFBQVEsQ0FBQyxHQUFRO0lBRTdCLE9BQU8sT0FBTyxHQUFHLEtBQUssUUFBUSxDQUFDO0FBQ25DLENBQUM7QUFFRDs7O0dBR0c7QUFDSCxNQUFN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9ydCBmdW5jdGlvbiBub29wKCk6IHZvaWRcclxue1xyXG59XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gbm9ybWFsaXplQmxhbms8VE9iaiBleHRlbmRzIE9iamVjdD4ob2JqOiBUT2JqfHVuZGVmaW5lZHxudWxsKTogVE9ianxudWxsXHJcbntcclxuICAgIHJldHVybiBpc0JsYW5rKG9iaikgPyBudWxsIDogb2JqO1xyXG59XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gaXNKc09iamVjdChvOiBhbnkpOiBvIGlzIEZ1bmN0aW9ufE9iamVjdFxyXG57XHJcbiAgICByZXR1cm4gbyAhPT0gbnVsbCAmJiAodHlwZW9mIG8gPT09ICdmdW5jdGlvbicgfHwgdHlwZW9mIG8gPT09ICdvYmplY3QnKTtcclxufVxyXG5cclxuZXhwb3J0IGZ1bmN0aW9uIGlzUHJpbWl0aXZlKG9iajogYW55KTogYm9vbGVhblxyXG57XHJcbiAgICByZXR1cm4gIWlzSnNPYmplY3Qob2JqKTtcclxufVxyXG5cclxuZXhwb3J0IGZ1bmN0aW9uIGhhc0NvbnN0cnVjdG9yKHZhbHVlOiBPYmplY3QsIHR5cGU6IGFueSk6IGJvb2xlYW5cclxue1xyXG4gICAgcmV0dXJuIHZhbHVlLmNvbnN0cnVjdG9yID09PSB0eXBlO1xyXG59XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gaXNFbXB0eU9iamVjdChvYmo6IGFueSk6IGJvb2xlYW5cclxue1xyXG4gICAgZm9yIChsZXQgX25hbWUgaW4gb2JqKVxyXG4gICAge1xyXG4gICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgIH1cclxuXHJcbiAgICByZXR1cm4gdHJ1ZTtcclxufSJdfQ==
1
+ /**
2
+ * Tests whether is object not `null` and not `undefined` at the same time
3
+ * @param obj - Object to be tested
4
+ */
5
+ export function isPresent(obj) {
6
+ return obj !== undefined && obj !== null;
7
+ }
8
+ /**
9
+ * Tests whether is object `null` or `undefined`
10
+ * @param obj - Object to be tested
11
+ */
12
+ export function isBlank(obj) {
13
+ return obj === undefined || obj === null;
14
+ }
15
+ /**
16
+ * Tests whether is object instance of `boolean`
17
+ * @param obj - Object to be tested
18
+ */
19
+ export function isBoolean(obj) {
20
+ return typeof obj === 'boolean';
21
+ }
22
+ /**
23
+ * Tests whether is object instance of number
24
+ * @param obj - Object to be tested
25
+ */
26
+ export function isNumber(obj) {
27
+ return typeof obj === 'number';
28
+ }
29
+ /**
30
+ * Tests whether is object instance of string
31
+ * @param obj - Object to be tested
32
+ */
33
+ export function isString(obj) {
34
+ return typeof obj === 'string';
35
+ }
36
+ /**
37
+ * Tests whether is object instance of function
38
+ * @param obj - Object to be tested
39
+ */
40
+ export function isFunction(obj) {
41
+ return typeof obj === 'function';
42
+ }
43
+ export function isType(obj) {
44
+ return isFunction(obj);
45
+ }
46
+ export function isStringMap(obj) {
47
+ return typeof obj === 'object' && obj !== null;
48
+ }
49
+ const STRING_MAP_PROTO = Object.getPrototypeOf({});
50
+ export function isStrictStringMap(obj) {
51
+ return isStringMap(obj) && Object.getPrototypeOf(obj) === STRING_MAP_PROTO;
52
+ }
53
+ export function isArray(obj) {
54
+ return Array.isArray(obj);
55
+ }
56
+ export function isDate(obj) {
57
+ return obj instanceof Date && !isNaN(obj.valueOf());
58
+ }
59
+ export function noop() {
60
+ }
61
+ export function normalizeBlank(obj) {
62
+ return isBlank(obj) ? null : obj;
63
+ }
64
+ export function isJsObject(o) {
65
+ return o !== null && (typeof o === 'function' || typeof o === 'object');
66
+ }
67
+ export function isPrimitive(obj) {
68
+ return !isJsObject(obj);
69
+ }
70
+ export function hasConstructor(value, type) {
71
+ return value.constructor === type;
72
+ }
73
+ export function isEmptyObject(obj) {
74
+ for (const _name in obj) {
75
+ return false;
76
+ }
77
+ return true;
78
+ }
79
+ //# sourceMappingURL=lang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lang.js","sourceRoot":"","sources":["../../../src/utils/lang.ts"],"names":[],"mappings":"AA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GAAQ;IAE3B,OAAO,GAAG,YAAY,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;AACxD,CAAC;AAED,MAAM,UAAU,IAAI;AAGpB,CAAC;AAED,MAAM,UAAU,cAAc,CAAsB,GAAwB;IAExE,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,CAAM;IAE7B,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,UAAU,IAAI,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,GAAQ;IAEhC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAa,EAAE,IAAS;IAEnD,OAAO,KAAK,CAAC,WAAW,KAAK,IAAI,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,GAAQ;IAElC,KAAK,MAAM,KAAK,IAAI,GAAG,EACvB;QACI,OAAO,KAAK,CAAC;KAChB;IAED,OAAO,IAAI,CAAC;AAChB,CAAC","sourcesContent":["/**\r\n * Tests whether is object not `null` and not `undefined` at the same time\r\n * @param obj - Object to be tested\r\n */\r\nexport function isPresent<TObj>(obj: TObj): obj is NonNullable<TObj>\r\n{\r\n return obj !== undefined && obj !== null;\r\n}\r\n\r\n/**\r\n * Tests whether is object `null` or `undefined`\r\n * @param obj - Object to be tested\r\n */\r\nexport function isBlank(obj: any): obj is null|undefined\r\n{\r\n return obj === undefined || obj === null;\r\n}\r\n\r\n/**\r\n * Tests whether is object instance of `boolean`\r\n * @param obj - Object to be tested\r\n */\r\nexport function isBoolean(obj: any): obj is boolean\r\n{\r\n return typeof obj === 'boolean';\r\n}\r\n\r\n/**\r\n * Tests whether is object instance of number\r\n * @param obj - Object to be tested\r\n */\r\nexport function isNumber(obj: any): obj is number\r\n{\r\n return typeof obj === 'number';\r\n}\r\n\r\n/**\r\n * Tests whether is object instance of string\r\n * @param obj - Object to be tested\r\n */\r\nexport function isString(obj: any): obj is string\r\n{\r\n return typeof obj === 'string';\r\n}\r\n\r\n/**\r\n * Tests whether is object instance of function\r\n * @param obj - Object to be tested\r\n */\r\nexport function isFunction(obj: any): obj is Function\r\n{\r\n return typeof obj === 'function';\r\n}\r\n\r\nexport function isType(obj: any): obj is Function\r\n{\r\n return isFunction(obj);\r\n}\r\n\r\nexport function isStringMap(obj: any): obj is Object\r\n{\r\n return typeof obj === 'object' && obj !== null;\r\n}\r\n\r\nconst STRING_MAP_PROTO = Object.getPrototypeOf({});\r\n\r\nexport function isStrictStringMap(obj: any): boolean\r\n{\r\n return isStringMap(obj) && Object.getPrototypeOf(obj) === STRING_MAP_PROTO;\r\n}\r\n\r\nexport function isArray(obj: any): obj is Array<any>\r\n{\r\n return Array.isArray(obj);\r\n}\r\n\r\nexport function isDate(obj: any): obj is Date\r\n{\r\n return obj instanceof Date && !isNaN(obj.valueOf());\r\n}\r\n\r\nexport function noop(): void\r\n// eslint-disable-next-line @typescript-eslint/no-empty-function\r\n{\r\n}\r\n\r\nexport function normalizeBlank<TObj extends Object>(obj: TObj|undefined|null): TObj|null\r\n{\r\n return isBlank(obj) ? null : obj;\r\n}\r\n\r\nexport function isJsObject(o: any): o is Function|Object\r\n{\r\n return o !== null && (typeof o === 'function' || typeof o === 'object');\r\n}\r\n\r\nexport function isPrimitive(obj: any): boolean\r\n{\r\n return !isJsObject(obj);\r\n}\r\n\r\nexport function hasConstructor(value: Object, type: any): boolean\r\n{\r\n return value.constructor === type;\r\n}\r\n\r\nexport function isEmptyObject(obj: any): boolean\r\n{\r\n for (const _name in obj)\r\n {\r\n return false;\r\n }\r\n\r\n return true;\r\n}"]}
@@ -1,6 +1,6 @@
1
- /**
2
- * Returns name of property, checked by typescript
3
- * @param name - Name of property that should be returned
4
- */
5
- export const nameof = (name) => name;
6
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmFtZW9mLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3V0aWxzL25hbWVvZi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7O0dBR0c7QUFDSCxNQUFNLENBQUMsTUFBTSxNQUFNLEdBQUcsQ0FBSSxJQUFhLEVBQUUsRUFBRSxDQUFDLElBQUksQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxyXG4gKiBSZXR1cm5zIG5hbWUgb2YgcHJvcGVydHksIGNoZWNrZWQgYnkgdHlwZXNjcmlwdFxyXG4gKiBAcGFyYW0gbmFtZSAtIE5hbWUgb2YgcHJvcGVydHkgdGhhdCBzaG91bGQgYmUgcmV0dXJuZWRcclxuICovXHJcbmV4cG9ydCBjb25zdCBuYW1lb2YgPSA8VD4obmFtZToga2V5b2YgVCkgPT4gbmFtZTsiXX0=
1
+ /**
2
+ * Returns name of property, checked by typescript
3
+ * @param name - Name of property that should be returned
4
+ */
5
+ export const nameof = (name) => name;
6
+ //# sourceMappingURL=nameof.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nameof.js","sourceRoot":"","sources":["../../../src/utils/nameof.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAI,IAA8B,EAAU,EAAE,CAAC,IAAI,CAAC","sourcesContent":["/**\r\n * Returns name of property, checked by typescript\r\n * @param name - Name of property that should be returned\r\n */\r\nexport const nameof = <T>(name: Extract<keyof T, string>): string => name;"]}
@@ -0,0 +1,23 @@
1
+ import { isFunction } from '../utils';
2
+ /**
3
+ * Binds function to this, object instance where is defined, it is importat to place it in correct order with other decorators, usually should be first
4
+ */
5
+ export function BindThis(_target, propertyKey, descriptor) {
6
+ const originalValue = descriptor.value ?? descriptor.get?.();
7
+ if (!isFunction(originalValue)) {
8
+ throw new Error(`Unable to apply @BindThis decorator to '${propertyKey.toString()}', it is not a method.`);
9
+ }
10
+ return {
11
+ configurable: true,
12
+ get() {
13
+ const bound = originalValue.bind(this);
14
+ Object.defineProperty(this, propertyKey, {
15
+ value: bound,
16
+ configurable: true,
17
+ writable: true
18
+ });
19
+ return bound;
20
+ }
21
+ };
22
+ }
23
+ //# sourceMappingURL=bindThis.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bindThis.decorator.js","sourceRoot":"","sources":["../../../src/decorators/bindThis.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAEpC;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAe,EAAE,WAA0B,EAAE,UAA8B;IAEhG,MAAM,aAAa,GAAS,UAAU,CAAC,KAAK,IAAI,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC;IAEnE,IAAG,CAAC,UAAU,CAAC,aAAa,CAAC,EAC7B;QACI,MAAM,IAAI,KAAK,CAAC,2CAA2C,WAAW,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC;KAC9G;IAED,OAAO;QACH,YAAY,EAAE,IAAI;QAClB,GAAG;YAEC,MAAM,KAAK,GAAS,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAE7C,MAAM,CAAC,cAAc,CAAC,IAAI,EACJ,WAAW,EACX;gBACI,KAAK,EAAE,KAAK;gBACZ,YAAY,EAAE,IAAI;gBAClB,QAAQ,EAAE,IAAI;aACjB,CAAC,CAAC;YAEzB,OAAO,KAAK,CAAC;QACjB,CAAC;KACJ,CAAC;AACN,CAAC","sourcesContent":["import {Func} from '../types';\r\nimport {isFunction} from '../utils';\r\n\r\n/**\r\n * Binds function to this, object instance where is defined, it is importat to place it in correct order with other decorators, usually should be first\r\n */\r\nexport function BindThis(_target: Object, propertyKey: string|symbol, descriptor: PropertyDescriptor): TypedPropertyDescriptor<Func>\r\n{\r\n const originalValue: Func = descriptor.value ?? descriptor.get?.();\r\n\r\n if(!isFunction(originalValue))\r\n {\r\n throw new Error(`Unable to apply @BindThis decorator to '${propertyKey.toString()}', it is not a method.`);\r\n }\r\n\r\n return {\r\n configurable: true,\r\n get(this: unknown): Func\r\n {\r\n const bound: Func = originalValue.bind(this);\r\n\r\n Object.defineProperty(this,\r\n propertyKey,\r\n {\r\n value: bound,\r\n configurable: true,\r\n writable: true\r\n });\r\n\r\n return bound;\r\n }\r\n };\r\n}"]}
@@ -0,0 +1,28 @@
1
+ import { isFunction, isPresent } from '../utils';
2
+ /**
3
+ * Method is called only once for specified time, other calls during this time are blocked and it does nothing and returns null
4
+ * @param time - Number of miliseconds which specifies period while are calls to this method blocked after first call
5
+ */
6
+ export function CallOnce(time) {
7
+ return function (_target, propertyKey, descriptor) {
8
+ let timeout;
9
+ const originalValue = descriptor.value ?? descriptor.get?.();
10
+ if (!isFunction(originalValue)) {
11
+ throw new Error(`Unable to apply @CallOnce() decorator to '${propertyKey.toString()}', it is not a method.`);
12
+ }
13
+ descriptor.value = function (...args) {
14
+ if (isPresent(timeout)) {
15
+ return;
16
+ }
17
+ originalValue.apply(this, args);
18
+ timeout = setTimeout(() => {
19
+ if (isPresent(timeout)) {
20
+ clearTimeout(timeout);
21
+ }
22
+ timeout = null;
23
+ }, time);
24
+ };
25
+ return descriptor;
26
+ };
27
+ }
28
+ //# sourceMappingURL=callOnce.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"callOnce.decorator.js","sourceRoot":"","sources":["../../../src/decorators/callOnce.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAE,SAAS,EAAC,MAAM,UAAU,CAAC;AAE/C;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY;IAEjC,OAAO,UAAS,OAAe,EAAE,WAA0B,EAAE,UAA8B;QAEvF,IAAI,OAAoB,CAAC;QACzB,MAAM,aAAa,GAAS,UAAU,CAAC,KAAK,IAAI,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC;QAEnE,IAAG,CAAC,UAAU,CAAC,aAAa,CAAC,EAC7B;YACI,MAAM,IAAI,KAAK,CAAC,6CAA6C,WAAW,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC;SAChH;QAED,UAAU,CAAC,KAAK,GAAG,UAAS,GAAG,IAAe;YAE1C,IAAG,SAAS,CAAC,OAAO,CAAC,EACrB;gBACI,OAAO;aACV;YAED,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAEhC,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;gBAEtB,IAAG,SAAS,CAAC,OAAO,CAAC,EACrB;oBACI,YAAY,CAAC,OAAO,CAAC,CAAC;iBACzB;gBAED,OAAO,GAAG,IAAI,CAAC;YACnB,CAAC,EAAE,IAAI,CAAQ,CAAC;QACpB,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACtB,CAAC,CAAC;AACN,CAAC","sourcesContent":["import {Func} from '../types';\r\nimport {isFunction, isPresent} from '../utils';\r\n\r\n/**\r\n * Method is called only once for specified time, other calls during this time are blocked and it does nothing and returns null\r\n * @param time - Number of miliseconds which specifies period while are calls to this method blocked after first call\r\n */\r\nexport function CallOnce(time: number): MethodDecorator\r\n{\r\n return function(_target: Object, propertyKey: string|symbol, descriptor: PropertyDescriptor)\r\n {\r\n let timeout: number|null;\r\n const originalValue: Func = descriptor.value ?? descriptor.get?.();\r\n\r\n if(!isFunction(originalValue))\r\n {\r\n throw new Error(`Unable to apply @CallOnce() decorator to '${propertyKey.toString()}', it is not a method.`);\r\n }\r\n\r\n descriptor.value = function(...args: unknown[]): void\r\n {\r\n if(isPresent(timeout))\r\n {\r\n return;\r\n }\r\n\r\n originalValue.apply(this, args);\r\n\r\n timeout = setTimeout(() =>\r\n {\r\n if(isPresent(timeout))\r\n {\r\n clearTimeout(timeout);\r\n }\r\n \r\n timeout = null;\r\n }, time) as any;\r\n };\r\n\r\n return descriptor;\r\n };\r\n}"]}
@@ -0,0 +1,24 @@
1
+ import { isFunction, isPresent } from '../utils';
2
+ /**
3
+ * Adds special functionality to method call, that debounce method call for specified time
4
+ * @param delay - Number of miliseconds that delays function call
5
+ */
6
+ export function DebounceCall(delay) {
7
+ return function (_target, propertyKey, descriptor) {
8
+ let timeout;
9
+ const originalValue = descriptor.value ?? descriptor.get?.();
10
+ if (!isFunction(originalValue)) {
11
+ throw new Error(`Unable to apply @DebounceCall() decorator to '${propertyKey.toString()}', it is not a method.`);
12
+ }
13
+ descriptor.value = function (...args) {
14
+ if (isPresent(timeout)) {
15
+ clearTimeout(timeout);
16
+ }
17
+ timeout = setTimeout(() => {
18
+ originalValue.apply(this, args);
19
+ }, delay);
20
+ };
21
+ return descriptor;
22
+ };
23
+ }
24
+ //# sourceMappingURL=debounceCall.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debounceCall.decorator.js","sourceRoot":"","sources":["../../../src/decorators/debounceCall.decorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAE,SAAS,EAAC,MAAM,UAAU,CAAC;AAE/C;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa;IAEtC,OAAO,UAAS,OAAe,EAAE,WAA0B,EAAE,UAA8B;QAEvF,IAAI,OAAe,CAAC;QACpB,MAAM,aAAa,GAAS,UAAU,CAAC,KAAK,IAAI,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC;QAEnE,IAAG,CAAC,UAAU,CAAC,aAAa,CAAC,EAC7B;YACI,MAAM,IAAI,KAAK,CAAC,iDAAiD,WAAW,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC;SACpH;QAED,UAAU,CAAC,KAAK,GAAG,UAAS,GAAG,IAAe;YAE1C,IAAG,SAAS,CAAC,OAAO,CAAC,EACrB;gBACI,YAAY,CAAC,OAAO,CAAC,CAAC;aACzB;YAED,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;gBAEtB,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACpC,CAAC,EAAE,KAAK,CAAQ,CAAC;QACrB,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACtB,CAAC,CAAC;AACN,CAAC","sourcesContent":["import {Func} from '../types';\r\nimport {isFunction, isPresent} from '../utils';\r\n\r\n/**\r\n * Adds special functionality to method call, that debounce method call for specified time\r\n * @param delay - Number of miliseconds that delays function call\r\n */\r\nexport function DebounceCall(delay: number): MethodDecorator\r\n{\r\n return function(_target: Object, propertyKey: string|symbol, descriptor: PropertyDescriptor)\r\n {\r\n let timeout: number;\r\n const originalValue: Func = descriptor.value ?? descriptor.get?.();\r\n\r\n if(!isFunction(originalValue))\r\n {\r\n throw new Error(`Unable to apply @DebounceCall() decorator to '${propertyKey.toString()}', it is not a method.`);\r\n }\r\n\r\n descriptor.value = function(...args: unknown[]): void\r\n {\r\n if(isPresent(timeout))\r\n {\r\n clearTimeout(timeout);\r\n }\r\n\r\n timeout = setTimeout(() =>\r\n {\r\n originalValue.apply(this, args);\r\n }, delay) as any;\r\n };\r\n\r\n return descriptor;\r\n };\r\n}"]}
@@ -0,0 +1,4 @@
1
+ export * from './bindThis.decorator';
2
+ export * from './callOnce.decorator';
3
+ export * from './debounceCall.decorator';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC","sourcesContent":["export * from './bindThis.decorator';\r\nexport * from './callOnce.decorator';\r\nexport * from './debounceCall.decorator';"]}
@@ -0,0 +1,220 @@
1
+ /**
2
+ * A Javascript object to encode and/or decode html characters using HTML or Numeric entities that handles double or partial encoding
3
+ * Author: R Reid
4
+ * source: http://www.strictly-software.com/htmlencode
5
+ * Licences: GPL, The MIT License (MIT)
6
+ * Copyright: (c) 2011 Robert Reid - Strictly-Software.com
7
+ *
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10
+ * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11
+ *
12
+ * Revision:
13
+ * 2011-07-14, Jacques-Yves Bleau:
14
+ * - fixed conversion error with capitalized accentuated characters
15
+ * + converted arr1 and arr2 to object property to remove redundancy
16
+ *
17
+ * Revision:
18
+ * 2011-11-10, Ce-Yi Hio:
19
+ * - fixed conversion error with a number of capitalized entity characters
20
+ *
21
+ * Revision:
22
+ * 2011-11-10, Rob Reid:
23
+ * - changed array format
24
+ *
25
+ * Revision:
26
+ * 2012-09-23, Alex Oss:
27
+ * - replaced string concatonation in numEncode with string builder, push and join for peformance with ammendments by Rob Reid
28
+ */
29
+ export class Encoder {
30
+ constructor() {
31
+ // When encoding do we convert characters into html or numerical entities
32
+ this.EncodeType = 'entity'; // entity OR numerical
33
+ // arrays for conversion from HTML Entities to Numerical values
34
+ this.arr1 = ['&nbsp;', '&iexcl;', '&cent;', '&pound;', '&curren;', '&yen;', '&brvbar;', '&sect;', '&uml;', '&copy;', '&ordf;', '&laquo;', '&not;', '&shy;', '&reg;', '&macr;', '&deg;', '&plusmn;', '&sup2;', '&sup3;', '&acute;', '&micro;', '&para;', '&middot;', '&cedil;', '&sup1;', '&ordm;', '&raquo;', '&frac14;', '&frac12;', '&frac34;', '&iquest;', '&Agrave;', '&Aacute;', '&Acirc;', '&Atilde;', '&Auml;', '&Aring;', '&AElig;', '&Ccedil;', '&Egrave;', '&Eacute;', '&Ecirc;', '&Euml;', '&Igrave;', '&Iacute;', '&Icirc;', '&Iuml;', '&ETH;', '&Ntilde;', '&Ograve;', '&Oacute;', '&Ocirc;', '&Otilde;', '&Ouml;', '&times;', '&Oslash;', '&Ugrave;', '&Uacute;', '&Ucirc;', '&Uuml;', '&Yacute;', '&THORN;', '&szlig;', '&agrave;', '&aacute;', '&acirc;', '&atilde;', '&auml;', '&aring;', '&aelig;', '&ccedil;', '&egrave;', '&eacute;', '&ecirc;', '&euml;', '&igrave;', '&iacute;', '&icirc;', '&iuml;', '&eth;', '&ntilde;', '&ograve;', '&oacute;', '&ocirc;', '&otilde;', '&ouml;', '&divide;', '&oslash;', '&ugrave;', '&uacute;', '&ucirc;', '&uuml;', '&yacute;', '&thorn;', '&yuml;', '&quot;', '&amp;', '&lt;', '&gt;', '&OElig;', '&oelig;', '&Scaron;', '&scaron;', '&Yuml;', '&circ;', '&tilde;', '&ensp;', '&emsp;', '&thinsp;', '&zwnj;', '&zwj;', '&lrm;', '&rlm;', '&ndash;', '&mdash;', '&lsquo;', '&rsquo;', '&sbquo;', '&ldquo;', '&rdquo;', '&bdquo;', '&dagger;', '&Dagger;', '&permil;', '&lsaquo;', '&rsaquo;', '&euro;', '&fnof;', '&Alpha;', '&Beta;', '&Gamma;', '&Delta;', '&Epsilon;', '&Zeta;', '&Eta;', '&Theta;', '&Iota;', '&Kappa;', '&Lambda;', '&Mu;', '&Nu;', '&Xi;', '&Omicron;', '&Pi;', '&Rho;', '&Sigma;', '&Tau;', '&Upsilon;', '&Phi;', '&Chi;', '&Psi;', '&Omega;', '&alpha;', '&beta;', '&gamma;', '&delta;', '&epsilon;', '&zeta;', '&eta;', '&theta;', '&iota;', '&kappa;', '&lambda;', '&mu;', '&nu;', '&xi;', '&omicron;', '&pi;', '&rho;', '&sigmaf;', '&sigma;', '&tau;', '&upsilon;', '&phi;', '&chi;', '&psi;', '&omega;', '&thetasym;', '&upsih;', '&piv;', '&bull;', '&hellip;', '&prime;', '&Prime;', '&oline;', '&frasl;', '&weierp;', '&image;', '&real;', '&trade;', '&alefsym;', '&larr;', '&uarr;', '&rarr;', '&darr;', '&harr;', '&crarr;', '&lArr;', '&uArr;', '&rArr;', '&dArr;', '&hArr;', '&forall;', '&part;', '&exist;', '&empty;', '&nabla;', '&isin;', '&notin;', '&ni;', '&prod;', '&sum;', '&minus;', '&lowast;', '&radic;', '&prop;', '&infin;', '&ang;', '&and;', '&or;', '&cap;', '&cup;', '&int;', '&there4;', '&sim;', '&cong;', '&asymp;', '&ne;', '&equiv;', '&le;', '&ge;', '&sub;', '&sup;', '&nsub;', '&sube;', '&supe;', '&oplus;', '&otimes;', '&perp;', '&sdot;', '&lceil;', '&rceil;', '&lfloor;', '&rfloor;', '&lang;', '&rang;', '&loz;', '&spades;', '&clubs;', '&hearts;', '&diams;'];
35
+ this.arr2 = ['&#160;', '&#161;', '&#162;', '&#163;', '&#164;', '&#165;', '&#166;', '&#167;', '&#168;', '&#169;', '&#170;', '&#171;', '&#172;', '&#173;', '&#174;', '&#175;', '&#176;', '&#177;', '&#178;', '&#179;', '&#180;', '&#181;', '&#182;', '&#183;', '&#184;', '&#185;', '&#186;', '&#187;', '&#188;', '&#189;', '&#190;', '&#191;', '&#192;', '&#193;', '&#194;', '&#195;', '&#196;', '&#197;', '&#198;', '&#199;', '&#200;', '&#201;', '&#202;', '&#203;', '&#204;', '&#205;', '&#206;', '&#207;', '&#208;', '&#209;', '&#210;', '&#211;', '&#212;', '&#213;', '&#214;', '&#215;', '&#216;', '&#217;', '&#218;', '&#219;', '&#220;', '&#221;', '&#222;', '&#223;', '&#224;', '&#225;', '&#226;', '&#227;', '&#228;', '&#229;', '&#230;', '&#231;', '&#232;', '&#233;', '&#234;', '&#235;', '&#236;', '&#237;', '&#238;', '&#239;', '&#240;', '&#241;', '&#242;', '&#243;', '&#244;', '&#245;', '&#246;', '&#247;', '&#248;', '&#249;', '&#250;', '&#251;', '&#252;', '&#253;', '&#254;', '&#255;', '&#34;', '&#38;', '&#60;', '&#62;', '&#338;', '&#339;', '&#352;', '&#353;', '&#376;', '&#710;', '&#732;', '&#8194;', '&#8195;', '&#8201;', '&#8204;', '&#8205;', '&#8206;', '&#8207;', '&#8211;', '&#8212;', '&#8216;', '&#8217;', '&#8218;', '&#8220;', '&#8221;', '&#8222;', '&#8224;', '&#8225;', '&#8240;', '&#8249;', '&#8250;', '&#8364;', '&#402;', '&#913;', '&#914;', '&#915;', '&#916;', '&#917;', '&#918;', '&#919;', '&#920;', '&#921;', '&#922;', '&#923;', '&#924;', '&#925;', '&#926;', '&#927;', '&#928;', '&#929;', '&#931;', '&#932;', '&#933;', '&#934;', '&#935;', '&#936;', '&#937;', '&#945;', '&#946;', '&#947;', '&#948;', '&#949;', '&#950;', '&#951;', '&#952;', '&#953;', '&#954;', '&#955;', '&#956;', '&#957;', '&#958;', '&#959;', '&#960;', '&#961;', '&#962;', '&#963;', '&#964;', '&#965;', '&#966;', '&#967;', '&#968;', '&#969;', '&#977;', '&#978;', '&#982;', '&#8226;', '&#8230;', '&#8242;', '&#8243;', '&#8254;', '&#8260;', '&#8472;', '&#8465;', '&#8476;', '&#8482;', '&#8501;', '&#8592;', '&#8593;', '&#8594;', '&#8595;', '&#8596;', '&#8629;', '&#8656;', '&#8657;', '&#8658;', '&#8659;', '&#8660;', '&#8704;', '&#8706;', '&#8707;', '&#8709;', '&#8711;', '&#8712;', '&#8713;', '&#8715;', '&#8719;', '&#8721;', '&#8722;', '&#8727;', '&#8730;', '&#8733;', '&#8734;', '&#8736;', '&#8743;', '&#8744;', '&#8745;', '&#8746;', '&#8747;', '&#8756;', '&#8764;', '&#8773;', '&#8776;', '&#8800;', '&#8801;', '&#8804;', '&#8805;', '&#8834;', '&#8835;', '&#8836;', '&#8838;', '&#8839;', '&#8853;', '&#8855;', '&#8869;', '&#8901;', '&#8968;', '&#8969;', '&#8970;', '&#8971;', '&#9001;', '&#9002;', '&#9674;', '&#9824;', '&#9827;', '&#9829;', '&#9830;'];
36
+ }
37
+ isEmpty(val) {
38
+ if (val) {
39
+ return ((val === null) || val.length == 0 || /^\s+$/.test(val));
40
+ }
41
+ else {
42
+ return true;
43
+ }
44
+ }
45
+ // Convert HTML entities into numerical entities
46
+ HTML2Numerical(s) {
47
+ return this.swapArrayVals(s, this.arr1, this.arr2);
48
+ }
49
+ // Convert Numerical entities into HTML entities
50
+ NumericalToHTML(s) {
51
+ return this.swapArrayVals(s, this.arr2, this.arr1);
52
+ }
53
+ // Numerically encodes all unicode characters
54
+ numEncode(s) {
55
+ if (this.isEmpty(s)) {
56
+ return '';
57
+ }
58
+ const a = [], l = s.length;
59
+ for (let i = 0; i < l; i++) {
60
+ const c = s.charAt(i);
61
+ if (c < ' ' || c > '~') {
62
+ a.push('&#');
63
+ a.push(c.charCodeAt()); //numeric value of code point
64
+ a.push(';');
65
+ }
66
+ else {
67
+ a.push(c);
68
+ }
69
+ }
70
+ return a.join('');
71
+ }
72
+ // HTML Decode numerical and HTML entities back to original values
73
+ htmlDecode(s) {
74
+ let c, m, d = s;
75
+ if (this.isEmpty(d)) {
76
+ return '';
77
+ }
78
+ // convert HTML entites back to numerical entites first
79
+ d = this.HTML2Numerical(d);
80
+ // look for numerical entities &#34;
81
+ const arr = d.match(/&#[0-9]{1,5};/g);
82
+ // if no matches found in string then skip
83
+ if (arr != null) {
84
+ for (let x = 0; x < arr.length; x++) {
85
+ m = arr[x];
86
+ c = m.substring(2, m.length - 1); //get numeric part which is refernce to unicode character
87
+ // if its a valid number we can decode
88
+ if (c >= -32768 && c <= 65535) {
89
+ // decode every single match within string
90
+ d = d.replace(m, String.fromCharCode(c));
91
+ }
92
+ else {
93
+ d = d.replace(m, ''); //invalid so replace with nada
94
+ }
95
+ }
96
+ }
97
+ return d;
98
+ }
99
+ // encode an input string into either numerical or HTML entities
100
+ htmlEncode(s, dbl) {
101
+ if (this.isEmpty(s)) {
102
+ return '';
103
+ }
104
+ // do we allow double encoding? E.g will &amp; be turned into &amp;amp;
105
+ dbl = dbl || false; //default to prevent double encoding
106
+ // if allowing double encoding we do ampersands first
107
+ if (dbl) {
108
+ if (this.EncodeType == 'numerical') {
109
+ s = s.replace(/&/g, '&#38;');
110
+ }
111
+ else {
112
+ s = s.replace(/&/g, '&amp;');
113
+ }
114
+ }
115
+ // convert the xss chars to numerical entities ' ' < >
116
+ s = this.XSSEncode(s, false);
117
+ if (this.EncodeType == 'numerical' || !dbl) {
118
+ // Now call function that will convert any HTML entities to numerical codes
119
+ s = this.HTML2Numerical(s);
120
+ }
121
+ // Now encode all chars above 127 e.g unicode
122
+ s = this.numEncode(s);
123
+ // now we know anything that needs to be encoded has been converted to numerical entities we
124
+ // can encode any ampersands & that are not part of encoded entities
125
+ // to handle the fact that I need to do a negative check and handle multiple ampersands &&&
126
+ // I am going to use a placeholder
127
+ // if we don't want double encoded entities we ignore the & in existing entities
128
+ if (!dbl) {
129
+ s = s.replace(/&#/g, '##AMPHASH##');
130
+ if (this.EncodeType == 'numerical') {
131
+ s = s.replace(/&/g, '&#38;');
132
+ }
133
+ else {
134
+ s = s.replace(/&/g, '&amp;');
135
+ }
136
+ s = s.replace(/##AMPHASH##/g, '&#');
137
+ }
138
+ // replace any malformed entities
139
+ s = s.replace(/&#\d*([^\d;]|$)/g, '$1');
140
+ if (!dbl) {
141
+ // safety check to correct any double encoded &amp;
142
+ s = this.correctEncoding(s);
143
+ }
144
+ // now do we need to convert our numerical encoded string into entities
145
+ if (this.EncodeType == 'entity') {
146
+ s = this.NumericalToHTML(s);
147
+ }
148
+ return s;
149
+ }
150
+ // Encodes the basic 4 characters used to malform HTML in XSS hacks
151
+ XSSEncode(s, en) {
152
+ if (!this.isEmpty(s)) {
153
+ en = en || true;
154
+ // do we convert to numerical or html entity?
155
+ if (en) {
156
+ s = s.replace(/'/g, '&#39;'); //no HTML equivalent as &apos is not cross browser supported
157
+ s = s.replace(/"/g, '&quot;');
158
+ s = s.replace(/</g, '&lt;');
159
+ s = s.replace(/>/g, '&gt;');
160
+ }
161
+ else {
162
+ s = s.replace(/'/g, '&#39;'); //no HTML equivalent as &apos is not cross browser supported
163
+ s = s.replace(/"/g, '&#34;');
164
+ s = s.replace(/</g, '&#60;');
165
+ s = s.replace(/>/g, '&#62;');
166
+ }
167
+ return s;
168
+ }
169
+ else {
170
+ return '';
171
+ }
172
+ }
173
+ // returns true if a string contains html or numerical encoded entities
174
+ hasEncoded(s) {
175
+ if (/&#[0-9]{1,5};/g.test(s)) {
176
+ return true;
177
+ }
178
+ else if (/&[A-Z]{2,6};/gi.test(s)) {
179
+ return true;
180
+ }
181
+ else {
182
+ return false;
183
+ }
184
+ }
185
+ // will remove any unicode characters
186
+ stripUnicode(s) {
187
+ return s.replace(/[^\x20-\x7E]/g, '');
188
+ }
189
+ // corrects any double encoded &amp; entities e.g &amp;amp;
190
+ correctEncoding(s) {
191
+ return s.replace(/(&amp;)(amp;)+/, '$1');
192
+ }
193
+ // Function to loop through an array swaping each item with the value from another array e.g swap HTML entities with Numericals
194
+ swapArrayVals(s, arr1, arr2) {
195
+ if (this.isEmpty(s)) {
196
+ return '';
197
+ }
198
+ let re;
199
+ if (arr1 && arr2) {
200
+ //ShowDebug('in swapArrayVals arr1.length = ' + arr1.length + ' arr2.length = ' + arr2.length)
201
+ // array lengths must match
202
+ if (arr1.length == arr2.length) {
203
+ for (let x = 0, i = arr1.length; x < i; x++) {
204
+ re = new RegExp(arr1[x], 'g');
205
+ s = s.replace(re, arr2[x]); //swap arr1 item with matching item from arr2
206
+ }
207
+ }
208
+ }
209
+ return s;
210
+ }
211
+ inArray(item, arr) {
212
+ for (let i = 0, x = arr.length; i < x; i++) {
213
+ if (arr[i] === item) {
214
+ return i;
215
+ }
216
+ }
217
+ return -1;
218
+ }
219
+ }
220
+ //# sourceMappingURL=encoder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encoder.js","sourceRoot":"","sources":["../../../src/encoder/encoder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,MAAM,OAAO,OAAO;IAApB;QAEI,yEAAyE;QACzE,eAAU,GAAW,QAAQ,CAAC,CAAE,sBAAsB;QActD,+DAA+D;QAC/D,SAAI,GAAa,CAAC,QAAQ,EAAC,SAAS,EAAC,QAAQ,EAAC,SAAS,EAAC,UAAU,EAAC,OAAO,EAAC,UAAU,EAAC,QAAQ,EAAC,OAAO,EAAC,QAAQ,EAAC,QAAQ,EAAC,SAAS,EAAC,OAAO,EAAC,OAAO,EAAC,OAAO,EAAC,QAAQ,EAAC,OAAO,EAAC,UAAU,EAAC,QAAQ,EAAC,QAAQ,EAAC,SAAS,EAAC,SAAS,EAAC,QAAQ,EAAC,UAAU,EAAC,SAAS,EAAC,QAAQ,EAAC,QAAQ,EAAC,SAAS,EAAC,UAAU,EAAC,UAAU,EAAC,UAAU,EAAC,UAAU,EAAC,UAAU,EAAC,UAAU,EAAC,SAAS,EAAC,UAAU,EAAC,QAAQ,EAAC,SAAS,EAAC,SAAS,EAAC,UAAU,EAAC,UAAU,EAAC,UAAU,EAAC,SAAS,EAAC,QAAQ,EAAC,UAAU,EAAC,UAAU,EAAC,SAAS,EAAC,QAAQ,EAAC,OAAO,EAAC,UAAU,EAAC,UAAU,EAAC,UAAU,EAAC,SAAS,EAAC,UAAU,EAAC,QAAQ,EAAC,SAAS,EAAC,UAAU,EAAC,UAAU,EAAC,UAAU,EAAC,SAAS,EAAC,QAAQ,EAAC,UAAU,EAAC,SAAS,EAAC,SAAS,EAAC,UAAU,EAAC,UAAU,EAAC,SAAS,EAAC,UAAU,EAAC,QAAQ,EAAC,SAA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AAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EACxC;oBACI,EAAE,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;oBAC9B,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,6CAA6C;iBAC3E;aACJ;SACJ;QAED,OAAO,CAAC,CAAC;IACb,CAAC;IAED,OAAO,CAAE,IAAQ,EAAE,GAAO;QAEtB,KAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAC3C;YACI,IAAK,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,EACpB;gBACI,OAAO,CAAC,CAAC;aACZ;SACJ;QAED,OAAO,CAAC,CAAC,CAAC;IACd,CAAC;CAEJ","sourcesContent":["/**\r\n * A Javascript object to encode and/or decode html characters using HTML or Numeric entities that handles double or partial encoding\r\n * Author: R Reid\r\n * source: http://www.strictly-software.com/htmlencode\r\n * Licences: GPL, The MIT License (MIT)\r\n * Copyright: (c) 2011 Robert Reid - Strictly-Software.com\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\r\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\r\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n *\r\n * Revision:\r\n * 2011-07-14, Jacques-Yves Bleau:\r\n * - fixed conversion error with capitalized accentuated characters\r\n * + converted arr1 and arr2 to object property to remove redundancy\r\n *\r\n * Revision:\r\n * 2011-11-10, Ce-Yi Hio:\r\n * - fixed conversion error with a number of capitalized entity characters\r\n *\r\n * Revision:\r\n * 2011-11-10, Rob Reid:\r\n * - changed array format\r\n *\r\n * Revision:\r\n * 2012-09-23, Alex Oss:\r\n * - replaced string concatonation in numEncode with string builder, push and join for peformance with ammendments by Rob Reid\r\n */\r\n\r\nexport class Encoder\r\n{\r\n // When encoding do we convert characters into html or numerical entities\r\n EncodeType: string = 'entity'; // entity OR numerical\r\n\r\n isEmpty(val: any): boolean\r\n {\r\n if(val)\r\n {\r\n return ((val===null) || val.length==0 || /^\\s+$/.test(val));\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n }\r\n\r\n // arrays for conversion from HTML Entities to Numerical values\r\n arr1: string[] = ['&nbsp;','&iexcl;','&cent;','&pound;','&curren;','&yen;','&brvbar;','&sect;','&uml;','&copy;','&ordf;','&laquo;','&not;','&shy;','&reg;','&macr;','&deg;','&plusmn;','&sup2;','&sup3;','&acute;','&micro;','&para;','&middot;','&cedil;','&sup1;','&ordm;','&raquo;','&frac14;','&frac12;','&frac34;','&iquest;','&Agrave;','&Aacute;','&Acirc;','&Atilde;','&Auml;','&Aring;','&AElig;','&Ccedil;','&Egrave;','&Eacute;','&Ecirc;','&Euml;','&Igrave;','&Iacute;','&Icirc;','&Iuml;','&ETH;','&Ntilde;','&Ograve;','&Oacute;','&Ocirc;','&Otilde;','&Ouml;','&times;','&Oslash;','&Ugrave;','&Uacute;','&Ucirc;','&Uuml;','&Yacute;','&THORN;','&szlig;','&agrave;','&aacute;','&acirc;','&atilde;','&auml;','&aring;','&aelig;','&ccedil;','&egrave;','&eacute;','&ecirc;','&euml;','&igrave;','&iacute;','&icirc;','&iuml;','&eth;','&ntilde;','&ograve;','&oacute;','&ocirc;','&otilde;','&ouml;','&divide;','&oslash;','&ugrave;','&uacute;','&ucirc;','&uuml;','&yacute;','&thorn;','&yuml;','&quot;','&amp;','&lt;','&gt;','&OElig;','&oelig;','&Scaron;','&scaron;','&Yuml;','&circ;','&tilde;','&ensp;','&emsp;','&thinsp;','&zwnj;','&zwj;','&lrm;','&rlm;','&ndash;','&mdash;','&lsquo;','&rsquo;','&sbquo;','&ldquo;','&rdquo;','&bdquo;','&dagger;','&Dagger;','&permil;','&lsaquo;','&rsaquo;','&euro;','&fnof;','&Alpha;','&Beta;','&Gamma;','&Delta;','&Epsilon;','&Zeta;','&Eta;','&Theta;','&Iota;','&Kappa;','&Lambda;','&Mu;','&Nu;','&Xi;','&Omicron;','&Pi;','&Rho;','&Sigma;','&Tau;','&Upsilon;','&Phi;','&Chi;','&Psi;','&Omega;','&alpha;','&beta;','&gamma;','&delta;','&epsilon;','&zeta;','&eta;','&theta;','&iota;','&kappa;','&lambda;','&mu;','&nu;','&xi;','&omicron;','&pi;','&rho;','&sigmaf;','&sigma;','&tau;','&upsilon;','&phi;','&chi;','&psi;','&omega;','&thetasym;','&upsih;','&piv;','&bull;','&hellip;','&prime;','&Prime;','&oline;','&frasl;','&weierp;','&image;','&real;','&trade;','&alefsym;','&larr;','&uarr;','&rarr;','&darr;','&harr;','&crarr;','&lArr;','&uArr;','&rArr;','&dArr;','&hArr;','&forall;','&part;','&exist;','&empty;','&nabla;','&isin;','&notin;','&ni;','&prod;','&sum;','&minus;','&lowast;','&radic;','&prop;','&infin;','&ang;','&and;','&or;','&cap;','&cup;','&int;','&there4;','&sim;','&cong;','&asymp;','&ne;','&equiv;','&le;','&ge;','&sub;','&sup;','&nsub;','&sube;','&supe;','&oplus;','&otimes;','&perp;','&sdot;','&lceil;','&rceil;','&lfloor;','&rfloor;','&lang;','&rang;','&loz;','&spades;','&clubs;','&hearts;','&diams;'];\r\n arr2: string[] = ['&#160;','&#161;','&#162;','&#163;','&#164;','&#165;','&#166;','&#167;','&#168;','&#169;','&#170;','&#171;','&#172;','&#173;','&#174;','&#175;','&#176;','&#177;','&#178;','&#179;','&#180;','&#181;','&#182;','&#183;','&#184;','&#185;','&#186;','&#187;','&#188;','&#189;','&#190;','&#191;','&#192;','&#193;','&#194;','&#195;','&#196;','&#197;','&#198;','&#199;','&#200;','&#201;','&#202;','&#203;','&#204;','&#205;','&#206;','&#207;','&#208;','&#209;','&#210;','&#211;','&#212;','&#213;','&#214;','&#215;','&#216;','&#217;','&#218;','&#219;','&#220;','&#221;','&#222;','&#223;','&#224;','&#225;','&#226;','&#227;','&#228;','&#229;','&#230;','&#231;','&#232;','&#233;','&#234;','&#235;','&#236;','&#237;','&#238;','&#239;','&#240;','&#241;','&#242;','&#243;','&#244;','&#245;','&#246;','&#247;','&#248;','&#249;','&#250;','&#251;','&#252;','&#253;','&#254;','&#255;','&#34;','&#38;','&#60;','&#62;','&#338;','&#339;','&#352;','&#353;','&#376;','&#710;','&#732;','&#8194;','&#8195;','&#8201;','&#8204;','&#8205;','&#8206;','&#8207;','&#8211;','&#8212;','&#8216;','&#8217;','&#8218;','&#8220;','&#8221;','&#8222;','&#8224;','&#8225;','&#8240;','&#8249;','&#8250;','&#8364;','&#402;','&#913;','&#914;','&#915;','&#916;','&#917;','&#918;','&#919;','&#920;','&#921;','&#922;','&#923;','&#924;','&#925;','&#926;','&#927;','&#928;','&#929;','&#931;','&#932;','&#933;','&#934;','&#935;','&#936;','&#937;','&#945;','&#946;','&#947;','&#948;','&#949;','&#950;','&#951;','&#952;','&#953;','&#954;','&#955;','&#956;','&#957;','&#958;','&#959;','&#960;','&#961;','&#962;','&#963;','&#964;','&#965;','&#966;','&#967;','&#968;','&#969;','&#977;','&#978;','&#982;','&#8226;','&#8230;','&#8242;','&#8243;','&#8254;','&#8260;','&#8472;','&#8465;','&#8476;','&#8482;','&#8501;','&#8592;','&#8593;','&#8594;','&#8595;','&#8596;','&#8629;','&#8656;','&#8657;','&#8658;','&#8659;','&#8660;','&#8704;','&#8706;','&#8707;','&#8709;','&#8711;','&#8712;','&#8713;','&#8715;','&#8719;','&#8721;','&#8722;','&#8727;','&#8730;','&#8733;','&#8734;','&#8736;','&#8743;','&#8744;','&#8745;','&#8746;','&#8747;','&#8756;','&#8764;','&#8773;','&#8776;','&#8800;','&#8801;','&#8804;','&#8805;','&#8834;','&#8835;','&#8836;','&#8838;','&#8839;','&#8853;','&#8855;','&#8869;','&#8901;','&#8968;','&#8969;','&#8970;','&#8971;','&#9001;','&#9002;','&#9674;','&#9824;','&#9827;','&#9829;','&#9830;'];\r\n\r\n // Convert HTML entities into numerical entities\r\n HTML2Numerical(s:any)\r\n {\r\n return this.swapArrayVals(s, this.arr1, this.arr2);\r\n }\r\n\r\n // Convert Numerical entities into HTML entities\r\n NumericalToHTML(s:any)\r\n {\r\n return this.swapArrayVals(s, this.arr2, this.arr1);\r\n }\r\n\r\n\r\n // Numerically encodes all unicode characters\r\n numEncode(s:any)\r\n {\r\n if(this.isEmpty(s))\r\n { \r\n return '';\r\n }\r\n\r\n const a = [],\r\n l = s.length;\r\n\r\n for (let i=0; i < l; i++)\r\n {\r\n const c = s.charAt(i);\r\n \r\n if (c < ' ' || c > '~')\r\n {\r\n a.push('&#');\r\n a.push(c.charCodeAt()); //numeric value of code point\r\n a.push(';');\r\n }\r\n else\r\n {\r\n a.push(c);\r\n }\r\n }\r\n\r\n return a.join('');\r\n }\r\n\r\n // HTML Decode numerical and HTML entities back to original values\r\n htmlDecode(s:any)\r\n {\r\n let c,m,d = s;\r\n\r\n if(this.isEmpty(d)) \r\n {\r\n return '';\r\n }\r\n\r\n // convert HTML entites back to numerical entites first\r\n d = this.HTML2Numerical(d);\r\n\r\n // look for numerical entities &#34;\r\n const arr = d.match(/&#[0-9]{1,5};/g);\r\n\r\n // if no matches found in string then skip\r\n if(arr!=null)\r\n {\r\n for(let x=0; x < arr.length; x++)\r\n {\r\n m = arr[x];\r\n c = m.substring(2,m.length-1); //get numeric part which is refernce to unicode character\r\n // if its a valid number we can decode\r\n if(c >= -32768 && c <= 65535)\r\n {\r\n // decode every single match within string\r\n d = d.replace(m, String.fromCharCode(c));\r\n }\r\n else\r\n {\r\n d = d.replace(m, ''); //invalid so replace with nada\r\n }\r\n }\r\n }\r\n\r\n return d;\r\n }\r\n\r\n // encode an input string into either numerical or HTML entities\r\n htmlEncode(s:any, dbl:any)\r\n {\r\n if(this.isEmpty(s))\r\n {\r\n return '';\r\n }\r\n\r\n // do we allow double encoding? E.g will &amp; be turned into &amp;amp;\r\n dbl = dbl || false; //default to prevent double encoding\r\n\r\n // if allowing double encoding we do ampersands first\r\n if(dbl)\r\n {\r\n if(this.EncodeType=='numerical')\r\n {\r\n s = s.replace(/&/g, '&#38;');\r\n }\r\n else\r\n {\r\n s = s.replace(/&/g, '&amp;');\r\n }\r\n }\r\n\r\n // convert the xss chars to numerical entities ' ' < >\r\n s = this.XSSEncode(s,false);\r\n\r\n if(this.EncodeType=='numerical' || !dbl)\r\n {\r\n // Now call function that will convert any HTML entities to numerical codes\r\n s = this.HTML2Numerical(s);\r\n }\r\n\r\n // Now encode all chars above 127 e.g unicode\r\n s = this.numEncode(s);\r\n\r\n // now we know anything that needs to be encoded has been converted to numerical entities we\r\n // can encode any ampersands & that are not part of encoded entities\r\n // to handle the fact that I need to do a negative check and handle multiple ampersands &&&\r\n // I am going to use a placeholder\r\n\r\n // if we don't want double encoded entities we ignore the & in existing entities\r\n if(!dbl)\r\n {\r\n s = s.replace(/&#/g,'##AMPHASH##');\r\n\r\n if(this.EncodeType=='numerical')\r\n {\r\n s = s.replace(/&/g, '&#38;');\r\n }\r\n else\r\n {\r\n s = s.replace(/&/g, '&amp;');\r\n }\r\n\r\n s = s.replace(/##AMPHASH##/g,'&#');\r\n }\r\n\r\n // replace any malformed entities\r\n s = s.replace(/&#\\d*([^\\d;]|$)/g, '$1');\r\n\r\n if(!dbl)\r\n {\r\n // safety check to correct any double encoded &amp;\r\n s = this.correctEncoding(s);\r\n }\r\n\r\n // now do we need to convert our numerical encoded string into entities\r\n if(this.EncodeType=='entity')\r\n {\r\n s = this.NumericalToHTML(s);\r\n }\r\n\r\n return s;\r\n }\r\n\r\n // Encodes the basic 4 characters used to malform HTML in XSS hacks\r\n XSSEncode(s:any,en:any)\r\n {\r\n if(!this.isEmpty(s))\r\n {\r\n en = en || true;\r\n // do we convert to numerical or html entity?\r\n if(en)\r\n {\r\n s = s.replace(/'/g,'&#39;'); //no HTML equivalent as &apos is not cross browser supported\r\n s = s.replace(/\"/g,'&quot;');\r\n s = s.replace(/</g,'&lt;');\r\n s = s.replace(/>/g,'&gt;');\r\n }\r\n else\r\n {\r\n s = s.replace(/'/g,'&#39;'); //no HTML equivalent as &apos is not cross browser supported\r\n s = s.replace(/\"/g,'&#34;');\r\n s = s.replace(/</g,'&#60;');\r\n s = s.replace(/>/g,'&#62;');\r\n }\r\n \r\n return s;\r\n }\r\n else\r\n {\r\n return '';\r\n }\r\n }\r\n\r\n // returns true if a string contains html or numerical encoded entities\r\n hasEncoded(s:any)\r\n {\r\n if(/&#[0-9]{1,5};/g.test(s))\r\n {\r\n return true;\r\n }\r\n else if(/&[A-Z]{2,6};/gi.test(s))\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }\r\n\r\n // will remove any unicode characters\r\n stripUnicode(s:any)\r\n {\r\n return s.replace(/[^\\x20-\\x7E]/g,'');\r\n }\r\n\r\n // corrects any double encoded &amp; entities e.g &amp;amp;\r\n correctEncoding(s:any)\r\n {\r\n return s.replace(/(&amp;)(amp;)+/,'$1');\r\n }\r\n\r\n // Function to loop through an array swaping each item with the value from another array e.g swap HTML entities with Numericals\r\n swapArrayVals(s:any,arr1:any,arr2:any)\r\n {\r\n if(this.isEmpty(s))\r\n { \r\n return '';\r\n }\r\n \r\n let re;\r\n \r\n if(arr1 && arr2)\r\n {\r\n //ShowDebug('in swapArrayVals arr1.length = ' + arr1.length + ' arr2.length = ' + arr2.length)\r\n // array lengths must match\r\n if(arr1.length == arr2.length)\r\n {\r\n for(let x=0, i = arr1.length; x < i; x++)\r\n {\r\n re = new RegExp(arr1[x], 'g');\r\n s = s.replace(re,arr2[x]); //swap arr1 item with matching item from arr2\r\n }\r\n }\r\n }\r\n \r\n return s;\r\n }\r\n\r\n inArray( item:any, arr:any ) \r\n {\r\n for ( let i = 0, x = arr.length; i < x; i++ )\r\n {\r\n if ( arr[i] === item )\r\n {\r\n return i;\r\n }\r\n }\r\n \r\n return -1;\r\n }\r\n\r\n}\r\n"]}
@@ -0,0 +1,2 @@
1
+ export * from './orderByDirection';
2
+ //# sourceMappingURL=index.js.map