ctx-core 5.1.0 → 5.2.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 (208) hide show
  1. package/all/CACHE_VERSION/index.d.ts +10 -0
  2. package/all/CACHE_VERSION/index.js +14 -0
  3. package/all/NODE_ENV/index.d.ts +10 -0
  4. package/all/NODE_ENV/index.js +14 -0
  5. package/all/Request/index.js +2 -1
  6. package/all/Response/index.js +1 -1
  7. package/all/VERSION/index.d.ts +7 -0
  8. package/all/VERSION/index.js +12 -0
  9. package/all/add/index.js +1 -1
  10. package/all/all_union_a/index.js +1 -1
  11. package/all/and/index.js +2 -1
  12. package/all/andand_or/index.js +2 -1
  13. package/all/andandfn/index.js +4 -3
  14. package/all/apply/index.js +4 -2
  15. package/all/arg_a__pick/index.d.ts +6 -0
  16. package/all/arg_a__pick/index.js +16 -0
  17. package/all/arg_i0_a/index.js +3 -2
  18. package/all/assign_fn_key_a/index.js +1 -1
  19. package/all/bad_gateway/index.js +2 -1
  20. package/all/bad_request/index.js +1 -1
  21. package/all/be/index.js +3 -2
  22. package/all/be_/index.d.ts +38 -3
  23. package/all/be_/index.js +52 -14
  24. package/all/be_/index.test.ts +191 -90
  25. package/all/be_lock_memosig_triple/index.test.ts +6 -6
  26. package/all/be_memo_pair/index.test.ts +4 -4
  27. package/all/be_memosig_triple/index.test.ts +6 -6
  28. package/all/be_sig_triple/index.test.ts +4 -4
  29. package/all/binary_sort_rank/index.js +2 -1
  30. package/all/bind_apply/index.js +4 -4
  31. package/all/bind_call/index.js +1 -1
  32. package/all/bind_map_apply/index.js +1 -1
  33. package/all/bind_map_call/index.js +4 -5
  34. package/all/btoa/index.js +2 -1
  35. package/all/btoa_Uint32Array/index.js +2 -1
  36. package/all/call/index.js +2 -1
  37. package/all/call_assign/index.js +2 -1
  38. package/all/chain/index.js +3 -2
  39. package/all/clone_assign_fn_key_a/index.js +2 -1
  40. package/all/color_hsv_phi_rgb_a/index.js +3 -2
  41. package/all/color_invert_rgb_a/index.js +3 -2
  42. package/all/compact_a_ctx/index.js +2 -1
  43. package/all/compare/index.js +2 -1
  44. package/all/compose/index.js +5 -5
  45. package/all/concat_truthy_a/index.js +4 -2
  46. package/all/console__error/index.js +2 -1
  47. package/all/crypto__sign/index.js +2 -1
  48. package/all/currency_str/index.js +2 -1
  49. package/all/currency_symbol/index.js +2 -1
  50. package/all/curry/index.js +2 -2
  51. package/all/date/index.js +1 -1
  52. package/all/default_arg_a/index.d.ts +11 -0
  53. package/all/default_arg_a/index.js +41 -0
  54. package/all/dfn_flag_r/index.d.ts +8 -0
  55. package/all/dfn_flag_r/index.js +24 -0
  56. package/all/difference_a/index.js +4 -2
  57. package/all/each/index.js +2 -1
  58. package/all/ensure__refresh/index.js +3 -2
  59. package/all/eq/index.js +5 -3
  60. package/all/eql_fn_a/index.js +1 -1
  61. package/all/error__print/index.js +4 -2
  62. package/all/error_o/index.js +4 -2
  63. package/all/falsy__none/index.js +2 -1
  64. package/all/fetch/index.js +2 -1
  65. package/all/fetch__template_pair/index.js +2 -1
  66. package/all/fetch_method/index.js +2 -1
  67. package/all/fetch_response_pair/index.js +4 -2
  68. package/all/filter/index.js +2 -1
  69. package/all/filter_o/index.js +3 -2
  70. package/all/find/index.js +1 -1
  71. package/all/flag_a/index.d.ts +6 -0
  72. package/all/flag_a/index.js +13 -0
  73. package/all/flag_r/index.d.ts +8 -0
  74. package/all/flag_r/index.js +34 -0
  75. package/all/flag_r__pick/index.d.ts +11 -0
  76. package/all/flag_r__pick/index.js +31 -0
  77. package/all/flag_r_arg_a/index.d.ts +9 -0
  78. package/all/flag_r_arg_a/index.js +27 -0
  79. package/all/flag_r_param_name/index.d.ts +9 -0
  80. package/all/flag_r_param_name/index.js +24 -0
  81. package/all/flag_regex/index.d.ts +1 -0
  82. package/all/flag_regex/index.js +1 -0
  83. package/all/flatten/index.js +7 -7
  84. package/all/flip/index.js +3 -2
  85. package/all/head_arg_a/index.js +3 -2
  86. package/all/headers/index.js +1 -1
  87. package/all/hex__digest/index.js +2 -1
  88. package/all/hmac/index.js +2 -1
  89. package/all/hmac_key/index.js +2 -1
  90. package/all/html/index.d.ts +0 -1
  91. package/all/html/index.js +0 -4
  92. package/all/html_attr/index.d.ts +0 -2
  93. package/all/html_attr/index.js +0 -2
  94. package/all/html_attrs/index.d.ts +0 -1
  95. package/all/html_attrs/index.js +0 -1
  96. package/all/html_class/index.d.ts +0 -2
  97. package/all/html_class/index.js +0 -2
  98. package/all/html_dataset__data_attrs/index.d.ts +0 -1
  99. package/all/html_dataset__data_attrs/index.js +0 -1
  100. package/all/html_style/index.d.ts +0 -2
  101. package/all/html_style/index.js +0 -2
  102. package/all/html_style__assign/index.d.ts +2 -6
  103. package/all/html_style__assign/index.js +0 -5
  104. package/all/html_styles_o/index.d.ts +0 -5
  105. package/all/html_styles_o/index.js +0 -5
  106. package/all/http_error/index.js +4 -2
  107. package/all/idx/index.js +2 -1
  108. package/all/idx_filter/index.js +2 -2
  109. package/all/idx_key_r/index.js +5 -4
  110. package/all/idx_reject/index.js +1 -1
  111. package/all/idx_sort_a__sort_idx_o/index.js +2 -1
  112. package/all/import_meta_env/index.d.ts +10 -0
  113. package/all/import_meta_env/index.js +18 -0
  114. package/all/index.d.ts +22 -0
  115. package/all/index.js +22 -0
  116. package/all/intersection_a/index.js +4 -2
  117. package/all/intersection_by/index.js +2 -1
  118. package/all/invalid_state/index.js +2 -2
  119. package/all/is_development/index.d.ts +6 -0
  120. package/all/is_development/index.js +9 -0
  121. package/all/is_production/index.d.ts +9 -0
  122. package/all/is_production/index.js +12 -0
  123. package/all/is_staging/index.d.ts +9 -0
  124. package/all/is_staging/index.js +12 -0
  125. package/all/item_r_idx/index.js +2 -1
  126. package/all/js_html/index.d.ts +0 -4
  127. package/all/js_html/index.js +0 -4
  128. package/all/left_and/index.js +2 -1
  129. package/all/left_or/index.js +2 -1
  130. package/all/line__parse/index.js +2 -3
  131. package/all/line__transform_stream/index.js +1 -1
  132. package/all/links_html/index.d.ts +0 -5
  133. package/all/links_html/index.js +0 -4
  134. package/all/many_andand/index.js +4 -2
  135. package/all/many_andand_or/index.js +6 -3
  136. package/all/map/index.js +1 -1
  137. package/all/map_andand/index.js +1 -1
  138. package/all/map_andand_or/index.js +3 -2
  139. package/all/map_andandfn/index.js +2 -1
  140. package/all/map_apply/index.js +2 -1
  141. package/all/map_call/index.js +3 -2
  142. package/all/map_find/index.js +1 -1
  143. package/all/map_obj/index.js +3 -2
  144. package/all/map_obj_andand/index.js +1 -1
  145. package/all/missing_argument/index.js +3 -2
  146. package/all/missing_env__throw/index.d.ts +8 -0
  147. package/all/missing_env__throw/index.js +19 -0
  148. package/all/money_str/index.js +2 -2
  149. package/all/neq/index.js +2 -1
  150. package/all/not/index.js +4 -3
  151. package/all/not_found/index.js +1 -1
  152. package/all/nullish__none/index.js +1 -1
  153. package/all/nullish__not_all/index.js +1 -1
  154. package/all/number__count/index.js +2 -2
  155. package/all/o_a_present/index.js +1 -1
  156. package/all/one_andand/index.js +2 -1
  157. package/all/one_andand_or/index.js +3 -2
  158. package/all/or/index.js +2 -3
  159. package/all/or_null/index.js +2 -1
  160. package/all/param_dfn/index.d.ts +1 -0
  161. package/all/param_dfn/index.js +1 -0
  162. package/all/param_dfn_a_reducer/index.d.ts +9 -0
  163. package/all/param_dfn_a_reducer/index.js +12 -0
  164. package/all/param_dfn_split_regex/index.d.ts +1 -0
  165. package/all/param_dfn_split_regex/index.js +1 -0
  166. package/all/param_name_r_param_val_a/index.d.ts +11 -0
  167. package/all/param_name_r_param_val_a/index.js +29 -0
  168. package/all/param_r/index.d.ts +16 -0
  169. package/all/param_r/index.js +33 -0
  170. package/all/param_r/index.test.ts +28 -0
  171. package/all/parseFloat_andor/index.d.ts +3 -2
  172. package/all/parseFloat_andor/index.test.ts +1 -1
  173. package/all/promise_o/index.js +2 -1
  174. package/all/rank/index.js +2 -1
  175. package/all/reduce/index.js +1 -1
  176. package/all/reject/index.js +1 -1
  177. package/all/response_o/index.js +2 -3
  178. package/all/right_and/index.js +2 -1
  179. package/all/right_or/index.js +2 -1
  180. package/all/slice_arg_a/index.js +3 -2
  181. package/all/slice_arg_spread_a/index.js +3 -2
  182. package/all/sort/index.js +1 -1
  183. package/all/sort_a/index.js +1 -1
  184. package/all/sort_idx_a/index.js +1 -1
  185. package/all/sort_idx_o/index.js +5 -4
  186. package/all/sort_val_a/index.js +1 -1
  187. package/all/sort_val_a__transition_idx_a/index.js +1 -3
  188. package/all/spread/index.js +1 -1
  189. package/all/spread_slice/index.js +2 -1
  190. package/all/tap/index.js +1 -1
  191. package/all/tempfile_path/index.test.ts +1 -1
  192. package/all/unauthorized/index.js +1 -1
  193. package/all/unformat_currency_str/index.js +1 -2
  194. package/all/union_a/index.js +3 -2
  195. package/all/union_by/index.js +1 -1
  196. package/all/url__join/index.js +2 -1
  197. package/all/weak_r/index.js +1 -1
  198. package/all/wrap_a/index.js +8 -5
  199. package/all/wrap_aa/index.js +3 -2
  200. package/all/wrap_concat/index.js +4 -3
  201. package/all/zip_with/index.js +1 -1
  202. package/cli-args/index.d.ts +14 -0
  203. package/cli-args/index.js +14 -0
  204. package/env/index.d.ts +8 -0
  205. package/env/index.js +8 -0
  206. package/html/index.d.ts +31 -0
  207. package/html/index.js +31 -0
  208. package/package.json +13 -7
