skill-universe 1.1.0

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 (334) hide show
  1. package/README.md +24 -0
  2. package/bin/skillc.mjs +3 -0
  3. package/build/dev/javascript/argv/_gleam_artefacts/argv.cache +0 -0
  4. package/build/dev/javascript/argv/_gleam_artefacts/argv.cache_inline +0 -0
  5. package/build/dev/javascript/argv/_gleam_artefacts/argv.cache_meta +0 -0
  6. package/build/dev/javascript/argv/argv.erl +12 -0
  7. package/build/dev/javascript/argv/argv.mjs +31 -0
  8. package/build/dev/javascript/argv/argv_ffi.erl +27 -0
  9. package/build/dev/javascript/argv/argv_ffi.mjs +20 -0
  10. package/build/dev/javascript/argv/gleam.mjs +1 -0
  11. package/build/dev/javascript/filepath/_gleam_artefacts/filepath.cache +0 -0
  12. package/build/dev/javascript/filepath/_gleam_artefacts/filepath.cache_inline +0 -0
  13. package/build/dev/javascript/filepath/_gleam_artefacts/filepath.cache_meta +0 -0
  14. package/build/dev/javascript/filepath/filepath.erl +425 -0
  15. package/build/dev/javascript/filepath/filepath.mjs +529 -0
  16. package/build/dev/javascript/filepath/filepath_ffi.erl +9 -0
  17. package/build/dev/javascript/filepath/filepath_ffi.mjs +6 -0
  18. package/build/dev/javascript/filepath/gleam.mjs +1 -0
  19. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache +0 -0
  20. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache_inline +0 -0
  21. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bit_array.cache_meta +0 -0
  22. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache +0 -0
  23. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_inline +0 -0
  24. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bool.cache_meta +0 -0
  25. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache +0 -0
  26. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache_inline +0 -0
  27. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@bytes_tree.cache_meta +0 -0
  28. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dict.cache +0 -0
  29. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dict.cache_inline +0 -0
  30. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dict.cache_meta +0 -0
  31. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache +0 -0
  32. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_inline +0 -0
  33. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic.cache_meta +0 -0
  34. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache +0 -0
  35. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache_inline +0 -0
  36. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@dynamic@decode.cache_meta +0 -0
  37. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache +0 -0
  38. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache_inline +0 -0
  39. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@float.cache_meta +0 -0
  40. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache +0 -0
  41. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache_inline +0 -0
  42. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@function.cache_meta +0 -0
  43. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache +0 -0
  44. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache_inline +0 -0
  45. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@int.cache_meta +0 -0
  46. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache +0 -0
  47. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache_inline +0 -0
  48. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@io.cache_meta +0 -0
  49. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache +0 -0
  50. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache_inline +0 -0
  51. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@list.cache_meta +0 -0
  52. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache +0 -0
  53. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache_inline +0 -0
  54. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@option.cache_meta +0 -0
  55. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache +0 -0
  56. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache_inline +0 -0
  57. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@order.cache_meta +0 -0
  58. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache +0 -0
  59. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_inline +0 -0
  60. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@pair.cache_meta +0 -0
  61. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache +0 -0
  62. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache_inline +0 -0
  63. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@result.cache_meta +0 -0
  64. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache +0 -0
  65. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache_inline +0 -0
  66. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@set.cache_meta +0 -0
  67. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache +0 -0
  68. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache_inline +0 -0
  69. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string.cache_meta +0 -0
  70. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache +0 -0
  71. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache_inline +0 -0
  72. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@string_tree.cache_meta +0 -0
  73. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache +0 -0
  74. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_inline +0 -0
  75. package/build/dev/javascript/gleam_stdlib/_gleam_artefacts/gleam@uri.cache_meta +0 -0
  76. package/build/dev/javascript/gleam_stdlib/dict.mjs +710 -0
  77. package/build/dev/javascript/gleam_stdlib/gleam/bit_array.mjs +285 -0
  78. package/build/dev/javascript/gleam_stdlib/gleam/bool.mjs +313 -0
  79. package/build/dev/javascript/gleam_stdlib/gleam/bytes_tree.mjs +225 -0
  80. package/build/dev/javascript/gleam_stdlib/gleam/dict.mjs +456 -0
  81. package/build/dev/javascript/gleam_stdlib/gleam/dynamic/decode.mjs +985 -0
  82. package/build/dev/javascript/gleam_stdlib/gleam/dynamic.mjs +35 -0
  83. package/build/dev/javascript/gleam_stdlib/gleam/float.mjs +572 -0
  84. package/build/dev/javascript/gleam_stdlib/gleam/function.mjs +6 -0
  85. package/build/dev/javascript/gleam_stdlib/gleam/int.mjs +832 -0
  86. package/build/dev/javascript/gleam_stdlib/gleam/io.mjs +8 -0
  87. package/build/dev/javascript/gleam_stdlib/gleam/list.mjs +3160 -0
  88. package/build/dev/javascript/gleam_stdlib/gleam/option.mjs +418 -0
  89. package/build/dev/javascript/gleam_stdlib/gleam/order.mjs +178 -0
  90. package/build/dev/javascript/gleam_stdlib/gleam/pair.mjs +102 -0
  91. package/build/dev/javascript/gleam_stdlib/gleam/result.mjs +480 -0
  92. package/build/dev/javascript/gleam_stdlib/gleam/set.mjs +416 -0
  93. package/build/dev/javascript/gleam_stdlib/gleam/string.mjs +723 -0
  94. package/build/dev/javascript/gleam_stdlib/gleam/string_tree.mjs +133 -0
  95. package/build/dev/javascript/gleam_stdlib/gleam/uri.mjs +1155 -0
  96. package/build/dev/javascript/gleam_stdlib/gleam.mjs +1 -0
  97. package/build/dev/javascript/gleam_stdlib/gleam@bit_array.erl +347 -0
  98. package/build/dev/javascript/gleam_stdlib/gleam@bool.erl +352 -0
  99. package/build/dev/javascript/gleam_stdlib/gleam@bytes_tree.erl +211 -0
  100. package/build/dev/javascript/gleam_stdlib/gleam@dict.erl +521 -0
  101. package/build/dev/javascript/gleam_stdlib/gleam@dynamic.erl +106 -0
  102. package/build/dev/javascript/gleam_stdlib/gleam@dynamic@decode.erl +1112 -0
  103. package/build/dev/javascript/gleam_stdlib/gleam@float.erl +764 -0
  104. package/build/dev/javascript/gleam_stdlib/gleam@function.erl +18 -0
  105. package/build/dev/javascript/gleam_stdlib/gleam@int.erl +1004 -0
  106. package/build/dev/javascript/gleam_stdlib/gleam@io.erl +80 -0
  107. package/build/dev/javascript/gleam_stdlib/gleam@list.erl +2832 -0
  108. package/build/dev/javascript/gleam_stdlib/gleam@option.erl +413 -0
  109. package/build/dev/javascript/gleam_stdlib/gleam@order.erl +200 -0
  110. package/build/dev/javascript/gleam_stdlib/gleam@pair.erl +110 -0
  111. package/build/dev/javascript/gleam_stdlib/gleam@result.erl +532 -0
  112. package/build/dev/javascript/gleam_stdlib/gleam@set.erl +433 -0
  113. package/build/dev/javascript/gleam_stdlib/gleam@string.erl +1012 -0
  114. package/build/dev/javascript/gleam_stdlib/gleam@string_tree.erl +207 -0
  115. package/build/dev/javascript/gleam_stdlib/gleam@uri.erl +1049 -0
  116. package/build/dev/javascript/gleam_stdlib/gleam_stdlib.erl +529 -0
  117. package/build/dev/javascript/gleam_stdlib/gleam_stdlib.mjs +1050 -0
  118. package/build/dev/javascript/gleam_version +1 -0
  119. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit.cache +0 -0
  120. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit.cache_inline +0 -0
  121. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit.cache_meta +0 -0
  122. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@gleam_panic.cache +0 -0
  123. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@gleam_panic.cache_inline +0 -0
  124. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@gleam_panic.cache_meta +0 -0
  125. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@reporting.cache +0 -0
  126. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@reporting.cache_inline +0 -0
  127. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@internal@reporting.cache_meta +0 -0
  128. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@should.cache +0 -0
  129. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@should.cache_inline +0 -0
  130. package/build/dev/javascript/gleeunit/_gleam_artefacts/gleeunit@should.cache_meta +0 -0
  131. package/build/dev/javascript/gleeunit/gleam.mjs +1 -0
  132. package/build/dev/javascript/gleeunit/gleeunit/internal/gleam_panic.mjs +180 -0
  133. package/build/dev/javascript/gleeunit/gleeunit/internal/gleeunit_gleam_panic_ffi.erl +49 -0
  134. package/build/dev/javascript/gleeunit/gleeunit/internal/gleeunit_gleam_panic_ffi.mjs +91 -0
  135. package/build/dev/javascript/gleeunit/gleeunit/internal/reporting.mjs +256 -0
  136. package/build/dev/javascript/gleeunit/gleeunit/should.mjs +135 -0
  137. package/build/dev/javascript/gleeunit/gleeunit.erl +89 -0
  138. package/build/dev/javascript/gleeunit/gleeunit.mjs +62 -0
  139. package/build/dev/javascript/gleeunit/gleeunit@internal@gleam_panic.erl +56 -0
  140. package/build/dev/javascript/gleeunit/gleeunit@internal@reporting.erl +343 -0
  141. package/build/dev/javascript/gleeunit/gleeunit@should.erl +153 -0
  142. package/build/dev/javascript/gleeunit/gleeunit_ffi.erl +21 -0
  143. package/build/dev/javascript/gleeunit/gleeunit_ffi.mjs +100 -0
  144. package/build/dev/javascript/gleeunit/gleeunit_progress.erl +72 -0
  145. package/build/dev/javascript/prelude.mjs +1575 -0
  146. package/build/dev/javascript/simplifile/_gleam_artefacts/simplifile.cache +0 -0
  147. package/build/dev/javascript/simplifile/_gleam_artefacts/simplifile.cache_inline +0 -0
  148. package/build/dev/javascript/simplifile/_gleam_artefacts/simplifile.cache_meta +0 -0
  149. package/build/dev/javascript/simplifile/gleam.mjs +1 -0
  150. package/build/dev/javascript/simplifile/simplifile.erl +893 -0
  151. package/build/dev/javascript/simplifile/simplifile.mjs +893 -0
  152. package/build/dev/javascript/simplifile/simplifile_erl.erl +244 -0
  153. package/build/dev/javascript/simplifile/simplifile_js.mjs +400 -0
  154. package/build/dev/javascript/skillc/_gleam_artefacts/cli_test.cache +0 -0
  155. package/build/dev/javascript/skillc/_gleam_artefacts/cli_test.cache_inline +0 -0
  156. package/build/dev/javascript/skillc/_gleam_artefacts/cli_test.cache_meta +0 -0
  157. package/build/dev/javascript/skillc/_gleam_artefacts/cli_test.cache_warnings +0 -0
  158. package/build/dev/javascript/skillc/_gleam_artefacts/compiler_test.cache +0 -0
  159. package/build/dev/javascript/skillc/_gleam_artefacts/compiler_test.cache_inline +0 -0
  160. package/build/dev/javascript/skillc/_gleam_artefacts/compiler_test.cache_meta +0 -0
  161. package/build/dev/javascript/skillc/_gleam_artefacts/compiler_test.cache_warnings +0 -0
  162. package/build/dev/javascript/skillc/_gleam_artefacts/config_test.cache +0 -0
  163. package/build/dev/javascript/skillc/_gleam_artefacts/config_test.cache_inline +0 -0
  164. package/build/dev/javascript/skillc/_gleam_artefacts/config_test.cache_meta +0 -0
  165. package/build/dev/javascript/skillc/_gleam_artefacts/config_test.cache_warnings +0 -0
  166. package/build/dev/javascript/skillc/_gleam_artefacts/importer_test.cache +0 -0
  167. package/build/dev/javascript/skillc/_gleam_artefacts/importer_test.cache_inline +0 -0
  168. package/build/dev/javascript/skillc/_gleam_artefacts/importer_test.cache_meta +0 -0
  169. package/build/dev/javascript/skillc/_gleam_artefacts/importer_test.cache_warnings +0 -0
  170. package/build/dev/javascript/skillc/_gleam_artefacts/parser_test.cache +0 -0
  171. package/build/dev/javascript/skillc/_gleam_artefacts/parser_test.cache_inline +0 -0
  172. package/build/dev/javascript/skillc/_gleam_artefacts/parser_test.cache_meta +0 -0
  173. package/build/dev/javascript/skillc/_gleam_artefacts/parser_test.cache_warnings +0 -0
  174. package/build/dev/javascript/skillc/_gleam_artefacts/path_test.cache +0 -0
  175. package/build/dev/javascript/skillc/_gleam_artefacts/path_test.cache_inline +0 -0
  176. package/build/dev/javascript/skillc/_gleam_artefacts/path_test.cache_meta +0 -0
  177. package/build/dev/javascript/skillc/_gleam_artefacts/path_test.cache_warnings +0 -0
  178. package/build/dev/javascript/skillc/_gleam_artefacts/provider_test.cache +0 -0
  179. package/build/dev/javascript/skillc/_gleam_artefacts/provider_test.cache_inline +0 -0
  180. package/build/dev/javascript/skillc/_gleam_artefacts/provider_test.cache_meta +0 -0
  181. package/build/dev/javascript/skillc/_gleam_artefacts/provider_test.cache_warnings +0 -0
  182. package/build/dev/javascript/skillc/_gleam_artefacts/registry_test.cache +0 -0
  183. package/build/dev/javascript/skillc/_gleam_artefacts/registry_test.cache_inline +0 -0
  184. package/build/dev/javascript/skillc/_gleam_artefacts/registry_test.cache_meta +0 -0
  185. package/build/dev/javascript/skillc/_gleam_artefacts/registry_test.cache_warnings +0 -0
  186. package/build/dev/javascript/skillc/_gleam_artefacts/scaffold_test.cache +0 -0
  187. package/build/dev/javascript/skillc/_gleam_artefacts/scaffold_test.cache_inline +0 -0
  188. package/build/dev/javascript/skillc/_gleam_artefacts/scaffold_test.cache_meta +0 -0
  189. package/build/dev/javascript/skillc/_gleam_artefacts/scaffold_test.cache_warnings +0 -0
  190. package/build/dev/javascript/skillc/_gleam_artefacts/skillc.cache +0 -0
  191. package/build/dev/javascript/skillc/_gleam_artefacts/skillc.cache_inline +0 -0
  192. package/build/dev/javascript/skillc/_gleam_artefacts/skillc.cache_meta +0 -0
  193. package/build/dev/javascript/skillc/_gleam_artefacts/skillc.cache_warnings +0 -0
  194. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@compiler.cache +0 -0
  195. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@compiler.cache_inline +0 -0
  196. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@compiler.cache_meta +0 -0
  197. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@compiler.cache_warnings +0 -0
  198. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@config.cache +0 -0
  199. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@config.cache_inline +0 -0
  200. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@config.cache_meta +0 -0
  201. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@config.cache_warnings +0 -0
  202. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@error.cache +0 -0
  203. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@error.cache_inline +0 -0
  204. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@error.cache_meta +0 -0
  205. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@error.cache_warnings +0 -0
  206. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@fs.cache +0 -0
  207. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@fs.cache_inline +0 -0
  208. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@fs.cache_meta +0 -0
  209. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@fs.cache_warnings +0 -0
  210. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@importer.cache +0 -0
  211. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@importer.cache_inline +0 -0
  212. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@importer.cache_meta +0 -0
  213. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@importer.cache_warnings +0 -0
  214. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@parser.cache +0 -0
  215. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@parser.cache_inline +0 -0
  216. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@parser.cache_meta +0 -0
  217. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@parser.cache_warnings +0 -0
  218. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@path.cache +0 -0
  219. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@path.cache_inline +0 -0
  220. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@path.cache_meta +0 -0
  221. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@path.cache_warnings +0 -0
  222. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@platform.cache +0 -0
  223. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@platform.cache_inline +0 -0
  224. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@platform.cache_meta +0 -0
  225. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@platform.cache_warnings +0 -0
  226. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@provider.cache +0 -0
  227. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@provider.cache_inline +0 -0
  228. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@provider.cache_meta +0 -0
  229. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@provider.cache_warnings +0 -0
  230. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@registry.cache +0 -0
  231. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@registry.cache_inline +0 -0
  232. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@registry.cache_meta +0 -0
  233. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@registry.cache_warnings +0 -0
  234. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@scaffold.cache +0 -0
  235. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@scaffold.cache_inline +0 -0
  236. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@scaffold.cache_meta +0 -0
  237. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@scaffold.cache_warnings +0 -0
  238. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@semver.cache +0 -0
  239. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@semver.cache_inline +0 -0
  240. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@semver.cache_meta +0 -0
  241. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@semver.cache_warnings +0 -0
  242. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@shell.cache +0 -0
  243. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@shell.cache_inline +0 -0
  244. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@shell.cache_meta +0 -0
  245. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@shell.cache_warnings +0 -0
  246. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@template.cache +0 -0
  247. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@template.cache_inline +0 -0
  248. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@template.cache_meta +0 -0
  249. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@template.cache_warnings +0 -0
  250. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@types.cache +0 -0
  251. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@types.cache_inline +0 -0
  252. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@types.cache_meta +0 -0
  253. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@types.cache_warnings +0 -0
  254. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@version_constraint.cache +0 -0
  255. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@version_constraint.cache_inline +0 -0
  256. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@version_constraint.cache_meta +0 -0
  257. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@version_constraint.cache_warnings +0 -0
  258. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@yaml.cache +0 -0
  259. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@yaml.cache_inline +0 -0
  260. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@yaml.cache_meta +0 -0
  261. package/build/dev/javascript/skillc/_gleam_artefacts/skillc@yaml.cache_warnings +0 -0
  262. package/build/dev/javascript/skillc/_gleam_artefacts/skillc_test.cache +0 -0
  263. package/build/dev/javascript/skillc/_gleam_artefacts/skillc_test.cache_inline +0 -0
  264. package/build/dev/javascript/skillc/_gleam_artefacts/skillc_test.cache_meta +0 -0
  265. package/build/dev/javascript/skillc/_gleam_artefacts/skillc_test.cache_warnings +0 -0
  266. package/build/dev/javascript/skillc/_gleam_artefacts/template_test.cache +0 -0
  267. package/build/dev/javascript/skillc/_gleam_artefacts/template_test.cache_inline +0 -0
  268. package/build/dev/javascript/skillc/_gleam_artefacts/template_test.cache_meta +0 -0
  269. package/build/dev/javascript/skillc/_gleam_artefacts/template_test.cache_warnings +0 -0
  270. package/build/dev/javascript/skillc/_gleam_artefacts/version_constraint_test.cache +0 -0
  271. package/build/dev/javascript/skillc/_gleam_artefacts/version_constraint_test.cache_inline +0 -0
  272. package/build/dev/javascript/skillc/_gleam_artefacts/version_constraint_test.cache_meta +0 -0
  273. package/build/dev/javascript/skillc/_gleam_artefacts/version_constraint_test.cache_warnings +0 -0
  274. package/build/dev/javascript/skillc/cli_test.mjs +461 -0
  275. package/build/dev/javascript/skillc/compiler_test.mjs +3089 -0
  276. package/build/dev/javascript/skillc/config_test.mjs +308 -0
  277. package/build/dev/javascript/skillc/gleam.main.mjs +2 -0
  278. package/build/dev/javascript/skillc/gleam.mjs +1 -0
  279. package/build/dev/javascript/skillc/importer_test.mjs +1643 -0
  280. package/build/dev/javascript/skillc/parser_test.mjs +1601 -0
  281. package/build/dev/javascript/skillc/path_test.mjs +26 -0
  282. package/build/dev/javascript/skillc/provider_test.mjs +221 -0
  283. package/build/dev/javascript/skillc/registry_test.mjs +359 -0
  284. package/build/dev/javascript/skillc/scaffold_test.mjs +405 -0
  285. package/build/dev/javascript/skillc/skillc/compiler.mjs +724 -0
  286. package/build/dev/javascript/skillc/skillc/config.mjs +172 -0
  287. package/build/dev/javascript/skillc/skillc/error.mjs +145 -0
  288. package/build/dev/javascript/skillc/skillc/fs.mjs +40 -0
  289. package/build/dev/javascript/skillc/skillc/importer.mjs +975 -0
  290. package/build/dev/javascript/skillc/skillc/parser.mjs +427 -0
  291. package/build/dev/javascript/skillc/skillc/path.mjs +52 -0
  292. package/build/dev/javascript/skillc/skillc/platform.mjs +44 -0
  293. package/build/dev/javascript/skillc/skillc/provider.mjs +86 -0
  294. package/build/dev/javascript/skillc/skillc/registry.mjs +701 -0
  295. package/build/dev/javascript/skillc/skillc/scaffold.mjs +117 -0
  296. package/build/dev/javascript/skillc/skillc/semver.mjs +293 -0
  297. package/build/dev/javascript/skillc/skillc/shell.mjs +14 -0
  298. package/build/dev/javascript/skillc/skillc/template.mjs +1177 -0
  299. package/build/dev/javascript/skillc/skillc/types.mjs +249 -0
  300. package/build/dev/javascript/skillc/skillc/version_constraint.mjs +290 -0
  301. package/build/dev/javascript/skillc/skillc/yaml.mjs +51 -0
  302. package/build/dev/javascript/skillc/skillc.mjs +873 -0
  303. package/build/dev/javascript/skillc/skillc_ffi.mjs +30 -0
  304. package/build/dev/javascript/skillc/skillc_test.mjs +5 -0
  305. package/build/dev/javascript/skillc/template_test.mjs +1638 -0
  306. package/build/dev/javascript/skillc/version_constraint_test.mjs +1325 -0
  307. package/build/dev/javascript/yay/_gleam_artefacts/yay.cache +0 -0
  308. package/build/dev/javascript/yay/_gleam_artefacts/yay.cache_inline +0 -0
  309. package/build/dev/javascript/yay/_gleam_artefacts/yay.cache_meta +0 -0
  310. package/build/dev/javascript/yay/gleam.mjs +1 -0
  311. package/build/dev/javascript/yay/yaml_ffi.erl +106 -0
  312. package/build/dev/javascript/yay/yaml_ffi.mjs +373 -0
  313. package/build/dev/javascript/yay/yay.erl +1218 -0
  314. package/build/dev/javascript/yay/yay.mjs +1403 -0
  315. package/package.json +28 -0
  316. package/src/skillc/compiler.gleam +561 -0
  317. package/src/skillc/config.gleam +91 -0
  318. package/src/skillc/error.gleam +37 -0
  319. package/src/skillc/fs.gleam +31 -0
  320. package/src/skillc/importer.gleam +709 -0
  321. package/src/skillc/parser.gleam +279 -0
  322. package/src/skillc/path.gleam +30 -0
  323. package/src/skillc/platform.gleam +25 -0
  324. package/src/skillc/provider.gleam +58 -0
  325. package/src/skillc/registry.gleam +472 -0
  326. package/src/skillc/scaffold.gleam +112 -0
  327. package/src/skillc/semver.gleam +165 -0
  328. package/src/skillc/shell.gleam +12 -0
  329. package/src/skillc/template.gleam +885 -0
  330. package/src/skillc/types.gleam +93 -0
  331. package/src/skillc/version_constraint.gleam +163 -0
  332. package/src/skillc/yaml.gleam +27 -0
  333. package/src/skillc.gleam +466 -0
  334. package/src/skillc_ffi.mjs +30 -0
