@ohos-ports/stdlib-process-read-stdin 0.0.0-stage → 0.2.3-beta.1

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 (368) hide show
  1. package/LICENSE +177 -0
  2. package/NOTICE +1 -0
  3. package/README.md +242 -2
  4. package/SECURITY.md +5 -0
  5. package/dist/index.d.ts +3 -0
  6. package/dist/index.js +5 -0
  7. package/dist/index.js.map +7 -0
  8. package/docs/types/index.d.ts +108 -0
  9. package/lib/browser.js +66 -0
  10. package/lib/index.js +47 -0
  11. package/lib/main.js +159 -0
  12. package/node_modules/@stdlib/assert-has-node-buffer-support/LICENSE +177 -0
  13. package/node_modules/@stdlib/assert-has-node-buffer-support/NOTICE +1 -0
  14. package/node_modules/@stdlib/assert-has-node-buffer-support/README.md +187 -0
  15. package/node_modules/@stdlib/assert-has-node-buffer-support/SECURITY.md +5 -0
  16. package/node_modules/@stdlib/assert-has-node-buffer-support/dist/index.d.ts +3 -0
  17. package/node_modules/@stdlib/assert-has-node-buffer-support/dist/index.js +7 -0
  18. package/node_modules/@stdlib/assert-has-node-buffer-support/dist/index.js.map +7 -0
  19. package/node_modules/@stdlib/assert-has-node-buffer-support/docs/types/index.d.ts +35 -0
  20. package/node_modules/@stdlib/assert-has-node-buffer-support/lib/buffer.js +28 -0
  21. package/node_modules/@stdlib/assert-has-node-buffer-support/lib/index.js +40 -0
  22. package/node_modules/@stdlib/assert-has-node-buffer-support/lib/main.js +68 -0
  23. package/node_modules/@stdlib/assert-has-node-buffer-support/package.json +76 -0
  24. package/node_modules/@stdlib/assert-has-own-property/LICENSE +177 -0
  25. package/node_modules/@stdlib/assert-has-own-property/NOTICE +1 -0
  26. package/node_modules/@stdlib/assert-has-own-property/README.md +263 -0
  27. package/node_modules/@stdlib/assert-has-own-property/SECURITY.md +5 -0
  28. package/node_modules/@stdlib/assert-has-own-property/dist/index.d.ts +3 -0
  29. package/node_modules/@stdlib/assert-has-own-property/dist/index.js +5 -0
  30. package/node_modules/@stdlib/assert-has-own-property/dist/index.js.map +7 -0
  31. package/node_modules/@stdlib/assert-has-own-property/docs/types/index.d.ts +49 -0
  32. package/node_modules/@stdlib/assert-has-own-property/lib/index.js +47 -0
  33. package/node_modules/@stdlib/assert-has-own-property/lib/main.js +64 -0
  34. package/node_modules/@stdlib/assert-has-own-property/package.json +74 -0
  35. package/node_modules/@stdlib/assert-has-symbol-support/LICENSE +177 -0
  36. package/node_modules/@stdlib/assert-has-symbol-support/NOTICE +1 -0
  37. package/node_modules/@stdlib/assert-has-symbol-support/README.md +193 -0
  38. package/node_modules/@stdlib/assert-has-symbol-support/SECURITY.md +5 -0
  39. package/node_modules/@stdlib/assert-has-symbol-support/dist/index.d.ts +3 -0
  40. package/node_modules/@stdlib/assert-has-symbol-support/dist/index.js +5 -0
  41. package/node_modules/@stdlib/assert-has-symbol-support/dist/index.js.map +7 -0
  42. package/node_modules/@stdlib/assert-has-symbol-support/docs/types/index.d.ts +35 -0
  43. package/node_modules/@stdlib/assert-has-symbol-support/lib/index.js +40 -0
  44. package/node_modules/@stdlib/assert-has-symbol-support/lib/main.js +42 -0
  45. package/node_modules/@stdlib/assert-has-symbol-support/package.json +73 -0
  46. package/node_modules/@stdlib/assert-has-tostringtag-support/LICENSE +177 -0
  47. package/node_modules/@stdlib/assert-has-tostringtag-support/NOTICE +1 -0
  48. package/node_modules/@stdlib/assert-has-tostringtag-support/README.md +187 -0
  49. package/node_modules/@stdlib/assert-has-tostringtag-support/SECURITY.md +5 -0
  50. package/node_modules/@stdlib/assert-has-tostringtag-support/dist/index.d.ts +3 -0
  51. package/node_modules/@stdlib/assert-has-tostringtag-support/dist/index.js +5 -0
  52. package/node_modules/@stdlib/assert-has-tostringtag-support/dist/index.js.map +7 -0
  53. package/node_modules/@stdlib/assert-has-tostringtag-support/docs/types/index.d.ts +35 -0
  54. package/node_modules/@stdlib/assert-has-tostringtag-support/lib/index.js +40 -0
  55. package/node_modules/@stdlib/assert-has-tostringtag-support/lib/main.js +49 -0
  56. package/node_modules/@stdlib/assert-has-tostringtag-support/package.json +79 -0
  57. package/node_modules/@stdlib/assert-is-array/LICENSE +177 -0
  58. package/node_modules/@stdlib/assert-is-array/NOTICE +1 -0
  59. package/node_modules/@stdlib/assert-is-array/README.md +183 -0
  60. package/node_modules/@stdlib/assert-is-array/SECURITY.md +5 -0
  61. package/node_modules/@stdlib/assert-is-array/dist/index.d.ts +3 -0
  62. package/node_modules/@stdlib/assert-is-array/dist/index.js +5 -0
  63. package/node_modules/@stdlib/assert-is-array/dist/index.js.map +7 -0
  64. package/node_modules/@stdlib/assert-is-array/docs/types/index.d.ts +40 -0
  65. package/node_modules/@stdlib/assert-is-array/lib/index.js +43 -0
  66. package/node_modules/@stdlib/assert-is-array/lib/main.js +63 -0
  67. package/node_modules/@stdlib/assert-is-array/package.json +72 -0
  68. package/node_modules/@stdlib/assert-is-boolean/LICENSE +177 -0
  69. package/node_modules/@stdlib/assert-is-boolean/NOTICE +1 -0
  70. package/node_modules/@stdlib/assert-is-boolean/README.md +228 -0
  71. package/node_modules/@stdlib/assert-is-boolean/SECURITY.md +5 -0
  72. package/node_modules/@stdlib/assert-is-boolean/dist/index.d.ts +3 -0
  73. package/node_modules/@stdlib/assert-is-boolean/dist/index.js +13 -0
  74. package/node_modules/@stdlib/assert-is-boolean/dist/index.js.map +7 -0
  75. package/node_modules/@stdlib/assert-is-boolean/docs/types/index.d.ts +125 -0
  76. package/node_modules/@stdlib/assert-is-boolean/lib/index.js +73 -0
  77. package/node_modules/@stdlib/assert-is-boolean/lib/main.js +62 -0
  78. package/node_modules/@stdlib/assert-is-boolean/lib/object.js +68 -0
  79. package/node_modules/@stdlib/assert-is-boolean/lib/primitive.js +48 -0
  80. package/node_modules/@stdlib/assert-is-boolean/lib/tostring.js +27 -0
  81. package/node_modules/@stdlib/assert-is-boolean/lib/try2serialize.js +47 -0
  82. package/node_modules/@stdlib/assert-is-boolean/package.json +80 -0
  83. package/node_modules/@stdlib/assert-is-buffer/LICENSE +177 -0
  84. package/node_modules/@stdlib/assert-is-buffer/NOTICE +1 -0
  85. package/node_modules/@stdlib/assert-is-buffer/README.md +223 -0
  86. package/node_modules/@stdlib/assert-is-buffer/SECURITY.md +5 -0
  87. package/node_modules/@stdlib/assert-is-buffer/dist/index.d.ts +3 -0
  88. package/node_modules/@stdlib/assert-is-buffer/dist/index.js +5 -0
  89. package/node_modules/@stdlib/assert-is-buffer/dist/index.js.map +7 -0
  90. package/node_modules/@stdlib/assert-is-buffer/docs/types/index.d.ts +50 -0
  91. package/node_modules/@stdlib/assert-is-buffer/lib/index.js +43 -0
  92. package/node_modules/@stdlib/assert-is-buffer/lib/main.js +70 -0
  93. package/node_modules/@stdlib/assert-is-buffer/package.json +73 -0
  94. package/node_modules/@stdlib/assert-is-function/LICENSE +177 -0
  95. package/node_modules/@stdlib/assert-is-function/NOTICE +1 -0
  96. package/node_modules/@stdlib/assert-is-function/README.md +192 -0
  97. package/node_modules/@stdlib/assert-is-function/SECURITY.md +5 -0
  98. package/node_modules/@stdlib/assert-is-function/dist/index.d.ts +3 -0
  99. package/node_modules/@stdlib/assert-is-function/dist/index.js +5 -0
  100. package/node_modules/@stdlib/assert-is-function/dist/index.js.map +7 -0
  101. package/node_modules/@stdlib/assert-is-function/docs/types/index.d.ts +40 -0
  102. package/node_modules/@stdlib/assert-is-function/lib/index.js +44 -0
  103. package/node_modules/@stdlib/assert-is-function/lib/main.js +50 -0
  104. package/node_modules/@stdlib/assert-is-function/package.json +74 -0
  105. package/node_modules/@stdlib/assert-is-object-like/LICENSE +177 -0
  106. package/node_modules/@stdlib/assert-is-object-like/NOTICE +1 -0
  107. package/node_modules/@stdlib/assert-is-object-like/README.md +264 -0
  108. package/node_modules/@stdlib/assert-is-object-like/SECURITY.md +5 -0
  109. package/node_modules/@stdlib/assert-is-object-like/dist/index.d.ts +3 -0
  110. package/node_modules/@stdlib/assert-is-object-like/dist/index.js +5 -0
  111. package/node_modules/@stdlib/assert-is-object-like/dist/index.js.map +7 -0
  112. package/node_modules/@stdlib/assert-is-object-like/docs/types/index.d.ts +48 -0
  113. package/node_modules/@stdlib/assert-is-object-like/lib/index.js +67 -0
  114. package/node_modules/@stdlib/assert-is-object-like/lib/main.js +49 -0
  115. package/node_modules/@stdlib/assert-is-object-like/package.json +79 -0
  116. package/node_modules/@stdlib/assert-is-string/LICENSE +177 -0
  117. package/node_modules/@stdlib/assert-is-string/NOTICE +1 -0
  118. package/node_modules/@stdlib/assert-is-string/README.md +224 -0
  119. package/node_modules/@stdlib/assert-is-string/SECURITY.md +5 -0
  120. package/node_modules/@stdlib/assert-is-string/dist/index.d.ts +3 -0
  121. package/node_modules/@stdlib/assert-is-string/dist/index.js +13 -0
  122. package/node_modules/@stdlib/assert-is-string/dist/index.js.map +7 -0
  123. package/node_modules/@stdlib/assert-is-string/docs/types/index.d.ts +101 -0
  124. package/node_modules/@stdlib/assert-is-string/lib/index.js +73 -0
  125. package/node_modules/@stdlib/assert-is-string/lib/main.js +50 -0
  126. package/node_modules/@stdlib/assert-is-string/lib/object.js +65 -0
  127. package/node_modules/@stdlib/assert-is-string/lib/primitive.js +42 -0
  128. package/node_modules/@stdlib/assert-is-string/lib/try2valueof.js +47 -0
  129. package/node_modules/@stdlib/assert-is-string/lib/valueof.js +27 -0
  130. package/node_modules/@stdlib/assert-is-string/package.json +80 -0
  131. package/node_modules/@stdlib/assert-tools-array-function/LICENSE +177 -0
  132. package/node_modules/@stdlib/assert-tools-array-function/NOTICE +1 -0
  133. package/node_modules/@stdlib/assert-tools-array-function/README.md +216 -0
  134. package/node_modules/@stdlib/assert-tools-array-function/SECURITY.md +5 -0
  135. package/node_modules/@stdlib/assert-tools-array-function/dist/index.d.ts +3 -0
  136. package/node_modules/@stdlib/assert-tools-array-function/dist/index.js +5 -0
  137. package/node_modules/@stdlib/assert-tools-array-function/dist/index.js.map +7 -0
  138. package/node_modules/@stdlib/assert-tools-array-function/docs/types/index.d.ts +61 -0
  139. package/node_modules/@stdlib/assert-tools-array-function/lib/index.js +49 -0
  140. package/node_modules/@stdlib/assert-tools-array-function/lib/main.js +85 -0
  141. package/node_modules/@stdlib/assert-tools-array-function/package.json +73 -0
  142. package/node_modules/@stdlib/boolean-ctor/LICENSE +177 -0
  143. package/node_modules/@stdlib/boolean-ctor/NOTICE +1 -0
  144. package/node_modules/@stdlib/boolean-ctor/README.md +264 -0
  145. package/node_modules/@stdlib/boolean-ctor/SECURITY.md +5 -0
  146. package/node_modules/@stdlib/boolean-ctor/dist/index.d.ts +3 -0
  147. package/node_modules/@stdlib/boolean-ctor/dist/index.js +5 -0
  148. package/node_modules/@stdlib/boolean-ctor/dist/index.js.map +7 -0
  149. package/node_modules/@stdlib/boolean-ctor/docs/types/index.d.ts +52 -0
  150. package/node_modules/@stdlib/boolean-ctor/lib/index.js +52 -0
  151. package/node_modules/@stdlib/boolean-ctor/lib/main.js +51 -0
  152. package/node_modules/@stdlib/boolean-ctor/package.json +61 -0
  153. package/node_modules/@stdlib/buffer-ctor/LICENSE +177 -0
  154. package/node_modules/@stdlib/buffer-ctor/NOTICE +1 -0
  155. package/node_modules/@stdlib/buffer-ctor/README.md +273 -0
  156. package/node_modules/@stdlib/buffer-ctor/SECURITY.md +5 -0
  157. package/node_modules/@stdlib/buffer-ctor/dist/index.d.ts +3 -0
  158. package/node_modules/@stdlib/buffer-ctor/dist/index.js +19 -0
  159. package/node_modules/@stdlib/buffer-ctor/dist/index.js.map +7 -0
  160. package/node_modules/@stdlib/buffer-ctor/docs/types/index.d.ts +37 -0
  161. package/node_modules/@stdlib/buffer-ctor/lib/index.js +52 -0
  162. package/node_modules/@stdlib/buffer-ctor/lib/main.js +28 -0
  163. package/node_modules/@stdlib/buffer-ctor/lib/polyfill.js +37 -0
  164. package/node_modules/@stdlib/buffer-ctor/package.json +66 -0
  165. package/node_modules/@stdlib/buffer-from-string/LICENSE +177 -0
  166. package/node_modules/@stdlib/buffer-from-string/NOTICE +1 -0
  167. package/node_modules/@stdlib/buffer-from-string/README.md +249 -0
  168. package/node_modules/@stdlib/buffer-from-string/SECURITY.md +5 -0
  169. package/node_modules/@stdlib/buffer-from-string/dist/index.d.ts +3 -0
  170. package/node_modules/@stdlib/buffer-from-string/dist/index.js +19 -0
  171. package/node_modules/@stdlib/buffer-from-string/dist/index.js.map +7 -0
  172. package/node_modules/@stdlib/buffer-from-string/docs/types/index.d.ts +42 -0
  173. package/node_modules/@stdlib/buffer-from-string/lib/has_from.js +34 -0
  174. package/node_modules/@stdlib/buffer-from-string/lib/index.js +52 -0
  175. package/node_modules/@stdlib/buffer-from-string/lib/main.js +60 -0
  176. package/node_modules/@stdlib/buffer-from-string/lib/polyfill.js +60 -0
  177. package/node_modules/@stdlib/buffer-from-string/package.json +74 -0
  178. package/node_modules/@stdlib/error-tools-fmtprodmsg/LICENSE +177 -0
  179. package/node_modules/@stdlib/error-tools-fmtprodmsg/NOTICE +1 -0
  180. package/node_modules/@stdlib/error-tools-fmtprodmsg/README.md +182 -0
  181. package/node_modules/@stdlib/error-tools-fmtprodmsg/SECURITY.md +5 -0
  182. package/node_modules/@stdlib/error-tools-fmtprodmsg/dist/index.d.ts +3 -0
  183. package/node_modules/@stdlib/error-tools-fmtprodmsg/dist/index.js +5 -0
  184. package/node_modules/@stdlib/error-tools-fmtprodmsg/dist/index.js.map +7 -0
  185. package/node_modules/@stdlib/error-tools-fmtprodmsg/docs/types/index.d.ts +39 -0
  186. package/node_modules/@stdlib/error-tools-fmtprodmsg/lib/index.js +40 -0
  187. package/node_modules/@stdlib/error-tools-fmtprodmsg/lib/main.js +48 -0
  188. package/node_modules/@stdlib/error-tools-fmtprodmsg/package.json +71 -0
  189. package/node_modules/@stdlib/regexp-function-name/LICENSE +177 -0
  190. package/node_modules/@stdlib/regexp-function-name/NOTICE +1 -0
  191. package/node_modules/@stdlib/regexp-function-name/README.md +215 -0
  192. package/node_modules/@stdlib/regexp-function-name/SECURITY.md +5 -0
  193. package/node_modules/@stdlib/regexp-function-name/dist/index.d.ts +3 -0
  194. package/node_modules/@stdlib/regexp-function-name/dist/index.js +8 -0
  195. package/node_modules/@stdlib/regexp-function-name/dist/index.js.map +7 -0
  196. package/node_modules/@stdlib/regexp-function-name/docs/types/index.d.ts +74 -0
  197. package/node_modules/@stdlib/regexp-function-name/lib/index.js +61 -0
  198. package/node_modules/@stdlib/regexp-function-name/lib/main.js +54 -0
  199. package/node_modules/@stdlib/regexp-function-name/lib/regexp.js +60 -0
  200. package/node_modules/@stdlib/regexp-function-name/package.json +68 -0
  201. package/node_modules/@stdlib/streams-node-stdin/LICENSE +177 -0
  202. package/node_modules/@stdlib/streams-node-stdin/NOTICE +1 -0
  203. package/node_modules/@stdlib/streams-node-stdin/README.md +227 -0
  204. package/node_modules/@stdlib/streams-node-stdin/SECURITY.md +5 -0
  205. package/node_modules/@stdlib/streams-node-stdin/dist/index.d.ts +3 -0
  206. package/node_modules/@stdlib/streams-node-stdin/dist/index.js +5 -0
  207. package/node_modules/@stdlib/streams-node-stdin/dist/index.js.map +7 -0
  208. package/node_modules/@stdlib/streams-node-stdin/docs/types/index.d.ts +31 -0
  209. package/node_modules/@stdlib/streams-node-stdin/lib/index.js +41 -0
  210. package/node_modules/@stdlib/streams-node-stdin/lib/main.js +28 -0
  211. package/node_modules/@stdlib/streams-node-stdin/package.json +65 -0
  212. package/node_modules/@stdlib/string-base-format-interpolate/LICENSE +177 -0
  213. package/node_modules/@stdlib/string-base-format-interpolate/NOTICE +1 -0
  214. package/node_modules/@stdlib/string-base-format-interpolate/README.md +219 -0
  215. package/node_modules/@stdlib/string-base-format-interpolate/SECURITY.md +5 -0
  216. package/node_modules/@stdlib/string-base-format-interpolate/dist/index.d.ts +3 -0
  217. package/node_modules/@stdlib/string-base-format-interpolate/dist/index.js +17 -0
  218. package/node_modules/@stdlib/string-base-format-interpolate/dist/index.js.map +7 -0
  219. package/node_modules/@stdlib/string-base-format-interpolate/docs/types/index.d.ts +71 -0
  220. package/node_modules/@stdlib/string-base-format-interpolate/lib/format_double.js +103 -0
  221. package/node_modules/@stdlib/string-base-format-interpolate/lib/format_integer.js +115 -0
  222. package/node_modules/@stdlib/string-base-format-interpolate/lib/index.js +41 -0
  223. package/node_modules/@stdlib/string-base-format-interpolate/lib/is_number.js +46 -0
  224. package/node_modules/@stdlib/string-base-format-interpolate/lib/is_string.js +42 -0
  225. package/node_modules/@stdlib/string-base-format-interpolate/lib/main.js +243 -0
  226. package/node_modules/@stdlib/string-base-format-interpolate/lib/space_pad.js +65 -0
  227. package/node_modules/@stdlib/string-base-format-interpolate/lib/zero_pad.js +84 -0
  228. package/node_modules/@stdlib/string-base-format-interpolate/package.json +72 -0
  229. package/node_modules/@stdlib/string-base-format-tokenize/LICENSE +177 -0
  230. package/node_modules/@stdlib/string-base-format-tokenize/NOTICE +1 -0
  231. package/node_modules/@stdlib/string-base-format-tokenize/README.md +203 -0
  232. package/node_modules/@stdlib/string-base-format-tokenize/SECURITY.md +5 -0
  233. package/node_modules/@stdlib/string-base-format-tokenize/dist/index.d.ts +3 -0
  234. package/node_modules/@stdlib/string-base-format-tokenize/dist/index.js +5 -0
  235. package/node_modules/@stdlib/string-base-format-tokenize/dist/index.js.map +7 -0
  236. package/node_modules/@stdlib/string-base-format-tokenize/docs/types/index.d.ts +68 -0
  237. package/node_modules/@stdlib/string-base-format-tokenize/lib/index.js +41 -0
  238. package/node_modules/@stdlib/string-base-format-tokenize/lib/main.js +95 -0
  239. package/node_modules/@stdlib/string-base-format-tokenize/package.json +70 -0
  240. package/node_modules/@stdlib/string-format/LICENSE +177 -0
  241. package/node_modules/@stdlib/string-format/NOTICE +1 -0
  242. package/node_modules/@stdlib/string-format/README.md +341 -0
  243. package/node_modules/@stdlib/string-format/SECURITY.md +5 -0
  244. package/node_modules/@stdlib/string-format/dist/index.d.ts +3 -0
  245. package/node_modules/@stdlib/string-format/dist/index.js +7 -0
  246. package/node_modules/@stdlib/string-format/dist/index.js.map +7 -0
  247. package/node_modules/@stdlib/string-format/docs/types/index.d.ts +42 -0
  248. package/node_modules/@stdlib/string-format/lib/index.js +43 -0
  249. package/node_modules/@stdlib/string-format/lib/is_string.js +42 -0
  250. package/node_modules/@stdlib/string-format/lib/main.js +64 -0
  251. package/node_modules/@stdlib/string-format/package.json +73 -0
  252. package/node_modules/@stdlib/symbol-ctor/LICENSE +177 -0
  253. package/node_modules/@stdlib/symbol-ctor/NOTICE +1 -0
  254. package/node_modules/@stdlib/symbol-ctor/README.md +234 -0
  255. package/node_modules/@stdlib/symbol-ctor/SECURITY.md +5 -0
  256. package/node_modules/@stdlib/symbol-ctor/dist/index.d.ts +3 -0
  257. package/node_modules/@stdlib/symbol-ctor/dist/index.js +5 -0
  258. package/node_modules/@stdlib/symbol-ctor/dist/index.js.map +7 -0
  259. package/node_modules/@stdlib/symbol-ctor/docs/types/index.d.ts +34 -0
  260. package/node_modules/@stdlib/symbol-ctor/lib/index.js +40 -0
  261. package/node_modules/@stdlib/symbol-ctor/lib/main.js +28 -0
  262. package/node_modules/@stdlib/symbol-ctor/package.json +63 -0
  263. package/node_modules/@stdlib/types/LICENSE +177 -0
  264. package/node_modules/@stdlib/types/NOTICE +1 -0
  265. package/node_modules/@stdlib/types/README.md +212 -0
  266. package/node_modules/@stdlib/types/SECURITY.md +5 -0
  267. package/node_modules/@stdlib/types/index.d.ts +3923 -0
  268. package/node_modules/@stdlib/types/lib/browser.js +28 -0
  269. package/node_modules/@stdlib/types/lib/index.js +39 -0
  270. package/node_modules/@stdlib/types/lib/main.js +40 -0
  271. package/node_modules/@stdlib/types/package.json +68 -0
  272. package/node_modules/@stdlib/types/test.ts +734 -0
  273. package/node_modules/@stdlib/utils-constructor-name/LICENSE +177 -0
  274. package/node_modules/@stdlib/utils-constructor-name/NOTICE +1 -0
  275. package/node_modules/@stdlib/utils-constructor-name/README.md +400 -0
  276. package/node_modules/@stdlib/utils-constructor-name/SECURITY.md +5 -0
  277. package/node_modules/@stdlib/utils-constructor-name/dist/index.d.ts +3 -0
  278. package/node_modules/@stdlib/utils-constructor-name/dist/index.js +5 -0
  279. package/node_modules/@stdlib/utils-constructor-name/dist/index.js.map +7 -0
  280. package/node_modules/@stdlib/utils-constructor-name/docs/types/index.d.ts +52 -0
  281. package/node_modules/@stdlib/utils-constructor-name/lib/index.js +46 -0
  282. package/node_modules/@stdlib/utils-constructor-name/lib/main.js +80 -0
  283. package/node_modules/@stdlib/utils-constructor-name/package.json +77 -0
  284. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/LICENSE +177 -0
  285. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/NOTICE +1 -0
  286. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/README.md +216 -0
  287. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/SECURITY.md +5 -0
  288. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/dist/index.d.ts +3 -0
  289. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/dist/index.js +31 -0
  290. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/dist/index.js.map +7 -0
  291. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/dist/main.js +58 -0
  292. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/docs/types/index.d.ts +52 -0
  293. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/lib/index.js +47 -0
  294. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/lib/main.js +58 -0
  295. package/node_modules/@stdlib/utils-define-nonenumerable-read-only-property/package.json +93 -0
  296. package/node_modules/@stdlib/utils-define-property/LICENSE +177 -0
  297. package/node_modules/@stdlib/utils-define-property/NOTICE +1 -0
  298. package/node_modules/@stdlib/utils-define-property/README.md +228 -0
  299. package/node_modules/@stdlib/utils-define-property/SECURITY.md +5 -0
  300. package/node_modules/@stdlib/utils-define-property/dist/index.d.ts +3 -0
  301. package/node_modules/@stdlib/utils-define-property/dist/index.js +36 -0
  302. package/node_modules/@stdlib/utils-define-property/dist/index.js.map +7 -0
  303. package/node_modules/@stdlib/utils-define-property/docs/types/index.d.ts +52 -0
  304. package/node_modules/@stdlib/utils-define-property/lib/builtin.js +61 -0
  305. package/node_modules/@stdlib/utils-define-property/lib/define_property.js +28 -0
  306. package/node_modules/@stdlib/utils-define-property/lib/has_define_property_support.js +51 -0
  307. package/node_modules/@stdlib/utils-define-property/lib/index.js +58 -0
  308. package/node_modules/@stdlib/utils-define-property/lib/polyfill.js +122 -0
  309. package/node_modules/@stdlib/utils-define-property/package.json +75 -0
  310. package/node_modules/@stdlib/utils-global/LICENSE +177 -0
  311. package/node_modules/@stdlib/utils-global/NOTICE +1 -0
  312. package/node_modules/@stdlib/utils-global/README.md +208 -0
  313. package/node_modules/@stdlib/utils-global/SECURITY.md +5 -0
  314. package/node_modules/@stdlib/utils-global/dist/index.d.ts +3 -0
  315. package/node_modules/@stdlib/utils-global/dist/index.js +36 -0
  316. package/node_modules/@stdlib/utils-global/dist/index.js.map +7 -0
  317. package/node_modules/@stdlib/utils-global/docs/types/index.d.ts +40 -0
  318. package/node_modules/@stdlib/utils-global/lib/browser.js +79 -0
  319. package/node_modules/@stdlib/utils-global/lib/codegen.js +36 -0
  320. package/node_modules/@stdlib/utils-global/lib/global.js +28 -0
  321. package/node_modules/@stdlib/utils-global/lib/global_this.js +28 -0
  322. package/node_modules/@stdlib/utils-global/lib/index.js +40 -0
  323. package/node_modules/@stdlib/utils-global/lib/main.js +83 -0
  324. package/node_modules/@stdlib/utils-global/lib/self.js +28 -0
  325. package/node_modules/@stdlib/utils-global/lib/window.js +28 -0
  326. package/node_modules/@stdlib/utils-global/package.json +74 -0
  327. package/node_modules/@stdlib/utils-native-class/LICENSE +177 -0
  328. package/node_modules/@stdlib/utils-native-class/NOTICE +1 -0
  329. package/node_modules/@stdlib/utils-native-class/README.md +349 -0
  330. package/node_modules/@stdlib/utils-native-class/SECURITY.md +5 -0
  331. package/node_modules/@stdlib/utils-native-class/dist/index.d.ts +3 -0
  332. package/node_modules/@stdlib/utils-native-class/dist/index.js +11 -0
  333. package/node_modules/@stdlib/utils-native-class/dist/index.js.map +7 -0
  334. package/node_modules/@stdlib/utils-native-class/docs/types/index.d.ts +51 -0
  335. package/node_modules/@stdlib/utils-native-class/lib/index.js +61 -0
  336. package/node_modules/@stdlib/utils-native-class/lib/main.js +56 -0
  337. package/node_modules/@stdlib/utils-native-class/lib/polyfill.js +81 -0
  338. package/node_modules/@stdlib/utils-native-class/lib/tostring.js +28 -0
  339. package/node_modules/@stdlib/utils-native-class/lib/tostringtag.js +33 -0
  340. package/node_modules/@stdlib/utils-native-class/package.json +84 -0
  341. package/node_modules/@stdlib/utils-next-tick/LICENSE +177 -0
  342. package/node_modules/@stdlib/utils-next-tick/NOTICE +1 -0
  343. package/node_modules/@stdlib/utils-next-tick/README.md +183 -0
  344. package/node_modules/@stdlib/utils-next-tick/SECURITY.md +5 -0
  345. package/node_modules/@stdlib/utils-next-tick/dist/index.d.ts +3 -0
  346. package/node_modules/@stdlib/utils-next-tick/dist/index.js +5 -0
  347. package/node_modules/@stdlib/utils-next-tick/dist/index.js.map +7 -0
  348. package/node_modules/@stdlib/utils-next-tick/docs/types/index.d.ts +43 -0
  349. package/node_modules/@stdlib/utils-next-tick/lib/index.js +43 -0
  350. package/node_modules/@stdlib/utils-next-tick/lib/main.js +72 -0
  351. package/node_modules/@stdlib/utils-next-tick/package.json +77 -0
  352. package/node_modules/@stdlib/utils-type-of/LICENSE +177 -0
  353. package/node_modules/@stdlib/utils-type-of/NOTICE +1 -0
  354. package/node_modules/@stdlib/utils-type-of/README.md +366 -0
  355. package/node_modules/@stdlib/utils-type-of/SECURITY.md +5 -0
  356. package/node_modules/@stdlib/utils-type-of/dist/index.d.ts +3 -0
  357. package/node_modules/@stdlib/utils-type-of/dist/index.js +15 -0
  358. package/node_modules/@stdlib/utils-type-of/dist/index.js.map +7 -0
  359. package/node_modules/@stdlib/utils-type-of/docs/types/index.d.ts +50 -0
  360. package/node_modules/@stdlib/utils-type-of/lib/check.js +55 -0
  361. package/node_modules/@stdlib/utils-type-of/lib/fixtures/nodelist.js +34 -0
  362. package/node_modules/@stdlib/utils-type-of/lib/fixtures/re.js +26 -0
  363. package/node_modules/@stdlib/utils-type-of/lib/fixtures/typedarray.js +26 -0
  364. package/node_modules/@stdlib/utils-type-of/lib/index.js +50 -0
  365. package/node_modules/@stdlib/utils-type-of/lib/main.js +76 -0
  366. package/node_modules/@stdlib/utils-type-of/lib/polyfill.js +41 -0
  367. package/node_modules/@stdlib/utils-type-of/package.json +72 -0
  368. package/package.json +108 -3
