jsf.js_next_gen 1.0.0-beta-1 → 1.0.0-beta-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.
Files changed (184) hide show
  1. package/.github/workflows/codeql-analysis.yml +83 -0
  2. package/.github/workflows/nodejs.yml +1 -1
  3. package/dist/docs/.nojekyll +1 -0
  4. package/dist/docs/assets/highlight.css +22 -0
  5. package/dist/docs/assets/main.js +54 -0
  6. package/dist/docs/assets/search.js +1 -0
  7. package/dist/docs/assets/style.css +1225 -0
  8. package/dist/docs/assets/widgets.png +0 -0
  9. package/dist/docs/assets/widgets@2x.png +0 -0
  10. package/dist/docs/functions/jsf.ajax.addOnError.html +84 -0
  11. package/dist/docs/functions/jsf.ajax.addOnEvent.html +74 -0
  12. package/dist/docs/functions/jsf.ajax.request.html +74 -0
  13. package/dist/docs/functions/jsf.ajax.response.html +69 -0
  14. package/dist/docs/functions/jsf.getClientWindow.html +65 -0
  15. package/dist/docs/functions/jsf.getProjectStage.html +69 -0
  16. package/dist/docs/functions/jsf.getViewState.html +68 -0
  17. package/dist/docs/functions/jsf.push.close.html +63 -0
  18. package/dist/docs/functions/jsf.push.init.html +81 -0
  19. package/dist/docs/functions/jsf.push.open.html +63 -0
  20. package/dist/docs/functions/jsf.util.chain.html +69 -0
  21. package/dist/docs/functions/myfaces.ab.html +78 -0
  22. package/dist/docs/index.html +173 -0
  23. package/dist/docs/modules/jsf.ajax.html +59 -0
  24. package/dist/docs/modules/jsf.html +71 -0
  25. package/dist/docs/modules/jsf.push.html +57 -0
  26. package/dist/docs/modules/jsf.util.html +53 -0
  27. package/dist/docs/modules/myfaces.html +52 -0
  28. package/dist/docs/modules.html +48 -0
  29. package/dist/docs/variables/jsf.implversion.html +57 -0
  30. package/dist/docs/variables/jsf.separatorchar.html +54 -0
  31. package/dist/docs/variables/jsf.specversion.html +52 -0
  32. package/dist/window/jsf-development.js +51 -39
  33. package/dist/window/jsf-development.js.map +1 -1
  34. package/dist/window/jsf.js +1 -1
  35. package/dist/window/jsf.js.br +0 -0
  36. package/dist/window/jsf.js.gz +0 -0
  37. package/dist/window/jsf.js.map +1 -1
  38. package/package.json +26 -25
  39. package/remap.js +44 -0
  40. package/remap.js.map +1 -0
  41. package/remap.ts +1 -1
  42. package/src/main/typescript/impl/util/AsyncQueue.ts +1 -1
  43. package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +1 -1
  44. package/src/main/typescript/tsconfig-typedoc.json +20 -0
  45. package/src/test/typescript/frameworkBase/LangTest.ts +2 -10
  46. package/src/test/typescript/frameworkBase/_ext/monadish/DomQueryTest.ts +12 -11
  47. package/src/test/typescript/frameworkBase/_ext/monadish/LangTest.ts +1 -1
  48. package/src/test/typescript/frameworkBase/_ext/monadish/MappingProbes.ts +13 -19
  49. package/src/test/typescript/frameworkBase/_ext/monadish/StreamTest.ts +5 -9
  50. package/target/api/Jsf.js +258 -0
  51. package/target/api/Jsf.js.map +1 -0
  52. package/target/impl/AjaxImpl.js +569 -0
  53. package/target/impl/AjaxImpl.js.map +1 -0
  54. package/target/impl/PushImpl.js +215 -0
  55. package/target/impl/PushImpl.js.map +1 -0
  56. package/target/impl/core/Const.js +135 -0
  57. package/target/impl/core/Const.js.map +1 -0
  58. package/target/impl/core/ImplTypes.js +43 -0
  59. package/target/impl/core/ImplTypes.js.map +1 -0
  60. package/target/impl/i18n/Messages.js +114 -0
  61. package/target/impl/i18n/Messages.js.map +1 -0
  62. package/target/impl/util/Assertions.js +90 -0
  63. package/target/impl/util/Assertions.js.map +1 -0
  64. package/target/impl/util/AsyncQueue.js +104 -0
  65. package/target/impl/util/AsyncQueue.js.map +1 -0
  66. package/target/impl/util/AsyncRunnable.js +18 -0
  67. package/target/impl/util/AsyncRunnable.js.map +1 -0
  68. package/target/impl/util/ExtDomQuery.js +129 -0
  69. package/target/impl/util/ExtDomQuery.js.map +1 -0
  70. package/target/impl/util/Lang.js +215 -0
  71. package/target/impl/util/Lang.js.map +1 -0
  72. package/target/impl/util/ListenerQueue.js +3 -0
  73. package/target/impl/util/ListenerQueue.js.map +1 -0
  74. package/target/impl/xhrCore/ErrorData.js +89 -0
  75. package/target/impl/xhrCore/ErrorData.js.map +1 -0
  76. package/target/impl/xhrCore/EventData.js +30 -0
  77. package/target/impl/xhrCore/EventData.js.map +1 -0
  78. package/target/impl/xhrCore/IResponseProcessor.js +3 -0
  79. package/target/impl/xhrCore/IResponseProcessor.js.map +1 -0
  80. package/target/impl/xhrCore/RequestDataResolver.js +143 -0
  81. package/target/impl/xhrCore/RequestDataResolver.js.map +1 -0
  82. package/target/impl/xhrCore/ResonseDataResolver.js +103 -0
  83. package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -0
  84. package/target/impl/xhrCore/Response.js +167 -0
  85. package/target/impl/xhrCore/Response.js.map +1 -0
  86. package/target/impl/xhrCore/ResponseProcessor.js +368 -0
  87. package/target/impl/xhrCore/ResponseProcessor.js.map +1 -0
  88. package/target/impl/xhrCore/XhrFormData.js +272 -0
  89. package/target/impl/xhrCore/XhrFormData.js.map +1 -0
  90. package/target/impl/xhrCore/XhrRequest.js +281 -0
  91. package/target/impl/xhrCore/XhrRequest.js.map +1 -0
  92. package/target/main/typescript/api/Jsf.js +258 -0
  93. package/target/main/typescript/api/Jsf.js.map +1 -0
  94. package/target/main/typescript/impl/AjaxImpl.js +569 -0
  95. package/target/main/typescript/impl/AjaxImpl.js.map +1 -0
  96. package/target/main/typescript/impl/PushImpl.js +215 -0
  97. package/target/main/typescript/impl/PushImpl.js.map +1 -0
  98. package/target/main/typescript/impl/core/Const.js +135 -0
  99. package/target/main/typescript/impl/core/Const.js.map +1 -0
  100. package/target/main/typescript/impl/core/ImplTypes.js +43 -0
  101. package/target/main/typescript/impl/core/ImplTypes.js.map +1 -0
  102. package/target/main/typescript/impl/i18n/Messages.js +114 -0
  103. package/target/main/typescript/impl/i18n/Messages.js.map +1 -0
  104. package/target/main/typescript/impl/util/Assertions.js +90 -0
  105. package/target/main/typescript/impl/util/Assertions.js.map +1 -0
  106. package/target/main/typescript/impl/util/AsyncQueue.js +104 -0
  107. package/target/main/typescript/impl/util/AsyncQueue.js.map +1 -0
  108. package/target/main/typescript/impl/util/AsyncRunnable.js +18 -0
  109. package/target/main/typescript/impl/util/AsyncRunnable.js.map +1 -0
  110. package/target/main/typescript/impl/util/ExtDomQuery.js +129 -0
  111. package/target/main/typescript/impl/util/ExtDomQuery.js.map +1 -0
  112. package/target/main/typescript/impl/util/Lang.js +215 -0
  113. package/target/main/typescript/impl/util/Lang.js.map +1 -0
  114. package/target/main/typescript/impl/util/ListenerQueue.js +3 -0
  115. package/target/main/typescript/impl/util/ListenerQueue.js.map +1 -0
  116. package/target/main/typescript/impl/xhrCore/ErrorData.js +89 -0
  117. package/target/main/typescript/impl/xhrCore/ErrorData.js.map +1 -0
  118. package/target/main/typescript/impl/xhrCore/EventData.js +30 -0
  119. package/target/main/typescript/impl/xhrCore/EventData.js.map +1 -0
  120. package/target/main/typescript/impl/xhrCore/IResponseProcessor.js +3 -0
  121. package/target/main/typescript/impl/xhrCore/IResponseProcessor.js.map +1 -0
  122. package/target/main/typescript/impl/xhrCore/RequestDataResolver.js +143 -0
  123. package/target/main/typescript/impl/xhrCore/RequestDataResolver.js.map +1 -0
  124. package/target/main/typescript/impl/xhrCore/ResonseDataResolver.js +103 -0
  125. package/target/main/typescript/impl/xhrCore/ResonseDataResolver.js.map +1 -0
  126. package/target/main/typescript/impl/xhrCore/Response.js +167 -0
  127. package/target/main/typescript/impl/xhrCore/Response.js.map +1 -0
  128. package/target/main/typescript/impl/xhrCore/ResponseProcessor.js +368 -0
  129. package/target/main/typescript/impl/xhrCore/ResponseProcessor.js.map +1 -0
  130. package/target/main/typescript/impl/xhrCore/XhrFormData.js +272 -0
  131. package/target/main/typescript/impl/xhrCore/XhrFormData.js.map +1 -0
  132. package/target/main/typescript/impl/xhrCore/XhrRequest.js +281 -0
  133. package/target/main/typescript/impl/xhrCore/XhrRequest.js.map +1 -0
  134. package/target/test/typescript/frameworkBase/LangTest.js +112 -0
  135. package/target/test/typescript/frameworkBase/LangTest.js.map +1 -0
  136. package/target/test/typescript/frameworkBase/_ext/monadish/DomQueryTest.js +293 -0
  137. package/target/test/typescript/frameworkBase/_ext/monadish/DomQueryTest.js.map +1 -0
  138. package/target/test/typescript/frameworkBase/_ext/monadish/LangTest.js +89 -0
  139. package/target/test/typescript/frameworkBase/_ext/monadish/LangTest.js.map +1 -0
  140. package/target/test/typescript/frameworkBase/_ext/monadish/MappingProbes.js +115 -0
  141. package/target/test/typescript/frameworkBase/_ext/monadish/MappingProbes.js.map +1 -0
  142. package/target/test/typescript/frameworkBase/_ext/monadish/MappingTest.js +39 -0
  143. package/target/test/typescript/frameworkBase/_ext/monadish/MappingTest.js.map +1 -0
  144. package/target/test/typescript/frameworkBase/_ext/monadish/MonadTest.js +155 -0
  145. package/target/test/typescript/frameworkBase/_ext/monadish/MonadTest.js.map +1 -0
  146. package/target/test/typescript/frameworkBase/_ext/monadish/StreamTest.js +176 -0
  147. package/target/test/typescript/frameworkBase/_ext/monadish/StreamTest.js.map +1 -0
  148. package/target/test/typescript/frameworkBase/_ext/monadish/XmlQueryTest.js +1 -0
  149. package/target/test/typescript/frameworkBase/_ext/monadish/XmlQueryTest.js.map +1 -0
  150. package/target/test/typescript/frameworkBase/_ext/shared/StandardInits.js +264 -0
  151. package/target/test/typescript/frameworkBase/_ext/shared/StandardInits.js.map +1 -0
  152. package/target/test/typescript/frameworkBase/_ext/shared/XmlResponses.js +23 -0
  153. package/target/test/typescript/frameworkBase/_ext/shared/XmlResponses.js.map +1 -0
  154. package/target/test/typescript/impl/ImplTest.js +98 -0
  155. package/target/test/typescript/impl/ImplTest.js.map +1 -0
  156. package/target/test/typescript/impl/SeparatorCharsTest.js +72 -0
  157. package/target/test/typescript/impl/SeparatorCharsTest.js.map +1 -0
  158. package/target/test/typescript/queue/AsynchronousProbe.js +99 -0
  159. package/target/test/typescript/queue/AsynchronousProbe.js.map +1 -0
  160. package/target/test/typescript/queue/AsynchronousQueueTest.js +130 -0
  161. package/target/test/typescript/queue/AsynchronousQueueTest.js.map +1 -0
  162. package/target/test/typescript/xhrCore/EventTests.js +155 -0
  163. package/target/test/typescript/xhrCore/EventTests.js.map +1 -0
  164. package/target/test/typescript/xhrCore/FakeWebsocket.js +25 -0
  165. package/target/test/typescript/xhrCore/FakeWebsocket.js.map +1 -0
  166. package/target/test/typescript/xhrCore/FileUploadTest.js +166 -0
  167. package/target/test/typescript/xhrCore/FileUploadTest.js.map +1 -0
  168. package/target/test/typescript/xhrCore/RequestParamsTest.js +151 -0
  169. package/target/test/typescript/xhrCore/RequestParamsTest.js.map +1 -0
  170. package/target/test/typescript/xhrCore/RequestTest.js +318 -0
  171. package/target/test/typescript/xhrCore/RequestTest.js.map +1 -0
  172. package/target/test/typescript/xhrCore/ResponseTest.js +257 -0
  173. package/target/test/typescript/xhrCore/ResponseTest.js.map +1 -0
  174. package/target/test/typescript/xhrCore/ShadowDomTest.js +122 -0
  175. package/target/test/typescript/xhrCore/ShadowDomTest.js.map +1 -0
  176. package/target/test/typescript/xhrCore/WebsocketTest.js +182 -0
  177. package/target/test/typescript/xhrCore/WebsocketTest.js.map +1 -0
  178. package/target/test/typescript/xhrCore/XhrFormDataTest.js +58 -0
  179. package/target/test/typescript/xhrCore/XhrFormDataTest.js.map +1 -0
  180. package/webpack.config.js +71 -0
  181. package/webpack.config.js.map +1 -0
  182. package/webpack.config.ts +4 -6
  183. package/dist/window/jsf-development.js.LICENSE.txt +0 -135
  184. package/dist/window/jsf-development.js.br +0 -0
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "jsf.js_next_gen",
3
- "version": "1.0.0-beta-1",
3
+ "version": "1.0.0-beta-4",
4
4
  "description": "A next generation typescript reimplementation of jsf.js",
