@keymanapp/developer-utils 18.0.41-alpha → 18.0.118-alpha

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/build/src/common-messages.d.ts +49 -0
  2. package/build/src/common-messages.d.ts.map +1 -0
  3. package/build/src/common-messages.js +35 -0
  4. package/build/src/common-messages.js.map +1 -0
  5. package/build/src/compiler-interfaces.d.ts +372 -0
  6. package/build/src/compiler-interfaces.d.ts.map +1 -0
  7. package/build/src/compiler-interfaces.js +382 -0
  8. package/build/src/compiler-interfaces.js.map +1 -0
  9. package/build/src/deps/xml2js/bom.d.ts +2 -0
  10. package/build/src/deps/xml2js/bom.d.ts.map +1 -0
  11. package/build/src/deps/xml2js/bom.js +14 -0
  12. package/build/src/deps/xml2js/bom.js.map +1 -0
  13. package/build/src/deps/xml2js/builder.d.ts +6 -0
  14. package/build/src/deps/xml2js/builder.d.ts.map +1 -0
  15. package/build/src/deps/xml2js/builder.js +133 -0
  16. package/build/src/deps/xml2js/builder.js.map +1 -0
  17. package/build/src/deps/xml2js/defaults.d.ts +69 -0
  18. package/build/src/deps/xml2js/defaults.d.ts.map +1 -0
  19. package/build/src/deps/xml2js/defaults.js +73 -0
  20. package/build/src/deps/xml2js/defaults.js.map +1 -0
  21. package/build/src/deps/xml2js/parser.d.ts +18 -0
  22. package/build/src/deps/xml2js/parser.d.ts.map +1 -0
  23. package/build/src/deps/xml2js/parser.js +395 -0
  24. package/build/src/deps/xml2js/parser.js.map +1 -0
  25. package/build/src/deps/xml2js/processors.d.ts +6 -0
  26. package/build/src/deps/xml2js/processors.d.ts.map +1 -0
  27. package/build/src/deps/xml2js/processors.js +28 -0
  28. package/build/src/deps/xml2js/processors.js.map +1 -0
  29. package/build/src/deps/xml2js/xml2js.d.ts +12 -0
  30. package/build/src/deps/xml2js/xml2js.d.ts.map +1 -0
  31. package/build/src/deps/xml2js/xml2js.js +26 -0
  32. package/build/src/deps/xml2js/xml2js.js.map +1 -0
  33. package/build/src/index.d.ts +24 -0
  34. package/build/src/index.d.ts.map +1 -0
  35. package/build/src/index.js +26 -0
  36. package/build/src/index.js.map +1 -0
  37. package/build/src/is-valid-email.d.ts +2 -0
  38. package/build/src/is-valid-email.d.ts.map +1 -0
  39. package/build/src/is-valid-email.js +20 -0
  40. package/build/src/is-valid-email.js.map +1 -0
  41. package/build/src/types/import/45/cldr_info.json +5 -0
  42. package/build/src/types/import/45/keys-Latn-implied.xml +80 -0
  43. package/build/src/types/import/45/keys-Zyyy-currency.xml +15 -0
  44. package/build/src/types/import/45/keys-Zyyy-punctuation.xml +45 -0
  45. package/build/src/types/import/45/scanCodes-implied.xml +53 -0
  46. package/build/src/types/keyman-touch-layout/keyman-touch-layout-file-reader.d.ts +7 -0
  47. package/build/src/types/keyman-touch-layout/keyman-touch-layout-file-reader.d.ts.map +1 -0
  48. package/build/src/types/keyman-touch-layout/keyman-touch-layout-file-reader.js +74 -0
  49. package/build/src/types/keyman-touch-layout/keyman-touch-layout-file-reader.js.map +1 -0
  50. package/build/src/types/keyman-touch-layout/keyman-touch-layout-file-writer.d.ts +30 -0
  51. package/build/src/types/keyman-touch-layout/keyman-touch-layout-file-writer.d.ts.map +1 -0
  52. package/build/src/types/keyman-touch-layout/keyman-touch-layout-file-writer.js +123 -0
  53. package/build/src/types/keyman-touch-layout/keyman-touch-layout-file-writer.js.map +1 -0
  54. package/build/src/types/kmx/kmx-builder.d.ts +42 -0
  55. package/build/src/types/kmx/kmx-builder.d.ts.map +1 -0
  56. package/build/src/types/kmx/kmx-builder.js +192 -0
  57. package/build/src/types/kmx/kmx-builder.js.map +1 -0
  58. package/build/src/types/kmx/kmx-plus-builder/build-disp.d.ts +20 -0
  59. package/build/src/types/kmx/kmx-plus-builder/build-disp.d.ts.map +1 -0
  60. package/build/src/types/kmx/kmx-plus-builder/build-disp.js +29 -0
  61. package/build/src/types/kmx/kmx-plus-builder/build-disp.js.map +1 -0
  62. package/build/src/types/kmx/kmx-plus-builder/build-elem.d.ts +29 -0
  63. package/build/src/types/kmx/kmx-plus-builder/build-elem.d.ts.map +1 -0
  64. package/build/src/types/kmx/kmx-plus-builder/build-elem.js +91 -0
  65. package/build/src/types/kmx/kmx-plus-builder/build-elem.js.map +1 -0
  66. package/build/src/types/kmx/kmx-plus-builder/build-keys.d.ts +59 -0
  67. package/build/src/types/kmx/kmx-plus-builder/build-keys.d.ts.map +1 -0
  68. package/build/src/types/kmx/kmx-plus-builder/build-keys.js +110 -0
  69. package/build/src/types/kmx/kmx-plus-builder/build-keys.js.map +1 -0
  70. package/build/src/types/kmx/kmx-plus-builder/build-layr.d.ts +57 -0
  71. package/build/src/types/kmx/kmx-plus-builder/build-layr.d.ts.map +1 -0
  72. package/build/src/types/kmx/kmx-plus-builder/build-layr.js +104 -0
  73. package/build/src/types/kmx/kmx-plus-builder/build-layr.js.map +1 -0
  74. package/build/src/types/kmx/kmx-plus-builder/build-list.d.ts +38 -0
  75. package/build/src/types/kmx/kmx-plus-builder/build-list.d.ts.map +1 -0
  76. package/build/src/types/kmx/kmx-plus-builder/build-list.js +69 -0
  77. package/build/src/types/kmx/kmx-plus-builder/build-list.js.map +1 -0
  78. package/build/src/types/kmx/kmx-plus-builder/build-loca.d.ts +13 -0
  79. package/build/src/types/kmx/kmx-plus-builder/build-loca.d.ts.map +1 -0
  80. package/build/src/types/kmx/kmx-plus-builder/build-loca.js +23 -0
  81. package/build/src/types/kmx/kmx-plus-builder/build-loca.js.map +1 -0
  82. package/build/src/types/kmx/kmx-plus-builder/build-meta.d.ts +18 -0
  83. package/build/src/types/kmx/kmx-plus-builder/build-meta.d.ts.map +1 -0
  84. package/build/src/types/kmx/kmx-plus-builder/build-meta.js +24 -0
  85. package/build/src/types/kmx/kmx-plus-builder/build-meta.js.map +1 -0
  86. package/build/src/types/kmx/kmx-plus-builder/build-sect.d.ts +16 -0
  87. package/build/src/types/kmx/kmx-plus-builder/build-sect.d.ts.map +1 -0
  88. package/build/src/types/kmx/kmx-plus-builder/build-sect.js +17 -0
  89. package/build/src/types/kmx/kmx-plus-builder/build-sect.js.map +1 -0
  90. package/build/src/types/kmx/kmx-plus-builder/build-strs.d.ts +25 -0
  91. package/build/src/types/kmx/kmx-plus-builder/build-strs.d.ts.map +1 -0
  92. package/build/src/types/kmx/kmx-plus-builder/build-strs.js +49 -0
  93. package/build/src/types/kmx/kmx-plus-builder/build-strs.js.map +1 -0
  94. package/build/src/types/kmx/kmx-plus-builder/build-tran.d.ts +35 -0
  95. package/build/src/types/kmx/kmx-plus-builder/build-tran.d.ts.map +1 -0
  96. package/build/src/types/kmx/kmx-plus-builder/build-tran.js +71 -0
  97. package/build/src/types/kmx/kmx-plus-builder/build-tran.js.map +1 -0
  98. package/build/src/types/kmx/kmx-plus-builder/build-uset.d.ts +34 -0
  99. package/build/src/types/kmx/kmx-plus-builder/build-uset.d.ts.map +1 -0
  100. package/build/src/types/kmx/kmx-plus-builder/build-uset.js +63 -0
  101. package/build/src/types/kmx/kmx-plus-builder/build-uset.js.map +1 -0
  102. package/build/src/types/kmx/kmx-plus-builder/build-vars.d.ts +23 -0
  103. package/build/src/types/kmx/kmx-plus-builder/build-vars.d.ts.map +1 -0
  104. package/build/src/types/kmx/kmx-plus-builder/build-vars.js +50 -0
  105. package/build/src/types/kmx/kmx-plus-builder/build-vars.js.map +1 -0
  106. package/build/src/types/kmx/kmx-plus-builder/builder-section.d.ts +10 -0
  107. package/build/src/types/kmx/kmx-plus-builder/builder-section.d.ts.map +1 -0
  108. package/build/src/types/kmx/kmx-plus-builder/builder-section.js +6 -0
  109. package/build/src/types/kmx/kmx-plus-builder/builder-section.js.map +1 -0
  110. package/build/src/types/kmx/kmx-plus-builder/kmx-plus-builder.d.ts +44 -0
  111. package/build/src/types/kmx/kmx-plus-builder/kmx-plus-builder.d.ts.map +1 -0
  112. package/build/src/types/kmx/kmx-plus-builder/kmx-plus-builder.js +139 -0
  113. package/build/src/types/kmx/kmx-plus-builder/kmx-plus-builder.js.map +1 -0
  114. package/build/src/types/kpj/keyman-developer-project.d.ts +79 -0
  115. package/build/src/types/kpj/keyman-developer-project.d.ts.map +1 -0
  116. package/build/src/types/kpj/keyman-developer-project.js +197 -0
  117. package/build/src/types/kpj/keyman-developer-project.js.map +1 -0
  118. package/build/src/types/kpj/kpj-file-reader.d.ts +19 -0
  119. package/build/src/types/kpj/kpj-file-reader.d.ts.map +1 -0
  120. package/build/src/types/kpj/kpj-file-reader.js +121 -0
  121. package/build/src/types/kpj/kpj-file-reader.js.map +1 -0
  122. package/build/src/types/kpj/kpj-file.d.ts +40 -0
  123. package/build/src/types/kpj/kpj-file.d.ts.map +1 -0
  124. package/build/src/types/kpj/kpj-file.js +14 -0
  125. package/build/src/types/kpj/kpj-file.js.map +1 -0
  126. package/build/src/types/kps/kps-file.d.ts +176 -0
  127. package/build/src/types/kps/kps-file.d.ts.map +1 -0
  128. package/build/src/types/kps/kps-file.js +19 -0
  129. package/build/src/types/kps/kps-file.js.map +1 -0
  130. package/build/src/types/kvks/kvks-file-reader.d.ts +26 -0
  131. package/build/src/types/kvks/kvks-file-reader.d.ts.map +1 -0
  132. package/build/src/types/kvks/kvks-file-reader.js +181 -0
  133. package/build/src/types/kvks/kvks-file-reader.js.map +1 -0
  134. package/build/src/types/kvks/kvks-file-writer.d.ts +9 -0
  135. package/build/src/types/kvks/kvks-file-writer.d.ts.map +1 -0
  136. package/build/src/types/kvks/kvks-file-writer.js +109 -0
  137. package/build/src/types/kvks/kvks-file-writer.js.map +1 -0
  138. package/build/src/types/kvks/kvks-file.d.ts +44 -0
  139. package/build/src/types/kvks/kvks-file.d.ts.map +1 -0
  140. package/build/src/types/kvks/kvks-file.js +13 -0
  141. package/build/src/types/kvks/kvks-file.js.map +1 -0
  142. package/build/src/types/ldml-keyboard/ldml-keyboard-testdata-xml.d.ts +61 -0
  143. package/build/src/types/ldml-keyboard/ldml-keyboard-testdata-xml.d.ts.map +1 -0
  144. package/build/src/types/ldml-keyboard/ldml-keyboard-testdata-xml.js +23 -0
  145. package/build/src/types/ldml-keyboard/ldml-keyboard-testdata-xml.js.map +1 -0
  146. package/build/src/types/ldml-keyboard/ldml-keyboard-xml-reader.d.ts +96 -0
  147. package/build/src/types/ldml-keyboard/ldml-keyboard-xml-reader.d.ts.map +1 -0
  148. package/build/src/types/ldml-keyboard/ldml-keyboard-xml-reader.js +430 -0
  149. package/build/src/types/ldml-keyboard/ldml-keyboard-xml-reader.js.map +1 -0
  150. package/build/src/types/ldml-keyboard/ldml-keyboard-xml.d.ts +171 -0
  151. package/build/src/types/ldml-keyboard/ldml-keyboard-xml.d.ts.map +1 -0
  152. package/build/src/types/ldml-keyboard/ldml-keyboard-xml.js +59 -0
  153. package/build/src/types/ldml-keyboard/ldml-keyboard-xml.js.map +1 -0
  154. package/build/src/{KeymanSentry.d.ts → utils/KeymanSentry.d.ts} +11 -11
  155. package/build/src/utils/KeymanSentry.d.ts.map +1 -0
  156. package/build/src/{KeymanSentry.js → utils/KeymanSentry.js} +75 -75
  157. package/build/src/utils/KeymanSentry.js.map +1 -0
  158. package/build/src/{keyman-urls.d.ts → utils/keyman-urls.d.ts} +14 -14
  159. package/build/src/utils/keyman-urls.d.ts.map +1 -0
  160. package/build/src/{keyman-urls.js → utils/keyman-urls.js} +20 -20
  161. package/build/src/utils/keyman-urls.js.map +1 -0
  162. package/build/src/{markdown.d.ts → utils/markdown.d.ts} +1 -1
  163. package/build/src/utils/markdown.d.ts.map +1 -0
  164. package/build/src/{markdown.js → utils/markdown.js} +22 -22
  165. package/build/src/utils/markdown.js.map +1 -0
  166. package/build/src/{options.d.ts → utils/options.d.ts} +43 -43
  167. package/build/src/utils/options.d.ts.map +1 -0
  168. package/build/src/{options.js → utils/options.js} +57 -57
  169. package/build/src/utils/options.js.map +1 -0
  170. package/build/src/{validate-mit-license.d.ts → utils/validate-mit-license.d.ts} +6 -6
  171. package/build/src/utils/validate-mit-license.d.ts.map +1 -0
  172. package/build/src/{validate-mit-license.js → utils/validate-mit-license.js} +50 -50
  173. package/build/src/utils/validate-mit-license.js.map +1 -0
  174. package/build/test/helpers/index.d.ts +13 -0
  175. package/build/test/helpers/index.d.ts.map +1 -0
  176. package/build/test/helpers/index.js +42 -0
  177. package/build/test/helpers/index.js.map +1 -0
  178. package/build/test/helpers/reader-callback-test.d.ts +73 -0
  179. package/build/test/helpers/reader-callback-test.d.ts.map +1 -0
  180. package/build/test/helpers/reader-callback-test.js +108 -0
  181. package/build/test/helpers/reader-callback-test.js.map +1 -0
  182. package/build/test/keyman-touch-layout/test-keyman-touch-layout-file-reader.d.ts +2 -0
  183. package/build/test/keyman-touch-layout/test-keyman-touch-layout-file-reader.d.ts.map +1 -0
  184. package/build/test/keyman-touch-layout/test-keyman-touch-layout-file-reader.js +64 -0
  185. package/build/test/keyman-touch-layout/test-keyman-touch-layout-file-reader.js.map +1 -0
  186. package/build/test/keyman-touch-layout/test-keyman-touch-layout-round-trip.d.ts +2 -0
  187. package/build/test/keyman-touch-layout/test-keyman-touch-layout-round-trip.d.ts.map +1 -0
  188. package/build/test/keyman-touch-layout/test-keyman-touch-layout-round-trip.js +34 -0
  189. package/build/test/keyman-touch-layout/test-keyman-touch-layout-round-trip.js.map +1 -0
  190. package/build/test/kmx/test-ldml-keyboard-testdata-reader.d.ts +2 -0
  191. package/build/test/kmx/test-ldml-keyboard-testdata-reader.d.ts.map +1 -0
  192. package/build/test/kmx/test-ldml-keyboard-testdata-reader.js +54 -0
  193. package/build/test/kmx/test-ldml-keyboard-testdata-reader.js.map +1 -0
  194. package/build/test/kmx/test-ldml-keyboard-xml-reader.d.ts +2 -0
  195. package/build/test/kmx/test-ldml-keyboard-xml-reader.d.ts.map +1 -0
  196. package/build/test/kmx/test-ldml-keyboard-xml-reader.js +209 -0
  197. package/build/test/kmx/test-ldml-keyboard-xml-reader.js.map +1 -0
  198. package/build/test/kpj/test-kpj-file-reader.d.ts +2 -0
  199. package/build/test/kpj/test-kpj-file-reader.d.ts.map +1 -0
  200. package/build/test/kpj/test-kpj-file-reader.js +141 -0
  201. package/build/test/kpj/test-kpj-file-reader.js.map +1 -0
  202. package/build/test/kvks/test-kvk-round-trip.d.ts +2 -0
  203. package/build/test/kvks/test-kvk-round-trip.d.ts.map +1 -0
  204. package/build/test/kvks/test-kvk-round-trip.js +108 -0
  205. package/build/test/kvks/test-kvk-round-trip.js.map +1 -0
  206. package/build/test/kvks/test-kvk-utils.d.ts +6 -0
  207. package/build/test/kvks/test-kvk-utils.d.ts.map +1 -0
  208. package/build/test/kvks/test-kvk-utils.js +42 -0
  209. package/build/test/kvks/test-kvk-utils.js.map +1 -0
  210. package/build/test/kvks/test-kvks-file.d.ts +2 -0
  211. package/build/test/kvks/test-kvks-file.d.ts.map +1 -0
  212. package/build/test/kvks/test-kvks-file.js +59 -0
  213. package/build/test/kvks/test-kvks-file.js.map +1 -0
  214. package/build/test/test-is-valid-email.d.ts +2 -0
  215. package/build/test/test-is-valid-email.d.ts.map +1 -0
  216. package/build/test/test-is-valid-email.js +36 -0
  217. package/build/test/test-is-valid-email.js.map +1 -0
  218. package/build/test/test-license.d.ts +2 -0
  219. package/build/test/test-license.d.ts.map +1 -0
  220. package/build/test/test-license.js +24 -0
  221. package/build/test/test-license.js.map +1 -0
  222. package/build/test/tsconfig.tsbuildinfo +1 -0
  223. package/build/tsconfig.tsbuildinfo +1 -1
  224. package/package.json +15 -6
  225. package/build/index.d.ts +0 -6
  226. package/build/index.d.ts.map +0 -1
  227. package/build/index.js +0 -9
  228. package/build/index.js.map +0 -1
  229. package/build/src/KeymanSentry.d.ts.map +0 -1
  230. package/build/src/KeymanSentry.js.map +0 -1
  231. package/build/src/keyman-urls.d.ts.map +0 -1
  232. package/build/src/keyman-urls.js.map +0 -1
  233. package/build/src/markdown.d.ts.map +0 -1
  234. package/build/src/markdown.js.map +0 -1
  235. package/build/src/options.d.ts.map +0 -1
  236. package/build/src/options.js.map +0 -1
  237. package/build/src/validate-mit-license.d.ts.map +0 -1
  238. package/build/src/validate-mit-license.js.map +0 -1