@@ -0,0 +1,734 @@
1
+ /*
2
+ * @license Apache-2.0
3
+ *
4
+ * Copyright (c) 2019 The Stdlib Authors.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+
19
+ /// <reference types="@stdlib/types"/>
20
+
21
+ import * as array from '@stdlib/types/array';
22
+ import * as blas from '@stdlib/types/blas';
23
+ import * as complex from '@stdlib/types/complex';
24
+ import * as iter from '@stdlib/types/iter';
25
+ import * as ndarray from '@stdlib/types/ndarray';
26
+ import * as obj from '@stdlib/types/object';
27
+ import * as random from '@stdlib/types/random';
28
+ import * as slice from '@stdlib/types/slice';
29
+
30
+ /**
31
+ * Returns an iterator protocol-compliant object.
32
+ *
33
+ * @returns iterator protocol-compliant object
34
+ */
35
+ function createIterator1(): iter.Iterator {
36
+ return {
37
+ 'next': next1
38
+ };
39
+ }
40
+
41
+ /**
42
+ * Implements the iterator protocol `next` method.
43
+ *
44
+ * @returns iterator protocol-compliant object
45
+ */
46
+ function next1(): iter.IteratorResult {
47
+ return {
48
+ 'value': true,
49
+ 'done': false
50
+ };
51
+ }
52
+
53
+ /**
54
+ * Returns an iterator protocol-compliant object.
55
+ *
56
+ * @returns iterator protocol-compliant object
57
+ */
58
+ function createIterator2(): iter.Iterator {
59
+ return {
60
+ 'next': next2
61
+ };
62
+ }
63
+
64
+ /**
65
+ * Implements the iterator protocol `next` method.
66
+ *
67
+ * @returns iterator protocol-compliant object
68
+ */
69
+ function next2(): iter.IteratorResult {
70
+ return {
71
+ 'done': true
72
+ };
73
+ }
74
+
75
+ /**
76
+ * Returns an iterable iterator protocol-compliant object.
77
+ *
78
+ * @returns iterable iterator protocol-compliant object
79
+ */
80
+ function createIterableIterator(): iter.IterableIterator {
81
+ return {
82
+ 'next': next3,
83
+ [ Symbol.iterator ]: factory
84
+ };
85
+ }
86
+
87
+ /**
88
+ * Implements the iterator protocol `next` method.
89
+ *
90
+ * @returns iterator protocol-compliant object
91
+ */
92
+ function next3(): iter.IteratorResult {
93
+ return {
94
+ 'done': true
95
+ };
96
+ }
97
+
98
+ /**
99
+ * Returns an iterable iterator protocol-compliant object.
100
+ *
101
+ * @returns iterable iterator protocol-compliant object
102
+ */
103
+ function factory(): iter.IterableIterator {
104
+ return createIterableIterator();
105
+ }
106
+
107
+ /**
108
+ * Returns a boolean array-like object.
109
+ *
110
+ * @returns boolean array-like object
111
+ */
112
+ function boolArray(): array.BooleanArrayLike {
113
+ const buf: array.TypedArray = new Uint8Array( 8 );
114
+ const obj: array.BooleanArrayLike = {
115
+ 'byteLength': 8,
116
+ 'byteOffset': 0,
117
+ 'BYTES_PER_ELEMENT': 1,
118
+ 'length': 8,
119
+ 'get': ( i: number ): boolean => {
120
+ return Boolean( buf[ i ] );
121
+ },
122
+ 'set': ( value: boolean, i?: number ) => {
123
+ i = ( i ) ? i : 0;
124
+ buf[ i ] = ( buf[ i ] ) ? 1 : 0;
125
+ }
126
+ };
127
+ return obj;
128
+ }
129
+
130
+ /**
131
+ * Returns a complex number array-like object.
132
+ *
133
+ * @returns complex number array-like object
134
+ */
135
+ function cmplxArray(): array.ComplexArrayLike {
136
+ const buf: array.TypedArray = new Float64Array( 8 );
137
+ const obj: array.ComplexArrayLike = {
138
+ 'byteLength': 64,
139
+ 'byteOffset': 0,
140
+ 'BYTES_PER_ELEMENT': 8,
141
+ 'length': 8,
142
+ 'get': ( i: number ): complex.ComplexLike => {
143
+ return {
144
+ 're': i * 10,
145
+ 'im': i * 10
146
+ };
147
+ },
148
+ 'set': ( value: complex.ComplexLike, i?: number ) => {
149
+ i = ( i ) ? i : 0;
150
+ buf[ i ] = value.re;
151
+ buf[ i + 1 ] = value.im;
152
+ }
153
+ };
154
+ return obj;
155
+ }
156
+
157
+ /**
158
+ * Returns a 64-bit complex number array.
159
+ *
160
+ * @returns 64-bit complex number array
161
+ */
162
+ function cmplx64Array(): array.Complex64Array {
163
+ const buf: array.TypedArray = new Float64Array( 8 );
164
+ const obj: array.Complex64Array = {
165
+ 'byteLength': 64,
166
+ 'byteOffset': 0,
167
+ 'BYTES_PER_ELEMENT': 8,
168
+ 'length': 8,
169
+ 'get': ( i: number ): complex.Complex64 => {
170
+ return {
171
+ 're': i * 10,
172
+ 'im': i * 10,
173
+ 'byteLength': 8,
174
+ 'BYTES_PER_ELEMENT': 4
175
+ };
176
+ },
177
+ 'set': ( value: complex.Complex64, i?: number ) => {
178
+ i = ( i ) ? i : 0;
179
+ buf[ i ] = value.re;
180
+ buf[ i + 1 ] = value.im;
181
+ }
182
+ };
183
+ return obj;
184
+ }
185
+
186
+ /**
187
+ * Returns a 128-bit complex number array.
188
+ *
189
+ * @returns 128-bit complex number array
190
+ */
191
+ function cmplx128Array(): array.Complex128Array {
192
+ const buf: array.TypedArray = new Float64Array( 16 );
193
+ const obj: array.Complex128Array = {
194
+ 'byteLength': 128,
195
+ 'byteOffset': 0,
196
+ 'BYTES_PER_ELEMENT': 16,
197
+ 'length': 8,
198
+ 'get': ( i: number ): complex.Complex128 => {
199
+ return {
200
+ 're': i * 10,
201
+ 'im': i * 10,
202
+ 'byteLength': 16,
203
+ 'BYTES_PER_ELEMENT': 8
204
+ };
205
+ },
206
+ 'set': ( value: complex.Complex128, i?: number ) => {
207
+ i = ( i ) ? i : 0;
208
+ buf[ i ] = value.re;
209
+ buf[ i + 1 ] = value.im;
210
+ }
211
+ };
212
+ return obj;
213
+ }
214
+
215
+
216
+ // TESTS //
217
+
218
+ // The compiler should not throw an error when using array type aliases...
219
+ {
220
+ const v1: array.TypedArray = new Float64Array( 10 );
221
+ if ( v1[ 0 ] !== 0.0 ) {
222
+ throw new Error( 'something went wrong' );
223
+ }
224
+
225
+ const v2: array.IntegerTypedArray = new Int32Array( 10 );
226
+ if ( v2[ 0 ] !== 0 ) {
227
+ throw new Error( 'something went wrong' );
228
+ }
229
+
230
+ const v3: array.NumericArray = new Float64Array( 10 );
231
+ if ( v3[ 0 ] !== 0.0 ) {
232
+ throw new Error( 'something went wrong' );
233
+ }
234
+
235
+ const v4: array.ArrayLike<string> = 'beep';
236
+ if ( v4[ 0 ] !== 'b' ) {
237
+ throw new Error( 'something went wrong' );
238
+ }
239
+
240
+ const v5: array.ArrayLike<number> = [ 1, 2, 3 ];
241
+ if ( v5[ 0 ] !== 1 ) {
242
+ throw new Error( 'something went wrong' );
243
+ }
244
+
245
+ const v6: array.ArrayLike<number> = new Int8Array( 10 );
246
+ if ( v6[ 0 ] !== 1 ) {
247
+ throw new Error( 'something went wrong' );
248
+ }
249
+
250
+ const v7: array.ComplexArrayLike = cmplxArray();
251
+ if ( v7.byteOffset !== 0 ) {
252
+ throw new Error( 'something went wrong' );
253
+ }
254
+
255
+ const v8: array.Complex64Array = cmplx64Array();
256
+ if ( v8.byteOffset !== 0 ) {
257
+ throw new Error( 'something went wrong' );
258
+ }
259
+
260
+ const v9: array.Complex128Array = cmplx128Array();
261
+ if ( v9.byteOffset !== 0 ) {
262
+ throw new Error( 'something went wrong' );
263
+ }
264
+
265
+ const v10: array.ComplexTypedArray = cmplx64Array();
266
+ if ( v10.byteOffset !== 0 ) {
267
+ throw new Error( 'something went wrong' );
268
+ }
269
+
270
+ const v11: array.ArrayOrTypedArray = new Float64Array( 10 );
271
+ if ( v11[ 0 ] !== 0.0 ) {
272
+ throw new Error( 'something went wrong' );
273
+ }
274
+
275
+ const v12: array.FloatTypedArray = new Float64Array( 10 );
276
+ if ( v12[ 0 ] !== 0.0 ) {
277
+ throw new Error( 'something went wrong' );
278
+ }
279
+
280
+ const v13: array.RealOrComplexArray = new Float64Array( 10 );
281
+ if ( v13[ 0 ] !== 0.0 ) {
282
+ throw new Error( 'something went wrong' );
283
+ }
284
+
285
+ const v14: array.RealOrComplexTypedArray = new Float64Array( 10 );
286
+ if ( v14[ 0 ] !== 0.0 ) {
287
+ throw new Error( 'something went wrong' );
288
+ }
289
+
290
+ const v15buf: array.ArrayLike<number> = new Float64Array( 10 );
291
+ const v15: array.AccessorArrayLike<number> = {
292
+ 'length': 10,
293
+ 'data': v15buf,
294
+ 'get': ( i: number ): number => v15buf[ i ],
295
+ 'set': ( value: number, i?: number ): void => {
296
+ v15buf[ i || 0 ] = value;
297
+ return;
298
+ }
299
+ };
300
+ if ( v15.length !== 10 ) {
301
+ throw new Error( 'something went wrong' );
302
+ }
303
+
304
+ const v16: array.IntegerTypedArray = new Int32Array( 10 );
305
+ if ( v16[ 0 ] !== 0 ) {
306
+ throw new Error( 'something went wrong' );
307
+ }
308
+
309
+ const v17: array.SignedIntegerTypedArray = new Int32Array( 10 );
310
+ if ( v17[ 0 ] !== 0 ) {
311
+ throw new Error( 'something went wrong' );
312
+ }
313
+
314
+ const v18: array.UnsignedIntegerTypedArray = new Uint32Array( 10 );
315
+ if ( v18[ 0 ] !== 0 ) {
316
+ throw new Error( 'something went wrong' );
317
+ }
318
+
319
+ const v19: array.AnyArray = new Uint32Array( 10 );
320
+ if ( v19[ 0 ] !== 0 ) {
321
+ throw new Error( 'something went wrong' );
322
+ }
323
+
324
+ const v20: array.RealTypedArray = new Uint32Array( 10 );
325
+ if ( v20[ 0 ] !== 0 ) {
326
+ throw new Error( 'something went wrong' );
327
+ }
328
+
329
+ const v21: array.FloatOrComplexTypedArray = new Float64Array( 10 );
330
+ if ( v21[ 0 ] !== 0.0 ) {
331
+ throw new Error( 'something went wrong' );
332
+ }
333
+
334
+ const v22: array.Array1D<number> = [ 1, 2, 3 ];
335
+ if ( v22.length === 0 ) {
336
+ throw new Error( 'something went wrong' );
337
+ }
338
+
339
+ const v23: array.Array2D<number> = [ [ 1, 2, 3 ] ];
340
+ if ( v23.length === 0 ) {
341
+ throw new Error( 'something went wrong' );
342
+ }
343
+
344
+ const v24: array.Array3D<number> = [ [ [ 1, 2, 3 ] ] ];
345
+ if ( v24.length === 0 ) {
346
+ throw new Error( 'something went wrong' );
347
+ }
348
+
349
+ const v25: array.Array4D<number> = [ [ [ [ 1, 2, 3 ] ] ] ];
350
+ if ( v25.length === 0 ) {
351
+ throw new Error( 'something went wrong' );
352
+ }
353
+
354
+ const v26: array.Array5D<number> = [ [ [ [ [ 1, 2, 3 ] ] ] ] ];
355
+ if ( v26.length === 0 ) {
356
+ throw new Error( 'something went wrong' );
357
+ }
358
+
359
+ const v27: array.Array6D<number> = [ [ [ [ [ [ 1, 2, 3 ] ] ] ] ] ];
360
+ if ( v27.length === 0 ) {
361
+ throw new Error( 'something went wrong' );
362
+ }
363
+
364
+ const v28: array.Array7D<number> = [ [ [ [ [ [ [ 1, 2, 3 ] ] ] ] ] ] ];
365
+ if ( v28.length === 0 ) {
366
+ throw new Error( 'something went wrong' );
367
+ }
368
+
369
+ const v29: array.Array8D<number> = [ [ [ [ [ [ [ [ 1, 2, 3 ] ] ] ] ] ] ] ];
370
+ if ( v29.length === 0 ) {
371
+ throw new Error( 'something went wrong' );
372
+ }
373
+
374
+ const v30: array.Array9D<number> = [ [ [ [ [ [ [ [ [ 1, 2, 3 ] ] ] ] ] ] ] ] ];
375
+ if ( v30.length === 0 ) {
376
+ throw new Error( 'something went wrong' );
377
+ }
378
+
379
+ const v31: array.Array10D<number> = [ [ [ [ [ [ [ [ [ [ 1, 2, 3 ] ] ] ] ] ] ] ] ] ];
380
+ if ( v31.length === 0 ) {
381
+ throw new Error( 'something went wrong' );
382
+ }
383
+
384
+ const v32: array.Collection<number> = [ 1, 2, 3 ];
385
+ if ( v32.length !== 3 ) {
386
+ throw new Error( 'something went wrong' );
387
+ }
388
+
389
+ const v33: array.BooleanArrayLike = boolArray();
390
+ if ( v33.byteOffset !== 0 ) {
391
+ throw new Error( 'something went wrong' );
392
+ }
393
+ }
394
+
395
+ // The compiler should not throw an error when using BLAS types...
396
+ {
397
+ const v1: blas.Layout = 'row-major';
398
+ if ( typeof v1 !== 'string' ) {
399
+ throw new Error( 'something went wrong' );
400
+ }
401
+
402
+ const v2: blas.TransposeOperation = 'transpose';
403
+ if ( typeof v2 !== 'string' ) {
404
+ throw new Error( 'something went wrong' );
405
+ }
406
+
407
+ const v3: blas.MatrixTriangle = 'upper';
408
+ if ( typeof v3 !== 'string' ) {
409
+ throw new Error( 'something went wrong' );
410
+ }
411
+
412
+ const v4: blas.DiagonalType = 'unit';
413
+ if ( typeof v4 !== 'string' ) {
414
+ throw new Error( 'something went wrong' );
415
+ }
416
+
417
+ const v5: blas.OperationSide = 'right';
418
+ if ( typeof v5 !== 'string' ) {
419
+ throw new Error( 'something went wrong' );
420
+ }
421
+ }
422
+
423
+ // The compiler should not throw an error when using complex number types...
424
+ {
425
+ const v1: complex.ComplexLike = {
426
+ 're': 1.0,
427
+ 'im': 1.0
428
+ };
429
+ if ( v1.re !== 1.0 ) {
430
+ throw new Error( 'something went wrong' );
431
+ }
432
+
433
+ const v2: complex.Complex64 = {
434
+ 're': 1.0,
435
+ 'im': 1.0,
436
+ 'byteLength': 8,
437
+ 'BYTES_PER_ELEMENT': 4
438
+ };
439
+ if ( v2.re !== 1.0 ) {
440
+ throw new Error( 'something went wrong' );
441
+ }
442
+
443
+ const v3: complex.Complex128 = {
444
+ 're': 1.0,
445
+ 'im': 1.0,
446
+ 'byteLength': 16,
447
+ 'BYTES_PER_ELEMENT': 8
448
+ };
449
+ if ( v3.re !== 1.0 ) {
450
+ throw new Error( 'something went wrong' );
451
+ }
452
+ }
453
+
454
+ // The compiler should not throw an error when using iterator or iterable types...
455
+ {
456
+ createIterator1();
457
+ createIterator2();
458
+ createIterableIterator();
459
+ }
460
+
461
+ // The compiler should not throw an error when using ndarray types...
462
+ {
463
+ const data = [ 1, 2, 3 ];
464
+ const arr: ndarray.ndarray = {
465
+ 'byteLength': null,
466
+ 'BYTES_PER_ELEMENT': null,
467
+ 'data': data,
468
+ 'dtype': 'generic',
469
+ 'flags': {
470
+ 'ROW_MAJOR_CONTIGUOUS': true,
471
+ 'COLUMN_MAJOR_CONTIGUOUS': false
472
+ },
473
+ 'length': 3,
474
+ 'ndims': 1,
475
+ 'offset': 0,
476
+ 'order': 'row-major',
477
+ 'shape': [ 3 ],
478
+ 'strides': [ 1 ],
479
+ 'get': ( i: number ): number => {
480
+ return data[ i ];
481
+ },
482
+ 'set': ( i: number, v: number ): ndarray.ndarray => {
483
+ data[ i ] = v;
484
+ return arr;
485
+ }
486
+ };
487
+ if ( arr.length !== 3 ) {
488
+ throw new Error( 'something went wrong' );
489
+ }
490
+ }
491
+
492
+ // The compiler should not throw an error when using object types...
493
+ {
494
+ const desc1: obj.DataPropertyDescriptor = {
495
+ 'configurable': true,
496
+ 'enumerable': false,
497
+ 'writable': false,
498
+ 'value': 'beep'
499
+ };
500
+ if ( desc1.value !== 'beep' ) {
501
+ throw new Error( 'something went wrong' );
502
+ }
503
+
504
+ const desc2: obj.DataPropertyDescriptor = {
505
+ 'enumerable': false,
506
+ 'writable': false,
507
+ 'value': 'beep'
508
+ };
509
+ if ( desc2.value !== 'beep' ) {
510
+ throw new Error( 'something went wrong' );
511
+ }
512
+
513
+ const desc3: obj.DataPropertyDescriptor = {
514
+ 'configurable': true,
515
+ 'writable': false,
516
+ 'value': 'beep'
517
+ };
518
+ if ( desc3.value !== 'beep' ) {
519
+ throw new Error( 'something went wrong' );
520
+ }
521
+
522
+ const desc4: obj.DataPropertyDescriptor = {
523
+ 'configurable': true,
524
+ 'enumerable': false,
525
+ 'writable': false
526
+ };
527
+ if ( desc4.value ) {
528
+ throw new Error( 'something went wrong' );
529
+ }
530
+
531
+ const desc5: obj.DataPropertyDescriptor = {
532
+ 'writable': false,
533
+ 'value': 'beep'
534
+ };
535
+ if ( desc5.value !== 'beep' ) {
536
+ throw new Error( 'something went wrong' );
537
+ }
538
+
539
+ const desc6: obj.DataPropertyDescriptor = {
540
+ 'configurable': true,
541
+ 'value': 'beep'
542
+ };
543
+ if ( desc6.value !== 'beep' ) {
544
+ throw new Error( 'something went wrong' );
545
+ }
546
+
547
+ const desc7: obj.DataPropertyDescriptor = {
548
+ 'enumerable': false,
549
+ 'value': 'beep'
550
+ };
551
+ if ( desc7.value !== 'beep' ) {
552
+ throw new Error( 'something went wrong' );
553
+ }
554
+
555
+ const desc8: obj.DataPropertyDescriptor = {
556
+ 'enumerable': false,
557
+ 'writable': false
558
+ };
559
+ if ( desc8.value ) {
560
+ throw new Error( 'something went wrong' );
561
+ }
562
+
563
+ const desc9: obj.AccessorPropertyDescriptor = {
564
+ 'configurable': true,
565
+ 'enumerable': false,
566
+ 'get': (): string => 'beep',
567
+ 'set': () => { throw new Error( 'beep' ); }
568
+ };
569
+ if ( desc9.enumerable !== false ) {
570
+ throw new Error( 'something went wrong' );
571
+ }
572
+
573
+ const desc10: obj.AccessorPropertyDescriptor = {
574
+ 'enumerable': false,
575
+ 'get': (): string => 'beep',
576
+ 'set': () => { throw new Error( 'beep' ); }
577
+ };
578
+ if ( desc10.enumerable !== false ) {
579
+ throw new Error( 'something went wrong' );
580
+ }
581
+
582
+ const desc11: obj.AccessorPropertyDescriptor = {
583
+ 'configurable': true,
584
+ 'get': (): string => 'beep',
585
+ 'set': () => { throw new Error( 'beep' ); }
586
+ };
587
+ if ( desc11.enumerable !== false ) {
588
+ throw new Error( 'something went wrong' );
589
+ }
590
+
591
+ const desc12: obj.AccessorPropertyDescriptor = {
592
+ 'configurable': true,
593
+ 'enumerable': false,
594
+ 'set': () => { throw new Error( 'beep' ); }
595
+ };
596
+ if ( desc12.enumerable !== false ) {
597
+ throw new Error( 'something went wrong' );
598
+ }
599
+
600
+ const desc13: obj.AccessorPropertyDescriptor = {
601
+ 'configurable': true,
602
+ 'enumerable': false,
603
+ 'get': (): string => 'beep'
604
+ };
605
+ if ( desc13.enumerable !== false ) {
606
+ throw new Error( 'something went wrong' );
607
+ }
608
+
609
+ const desc14: obj.AccessorPropertyDescriptor = {
610
+ 'get': (): string => 'beep',
611
+ 'set': () => { throw new Error( 'beep' ); }
612
+ };
613
+ if ( desc14.enumerable !== false ) {
614
+ throw new Error( 'something went wrong' );
615
+ }
616
+
617
+ const desc15: obj.PropertyDescriptor = {
618
+ 'configurable': true,
619
+ 'enumerable': false,
620
+ 'writable': false,
621
+ 'value': 'beep'
622
+ };
623
+ if ( desc15.value !== 'beep' ) {
624
+ throw new Error( 'something went wrong' );
625
+ }
626
+
627
+ const prop: obj.PropertyName = 'foo';
628
+ if ( prop !== 'foo' ) {
629
+ throw new Error( 'something went wrong' );
630
+ }
631
+ }
632
+
633
+ // The compiler should not throw an error when using PRNG types...
634
+ {
635
+ const rand: random.PRNG = (): number => 3.14;
636
+ if ( rand() !== 3.14 ) {
637
+ throw new Error( 'something went wrong' );
638
+ }
639
+
640
+ const s1: random.PRNGSeedMT19937 = 12345;
641
+ if ( s1 !== 12345 ) {
642
+ throw new Error( 'something went wrong' );
643
+ }
644
+
645
+ const s2: random.PRNGSeedMT19937 = new Uint32Array( 10 );
646
+ if ( s2[ 0 ] !== 0 ) {
647
+ throw new Error( 'something went wrong' );
648
+ }
649
+
650
+ const s3: random.PRNGSeedMINSTD = 12345;
651
+ if ( s3 !== 12345 ) {
652
+ throw new Error( 'something went wrong' );
653
+ }
654
+
655
+ const s4: random.PRNGSeedMINSTD = new Int32Array( 10 );
656
+ if ( s4[ 0 ] !== 0 ) {
657
+ throw new Error( 'something went wrong' );
658
+ }
659
+
660
+ const s5: random.PRNGStateMT19937 = new Uint32Array( 10 );
661
+ if ( s5[ 0 ] !== 0 ) {
662
+ throw new Error( 'something went wrong' );
663
+ }
664
+
665
+ const s6: random.PRNGStateMINSTD = new Int32Array( 10 );
666
+ if ( s6[ 0 ] !== 0 ) {
667
+ throw new Error( 'something went wrong' );
668
+ }
669
+ }
670
+
671
+ // The compiler should not throw an error when using slice types...
672
+ {
673
+ const v1: slice.Slice = {
674
+ 'start': 0,
675
+ 'stop': 10,
676
+ 'step': 1
677
+ };
678
+ if ( v1.start !== v1.start ) {
679
+ throw new Error( 'something went wrong' );
680
+ }
681
+
682
+ const v2: slice.Slice = {
683
+ 'start': null,
684
+ 'stop': null,
685
+ 'step': null
686
+ };
687
+ if ( v2.start !== v2.start ) {
688
+ throw new Error( 'something went wrong' );
689
+ }
690
+
691
+ const v3: slice.Slice = {
692
+ 'start': null,
693
+ 'stop': 10,
694
+ 'step': null
695
+ };
696
+ if ( v3.start !== v3.start ) {
697
+ throw new Error( 'something went wrong' );
698
+ }
699
+
700
+ const v4: slice.Slice = {
701
+ 'start': 0,
702
+ 'stop': 10,
703
+ 'step': null
704
+ };
705
+ if ( v4.start !== v4.start ) {
706
+ throw new Error( 'something went wrong' );
707
+ }
708
+
709
+ const v5: slice.Slice = {
710
+ 'start': 0,
711
+ 'stop': null,
712
+ 'step': null
713
+ };
714
+ if ( v5.start !== v5.start ) {
715
+ throw new Error( 'something went wrong' );
716
+ }
717
+
718
+ const v6: slice.Slice = {
719
+ 'start': 0,
720
+ 'stop': null,
721
+ 'step': 1
722
+ };
723
+ if ( v6.start !== v6.start ) {
724
+ throw new Error( 'something went wrong' );
725
+ }
726
+
727
+ const v7: slice.MultiSlice = {
728
+ 'ndims': 3,
729
+ 'data': [ 1, null, 3 ]
730
+ };
731
+ if ( v7.ndims !== v7.ndims ) {
732
+ throw new Error( 'something went wrong' );
733
+ }
734
+ }