5
5
  "main": "dist/window/jsf.js",
6
6
  "scripts": {
7
- "test": "mocha -r ts-node/register ./src/test/typescript/**/**/*Test*.ts",
7
+ "doc": "npx typedoc --tsconfig src/main/typescript/tsconfig-typedoc.json",
8
+ "test": "env TS_NODE_PROJECT=./src/test/typescript/tsconfig.json mocha -r ts-node/register ./src/test/typescript/**/**/*Test*.ts",
8
9
  "coverage": "nyc --reporter=html --reporter=text mocha -r ts-node/register ./**/test/typescript/**/**/*Test*.ts",
9
10
  "build-production": "webpack --mode production --env FILE_NAME=jsf && ts-node ./remap.ts --production",
10
11
  "build-development": "webpack --mode development --env FILE_NAME=jsf-development && ts-node ./remap.ts --development",
11
- "build": "npm run build-development && npm run build-production"
12
+ "build": "npm run doc && npm run build-development && npm run build-production"
12
13
  },
13
14
  "keywords": [
14
15
  "myfaces",
@@ -18,32 +19,32 @@
18
19
  "author": "Werner Punz werpu@apache.org",
19
20
  "license": "Apache-2.0",
20
21
  "devDependencies": {
21
- "@istanbuljs/nyc-config-typescript": "^1.0.1",
22
- "@types/chai": "^4.2.16",
23
- "@types/mocha": "^8.2.2",
24
- "@types/sinon": "^10.0.0",
22
+ "@istanbuljs/nyc-config-typescript": "^1.0.2",
23
+ "@types/chai": "^4.3.3",
24
+ "@types/mocha": "^9.1.1",
25
+ "@types/sinon": "^10.0.13",
25
26
  "babel-plugin-syntax-dynamic-import": "^6.18.0",
26
- "brotli-webpack-plugin": "^1.1.0",
27
- "chai": "^4.3.4",
28
- "compression-webpack-plugin": "^7.1.2",
29
- "html-webpack-plugin": "^5.3.1",
30
- "jsdom": "^16.5.3",
27
+ "chai": "^4.3.6",
28
+ "compression-webpack-plugin": "^10.0.0",
29
+ "html-webpack-plugin": "^5.5.0",
30
+ "jsdom": "^20.0.0",
31
31
  "jsdom-global": "^3.0.2",
32
- "mocha": "^8.3.2",
33
- "npm-check-updates": "^11.5.0",
32
+ "mocha": "^10.0.0",
33
+ "npm-check-updates": "^16.1.0",
34
34
  "nyc": "^15.1.0",
35
- "replace-in-file": "^6.2.0",
36
- "rxjs": "^6.6.7",
37
- "sinon": "^10.0.0",
38
- "terser-webpack-plugin": "^5.1.1",
39
- "ts-loader": "^9.0.2",
40
- "ts-node": "^9.1.1",
41
- "typescript": "^4.2.4",
42
- "webpack": "^5.34.0",
43
- "webpack-cli": "^4.6.0",
44
- "webpack-dev-server": "^3.11.2"
35
+ "replace-in-file": "^6.3.5",
36
+ "rxjs": "^7.5.6",
37
+ "sinon": "^14.0.0",
38
+ "terser-webpack-plugin": "^5.3.6",
39
+ "ts-loader": "^9.3.1",
40
+ "ts-node": "^10.9.1",
41
+ "typedoc": "^0.23.14",
42
+ "typescript": "^4.8.2",
43
+ "webpack": "^5.74.0",
44
+ "webpack-cli": "^4.10.0",
45
+ "webpack-dev-server": "^4.10.1"
45
46
  },
46
47
  "dependencies": {
47
- "mona-dish": "0.20.3"
48
+ "mona-dish": "0.21.2"
48
49
  }
49
50
  }
