functionalscript 0.0.486 → 0.0.487

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.
@@ -51,22 +51,26 @@ const this_ = ['this: &Object']
51
51
  const rustType = n => `pub type ${n} = nanocom::${n}<Interface>;`
52
52
 
53
53
  /**
54
- * @typedef {{
55
- * readonly where?: readonly string[]
56
- * readonly content: text.Block
57
- * }} WhereContent
54
+ * @template T
55
+ * @typedef {T|{}} OptionalProperty
56
+ */
57
+
58
+ /** @typedef {{readonly where: readonly string[]}} Where */
59
+
60
+ /**
61
+ * @typedef {OptionalProperty<Where> & {readonly content: text.Block}} WhereContent
58
62
  */
59
63
 
60
64
  /** @type {(h: string) => (wh: WhereContent) => text.Block} */
61
- const whereContent = h => ({ where, content }) => {
62
- const w = isEmpty(where) ? [`${h} {`] : [
65
+ const whereContent = h => wh => {
66
+ const w = 'where' in wh ? [
63
67
  h,
64
68
  `where`,
65
- mapComma(where),
69
+ mapComma(wh.where),
66
70
  '{'
67
- ]
71
+ ]: [`${h} {`]
68
72
  const x = [
69
- content,
73
+ wh.content,
70
74
  '}',
71
75
  ]
72
76
  return flat([w, x])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "functionalscript",
3
- "version": "0.0.486",
3
+ "version": "0.0.487",
4
4
  "description": "FunctionalScript is a functional subset of JavaScript",
5
5
  "main": "module.f.cjs",
6
6
  "scripts": {