package/all/call/index.js CHANGED
@@ -1,4 +1,5 @@
1
- /** @typedef {import('../call/index.d.ts').call_fn_T} */
1
+ /// <reference types="../call/index.d.ts" />
2
+ /** @typedef {call_fn_T} */
2
3
  /**
3
4
  * Calls the fn with ...arg_a.
4
5
  * @param {call_fn_T}fn
@@ -1,4 +1,5 @@
1
- /** @typedef {import('../call_assign/index.d.ts').assign_fn_T} */
1
+ /// <reference types="../call_assign/index.d.ts" />
2
+ /** @typedef {assign_fn_T} */
2
3
  /**
3
4
  * Assigns function calls into obj
4
5
  * @param {object}obj
@@ -1,7 +1,8 @@
1
+ /// <reference types="../chain/index.d.ts" />
1
2
  import { isArray } from '../isArray/index.js'
2
3
  /**
3
- * @param {import('../chain/index.js').chain__o_T}chain__o
4
- * @param {import('../chain/index.js').chain_key__T[]}key_a
4
+ * @param {chain__o_T}chain__o
5
+ * @param {chain_key__T[]}key_a
5
6
  * @returns {*}
6
7
  */
7
8
  export function chain_(chain__o, ...key_a) {
@@ -1,9 +1,10 @@
1
+ /// <reference types="../assign_fn_key_a/index.d.ts" />
1
2
  import { assign_fn_key_a } from '../assign_fn_key_a/index.js'
2
3
  import { clone } from '../clone/index.js'
3
4
  /**
4
5
  * Assigns to a cloned obj array of keys the return value of function in key_a_fn_aa.
5
6
  * @param {Record<string, object>}obj
6
- * @param {import('../assign_fn_key_a/index.js').fn_key_a_tuple_T}key_a_fn_aa
7
+ * @param {fn_key_a_tuple_T}key_a_fn_aa
7
8
  * @returns {Record<string, object>}
8
9
  */
9
10
  export function clone_assign_fn_key_a(
@@ -1,11 +1,12 @@
1
+ /// <reference types="../color_rgb_a__color_hsv_a/index.d.ts" />
1
2
  import { color_rgb_a__color_hsv_a_ } from '../color_hsv/index.js'
2
3
  import { PHI } from '../PHI/index.js'
3
4
  const { floor } = Math
4
5
  /**
5
6
  * Returns an array of colors with a given sv (`[saturation, value]`)
6
7
  * with h (hue) seperated by `1/PHI`
7
- * @param {import('../color_rgb_a__color_hsv_a/index.js').hsv_phi_rgb_color_a__params_T}params
8
- * @returns {import('../color_rgb_a__color_hsv_a/index.js').color_rgb_a_T[]}
8
+ * @param {hsv_phi_rgb_color_a__params_T}params
9
+ * @returns {color_rgb_a_T[]}
9
10
  * @see {@link https://martin.ankerl.com/2009/12/09/how-to-create-random-colors-programmatically/}
10
11
  */
11
12
  export function color_hsv_phi_rgb_a_(
@@ -1,7 +1,8 @@
1
+ /// <reference types="../color_invert_rgb_a/index.d.ts" />
1
2
  /**
2
3
  * Inverted color for rgb_color_a as rgb_color_a
3
- * @param {import('../color_invert_rgb_a/index.js').color_hsv_a_T}rgb_color_a
4
- * @return {import('../color_invert_rgb_a/index.js').color_hsv_a_T}
4
+ * @param {color_hsv_a_T}rgb_color_a
5
+ * @return {color_hsv_a_T}
5
6
  */
6
7
  export function color_invert_rgb_a_(
7
8
  rgb_color_a
@@ -1,7 +1,8 @@
1
+ /// <reference types="../array_types/index.d.ts" />
1
2
  /**
2
3
  * Returns a [sort_val_a__transition_a_frame_T](#sort_val_a__transition_a_frame_T)
3
4
  * @param {unknown[]}sparse_a
4
- * @returns {import('../array_types/index.js').sort_val_a__transition_a_frame_T}
5
+ * @returns {sort_val_a__transition_a_frame_T}
5
6
  */
6
7
  export function compact_a_ctx_(sparse_a) {
7
8
  const idx_a = []
@@ -1,7 +1,8 @@
1
+ /// <reference types="../array_types/index.d.ts" />
1
2
  /**
2
3
  * Returns a basic ascending or descending `compare` function to be used for sorting.
3
4
  * @param {boolean}[asc]
4
- * @returns {import('../array_types/index.js').compare_T}
5
+ * @returns {compare_T}
5
6
  */
6
7
  export function compare_(asc = true) {
7
8
  return (a, b)=>{
@@ -1,4 +1,4 @@
1
- /** @typedef {import('../compose/index.d.ts').compose_fn_T} */
1
+ /// <reference types="../compose/index.d.ts" />
2
2
  /**
3
3
  * Composes fn_a into a single function
4
4
  *
@@ -9,9 +9,9 @@
9
9
  export function compose(...fn_a) {
10
10
  return (
11
11
  fn_a.reduceRight((prev_fn, next_fn)=>
12
- (...arg_a)=>
13
- next_fn(
14
- prev_fn(...arg_a)),
15
- $=>$)
12
+ (...arg_a)=>
13
+ next_fn(
14
+ prev_fn(...arg_a)),
15
+ $=>$)
16
16
  )
17
17
  }
@@ -1,9 +1,11 @@
1
+ /// <reference types="../a_nowrap/index.d.ts" />
2
+ /// <reference types="../wrap_a/index.d.ts" />
1
3
  import { wrap_a_ } from '../wrap_a/index.js'
2
4
  /**
3
5
  * Array#`concat`, setting falsy values to an empty Array (`[]`).
4
- * @param {import('../a_nowrap/index.js').a_nowrap_T}a_nowrap
6
+ * @param {a_nowrap_T}a_nowrap
5
7
  * @param {unknown}rest_a
6
- * @returns {import('../wrap_a/index.js').wrap_a_T<unknown>}
8
+ * @returns {wrap_a_T<unknown>}
7
9
  */
8
10
  export function concat_truthy_a(a_nowrap, ...rest_a) {
9
11
  let out_a = a_nowrap ? wrap_a_(a_nowrap) : []
@@ -1,4 +1,5 @@
1
- /** @typedef {import('../error_o/index.d.ts').error_o_error_T} */
1
+ /// <reference types="../error_o/index.d.ts" />
2
+ /** @typedef {error_o_error_T} */
2
3
  /**
3
4
  * Logs the given error_o_error to stderr
4
5
  * @param {error_o_error_T}error_o_error
@@ -1,6 +1,7 @@
1
+ /// <reference types="../crypto__sign/index.d.ts" />
1
2
  import { crypto_ } from '../crypto/index.js'
2
3
  /**
3
- * @param {import('../crypto__sign/index.js').crypto__sign__algorithm_T}algorithm
4
+ * @param {crypto__sign__algorithm_T}algorithm
4
5
  * @param {CryptoKey}key
5
6
  * @param {BufferSource}data
6
7
  * @returns {Promise<ArrayBuffer>}
@@ -1,3 +1,4 @@
1
+ /// <reference types="../currency_str/index.d.ts" />
1
2
  import { currency_symbol_ } from '../currency_symbol/index.js'
2
3
  import { money_str_ } from '../money_str/index.js'
3
4
  /**
@@ -25,7 +26,7 @@ export {
25
26
  currency_str_ as format__currency,
26
27
  }
27
28
  /**
28
- * @param {import('../currency_str').currency_str__default_params_T|string}params
29
+ * @param {currency_str__default_params_T|string}params
29
30
  * @returns {(amount:number)=>string}
30
31
  */
31
32
  export function currency_str__(params) {
@@ -1,7 +1,8 @@
1
+ /// <reference types="../currency_code/index.d.ts" />
1
2
  import { currencies } from '../currencies/index.js'
2
3
  /**
3
4
  * Returns the symbol for the given `currency_code_.currency`. Defaults to `$`
4
- * @param {import('../currency_code').currency_code_o_T|string}currency_code_
5
+ * @param {currency_code_o_T|string}currency_code_
5
6
  * @returns {string} * @see {@link https://github.com/bengourley/currency-symbol-map}
6
7
  * @see {@link https://raw.githubusercontent.com/bengourley/currency-symbol-map/master/map.js}
7
8
  */
@@ -1,8 +1,8 @@
1
1
  /// <reference types="../resolver_curry/index.d.ts" />
2
2
  /// <reference types="./index.d.ts" />
3
3
  /**
4
- * @param append{import('../resolver_curry/index.js').append_current_T}
5
- * @returns {import('../resolver_curry/index.js').resolver_curry_T}
4
+ * @param append{append_current_T}
5
+ * @returns {resolver_curry_T}
6
6
  */
7
7
  export function curry(append) {
8
8
  return curry_((local, arg_a)=>
package/all/date/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @type {typeof import('../date/index.d.ts').date_} */
1
+ /// <reference types="../date/index.d.ts" />
2
2
  export const date_ =
3
3
  (...arg_a)=>
4
4
  new Date(/** @type {any} */...arg_a)
@@ -0,0 +1,11 @@
1
+ import type { param_dfn_T } from '../param_dfn/index.js'
2
+ export declare function default_arg_a_(
3
+ arg_a:string[],
4
+ value_r_param_dfn?:Record<string, param_dfn_T>,
5
+ cancel_a?:string[]
6
+ ):string[]
7
+ export {
8
+ default_arg_a_ as default_arg_a1_fn,
9
+ default_arg_a_ as _default_arg_a1,
10
+ default_arg_a_ as _a1__arg__default,
11
+ }
@@ -0,0 +1,41 @@
1
+ import { a_some } from '../a_some/index.js'
2
+ import { every } from '../every/index.js'
3
+ import { flag_a_ } from '../flag_a/index.js'
4
+ import { flag_r_ } from '../flag_r/index.js'
5
+ import { keys } from '../keys/index.js'
6
+ /**
7
+ * @param {string[]}arg_a
8
+ * @param {Record<string, param_dfn_T>}value_R_param_dfn
9
+ * @param {string[]}cancel_a
10
+ * @returns {string[]}
11
+ */
12
+ export function default_arg_a_(
13
+ arg_a,
14
+ value_R_param_dfn = {},
15
+ cancel_a = []
16
+ ) {
17
+ const default_arg_a = arg_a.slice(0)
18
+ const flag_h = flag_r_(default_arg_a)
19
+ if (
20
+ a_some(keys(flag_h), flag=>cancel_a.indexOf(flag) > -1
21
+ )) {
22
+ return default_arg_a
23
+ }
24
+ for (let param_dfn in value_R_param_dfn) {
25
+ const flag_a = flag_a_(param_dfn)
26
+ if (every(flag_a, (flag)=>!(flag in flag_h)
27
+ )) {
28
+ const value = value_R_param_dfn[param_dfn]
29
+ const $value = typeof value === 'function' ? value() : value
30
+ const flag1 = find(flag_a, (flag)=>/^--/.test(flag)
31
+ ) || flag_a[0]
32
+ default_arg_a.push(flag1, $value)
33
+ }
34
+ }
35
+ return default_arg_a
36
+ }
37
+ export {
38
+ default_arg_a_ as default_arg_a1_fn,
39
+ default_arg_a_ as _default_arg_a1,
40
+ default_arg_a_ as _a1__arg__default,
41
+ }
@@ -0,0 +1,8 @@
1
+ import type { param_dfn_T } from '../param_dfn/index.js'
2
+ export declare function dfn_flag_r_(
3
+ param_dfn_a:param_dfn_T[]
4
+ ):Record<string, string[]>
5
+ export {
6
+ dfn_flag_r_ as dfn_flag_h_,
7
+ dfn_flag_r_ as _dfn_flag_h,
8
+ }
@@ -0,0 +1,24 @@
1
+ /// <reference types="../types/index.d.ts" />
2
+ import { each } from '../each/index.js'
3
+ import { flag_a_ } from '../flag_a/index.js'
4
+ /**
5
+ * @param {param_dfn_T[]}param_dfn_a
6
+ * @returns {Record<string, string[]>}
7
+ */
8
+ export function dfn_flag_r_(param_dfn_a) {
9
+ const dfn_flag_R = {}
10
+ each(param_dfn_a, (param_dfn)=>{
11
+ const flag_a = flag_a_(
12
+ typeof param_dfn === 'function'
13
+ ? param_dfn()
14
+ : param_dfn)
15
+ each(flag_a, (flag)=>{
16
+ dfn_flag_R[flag] = flag_a
17
+ })
18
+ })
19
+ return dfn_flag_R
20
+ }
21
+ export {
22
+ dfn_flag_r_ as dfn_flag_h_,
23
+ dfn_flag_r_ as _dfn_flag_h,
24
+ }
@@ -1,9 +1,11 @@
1
+ /// <reference types="../a_nowrap/index.d.ts" />
2
+ /// <reference types="../wrap_aa/index.d.ts" />
1
3
  import { difference_set_ } from '../difference_set/index.js'
2
4
  import { wrap_aa_ } from '../wrap_aa/index.js'
3
5
  /**
4
6
  * Returns the difference of n arrays
5
- * @param {import('../a_nowrap/index.js').a_nowrap_T}aa_nowrap
6
- * @returns {import('../wrap_aa/index.js').wrap_aa_T[]}
7
+ * @param {a_nowrap_T}aa_nowrap
8
+ * @returns {wrap_aa_T[]}
7
9
  * @see {@link http://www.2ality.com/2015/01/es6-set-operations.html}
8
10
  */
9
11
  export function difference_a_(aa_nowrap) {
package/all/each/index.js CHANGED
@@ -1,4 +1,5 @@
1
- /** @typedef {import('../each/index.d.ts').each_fn_T} */
1
+ /// <reference types="../each/index.d.ts" />
2
+ /** @typedef {each_fn_T} */
2
3
  /**
3
4
  * Iterate over each item in `a` with `fn(a[i], i)`.
4
5
  * @param {unknown[]}a
@@ -1,8 +1,9 @@
1
+ /// <reference types="../ensure__refresh/index.d.ts" />
1
2
  import { clone } from '../clone/index.js'
2
3
  /**
3
4
  * `ensure` `obj[key]` is present or call `ensure(obj)`. Then call `refresh(obj, obj[key])`.
4
- * @param {import('../ensure__refresh/index.js').ensure_refresh__o_T}obj
5
- * @param {import('../ensure__refresh/index.js').ensure__refresh_opts_T}ensure__refresh_opts_a
5
+ * @param {ensure_refresh__o_T}obj
6
+ * @param {ensure__refresh_opts_T}ensure__refresh_opts_a
6
7
  * @returns {unknown}
7
8
  */
8
9
  export function ensure__refresh(
package/all/eq/index.js CHANGED
@@ -1,8 +1,10 @@
1
+ /// <reference types="../a_nowrap/index.d.ts" />
2
+ /// <reference types="../eq/index.d.ts" />
1
3
  import { wrap_a_ } from '../wrap_a/index.js'
2
4
  import { wrap_concat } from '../wrap_concat/index.js'
3
5
  /**
4
6
  * Returns `==` operator to all values in `a_nowrap`.
5
- * @param {import('../a_nowrap/index.js').a_nowrap_T}a_nowrap
7
+ * @param {a_nowrap_T}a_nowrap
6
8
  * @returns {boolean}
7
9
  */
8
10
  export function eq(a_nowrap) {
@@ -16,8 +18,8 @@ export function eq(a_nowrap) {
16
18
  }
17
19
  /**
18
20
  * Returns function that returns `==` operator to all values in `in_value_aS`.
19
- * @param {import('../a_nowrap/index.js').a_nowrap_T}a_nowrap
20
- * @returns {import('../eq/index.js').eq_fn_T}
21
+ * @param {a_nowrap_T}a_nowrap
22
+ * @returns {eq_fn_T}
21
23
  */
22
24
  export function eq_(a_nowrap) {
23
25
  return (value)=>eq(wrap_concat(a_nowrap, value))
@@ -1,4 +1,4 @@
1
- /** @typedef {import('../a_item/index.d.ts').a_item_T} */
1
+ /// <reference types="../a_item/index.d.ts" />
2
2
  /**
3
3
  * Is i0_a `===` to i1_a based on `fn(a, b, i)`? Checks first level equality.
4
4
  * @param i0_a{unknown[]}
@@ -1,8 +1,10 @@
1
- /** @typedef {import('../error_o/index.d.ts').argument__error_o_T} */
1
+ /// <reference types="../error_o/index.d.ts" />
2
+ /// <reference types="../error__print/index.d.ts" />
3
+ /** @typedef {argument__error_o_T} */
2
4
  /**
3
5
  * Prints the given `error_o_error` to stderr
4
6
  * @param {error_o_error_T}error_o_error
5
- * @type {typeof import('../error__print/index.js').error__print}
7
+ * @type {typeof error__print}
6
8
  */
7
9
  export function error__print(error_o_error) {
8
10
  const {
@@ -1,6 +1,8 @@
1
+ /// <reference types="../error_o/index.d.ts" />
2
+ /// <reference types="./index.d.ts" />
1
3
  import { assign } from '../assign/index.js'
2
- /** @typedef {import('./index.d.ts').argument__error_o_T} */
3
- /** @typedef {import('../error_o/index.d.ts').error_o_error_T} */
4
+ /** @typedef {argument__error_o_T} */
5
+ /** @typedef {error_o_error_T} */
4
6
  /**
5
7
  * argument__error_o_T factory function
6
8
  * @param {string}[message]
@@ -1,4 +1,5 @@
1
- /** @typedef {import('../falsy/index.d.ts').falsy} */
1
+ /// <reference types="../falsy/index.d.ts" />
2
+ /** @typedef {falsy} */
2
3
  /**
3
4
  * @param {unknown[]}a
4
5
  * @param {(...$:unknown[])=>unknown}_
@@ -1,2 +1,3 @@
1
- /** @type {import('../fetch/index.d.ts').fetch} */
1
+ /// <reference types="../fetch/index.d.ts" />
2
+ /** @type {fetch} */
2
3
  export const { fetch } = globalThis
@@ -1,5 +1,6 @@
1
+ /// <reference types="../fetch__template_pair/index.d.ts" />
1
2
  import { response_pair__new } from '../response_pair/index.js'
2
- /** @typedef {import('../fetch__template_pair/index.d.ts').fetch__template_pair_T} */
3
+ /** @typedef {fetch__template_pair_T} */
3
4
  /**
4
5
  * @param {(...arg_a:any[])=>Promise<Response>}fetch_fn
5
6
  * @param {(val:unknown)=>unknown}[hydrate]
@@ -1,5 +1,6 @@
1
+ /// <reference types="../fetch_method/index.d.ts" />
1
2
  /**
2
- * @param {import('../fetch_method/index.js').fetch_method___params_T}fetch_method___params
3
+ * @param {fetch_method___params_T}fetch_method___params
3
4
  * @returns {string}
4
5
  * @private
5
6
  */
@@ -1,8 +1,10 @@
1
+ /// <reference types="../fetch/index.d.ts" />
2
+ /// <reference types="../fetch__template_pair/index.d.ts" />
1
3
  import { response_pair__new } from '../response_pair/index.js'
2
- /** @typedef {import('../fetch/index.d.ts').fetch_T} */
4
+ /** @typedef {fetch_T} */
3
5
  /**
4
6
  * @param {fetch_T}fetch
5
- * @returns {typeof import('../fetch__template_pair/index.js').fetch_response_pair__new}
7
+ * @returns {typeof fetch_response_pair__new}
6
8
  */
7
9
  export function fetch_response_pair__new2(fetch) {
8
10
  return async (input, init)=>{
@@ -1,4 +1,5 @@
1
- /** @typedef {import('../array_types/index.d.ts').is_match__T} */
1
+ /// <reference types="../fetch__template_pair/index.d.ts" />
2
+ /** @typedef {is_match__T} */
2
3
  /**
3
4
  * Returns Array where items in `a` are filtered by `fn`.
4
5
  * @param {unknown[]}a
@@ -1,9 +1,10 @@
1
+ /// <reference types="../filter_o/index.d.ts" />
1
2
  import { I__ } from '../combinators/index.js'
2
3
  /**
3
4
  * Returns a filter_h1 with the values filtered by `fn`.
4
5
  * @param {object}o
5
6
  * @param {(val:any, key:string, h1:object)=>any}fn
6
- * @returns {import('../filter_o').filter_o_T|undefined}
7
+ * @returns {filter_o_T|undefined}
7
8
  */
8
9
  export function filter_o_(
9
10
  o,
@@ -27,7 +28,7 @@ export {
27
28
  * Returns a filter_h where the value is a
28
29
  * boolean of whether the array has items present
29
30
  * @param {(val:any, key:string, l0_r:object)=>any}fn
30
- * @returns {(l1_r:object|undefined)=>(import('../filter_o').filter_o_T|undefined)}
31
+ * @returns {(l1_r:object|undefined)=>(filter_o_T|undefined)}
31
32
  */
32
33
  export function filter_o__(fn = I__) {
33
34
  return (l1_r)=>filter_o_(l1_r, fn)
package/all/find/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @typedef {import('../wrap_a/index.d.ts').wrap_a_T2} */
1
+ /// <reference types="../wrap_a/index.d.ts" />
2
2
  /**
3
3
  * Returns first item in `a` where `fn(a[idx], idx)` is truthy.
4
4
  * @param {wrap_a_T2}a
@@ -0,0 +1,6 @@
1
+ export declare function flag_a_(param_dfn:string):string[]
2
+ export {
3
+ flag_a_ as flag_a1_fn,
4
+ flag_a_ as _flag_a1,
5
+ flag_a_ as _a1__flag,
6
+ }
@@ -0,0 +1,13 @@
1
+ import { param_dfn_split_regex } from '../param_dfn_split_regex/index.js'
2
+ /**
3
+ * @param {string}param_dfn
4
+ * @returns {string[]}
5
+ */
6
+ export function flag_a_(param_dfn) {
7
+ return param_dfn.split(param_dfn_split_regex)
8
+ }
9
+ export {
10
+ flag_a_ as flag_a1_fn,
11
+ flag_a_ as _flag_a1,
12
+ flag_a_ as _a1__flag,
13
+ }
@@ -0,0 +1,8 @@
1
+ export declare function flag_r_(
2
+ arg_a:string[]
3
+ ):Record<string, string>
4
+ export {
5
+ flag_r_ as flag_h_,
6
+ flag_r_ as _flag_h,
7
+ flag_r_ as _h__flag,
8
+ }
@@ -0,0 +1,34 @@
1
+ import { flag_regex } from '../flag_regex/index.js'
2
+ /**
3
+ * @param {string[]}arg_a
4
+ * @returns {Record<string, string>}
5
+ * @private
6
+ */
7
+ export function flag_r_(arg_a) {
8
+ const flag_R = {}
9
+ let i = 0
10
+ while (i < arg_a.length) {
11
+ const flag = arg_a[i]
12
+ const match = flag_regex.test(flag)
13
+ let j = i + 1
14
+ if (match) {
15
+ while (j < arg_a.length && !flag_regex.test(arg_a[j])) {
16
+ const value = arg_a[j]
17
+ if (flag_R[flag]) {
18
+ flag_R[flag] += ` ${value}`
19
+ } else {
20
+ flag_R[flag] = value
21
+ }
22
+ j += 1
23
+ }
24
+ }
25
+ if (!(flag in flag_R)) delete flag_R[flag]
26
+ i = j
27
+ }
28
+ return flag_R
29
+ }
30
+ export {
31
+ flag_r_ as flag_h_,
32
+ flag_r_ as _flag_h,
33
+ flag_r_ as _h__flag,
34
+ }
@@ -0,0 +1,11 @@
1
+ import type { param_dfn_T } from '../param_dfn/index.js'
2
+ export declare function flag_r__pick(
3
+ arg_a:string[],
4
+ ...param_dfn_a:param_dfn_T[]
5
+ ):Record<string, string>
6
+ export {
7
+ flag_r__pick as flag_R__pick,
8
+ flag_r__pick as pick_flag_r_,
9
+ flag_r__pick as pick_flag_h_,
10
+ flag_r__pick as _pick_flag_h,
11
+ }
@@ -0,0 +1,31 @@
1
+ /// <reference types="../types/index.d.ts" />
2
+ import { dfn_flag_r_ } from '../dfn_flag_r/index.js'
3
+ import { each } from '../each/index.js'
4
+ import { flag_r_ } from '../flag_r/index.js'
5
+ import { keys } from '../keys/index.js'
6
+ /**
7
+ * @param {string[]}arg_a
8
+ * @param {param_dfn_T}param_dfn_a
9
+ * @returns {Record<string, string>}
10
+ * @private
11
+ */
12
+ export function flag_r__pick(
13
+ arg_a,
14
+ ...param_dfn_a
15
+ ) {
16
+ const dfn_flag_h = dfn_flag_r_(param_dfn_a)
17
+ const flag_h = flag_r_(arg_a)
18
+ const pick_flag_a = []
19
+ each(keys(flag_h), (flag)=>{
20
+ if (flag in dfn_flag_h) {
21
+ pick_flag_a.push(flag)
22
+ }
23
+ })
24
+ return pick(flag_h, ...pick_flag_a)
25
+ }
26
+ export {
27
+ flag_r__pick as flag_R__pick,
28
+ flag_r__pick as pick_flag_r_,
29
+ flag_r__pick as pick_flag_h_,
30
+ flag_r__pick as _pick_flag_h,
31
+ }
@@ -0,0 +1,9 @@
1
+ export declare function flag_r_arg_a_<O>(
2
+ flag_r:Record<string, O>,
3
+ arg_a:string[]
4
+ ):(string|O)[]
5
+ export {
6
+ flag_r_arg_a_ as flag_R_arg_a_,
7
+ flag_r_arg_a_ as flag_h_arg_a_,
8
+ flag_r_arg_a_ as _flag_h_arg_a1,
9
+ }
@@ -0,0 +1,27 @@
1
+ import { keys } from '../keys/index.js'
2
+ import { reduce } from '../reduce/index.js'
3
+ /**
4
+ * @param {Record<string, unknown>}flag_R
5
+ * @param {string[]}arg_a
6
+ * @returns {string|unknown}
7
+ * @private
8
+ */
9
+ export function flag_r_arg_a_(
10
+ flag_R,
11
+ arg_a
12
+ ) {
13
+ return reduce(keys(flag_R), (memo, flag)=>{
14
+ memo.push(flag)
15
+ const _value = flag_R[flag]
16
+ const value = typeof _value === 'function' ? _value(arg_a) : _value
17
+ if (value != null) {
18
+ memo.push(...[].concat(value))
19
+ }
20
+ return memo
21
+ }, [])
22
+ }
23
+ export {
24
+ flag_r_arg_a_ as flag_R_arg_a_,
25
+ flag_r_arg_a_ as flag_h_arg_a_,
26
+ flag_r_arg_a_ as _flag_h_arg_a1,
27
+ }
@@ -0,0 +1,9 @@
1
+ export declare function flag_r_param_name_(
2
+ param_dfn_r_param_name?:param_name_r_param_dfn_T
3
+ ):Record<string, string>
4
+ export {
5
+ flag_r_param_name_ as flag_R_param_name_,
6
+ flag_r_param_name_ as flag_h_param_name_,
7
+ flag_r_param_name_ as _flag_h_param_name,
8
+ }
9
+ export type param_name_r_param_dfn_T = Record<string, string>
@@ -0,0 +1,24 @@
1
+ /// <reference types="../types/index.d.ts" />
2
+ import { each } from '../each/index.js'
3
+ import { flag_a_ } from '../flag_a/index.js'
4
+ /**
5
+ * @param {param_name_r_param_dfn_T}param_dfn_r_param_name
6
+ * @returns {Record<string, string>}
7
+ */
8
+ export function flag_r_param_name_(
9
+ param_dfn_r_param_name
10
+ ) {
11
+ const flag_R_param_name = {}
12
+ for (let param_name in param_dfn_r_param_name) {
13
+ const param_dfn = param_dfn_r_param_name[param_name]
14
+ const flag_a = flag_a_(param_dfn)
15
+ each(flag_a, flag=>
16
+ flag_R_param_name[flag] = param_name)
17
+ }
18
+ return flag_R_param_name
19
+ }
20
+ export {
21
+ flag_r_param_name_ as flag_R_param_name_,
22
+ flag_r_param_name_ as flag_h_param_name_,
23
+ flag_r_param_name_ as _flag_h_param_name,
24
+ }