package/remap.js ADDED
@@ -0,0 +1,44 @@
1
+ /* Licensed to the Apache Software Foundation (ASF) under one or more
2
+ * contributor license agreements. See the NOTICE file distributed with
3
+ * this work for additional information regarding copyright ownership.
4
+ * The ASF licenses this file to you under the Apache License, Version 2.0
5
+ * (the "License"); you may not use this file except in compliance with
6
+ * the License. You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * we are remapping the mappings in our dist file, to meet the expected
18
+ * jsf loading criteria...
19
+ * luckily we can use more than one source map entry
20
+ * so either one is found and the other is not
21
+ */
22
+ //the replace in file plugin meets our system independent grep/awk criteria
23
+ //does pretty much what grep and awk do on unix systems
24
+ var replace = require('replace-in-file');
25
+ // we ned to fetch the proper argument
26
+ var args = process.argv.slice(2);
27
+ // and remap it into our proper option
28
+ var buildStage = (args[0] == "--development") ? "-development" : "";
29
+ console.log("fixing mapping file references for jsf");
30
+ var option = {
31
+ //development
32
+ files: 'dist/**/*.js',
33
+ from: (buildStage == "-development") ? /jsf-development.js\.map/g : /jsf.js\.map/g,
34
+ to: "jsf".concat(buildStage, ".js.map\n//# sourceMappingURL=jsf").concat(buildStage, ".js.map.jsf?ln=scripts")
35
+ };
36
+ try {
37
+ var result = replace.sync(option);
38
+ console.log("mapping file references fixed!");
39
+ console.log('Replacement results:', result);
40
+ }
41
+ catch (error) {
42
+ console.error('Error occurred:', error);
43
+ }
44
+ //# sourceMappingURL=remap.js.map
package/remap.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remap.js","sourceRoot":"","sources":["remap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;GAKG;AAEH,2EAA2E;AAC3E,uDAAuD;AACvD,IAAM,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE3C,sCAAsC;AACtC,IAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,sCAAsC;AACtC,IAAM,UAAU,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;AACtE,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;AAEtD,IAAI,MAAM,GAAG;IACT,aAAa;IACb,KAAK,EAAE,cAAc;IACrB,IAAI,EAAE,CAAC,UAAU,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,cAAc;IAClF,EAAE,EAAE,aAAM,UAAU,8CAAoC,UAAU,2BAAwB;CAC7F,CAAA;AAED,IAAI;IACA,IAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACpC,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;IAC9C,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC;CAC/C;AAAC,OAAO,KAAK,EAAE;IACZ,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC;CAC3C"}
package/remap.ts CHANGED
@@ -21,7 +21,7 @@
21
21
  * so either one is found and the other is not