@@ -1,7 +1,7 @@
1
- /**
2
- * Returns an error string for license issues, or null if no issues found
3
- * @param license
4
- * @returns
5
- */
6
- export declare function validateMITLicense(license: string): string;
1
+ /**
2
+ * Returns an error string for license issues, or null if no issues found
3
+ * @param license
4
+ * @returns
5
+ */
6
+ export declare function validateMITLicense(license: string): string;
7
7
  //# sourceMappingURL=validate-mit-license.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-mit-license.d.ts","sourceRoot":"","sources":["../../../src/utils/validate-mit-license.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,UA+DjD"}
@@ -1,64 +1,64 @@
1
- /**
2
- * Returns an error string for license issues, or null if no issues found
3
- * @param license
4
- * @returns
5
- */
1
+ /**
2
+ * Returns an error string for license issues, or null if no issues found
3
+ * @param license
4
+ * @returns
5
+ */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="138751cc-71b4-5c1d-9b56-91928c3e66ec")}catch(e){}}();
8
- export function validateMITLicense(license) {
9
- // NOTE: this function returns error messages which will not be easily
10
- // localizable. Given this is only for use with the keyboards and
11
- // lexical-models repositories, suggest we don't worry about this
12
- // split input text into paragraphs, trimming whitespace
13
- const text = license.trim().split('\n').map(line => line.trim()).join('\n').split(/\n\s*\n/);
14
- // MIT license, cleanup whitespace
15
- const clauses = [
16
- `The MIT License (MIT)`,
17
- `Copyright ...`,
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="eb97b08c-8176-56c9-ac29-b40cae3e0e2d")}catch(e){}}();
8
+ export function validateMITLicense(license) {
9
+ // NOTE: this function returns error messages which will not be easily
10
+ // localizable. Given this is only for use with the keyboards and
11
+ // lexical-models repositories, suggest we don't worry about this
12
+ // split input text into paragraphs, trimming whitespace
13
+ const text = license.trim().split('\n').map(line => line.trim()).join('\n').split(/\n\s*\n/);
14
+ // MIT license, cleanup whitespace
15
+ const clauses = [
16
+ `The MIT License (MIT)`,
17
+ `Copyright ...`, // Copyright is tested separately below
18
18
  `Permission is hereby granted, free of charge, to any person obtaining a copy
19
19
  of this software and associated documentation files (the "Software"), to deal
20
20
  in the Software without restriction, including without limitation the rights
21
21
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
22
22
  copies of the Software, and to permit persons to whom the Software is
23
- furnished to do so, subject to the following conditions:`,
23
+ furnished to do so, subject to the following conditions:`,
24
24
  `The above copyright notice and this permission notice shall be included in all
25
- copies or substantial portions of the Software.`,
25
+ copies or substantial portions of the Software.`,
26
26
  `THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27
27
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28
28
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29
29
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30
30
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31
31
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32
- SOFTWARE.`
33
- ]
34
- .map(clause => clause.split('\n').map(line => line.trim()).join(' '));
35
- if (text.length < clauses.length) {
36
- // not enough clauses in the file
37
- return 'License is missing clauses from MIT license';
38
- }
39
- if (text.length > clauses.length) {
40
- // too many clauses in the file
41
- return 'License contains extra text';
42
- }
43
- for (let i = 0; i < clauses.length; i++) {
44
- if (i == 1) {
45
- // Clause 1 is the only one that can differ, and just with
46
- // a copyright holder
47
- if (!text[i].match(/^Copyright/)) {
48
- // No Copyright clause
49
- return `Clause 2 does not start with 'Copyright'`;
50
- }
51
- }
52
- else {
53
- const t0 = text[i].replaceAll(/\s+/g, ' ').trim();
54
- const c0 = clauses[i].replaceAll(/\s+/g, ' ').trim();
55
- if (t0 != c0) {
56
- // Clause does not match
57
- return `Clause ${i + 1} differs from MIT license`;
58
- }
59
- }
60
- }
61
- return null;
62
- }
32
+ SOFTWARE.`
33
+ ]
34
+ .map(clause => clause.split('\n').map(line => line.trim()).join(' '));
35
+ if (text.length < clauses.length) {
36
+ // not enough clauses in the file
37
+ return 'License is missing clauses from MIT license';
38
+ }
39
+ if (text.length > clauses.length) {
40
+ // too many clauses in the file
41
+ return 'License contains extra text';
42
+ }
43
+ for (let i = 0; i < clauses.length; i++) {
44
+ if (i == 1) {
45
+ // Clause 1 is the only one that can differ, and just with
46
+ // a copyright holder
47
+ if (!text[i].match(/^Copyright/)) {
48
+ // No Copyright clause
49
+ return `Clause 2 does not start with 'Copyright'`;
50
+ }
51
+ }
52
+ else {
53
+ const t0 = text[i].replaceAll(/\s+/g, ' ').trim();
54
+ const c0 = clauses[i].replaceAll(/\s+/g, ' ').trim();
55
+ if (t0 != c0) {
56
+ // Clause does not match
57
+ return `Clause ${i + 1} differs from MIT license`;
58
+ }
59
+ }
60
+ }
61
+ return null;
62
+ }
63
63
  //# sourceMappingURL=validate-mit-license.js.map
64
- //# debugId=138751cc-71b4-5c1d-9b56-91928c3e66ec
64
+ //# debugId=eb97b08c-8176-56c9-ac29-b40cae3e0e2d
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-mit-license.js","sources":["../../../src/utils/validate-mit-license.ts"],"sourceRoot":"","names":[],"mappings":"AAAA;;;;GAIG;;;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAe;IAChD,sEAAsE;IACtE,iEAAiE;IACjE,iEAAiE;IAEjE,wDAAwD;IACxD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CA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AAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;YACrD,IAAG,EAAE,IAAI,EAAE,EAAE,CAAC;gBACZ,wBAAwB;gBACxB,OAAO,UAAU,CAAC,GAAC,CAAC,2BAA2B,CAAC;YAClD,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC","debug_id":"eb97b08c-8176-56c9-ac29-b40cae3e0e2d"}
@@ -0,0 +1,13 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ /**
3
+ * Builds a path to the fixture with the given path components.
4
+ *
5
+ * e.g., makePathToFixture('example.qaa.trivial')
6
+ * e.g., makePathToFixture('example.qaa.trivial', 'model.ts')
7
+ *
8
+ * @param components One or more path components.
9
+ */
10
+ export declare function makePathToFixture(...components: string[]): string;
11
+ export declare function loadFile(filename: string | URL): Buffer;
12
+ export declare function resolveFilename(baseFilename: string, filename: string): string;
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../test/helpers/index.ts"],"names":[],"mappings":";AAOA;;;;;;;GAOG;AACF,wBAAgB,iBAAiB,CAAC,GAAG,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,CAElE;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,GAAG,MAAM,CAEvD;AAED,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,UAiBrE"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Helpers and utilities for the Mocha tests.
3
+ */
4
+
5
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="98e4d73f-3cf5-5230-996c-f0327812aa04")}catch(e){}}();
6
+ import * as path from 'path';
7
+ import * as fs from "fs";
8
+ import { fileURLToPath } from 'url';
9
+ /**
10
+ * Builds a path to the fixture with the given path components.
11
+ *
12
+ * e.g., makePathToFixture('example.qaa.trivial')
13
+ * e.g., makePathToFixture('example.qaa.trivial', 'model.ts')
14
+ *
15
+ * @param components One or more path components.
16
+ */
17
+ export function makePathToFixture(...components) {
18
+ return fileURLToPath(new URL(path.join('..', '..', '..', 'test', 'fixtures', ...components), import.meta.url));
19
+ }
20
+ export function loadFile(filename) {
21
+ return fs.readFileSync(filename);
22
+ }
23
+ export function resolveFilename(baseFilename, filename) {
24
+ const basePath = baseFilename.endsWith('/') || baseFilename.endsWith('\\') ?
25
+ baseFilename :
26
+ path.dirname(baseFilename);
27
+ // Transform separators to platform separators -- we are agnostic
28
+ // in our use here but path prefers files may use
29
+ // either / or \, although older kps files were always \.
30
+ if (path.sep == '/') {
31
+ filename = filename.replace(/\\/g, '/');
32
+ }
33
+ else {
34
+ filename = filename.replace(/\//g, '\\');
35
+ }
36
+ if (!path.isAbsolute(filename)) {
37
+ filename = path.resolve(basePath, filename);
38
+ }
39
+ return filename;
40
+ }
41
+ //# sourceMappingURL=index.js.map
42
+ //# debugId=98e4d73f-3cf5-5230-996c-f0327812aa04
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../test/helpers/index.ts"],"sourceRoot":"","names":[],"mappings":"AAAA;;GAEG;;;AACH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC;;;;;;;GAOG;AACF,MAAM,UAAU,iBAAiB,CAAC,GAAG,UAAoB;IACxD,OAAO,aAAa,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACjH,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,QAAsB;IAC7C,OAAO,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,YAAoB,EAAE,QAAgB;IACpE,MAAM,QAAQ,GACZ,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3D,YAAY,CAAC,CAAC;QACd,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAC7B,iEAAiE;IACjE,iDAAiD;IACjD,yDAAyD;IACzD,IAAG,IAAI,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC;QACnB,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC1C,CAAC;SAAM,CAAC;QACN,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC3C,CAAC;IACD,IAAG,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9B,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC","debug_id":"98e4d73f-3cf5-5230-996c-f0327812aa04"}
@@ -0,0 +1,73 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ import 'mocha';
3
+ import { CompilerEvent } from '../../src/compiler-interfaces.js';
4
+ import { LDMLKeyboardXMLSourceFile } from '../../src/types/ldml-keyboard/ldml-keyboard-xml.js';
5
+ import { LDMLKeyboardTestDataXMLSourceFile } from '../../src/types/ldml-keyboard/ldml-keyboard-testdata-xml.js';
6
+ import { TestCompilerCallbacks } from '@keymanapp/developer-test-helpers';
7
+ export interface CompilationCase {
8
+ /**
9
+ * If true, loading (validation) should fail
10
+ */
11
+ loadfail?: boolean;
12
+ /**
13
+ * path to xml, such as 'sections/layr/invalid-case.xml'
14
+ */
15
+ subpath: string;
16
+ /**
17
+ * expected error messages. If falsy, expected to succeed. All must be present to pass.
18
+ */
19
+ errors?: CompilerEvent[];
20
+ /**
21
+ * expected warning messages. All must be present to pass.
22
+ */
23
+ warnings?: CompilerEvent[];
24
+ /**
25
+ * optional callback with the section
26
+ */
27
+ callback?: (data: Buffer, source: LDMLKeyboardXMLSourceFile, subpath: string, callbacks: TestCompilerCallbacks) => void;
28
+ /**
29
+ * if present, expect compiler to throw (use .* to match all)
30
+ */
31
+ throws?: RegExp;
32
+ }
33
+ export interface TestDataCase {
34
+ /**
35
+ * If true, loading (validation) should fail
36
+ */
37
+ loadfail?: boolean;
38
+ /**
39
+ * path to xml, such as 'sections/layr/invalid-case.xml'
40
+ */
41
+ subpath: string;
42
+ /**
43
+ * expected error messages. If falsy, expected to succeed. All must be present to pass.
44
+ */
45
+ errors?: CompilerEvent[];
46
+ /**
47
+ * expected warning messages. All must be present to pass.
48
+ */
49
+ warnings?: CompilerEvent[];
50
+ /**
51
+ * optional callback with the section
52
+ */
53
+ callback?: (data: Buffer, source: LDMLKeyboardTestDataXMLSourceFile, subpath: string, callbacks: TestCompilerCallbacks) => void;
54
+ /**
55
+ * if present, expect compiler to throw (use .* to match all)
56
+ */
57
+ throws?: RegExp;
58
+ }
59
+ /**
60
+ * Run a bunch of cases
61
+ * @param cases cases to run
62
+ * @param compiler argument to loadSectionFixture()
63
+ * @param callbacks argument to loadSectionFixture()
64
+ */
65
+ export declare function testReaderCases(cases: CompilationCase[]): void;
66
+ /**
67
+ * Run a bunch of cases
68
+ * @param cases cases to run
69
+ * @param compiler argument to loadSectionFixture()
70
+ * @param callbacks argument to loadSectionFixture()
71
+ */
72
+ export declare function testTestdataReaderCases(cases: TestDataCase[]): void;
73
+ //# sourceMappingURL=reader-callback-test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reader-callback-test.d.ts","sourceRoot":"","sources":["../../../test/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G;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAG,YAAY,EAAE,QAsC7D"}
@@ -0,0 +1,108 @@
1
+
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="68f94e66-9c79-535e-8bd8-0a367e13754b")}catch(e){}}();
3
+ import 'mocha';
4
+ import { assert } from 'chai';
5
+ import { loadFile, makePathToFixture } from './index.js';
6
+ import { LDMLKeyboardXMLSourceFileReader } from '../../src/types/ldml-keyboard/ldml-keyboard-xml-reader.js';
7
+ import { TestCompilerCallbacks } from '@keymanapp/developer-test-helpers';
8
+ import { fileURLToPath } from 'url';
9
+ const readerOptions = {
10
+ importsPath: fileURLToPath(new URL(...LDMLKeyboardXMLSourceFileReader.defaultImportsURL))
11
+ };
12
+ /**
13
+ * Run a bunch of cases
14
+ * @param cases cases to run
15
+ * @param compiler argument to loadSectionFixture()
16
+ * @param callbacks argument to loadSectionFixture()
17
+ */
18
+ export function testReaderCases(cases) {
19
+ // we need our own callbacks rather than using the global so messages don't get mixed
20
+ const callbacks = new TestCompilerCallbacks();
21
+ const reader = new LDMLKeyboardXMLSourceFileReader(readerOptions, callbacks);
22
+ for (const testcase of cases) {
23
+ const expectFailure = testcase.throws || !!(testcase.errors); // if true, we expect this to fail
24
+ const testHeading = expectFailure ? `should fail to load: ${testcase.subpath}` :
25
+ `should load: ${testcase.subpath}`;
26
+ it(testHeading, function () {
27
+ callbacks.clear();
28
+ const data = loadFile(makePathToFixture('ldml-keyboard', testcase.subpath));
29
+ assert.ok(data, `reading ${testcase.subpath}`);
30
+ const source = reader.load(data);
31
+ if (!testcase.loadfail) {
32
+ assert.ok(source, `loading ${testcase.subpath}`);
33
+ }
34
+ else {
35
+ assert.notOk(source, `loading ${testcase.subpath} (expected failure)`);
36
+ }
37
+ // special case for an expected exception
38
+ if (testcase.throws) {
39
+ assert.throws(() => reader.validate(source), testcase.throws);
40
+ }
41
+ else {
42
+ assert.doesNotThrow(() => reader.validate(source), `validating ${testcase.subpath}`);
43
+ // if we expected errors or warnings, show them
44
+ if (testcase.errors) {
45
+ assert.includeDeepMembers(callbacks.messages, testcase.errors, 'expected errors to be included');
46
+ }
47
+ if (testcase.warnings) {
48
+ assert.includeDeepMembers(callbacks.messages, testcase.warnings, 'expected warnings to be included');
49
+ }
50
+ else if (!expectFailure) {
51
+ // no warnings, so expect zero messages
52
+ assert.deepEqual(callbacks.messages, [], 'expected zero messages');
53
+ }
54
+ // run the user-supplied callback if any
55
+ if (testcase.callback) {
56
+ testcase.callback(data, source, testcase.subpath, callbacks);
57
+ }
58
+ }
59
+ });
60
+ }
61
+ }
62
+ /**
63
+ * Run a bunch of cases
64
+ * @param cases cases to run
65
+ * @param compiler argument to loadSectionFixture()
66
+ * @param callbacks argument to loadSectionFixture()
67
+ */
68
+ export function testTestdataReaderCases(cases) {
69
+ // we need our own callbacks rather than using the global so messages don't get mixed
70
+ const callbacks = new TestCompilerCallbacks();
71
+ const reader = new LDMLKeyboardXMLSourceFileReader(readerOptions, callbacks);
72
+ for (const testcase of cases) {
73
+ const expectFailure = testcase.throws || !!(testcase.errors); // if true, we expect this to fail
74
+ const testHeading = expectFailure ? `should fail to load: ${testcase.subpath}` :
75
+ `should load: ${testcase.subpath}`;
76
+ it(testHeading, function () {
77
+ callbacks.clear();
78
+ const data = loadFile(makePathToFixture('ldml-keyboard', testcase.subpath));
79
+ assert.ok(data, `reading ${testcase.subpath}`);
80
+ const source = reader.loadTestData(data);
81
+ if (!testcase.loadfail) {
82
+ assert.ok(source, `loading ${testcase.subpath}`);
83
+ }
84
+ else {
85
+ assert.notOk(source, `loading ${testcase.subpath} (expected failure)`);
86
+ }
87
+ // special case for an expected exception
88
+ // TODO-LDML: no validation for now.
89
+ // if we expected errors or warnings, show them
90
+ if (testcase.errors) {
91
+ assert.includeDeepMembers(callbacks.messages, testcase.errors, 'expected errors to be included');
92
+ }
93
+ if (testcase.warnings) {
94
+ assert.includeDeepMembers(callbacks.messages, testcase.warnings, 'expected warnings to be included');
95
+ }
96
+ else if (!expectFailure) {
97
+ // no warnings, so expect zero messages
98
+ assert.strictEqual(callbacks.messages.length, 0, 'expected zero messages but got ' + callbacks.messages.map(e => e.message).join(' '));
99
+ }
100
+ // run the user-supplied callback if any
101
+ if (testcase.callback) {
102
+ testcase.callback(data, source, testcase.subpath, callbacks);
103
+ }
104
+ });
105
+ }
106
+ }
107
+ //# sourceMappingURL=reader-callback-test.js.map
108
+ //# debugId=68f94e66-9c79-535e-8bd8-0a367e13754b
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reader-callback-test.js","sources":["../../../test/helpers/reader-callback-test.ts"],"sourceRoot":"","names":[],"mappings":";;AAAA,OAAO,OAAO,CAAC;AACf,OAAO,EAAC,MAAM,EAAC,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,+BAA+B,EAA0C,MAAM,2DAA2D,CAAC;AAIpJ,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,aAAa,GAA2C;IAC5D,WAAW,EAAE,aAAa,CAAC,IAAI,GAAG,CAAC,GAAG,+BAA+B,CAAC,iBAAiB,CAAC,CAAC;CAC1F,CAAC;AAyDF;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,KAAyB;IACvD,qFAAqF;IACrF,MAAM,SAAS,GAAG,IAAI,qBAAqB,EAAE,CAAC;IAC9C,MAAM,MAAM,GAAG,IAAI,+BAA+B,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;IAC7E,KAAK,MAAM,QAAQ,IAAI,KAAK,EAAE,CAAC;QAC7B,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,QAA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,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;YAC/D,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC","debug_id":"68f94e66-9c79-535e-8bd8-0a367e13754b"}
@@ -0,0 +1,2 @@
1
+ import 'mocha';
2
+ //# sourceMappingURL=test-keyman-touch-layout-file-reader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-keyman-touch-layout-file-reader.d.ts","sourceRoot":"","sources":["../../../test/keyman-touch-layout/test-keyman-touch-layout-file-reader.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,CAAC"}
@@ -0,0 +1,64 @@
1
+
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a6000afe-5226-5e95-8112-ce2129ddb945")}catch(e){}}();
3
+ import * as fs from 'fs';
4
+ import 'mocha';
5
+ import { assert } from 'chai';
6
+ import { makePathToFixture } from '../helpers/index.js';
7
+ import { TouchLayoutFileReader } from "../../src/types/keyman-touch-layout/keyman-touch-layout-file-reader.js";
8
+ describe('TouchLayoutFileReader', function () {
9
+ it('should read a valid file', function () {
10
+ const path = makePathToFixture('keyman-touch-layout', 'khmer_angkor.keyman-touch-layout');
11
+ const input = fs.readFileSync(path);
12
+ const reader = new TouchLayoutFileReader();
13
+ const layout = reader.read(input);
14
+ reader.validate(layout);
15
+ // We don't really need to validate the JSON parser. We'll do a handful of
16
+ // tests for object integrity and a couple of object members inside the file
17
+ // just as a sanity check
18
+ assert.hasAllKeys(layout, ['tablet', 'phone']);
19
+ assert.hasAllKeys(layout.tablet, ['layer', 'displayUnderlying', 'font', 'fontsize']);
20
+ assert.isFalse(layout.tablet.displayUnderlying);
21
+ assert.strictEqual(layout.tablet.font, 'Khmer Busra Kbd');
22
+ assert.strictEqual(layout.tablet.fontsize, '0.8em');
23
+ assert.isArray(layout.tablet.layer);
24
+ assert.strictEqual(layout.tablet.layer.length, 3);
25
+ assert.strictEqual(layout.tablet.layer[0].id, 'default');
26
+ assert.isArray(layout.tablet.layer[0].row);
27
+ assert.isArray(layout.tablet.layer[0].row);
28
+ assert.strictEqual(layout.tablet.layer[0].row.length, 5);
29
+ assert.strictEqual(layout.tablet.layer[0].row[0].id, 1);
30
+ assert.isArray(layout.tablet.layer[0].row[0].key);
31
+ assert.strictEqual(layout.tablet.layer[0].row[0].key.length, 13);
32
+ assert.strictEqual(layout.tablet.layer[0].row[0].key[0].id, "K_1");
33
+ assert.strictEqual(layout.tablet.layer[0].row[0].key[0].text, "១");
34
+ });
35
+ it('should fixup numeric types in a valid legacy file', function () {
36
+ const path = makePathToFixture('keyman-touch-layout', 'legacy.keyman-touch-layout');
37
+ const input = fs.readFileSync(path);
38
+ const reader = new TouchLayoutFileReader();
39
+ const layout = reader.read(input);
40
+ reader.validate(layout);
41
+ // row.id can be a string in legacy files
42
+ assert.strictEqual(layout.tablet.layer[0].row[0].id, 1);
43
+ // key pad, width and sp can be a string in legacy files
44
+ assert.strictEqual(layout.tablet.layer[0].row[0].key[0].pad, 25);
45
+ assert.strictEqual(layout.tablet.layer[0].row[0].key[0].width, 100);
46
+ assert.strictEqual(layout.tablet.layer[0].row[0].key[0].sp, 1);
47
+ // sk pad, width and sp can be a string in legacy files
48
+ assert.strictEqual(layout.tablet.layer[0].row[0].key[0].sk[0].pad, 10);
49
+ assert.strictEqual(layout.tablet.layer[0].row[0].key[0].sk[0].width, 25);
50
+ assert.strictEqual(layout.tablet.layer[0].row[0].key[0].sk[0].sp, 8);
51
+ });
52
+ it('should fixup remove empty arrays in a valid legacy file', function () {
53
+ const path = makePathToFixture('keyman-touch-layout', 'legacy.keyman-touch-layout');
54
+ const input = fs.readFileSync(path);
55
+ const reader = new TouchLayoutFileReader();
56
+ const layout = reader.read(input);
57
+ reader.validate(layout);
58
+ // sk was defined as [] in legacy.keyman-touch-layout but we want to treat
59
+ // it as not present
60
+ assert.isUndefined(layout.tablet.layer[0].row[0].key[1].sk);
61
+ });
62
+ });
63
+ //# sourceMappingURL=test-keyman-touch-layout-file-reader.js.map
64
+ //# debugId=a6000afe-5226-5e95-8112-ce2129ddb945
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-keyman-touch-layout-file-reader.js","sources":["../../../test/keyman-touch-layout/test-keyman-touch-layout-file-reader.ts"],"sourceRoot":"","names":[],"mappings":";;AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,OAAO,CAAC;AACf,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wEAAwE,CAAC;AAE/G,QAAQ,CAAC,uBAAuB,EAAE;IAChC,EAAE,CAAC,0BAA0B,EAAE;QAC7B,MAAM,IAAI,GAAG,iBAAiB,CAAC,qBAAqB,EAAE,kCAAkC,CAAC,CAAC;QAC1F,MAAM,KAAK,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QACpC,MAAM,MAAM,GAAG,IAAI,qBAAqB,EAAE,CAAC;QAC3C,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAExB,0EAA0E;QAC1E,4EAA4E;QAC5E,yBAAyB;QACzB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;QAC/C,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;QACrF,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;QAChD,MAAM,CAAC,WAAW,CAAC,MAAM,CAA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AC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","debug_id":"a6000afe-5226-5e95-8112-ce2129ddb945"}
@@ -0,0 +1,2 @@
1
+ import 'mocha';
2
+ //# sourceMappingURL=test-keyman-touch-layout-round-trip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-keyman-touch-layout-round-trip.d.ts","sourceRoot":"","sources":["../../../test/keyman-touch-layout/test-keyman-touch-layout-round-trip.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,CAAC"}
@@ -0,0 +1,34 @@
1
+
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8078aad8-fb4e-5655-848d-86d144cf52e7")}catch(e){}}();
3
+ import * as fs from 'fs';
4
+ import 'mocha';
5
+ import { assert } from 'chai';
6
+ import { makePathToFixture } from '../helpers/index.js';
7
+ import { TouchLayoutFileReader } from "../../src/types/keyman-touch-layout/keyman-touch-layout-file-reader.js";
8
+ import { TouchLayoutFileWriter } from "../../src/types/keyman-touch-layout/keyman-touch-layout-file-writer.js";
9
+ describe('TouchLayoutFile', function () {
10
+ it('should round-trip from TouchLayoutFileReader to TouchLayoutFileWriter', function () {
11
+ const path = makePathToFixture('keyman-touch-layout', 'khmer_angkor.keyman-touch-layout');
12
+ const input = fs.readFileSync(path);
13
+ const reader = new TouchLayoutFileReader();
14
+ const layout = reader.read(input);
15
+ const writer = new TouchLayoutFileWriter();
16
+ // We don't want to assert equality on formatting differences, or on the
17
+ // fixups that we do on input files (empty arrays, stringified numbers), so
18
+ // we'll re-read the output and compare it
19
+ let output = writer.write(layout);
20
+ let newLayout = reader.read(output);
21
+ assert.deepEqual(layout, newLayout);
22
+ // And do the same without formatted output
23
+ output = writer.write(layout);
24
+ newLayout = reader.read(output);
25
+ assert.deepEqual(layout, newLayout);
26
+ // And do the same without any options
27
+ const output2 = writer.write(layout);
28
+ assert.deepEqual(output, output2);
29
+ newLayout = reader.read(output2);
30
+ assert.deepEqual(layout, newLayout);
31
+ });
32
+ });
33
+ //# sourceMappingURL=test-keyman-touch-layout-round-trip.js.map
34
+ //# debugId=8078aad8-fb4e-5655-848d-86d144cf52e7
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-keyman-touch-layout-round-trip.js","sources":["../../../test/keyman-touch-layout/test-keyman-touch-layout-round-trip.ts"],"sourceRoot":"","names":[],"mappings":";;AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,OAAO,CAAC;AACf,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wEAAwE,CAAC;AAC/G,OAAO,EAAE,qBAAqB,EAAE,MAAM,wEAAwE,CAAC;AAE/G,QAAQ,CAAC,iBAAiB,EAAE;IAC1B,EAAE,CAAC,uEAAuE,EAAE;QAC1E,MAAM,IAAI,GAAG,iBAAiB,CAAC,qBAAqB,EAAE,kCAAkC,CAAC,CAAC;QAC1F,MAAM,KAAK,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QACpC,MAAM,MAAM,GAAG,IAAI,qBAAqB,EAAE,CAAC;QAC3C,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClC,MAAM,MAAM,GAAG,IAAI,qBAAqB,EAAE,CAAC;QAE3C,wEAAwE;QACxE,2EAA2E;QAC3E,0CAA0C;QAC1C,IAAI,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAClC,IAAI,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAEpC,2CAA2C;QAC3C,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC9B,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAEpC,sCAAsC;QACtC,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAElC,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","debug_id":"8078aad8-fb4e-5655-848d-86d144cf52e7"}
@@ -0,0 +1,2 @@
1
+ import 'mocha';
2
+ //# sourceMappingURL=test-ldml-keyboard-testdata-reader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-ldml-keyboard-testdata-reader.d.ts","sourceRoot":"","sources":["../../../test/kmx/test-ldml-keyboard-testdata-reader.ts"],"names":[],"mappings":"AAEA,OAAO,OAAO,CAAC"}
@@ -0,0 +1,54 @@
1
+
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="94dacd45-24be-5b5b-8854-82d380b11b7d")}catch(e){}}();
3
+ import { constants } from '@keymanapp/ldml-keyboard-constants';
4
+ import { assert } from 'chai';
5
+ import 'mocha';
6
+ import { testTestdataReaderCases } from '../helpers/reader-callback-test.js';
7
+ describe('ldml keyboard xml reader tests', function () {
8
+ this.slow(500); // 0.5 sec -- json schema validation takes a while
9
+ testTestdataReaderCases([
10
+ {
11
+ // Note! There's another test case against similar data, in developer/src/kmc-ldml/test/test-testdata-e2e.ts using test-fr.json
12
+ subpath: 'test-fr.xml',
13
+ callback: (data, source) => {
14
+ assert.ok(source);
15
+ assert.ok(source.keyboardTest3);
16
+ assert.equal(source.keyboardTest3.conformsTo, constants.cldr_test_version_latest);
17
+ assert.deepEqual(source.keyboardTest3.info, {
18
+ keyboard: 'fr-t-k0-azerty.xml',
19
+ author: 'Team Keyboard',
20
+ name: 'fr-test'
21
+ });
22
+ assert.sameDeepMembers(source.keyboardTest3.repertoire, [
23
+ {
24
+ name: 'simple-repertoire',
25
+ chars: '[a b c d e \\u{22}]',
26
+ type: 'simple'
27
+ },
28
+ { name: 'chars-repertoire', chars: '[á é ó]', type: 'gesture' }
29
+ ]);
30
+ assert.equal(1, source.keyboardTest3.tests?.length);
31
+ assert.equal('key-tests', source.keyboardTest3.tests[0].name);
32
+ assert.equal(1, source.keyboardTest3.tests[0].test?.length);
33
+ const test0 = source.keyboardTest3.tests[0].test[0];
34
+ assert.equal('key-test', test0.name);
35
+ assert.equal('abc\\u0022...', test0.startContext?.to);
36
+ const expectedActions = [
37
+ { type: "keystroke", key: 's' },
38
+ { type: "check", result: 'abc\\u0022...s' },
39
+ { type: "keystroke", key: 't' },
40
+ { type: "check", result: 'abc\\u0022...st' },
41
+ { type: "keystroke", key: 'u' },
42
+ { type: "check", result: 'abc\\u0022...stu' },
43
+ { type: "emit", to: 'v' },
44
+ { type: "check", result: 'abc\\u0022...stuv' },
45
+ { type: "backspace" },
46
+ { type: "check", result: 'abc\\u0022...stu' },
47
+ ];
48
+ assert.sameDeepOrderedMembers(expectedActions, test0.actions, 'Static data in .ts file should match parsed test-fr.xml');
49
+ },
50
+ }
51
+ ]);
52
+ });
53
+ //# sourceMappingURL=test-ldml-keyboard-testdata-reader.js.map
54
+ //# debugId=94dacd45-24be-5b5b-8854-82d380b11b7d
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-ldml-keyboard-testdata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AC;YAC3H,CAAC;SACF;KACF,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","debug_id":"94dacd45-24be-5b5b-8854-82d380b11b7d"}
@@ -0,0 +1,2 @@
1
+ import 'mocha';
2
+ //# sourceMappingURL=test-ldml-keyboard-xml-reader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-ldml-keyboard-xml-reader.d.ts","sourceRoot":"","sources":["../../../test/kmx/test-ldml-keyboard-xml-reader.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,CAAC"}