@@ -0,0 +1,723 @@
1
+ import {
2
+ Ok,
3
+ Error,
4
+ Empty as $Empty,
5
+ prepend as listPrepend,
6
+ CustomType as $CustomType,
7
+ remainderInt,
8
+ divideInt,
9
+ } from "../gleam.mjs";
10
+ import * as $list from "../gleam/list.mjs";
11
+ import * as $option from "../gleam/option.mjs";
12
+ import { None, Some } from "../gleam/option.mjs";
13
+ import * as $order from "../gleam/order.mjs";
14
+ import * as $string_tree from "../gleam/string_tree.mjs";
15
+ import {
16
+ string_length as length,
17
+ lowercase,
18
+ uppercase,
19
+ less_than,
20
+ string_grapheme_slice as grapheme_slice,
21
+ string_byte_slice as unsafe_byte_slice,
22
+ crop_string as crop,
23
+ contains_string as contains,
24
+ starts_with,
25
+ ends_with,
26
+ split_once,
27
+ trim_start,
28
+ trim_end,
29
+ pop_grapheme,
30
+ graphemes as to_graphemes,
31
+ codepoint as unsafe_int_to_utf_codepoint,
32
+ string_to_codepoint_integer_list,
33
+ utf_codepoint_list_to_string as from_utf_codepoints,
34
+ utf_codepoint_to_int,
35
+ inspect as do_inspect,
36
+ byte_size,
37
+ } from "../gleam_stdlib.mjs";
38
+
39
+ export {
40
+ byte_size,
41
+ contains,
42
+ crop,
43
+ ends_with,
44
+ from_utf_codepoints,
45
+ length,
46
+ lowercase,
47
+ pop_grapheme,
48
+ split_once,
49
+ starts_with,
50
+ to_graphemes,
51
+ trim_end,
52
+ trim_start,
53
+ uppercase,
54
+ utf_codepoint_to_int,
55
+ };
56
+
57
+ class Leading extends $CustomType {}
58
+
59
+ class Trailing extends $CustomType {}
60
+
61
+ /**
62
+ * Determines if a `String` is empty.
63
+ *
64
+ * ## Examples
65
+ *
66
+ * ```gleam
67
+ * is_empty("")
68
+ * // -> True
69
+ * ```
70
+ *
71
+ * ```gleam
72
+ * is_empty("the world")
73
+ * // -> False
74
+ * ```
75
+ */
76
+ export function is_empty(str) {
77
+ return str === "";
78
+ }
79
+
80
+ /**
81
+ * Reverses a `String`.
82
+ *
83
+ * This function has to iterate across the whole `String` so it runs in linear
84
+ * time. Avoid using this in a loop.
85
+ *
86
+ * ## Examples
87
+ *
88
+ * ```gleam
89
+ * reverse("stressed")
90
+ * // -> "desserts"
91
+ * ```
92
+ */
93
+ export function reverse(string) {
94
+ let _pipe = string;
95
+ let _pipe$1 = $string_tree.from_string(_pipe);
96
+ let _pipe$2 = $string_tree.reverse(_pipe$1);
97
+ return $string_tree.to_string(_pipe$2);
98
+ }
99
+
100
+ /**
101
+ * Creates a new `String` by replacing all occurrences of a given substring.
102
+ *
103
+ * ## Examples
104
+ *
105
+ * ```gleam
106
+ * replace("www.example.com", each: ".", with: "-")
107
+ * // -> "www-example-com"
108
+ * ```
109
+ *
110
+ * ```gleam
111
+ * replace("a,b,c,d,e", each: ",", with: "/")
112
+ * // -> "a/b/c/d/e"
113
+ * ```
114
+ */
115
+ export function replace(string, pattern, substitute) {
116
+ let _pipe = string;
117
+ let _pipe$1 = $string_tree.from_string(_pipe);
118
+ let _pipe$2 = $string_tree.replace(_pipe$1, pattern, substitute);
119
+ return $string_tree.to_string(_pipe$2);
120
+ }
121
+
122
+ /**
123
+ * Compares two `String`s to see which is "larger" by comparing their graphemes.
124
+ *
125
+ * This does not compare the size or length of the given `String`s.
126
+ *
127
+ * ## Examples
128
+ *
129
+ * ```gleam
130
+ * compare("Anthony", "Anthony")
131
+ * // -> order.Eq
132
+ * ```
133
+ *
134
+ * ```gleam
135
+ * compare("A", "B")
136
+ * // -> order.Lt
137
+ * ```
138
+ */
139
+ export function compare(a, b) {
140
+ let $ = a === b;
141
+ if ($) {
142
+ return new $order.Eq();
143
+ } else {
144
+ let $1 = less_than(a, b);
145
+ if ($1) {
146
+ return new $order.Lt();
147
+ } else {
148
+ return new $order.Gt();
149
+ }
150
+ }
151
+ }
152
+
153
+ /**
154
+ * Takes a substring given a start grapheme index and a length. Negative indexes
155
+ * are taken starting from the *end* of the string.
156
+ *
157
+ * This function runs in linear time with the size of the index and the
158
+ * length. Negative indexes are linear with the size of the input string in
159
+ * addition to the other costs.
160
+ *
161
+ * ## Examples
162
+ *
163
+ * ```gleam
164
+ * slice(from: "gleam", at_index: 1, length: 2)
165
+ * // -> "le"
166
+ * ```
167
+ *
168
+ * ```gleam
169
+ * slice(from: "gleam", at_index: 1, length: 10)
170
+ * // -> "leam"
171
+ * ```
172
+ *
173
+ * ```gleam
174
+ * slice(from: "gleam", at_index: 10, length: 3)
175
+ * // -> ""
176
+ * ```
177
+ *
178
+ * ```gleam
179
+ * slice(from: "gleam", at_index: -2, length: 2)
180
+ * // -> "am"
181
+ * ```
182
+ *
183
+ * ```gleam
184
+ * slice(from: "gleam", at_index: -12, length: 2)
185
+ * // -> ""
186
+ * ```
187
+ */
188
+ export function slice(string, idx, len) {
189
+ let $ = len <= 0;
190
+ if ($) {
191
+ return "";
192
+ } else {
193
+ let $1 = idx < 0;
194
+ if ($1) {
195
+ let translated_idx = length(string) + idx;
196
+ let $2 = translated_idx < 0;
197
+ if ($2) {
198
+ return "";
199
+ } else {
200
+ return grapheme_slice(string, translated_idx, len);
201
+ }
202
+ } else {
203
+ return grapheme_slice(string, idx, len);
204
+ }
205
+ }
206
+ }
207
+
208
+ /**
209
+ * Drops *n* graphemes from the end of a `String`.
210
+ *
211
+ * This function traverses the full string, so it runs in linear time with the
212
+ * size of the string. Avoid using this in a loop.
213
+ *
214
+ * ## Examples
215
+ *
216
+ * ```gleam
217
+ * drop_end(from: "Cigarette Smoking Man", up_to: 2)
218
+ * // -> "Cigarette Smoking M"
219
+ * ```
220
+ */
221
+ export function drop_end(string, num_graphemes) {
222
+ let $ = num_graphemes <= 0;
223
+ if ($) {
224
+ return string;
225
+ } else {
226
+ return slice(string, 0, length(string) - num_graphemes);
227
+ }
228
+ }
229
+
230
+ /**
231
+ * Creates a new `String` by joining two `String`s together.
232
+ *
233
+ * This function typically copies both `String`s and runs in linear time, but
234
+ * the exact behaviour will depend on how the runtime you are using optimises
235
+ * your code. Benchmark and profile your code if you need to understand its
236
+ * performance better.
237
+ *
238
+ * If you are joining together large string and want to avoid copying any data
239
+ * you may want to investigate using the [`string_tree`](../gleam/string_tree.html)
240
+ * module.
241
+ *
242
+ * ## Examples
243
+ *
244
+ * ```gleam
245
+ * append(to: "butter", suffix: "fly")
246
+ * // -> "butterfly"
247
+ * ```
248
+ */
249
+ export function append(first, second) {
250
+ return first + second;
251
+ }
252
+
253
+ function concat_loop(loop$strings, loop$accumulator) {
254
+ while (true) {
255
+ let strings = loop$strings;
256
+ let accumulator = loop$accumulator;
257
+ if (strings instanceof $Empty) {
258
+ return accumulator;
259
+ } else {
260
+ let string = strings.head;
261
+ let strings$1 = strings.tail;
262
+ loop$strings = strings$1;
263
+ loop$accumulator = accumulator + string;
264
+ }
265
+ }
266
+ }
267
+
268
+ /**
269
+ * Creates a new `String` by joining many `String`s together.
270
+ *
271
+ * This function copies all the `String`s and runs in linear time.
272
+ *
273
+ * ## Examples
274
+ *
275
+ * ```gleam
276
+ * concat(["never", "the", "less"])
277
+ * // -> "nevertheless"
278
+ * ```
279
+ */
280
+ export function concat(strings) {
281
+ return concat_loop(strings, "");
282
+ }
283
+
284
+ function repeat_loop(loop$times, loop$doubling_acc, loop$acc) {
285
+ while (true) {
286
+ let times = loop$times;
287
+ let doubling_acc = loop$doubling_acc;
288
+ let acc = loop$acc;
289
+ let _block;
290
+ let $ = times % 2;
291
+ if ($ === 0) {
292
+ _block = acc;
293
+ } else {
294
+ _block = acc + doubling_acc;
295
+ }
296
+ let acc$1 = _block;
297
+ let times$1 = globalThis.Math.trunc(times / 2);
298
+ let $1 = times$1 <= 0;
299
+ if ($1) {
300
+ return acc$1;
301
+ } else {
302
+ loop$times = times$1;
303
+ loop$doubling_acc = doubling_acc + doubling_acc;
304
+ loop$acc = acc$1;
305
+ }
306
+ }
307
+ }
308
+
309
+ /**
310
+ * Creates a new `String` by repeating a `String` a given number of times.
311
+ *
312
+ * This function runs in loglinear time.
313
+ *
314
+ * ## Examples
315
+ *
316
+ * ```gleam
317
+ * repeat("ha", times: 3)
318
+ * // -> "hahaha"
319
+ * ```
320
+ */
321
+ export function repeat(string, times) {
322
+ let $ = times <= 0;
323
+ if ($) {
324
+ return "";
325
+ } else {
326
+ return repeat_loop(times, string, "");
327
+ }
328
+ }
329
+
330
+ function join_loop(loop$strings, loop$separator, loop$accumulator) {
331
+ while (true) {
332
+ let strings = loop$strings;
333
+ let separator = loop$separator;
334
+ let accumulator = loop$accumulator;
335
+ if (strings instanceof $Empty) {
336
+ return accumulator;
337
+ } else {
338
+ let string = strings.head;
339
+ let strings$1 = strings.tail;
340
+ loop$strings = strings$1;
341
+ loop$separator = separator;
342
+ loop$accumulator = (accumulator + separator) + string;
343
+ }
344
+ }
345
+ }
346
+
347
+ /**
348
+ * Joins many `String`s together with a given separator.
349
+ *
350
+ * This function runs in linear time.
351
+ *
352
+ * ## Examples
353
+ *
354
+ * ```gleam
355
+ * join(["home","evan","Desktop"], with: "/")
356
+ * // -> "home/evan/Desktop"
357
+ * ```
358
+ */
359
+ export function join(strings, separator) {
360
+ if (strings instanceof $Empty) {
361
+ return "";
362
+ } else {
363
+ let first$1 = strings.head;
364
+ let rest = strings.tail;
365
+ return join_loop(rest, separator, first$1);
366
+ }
367
+ }
368
+
369
+ function padding(size, pad_string) {
370
+ let pad_string_length = length(pad_string);
371
+ let num_pads = divideInt(size, pad_string_length);
372
+ let extra = remainderInt(size, pad_string_length);
373
+ return repeat(pad_string, num_pads) + slice(pad_string, 0, extra);
374
+ }
375
+
376
+ /**
377
+ * Pads the start of a `String` until it has a given length.
378
+ *
379
+ * ## Examples
380
+ *
381
+ * ```gleam
382
+ * pad_start("121", to: 5, with: ".")
383
+ * // -> "..121"
384
+ * ```
385
+ *
386
+ * ```gleam
387
+ * pad_start("121", to: 3, with: ".")
388
+ * // -> "121"
389
+ * ```
390
+ *
391
+ * ```gleam
392
+ * pad_start("121", to: 2, with: ".")
393
+ * // -> "121"
394
+ * ```
395
+ */
396
+ export function pad_start(string, desired_length, pad_string) {
397
+ let current_length = length(string);
398
+ let to_pad_length = desired_length - current_length;
399
+ let $ = to_pad_length <= 0;
400
+ if ($) {
401
+ return string;
402
+ } else {
403
+ return padding(to_pad_length, pad_string) + string;
404
+ }
405
+ }
406
+
407
+ /**
408
+ * Pads the end of a `String` until it has a given length.
409
+ *
410
+ * ## Examples
411
+ *
412
+ * ```gleam
413
+ * pad_end("123", to: 5, with: ".")
414
+ * // -> "123.."
415
+ * ```
416
+ *
417
+ * ```gleam
418
+ * pad_end("123", to: 3, with: ".")
419
+ * // -> "123"
420
+ * ```
421
+ *
422
+ * ```gleam
423
+ * pad_end("123", to: 2, with: ".")
424
+ * // -> "123"
425
+ * ```
426
+ */
427
+ export function pad_end(string, desired_length, pad_string) {
428
+ let current_length = length(string);
429
+ let to_pad_length = desired_length - current_length;
430
+ let $ = to_pad_length <= 0;
431
+ if ($) {
432
+ return string;
433
+ } else {
434
+ return string + padding(to_pad_length, pad_string);
435
+ }
436
+ }
437
+
438
+ /**
439
+ * Removes whitespace on both sides of a `String`.
440
+ *
441
+ * Whitespace in this function is the set of nonbreakable whitespace
442
+ * codepoints, defined as Pattern_White_Space in [Unicode Standard Annex #31][1].
443
+ *
444
+ * [1]: https://unicode.org/reports/tr31/
445
+ *
446
+ * ## Examples
447
+ *
448
+ * ```gleam
449
+ * trim(" hats \n")
450
+ * // -> "hats"
451
+ * ```
452
+ */
453
+ export function trim(string) {
454
+ let _pipe = string;
455
+ let _pipe$1 = trim_start(_pipe);
456
+ return trim_end(_pipe$1);
457
+ }
458
+
459
+ function to_graphemes_loop(loop$string, loop$acc) {
460
+ while (true) {
461
+ let string = loop$string;
462
+ let acc = loop$acc;
463
+ let $ = pop_grapheme(string);
464
+ if ($ instanceof Ok) {
465
+ let grapheme = $[0][0];
466
+ let rest = $[0][1];
467
+ loop$string = rest;
468
+ loop$acc = listPrepend(grapheme, acc);
469
+ } else {
470
+ return acc;
471
+ }
472
+ }
473
+ }
474
+
475
+ /**
476
+ * Creates a list of `String`s by splitting a given string on a given substring.
477
+ *
478
+ * ## Examples
479
+ *
480
+ * ```gleam
481
+ * split("home/gleam/desktop/", on: "/")
482
+ * // -> ["home", "gleam", "desktop", ""]
483
+ * ```
484
+ */
485
+ export function split(x, substring) {
486
+ if (substring === "") {
487
+ return to_graphemes(x);
488
+ } else {
489
+ let _pipe = x;
490
+ let _pipe$1 = $string_tree.from_string(_pipe);
491
+ let _pipe$2 = $string_tree.split(_pipe$1, substring);
492
+ return $list.map(_pipe$2, $string_tree.to_string);
493
+ }
494
+ }
495
+
496
+ function do_to_utf_codepoints(string) {
497
+ let _pipe = string;
498
+ let _pipe$1 = string_to_codepoint_integer_list(_pipe);
499
+ return $list.map(_pipe$1, unsafe_int_to_utf_codepoint);
500
+ }
501
+
502
+ /**
503
+ * Converts a `String` to a `List` of `UtfCodepoint`.
504
+ *
505
+ * See <https://en.wikipedia.org/wiki/Code_point> and
506
+ * <https://en.wikipedia.org/wiki/Unicode#Codespace_and_Code_Points> for an
507
+ * explanation on code points.
508
+ *
509
+ * ## Examples
510
+ *
511
+ * ```gleam
512
+ * "a" |> to_utf_codepoints
513
+ * // -> [UtfCodepoint(97)]
514
+ * ```
515
+ *
516
+ * ```gleam
517
+ * // Semantically the same as:
518
+ * // ["🏳", "️", "‍", "🌈"] or:
519
+ * // [waving_white_flag, variant_selector_16, zero_width_joiner, rainbow]
520
+ * "🏳️‍🌈" |> to_utf_codepoints
521
+ * // -> [
522
+ * // UtfCodepoint(127987),
523
+ * // UtfCodepoint(65039),
524
+ * // UtfCodepoint(8205),
525
+ * // UtfCodepoint(127752),
526
+ * // ]
527
+ * ```
528
+ */
529
+ export function to_utf_codepoints(string) {
530
+ return do_to_utf_codepoints(string);
531
+ }
532
+
533
+ /**
534
+ * Converts an integer to a `UtfCodepoint`.
535
+ *
536
+ * Returns an `Error` if the integer does not represent a valid UTF codepoint.
537
+ */
538
+ export function utf_codepoint(value) {
539
+ let i = value;
540
+ if (i > 1_114_111) {
541
+ return new Error(undefined);
542
+ } else {
543
+ let i = value;
544
+ if ((i >= 55_296) && (i <= 57_343)) {
545
+ return new Error(undefined);
546
+ } else {
547
+ let i = value;
548
+ if (i < 0) {
549
+ return new Error(undefined);
550
+ } else {
551
+ let i = value;
552
+ return new Ok(unsafe_int_to_utf_codepoint(i));
553
+ }
554
+ }
555
+ }
556
+ }
557
+
558
+ /**
559
+ * Converts a `String` into `Option(String)` where an empty `String` becomes
560
+ * `None`.
561
+ *
562
+ * ## Examples
563
+ *
564
+ * ```gleam
565
+ * to_option("")
566
+ * // -> None
567
+ * ```
568
+ *
569
+ * ```gleam
570
+ * to_option("hats")
571
+ * // -> Some("hats")
572
+ * ```
573
+ */
574
+ export function to_option(string) {
575
+ if (string === "") {
576
+ return new None();
577
+ } else {
578
+ return new Some(string);
579
+ }
580
+ }
581
+
582
+ /**
583
+ * Returns the first grapheme cluster in a given `String` and wraps it in a
584
+ * `Result(String, Nil)`. If the `String` is empty, it returns `Error(Nil)`.
585
+ * Otherwise, it returns `Ok(String)`.
586
+ *
587
+ * ## Examples
588
+ *
589
+ * ```gleam
590
+ * first("")
591
+ * // -> Error(Nil)
592
+ * ```
593
+ *
594
+ * ```gleam
595
+ * first("icecream")
596
+ * // -> Ok("i")
597
+ * ```
598
+ */
599
+ export function first(string) {
600
+ let $ = pop_grapheme(string);
601
+ if ($ instanceof Ok) {
602
+ let first$1 = $[0][0];
603
+ return new Ok(first$1);
604
+ } else {
605
+ return $;
606
+ }
607
+ }
608
+
609
+ /**
610
+ * Returns the last grapheme cluster in a given `String` and wraps it in a
611
+ * `Result(String, Nil)`. If the `String` is empty, it returns `Error(Nil)`.
612
+ * Otherwise, it returns `Ok(String)`.
613
+ *
614
+ * This function traverses the full string, so it runs in linear time with the
615
+ * length of the string. Avoid using this in a loop.
616
+ *
617
+ * ## Examples
618
+ *
619
+ * ```gleam
620
+ * last("")
621
+ * // -> Error(Nil)
622
+ * ```
623
+ *
624
+ * ```gleam
625
+ * last("icecream")
626
+ * // -> Ok("m")
627
+ * ```
628
+ */
629
+ export function last(string) {
630
+ let $ = pop_grapheme(string);
631
+ if ($ instanceof Ok) {
632
+ let $1 = $[0][1];
633
+ if ($1 === "") {
634
+ let first$1 = $[0][0];
635
+ return new Ok(first$1);
636
+ } else {
637
+ let rest = $1;
638
+ return new Ok(slice(rest, -1, 1));
639
+ }
640
+ } else {
641
+ return $;
642
+ }
643
+ }
644
+
645
+ /**
646
+ * Creates a new `String` with the first grapheme in the input `String`
647
+ * converted to uppercase and the remaining graphemes to lowercase.
648
+ *
649
+ * ## Examples
650
+ *
651
+ * ```gleam
652
+ * capitalise("mamouna")
653
+ * // -> "Mamouna"
654
+ * ```
655
+ */
656
+ export function capitalise(string) {
657
+ let $ = pop_grapheme(string);
658
+ if ($ instanceof Ok) {
659
+ let first$1 = $[0][0];
660
+ let rest = $[0][1];
661
+ return append(uppercase(first$1), lowercase(rest));
662
+ } else {
663
+ return "";
664
+ }
665
+ }
666
+
667
+ /**
668
+ * Returns a `String` representation of a term in Gleam syntax.
669
+ *
670
+ * This may be occasionally useful for quick-and-dirty printing of values in
671
+ * scripts. For error reporting and other uses prefer constructing strings by
672
+ * pattern matching on the values.
673
+ *
674
+ * ## Limitations
675
+ *
676
+ * The output format of this function is not stable and could change at any
677
+ * time. The output is not suitable for parsing.
678
+ *
679
+ * This function works using runtime reflection, so the output may not be
680
+ * perfectly accurate for data structures where the runtime structure doesn't
681
+ * hold enough information to determine the original syntax. For example,
682
+ * tuples with an Erlang atom in the first position will be mistaken for Gleam
683
+ * records.
684
+ *
685
+ * ## Security and safety
686
+ *
687
+ * There is no limit to how large the strings that this function can produce.
688
+ * Be careful not to call this function with large data structures or you
689
+ * could use very large amounts of memory, potentially causing runtime
690
+ * problems.
691
+ */
692
+ export function inspect(term) {
693
+ let _pipe = term;
694
+ let _pipe$1 = do_inspect(_pipe);
695
+ return $string_tree.to_string(_pipe$1);
696
+ }
697
+
698
+ /**
699
+ * Drops *n* graphemes from the start of a `String`.
700
+ *
701
+ * This function runs in linear time with the number of graphemes to drop.
702
+ *
703
+ * ## Examples
704
+ *
705
+ * ```gleam
706
+ * drop_start(from: "The Lone Gunmen", up_to: 2)
707
+ * // -> "e Lone Gunmen"
708
+ * ```
709
+ */
710
+ export function drop_start(string, num_graphemes) {
711
+ let $ = num_graphemes <= 0;
712
+ if ($) {
713
+ return string;
714
+ } else {
715
+ let prefix = grapheme_slice(string, 0, num_graphemes);
716
+ let prefix_size = byte_size(prefix);
717
+ return unsafe_byte_slice(
718
+ string,
719
+ prefix_size,
720
+ byte_size(string) - prefix_size,
721
+ );
722
+ }
723
+ }