22
22
  */
23
23
 
24
- //the replace in file plugin meets our system independend grep/awk criteria
24
+ //the replace in file plugin meets our system independent grep/awk criteria
25
25
  //does pretty much what grep and awk do on unix systems
26
26
  const replace = require('replace-in-file');
27
27
 
@@ -14,7 +14,7 @@ import {AsyncRunnable} from "./AsyncRunnable";
14
14
  export class AsynchronouseQueue<T extends AsyncRunnable<any>> {
15
15
 
16
16
  private runnableQueue = [];
17
- private delayTimeout: number;
17
+ private delayTimeout: null | ReturnType<typeof setTimeout>;
18
18
 
19
19
  currentlyRunning: AsyncRunnable<any>;
20
20
 
@@ -57,7 +57,7 @@ export function resolveTargetUrl(srcFormElement: HTMLFormElement) {
57
57
  }
58
58
 
59
59
  export function resolveFinalUrl(sourceForm: DomQuery, formData: XhrFormData, ajaxType = REQ_TYPE_POST) {
60
- let targetUrl = this.resolveTargetUrl(<HTMLFormElement>sourceForm.getAsElem(0).value);
60
+ let targetUrl = resolveTargetUrl(<HTMLFormElement>sourceForm.getAsElem(0).value);
61
61
 
62
62
  return targetUrl + (ajaxType == REQ_TYPE_GET ? "?" + formData.toString() : EMPTY_STR);
63
63
  }
@@ -0,0 +1,20 @@
1
+ /*
2
+ Special config to generate the tsdocs
3
+ */
4
+ {
5
+ "extends": "./tsconfig.json",
6
+ "compilerOptions": {
7
+ "skipLibCheck": true
8
+ },
9
+ "typedocOptions": {
10
+ "entryPoints": ["api/Jsf.ts"],
11
+ "out": "../../../dist/docs",
12
+ "externalPattern": "**/node_modules/**",
13
+ "exclude": "**/{node_modules,test,doc,impl,myfaces}/**/*",
14
+ "excludeExternals": true,
15
+ "excludePrivate": true,
16
+ "excludeProtected": true,
17
+ "emit": "both",
18
+ "disableSources": true
19
+ }
20
+ }
@@ -33,7 +33,7 @@ const dom = new JSDOM(`
33
33
  `)
34
34
 
35
35
  export const window = dom.window;
36
- ;
36
+
37
37
 
38
38
  function hello_world() {
39
39
  return "Hello World!"
@@ -71,8 +71,6 @@ describe('Lang tests', () => {
71
71
  });
72
72
 
73
73
  it('strToArray working', () => {
74
- const lang = Lang;
75
-
76
74
  let arr = strToArray("hello.world.from.me", /\./gi);
77
75
 
78
76
  expect(arr).to.exist;
@@ -82,7 +80,6 @@ describe('Lang tests', () => {
82
80
  });
83
81
 
84
82
  it('trim working', () => {
85
- const lang = Lang;
86
83
  let origStr = " hello world from me ";
87
84
  let trimmed = trim(origStr);
88
85
  expect(trimmed).to.exist;
@@ -91,7 +88,6 @@ describe('Lang tests', () => {
91
88
  });
92
89
 
93
90
  it('isString working', () => {
94
- const lang = Lang;
95
91
  expect(isString(" ")).to.be.true;
96
92
  expect(isString('')).to.be.true;
97
93
  expect(isString(null)).to.be.false;
@@ -103,7 +99,6 @@ describe('Lang tests', () => {
103
99
  });
104
100
 
105
101
  it('isFunc working', () => {
106
- const lang = Lang;
107
102
  expect(isFunc(() => {
108
103
  })).to.be.true;
109
104
  expect(isFunc(function () {
@@ -114,7 +109,6 @@ describe('Lang tests', () => {
114
109
  });
115
110
 
116
111
  it('objToArray working', () => {
117
- const lang = Lang;
118
112
  let obj_probe = new Probe();
119
113
  let resultArr = objToArray(obj_probe);
120
114
  expect(assertType(resultArr, Array)).to.be.true;
@@ -126,15 +120,13 @@ describe('Lang tests', () => {
126
120
  });
127
121
 
128
122
  it('keyval to string working', () => {
129
- const lang = Lang;
130
123
  let keyval = keyValToStr("key", "val", ":")
131
124
  expect(keyval).to.eq("key:val");
132
125
 
133
126
  });
134
127
 
135
128
  it('equals ignore case test', () => {
136
- const lang = Lang;
137
- expect(equalsIgnoreCase(null, null)).to.be.true;
129
+ expect(equalsIgnoreCase(<any>null, <any>null)).to.be.true;
138
130
  expect(equalsIgnoreCase("", "")).to.be.true;
139
131
  expect(equalsIgnoreCase("null", "NuLL")).to.be.true;
140
132
  expect(equalsIgnoreCase("null ", "NuLL")).to.be.false;
@@ -1,3 +1,5 @@
1
+ // noinspection HtmlUnknownAttribute
2
+
1
3
  /* Licensed to the Apache Software Foundation (ASF) under one or more
2
4
  * contributor license agreements. See the NOTICE file distributed with
3
5
  * this work for additional information regarding copyright ownership.
@@ -24,7 +26,6 @@ import trim = Lang.trim;
24
26
  const jsdom = require("jsdom");
25
27
  const {JSDOM} = jsdom;
26
28
 
27
-
28
29
  describe('DOMQuery tests', function () {
29
30
 
30
31
  beforeEach(function () {
@@ -60,7 +61,7 @@ describe('DOMQuery tests', function () {
60
61
 
61
62
  this.xhr = sinon.useFakeXMLHttpRequest();
62
63
  this.requests = [];
63
- this.xhr.onCreate = (xhr) => {
64
+ this.xhr.onCreate = (xhr: any) => {
64
65
  this.requests.push(xhr);
65
66
  };
66
67
  (<any>global).XMLHttpRequest = this.xhr;
@@ -118,7 +119,7 @@ describe('DOMQuery tests', function () {
118
119
  it('domquery ops test2 eachNode', function () {
119
120
  let probe2 = DomQuery.querySelectorAll("div");
120
121
  let noIter = 0;
121
- probe2 = probe2.each((item, cnt) => {
122
+ probe2.each((item, cnt) => {
122
123
  expect(item instanceof DomQuery).to.be.true;
123
124
  expect(noIter == cnt).to.be.true;
124
125
  noIter++;
@@ -229,19 +230,19 @@ describe('DOMQuery tests', function () {
229
230
  it("must have a working input handling", function () {
230
231
  DomQuery.querySelectorAll("body").innerHtml = `<form id="blarg">
231
232
  <div id="embed1">
232
- <input type="text" id="id_1" name="id_1" value="id_1_val"></input>
233
- <input type="text" id="id_2" name="id_2" value="id_2_val" disabled="disabled"> </input>
233
+ <input type="text" id="id_1" name="id_1" value="id_1_val"/>
234
+ <input type="text" id="id_2" name="id_2" value="id_2_val" disabled="disabled"/>
234
235
  <textarea type="text" id="id_3" name="id_3">textareaVal</textarea>
235
236
 
236
237
  <fieldset>
237
- <input type="radio" id="mc" name="cc_1" value="Mastercard" checked="checked"></input>
238
+ <input type="radio" id="mc" name="cc_1" value="Mastercard" checked="checked"/>
238
239
  <label for="mc"> Mastercard</label>
239
- <input type="radio" id="vi" name="cc_1" value="Visa"></input>
240
+ <input type="radio" id="vi" name="cc_1" value="Visa"/>
240
241
  <label for="vi"> Visa</label>
241
- <input type="radio" id="ae" name="cc_1" value="AmericanExpress"></input>
242
+ <input type="radio" id="ae" name="cc_1" value="AmericanExpress"/>
242
243
  <label for="ae"> American Express</label>
243
244
  </fieldset>
244
- <select id="val_5" name="val_5" name="top5" size="5">
245
+ <select id="val_5" name="val_5" size="5">
245
246
  <option>barg</option>
246
247
  <option>jjj</option>
247
248
  <option selected>akaka</option>
@@ -343,7 +344,7 @@ describe('DOMQuery tests', function () {
343
344
  //-->
344
345
  </script>
345
346
 
346
- <style type="text/css">
347
+ <style>
347
348
  #first {
348
349
  border: 1px solid black;
349
350
  }
@@ -380,7 +381,7 @@ describe('DOMQuery tests', function () {
380
381
 
381
382
  it("it must handle events properly", function () {
382
383
  let clicked = 0;
383
- let listener = (evt: any) => {
384
+ let listener = () => {
384
385
  clicked++;
385
386
  };
386
387
  let eventReceiver = DomQuery.byId("id_1");
@@ -117,7 +117,7 @@ describe('Lang tests', () => {
117
117
 
118
118
  it('equals ignore case test', () => {
119
119
  const lang = Lang;
120
- expect(lang.equalsIgnoreCase(null, null)).to.be.true;
120
+ expect(lang.equalsIgnoreCase(<any>null, <any>null)).to.be.true;
121
121
  expect(lang.equalsIgnoreCase("", "")).to.be.true;
122
122
  expect(lang.equalsIgnoreCase("null", "NuLL")).to.be.true;
123
123
  expect(lang.equalsIgnoreCase("null ", "NuLL")).to.be.false;
@@ -52,14 +52,10 @@ class DtoUils {
52
52
  (<any>target)[key] = {};
53
53
 
54
54
  for (let key2 in newVal) {
55
- let subTarget = new mappings[key].clazz(newVal[key2]);
56
- // subTarget = this.mapIt(subTarget, <any> newVal[key2]);
57
- (<any>target)[key][key2] = subTarget;
55
+ (<any>target)[key][key2] = new mappings[key].clazz(newVal[key2]);
58
56
  }
59
57
  } else if (mappings && mappings[key]) {
60
- let subTarget = new mappings[key](newVal);
61
-
62
- (<any>target)[key] = subTarget;
58
+ (<any>target)[key] = new mappings[key](newVal);
63
59
  } else {
64
60
  (<any>target)[key] = newVal
65
61
  }
@@ -71,13 +67,14 @@ class DtoUils {
71
67
 
72
68
  }
73
69
 
70
+ // noinspection JSUnusedLocalSymbols
74
71
  class BaseDto<T> {
75
72
 
76
73
  TYPES = "___mappable_types___";
77
74
 
78
75
  constructor(data?: T, dtoTypes: any = {}) {
79
76
 
80
- this[this.TYPES] = dtoTypes;
77
+ (<any>this)[this.TYPES] = dtoTypes;
81
78
 
82
79
  if (data) {
83
80
  this.mapIt(this, data);
@@ -99,14 +96,11 @@ class BaseDto<T> {
99
96
  (<any>target)[key] = {};
100
97
 
101
98
  for (let key2 in newVal) {
102
- let subTarget = new target[this.TYPES][key].clazz(newVal[key2]);
103
- // subTarget = this.mapIt(subTarget, <any> newVal[key2]);
104
- (<any>target)[key][key2] = subTarget;
99
+ // subTarget = this.mapIt(subTarget, <any> newVal[key2]);
100
+ (<any>target)[key][key2] = new target[this.TYPES][key].clazz(newVal[key2]);
105
101
  }
106
102
  } else if (target[this.TYPES] && target[this.TYPES][key]) {
107
- let subTarget = new target[this.TYPES][key](newVal);
108
-
109
- (<any>target)[key] = subTarget;
103
+ (<any>target)[key] = new target[this.TYPES][key](newVal);
110
104
  } else {
111
105
  (<any>target)[key] = newVal
112
106
  }
@@ -136,12 +130,12 @@ function mixMaps(target: any, src: any): any {
136
130
 
137
131
  export class Probe1Impl implements Probe1 {
138
132
 
139
- val1: string;
140
- val2: Date;
141
- val3: any;
142
- val4: Probe2[];
143
- val5: Probe2;
144
- val6: any;
133
+ val1!: string;
134
+ val2!: Date;
135
+ val3!: any;
136
+ val4!: Probe2[];
137
+ val5!: Probe2;
138
+ val6!: any;
145
139
 
146
140
  constructor(data: Probe1, mixin: any = {} /*put your own arguments in here*/) {
147
141
  DtoUils.mapIt(this, data, mixMaps({
@@ -75,11 +75,9 @@ describe('early stream tests', () => {
75
75
  })
76
76
 
77
77
  it("must have a correct first last", function () {
78
- let stream = Stream.of<number>(...this.probe);
79
-
80
- let first = Stream.of<number>(...this.probe).filter((data) => data != 5).onElem((data) => {
78
+ let first = Stream.of<number>(...this.probe).filter((data) => data != 5).onElem(() => {
81
79
  }).first().value;
82
- let last = Stream.of<number>(...this.probe).filter((data) => data != 5).onElem((data) => {
80
+ let last = Stream.of<number>(...this.probe).filter((data) => data != 5).onElem(() => {
83
81
  }).last().value;
84
82
  expect(first).to.eq(1);
85
83
  expect(last).to.eq(4);
@@ -87,8 +85,6 @@ describe('early stream tests', () => {
87
85
  });
88
86
 
89
87
  it("must have a correct first last lazy", function () {
90
- let stream = LazyStream.of<number>(...this.probe);
91
-
92
88
  let first = LazyStream.of<number>(...this.probe).filter((data) => data != 5).onElem((data) => {
93
89
  data;
94
90
  }).first().value;
@@ -102,7 +98,7 @@ describe('early stream tests', () => {
102
98
 
103
99
  it("must have a correct limits", function () {
104
100
  let cnt = 0;
105
- let last = Stream.of<number>(...this.probe).filter((data) => data != 5).limits(2).onElem((data) => {
101
+ let last = Stream.of<number>(...this.probe).filter((data) => data != 5).limits(2).onElem(() => {
106
102
  cnt++;
107
103
  }).last().value;
108
104
 
@@ -118,8 +114,8 @@ describe('early stream tests', () => {
118
114
  key3: "val3"
119
115
  }
120
116
 
121
- let arr1 = [];
122
- let arr2 = [];
117
+ let arr1: Array<string | number> = [];
118
+ let arr2: Array<string | number> = [];
123
119
 
124
120
  Stream.ofAssoc(probe).each(item => {
125
121
  expect(item.length).to.eq(2);