@mojir/lits 2.2.2 → 2.2.3

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/dist/cli/cli.js +1145 -1105
  2. package/dist/cli/src/AutoCompleter/AutoCompleter.d.ts +2 -1
  3. package/dist/cli/src/builtin/bindingNode.d.ts +3 -3
  4. package/dist/cli/src/builtin/index.d.ts +0 -1
  5. package/dist/cli/src/builtin/interface.d.ts +3 -4
  6. package/dist/cli/src/builtin/specialExpressionTypes.d.ts +0 -1
  7. package/dist/cli/src/builtin/specialExpressions/and.d.ts +2 -2
  8. package/dist/cli/src/builtin/specialExpressions/array.d.ts +2 -2
  9. package/dist/cli/src/builtin/specialExpressions/block.d.ts +2 -2
  10. package/dist/cli/src/builtin/specialExpressions/cond.d.ts +2 -2
  11. package/dist/cli/src/builtin/specialExpressions/if.d.ts +2 -2
  12. package/dist/cli/src/builtin/specialExpressions/loop.d.ts +2 -2
  13. package/dist/cli/src/builtin/specialExpressions/loops.d.ts +4 -4
  14. package/dist/cli/src/builtin/specialExpressions/object.d.ts +2 -2
  15. package/dist/cli/src/builtin/specialExpressions/or.d.ts +2 -2
  16. package/dist/cli/src/builtin/specialExpressions/qq.d.ts +2 -2
  17. package/dist/cli/src/builtin/specialExpressions/recur.d.ts +2 -2
  18. package/dist/cli/src/builtin/specialExpressions/switch.d.ts +2 -2
  19. package/dist/cli/src/builtin/specialExpressions/throw.d.ts +2 -2
  20. package/dist/cli/src/builtin/specialExpressions/try.d.ts +2 -2
  21. package/dist/cli/src/builtin/specialExpressions/unless.d.ts +2 -2
  22. package/dist/cli/src/builtin/utils.d.ts +2 -2
  23. package/dist/cli/src/evaluator/index.d.ts +2 -2
  24. package/dist/cli/src/evaluator/interface.d.ts +4 -3
  25. package/dist/cli/src/getUndefinedSymbols/index.d.ts +2 -2
  26. package/dist/cli/src/parser/ParserContext.d.ts +20 -0
  27. package/dist/cli/src/parser/helpers.d.ts +19 -0
  28. package/dist/cli/src/parser/index.d.ts +3 -0
  29. package/dist/cli/src/parser/subParsers/getPrecedence.d.ts +3 -0
  30. package/dist/cli/src/parser/subParsers/parseArray.d.ts +3 -0
  31. package/dist/cli/src/parser/subParsers/parseBindingTarget.d.ts +6 -0
  32. package/dist/cli/src/parser/subParsers/parseCond.d.ts +4 -0
  33. package/dist/cli/src/parser/subParsers/parseDo.d.ts +3 -0
  34. package/dist/cli/src/parser/subParsers/parseForOrDoseq.d.ts +4 -0
  35. package/dist/cli/src/parser/subParsers/parseFunction.d.ts +4 -0
  36. package/dist/cli/src/parser/subParsers/parseFunctionCall.d.ts +3 -0
  37. package/dist/cli/src/parser/subParsers/parseIfOrUnless.d.ts +5 -0
  38. package/dist/cli/src/parser/subParsers/parseImplicitBlock.d.ts +5 -0
  39. package/dist/cli/src/parser/subParsers/parseLet.d.ts +4 -0
  40. package/dist/cli/src/parser/subParsers/parseLoop.d.ts +4 -0
  41. package/dist/cli/src/parser/subParsers/parseNumber.d.ts +3 -0
  42. package/dist/cli/src/parser/subParsers/parseObject.d.ts +3 -0
  43. package/dist/cli/src/parser/subParsers/parseOperand.d.ts +3 -0
  44. package/dist/cli/src/parser/subParsers/parseRegexpShorthand.d.ts +3 -0
  45. package/dist/cli/src/parser/subParsers/parseReservedSymbol.d.ts +3 -0
  46. package/dist/cli/src/parser/subParsers/parseString.d.ts +4 -0
  47. package/dist/cli/src/parser/subParsers/parseSwitch.d.ts +4 -0
  48. package/dist/cli/src/parser/subParsers/parseSymbol.d.ts +3 -0
  49. package/dist/cli/src/parser/subParsers/parseTry.d.ts +4 -0
  50. package/dist/cli/src/parser/types.d.ts +19 -26
  51. package/dist/cli/src/testFramework/index.d.ts +3 -2
  52. package/dist/cli/src/tokenizer/token.d.ts +0 -2
  53. package/dist/cli/src/tokenizer/tokenizers.d.ts +2 -2
  54. package/dist/cli/src/typeGuards/astNode.d.ts +18 -19
  55. package/dist/cli/src/typeGuards/index.d.ts +0 -1
  56. package/dist/cli/src/typeGuards/lits.d.ts +0 -1
  57. package/dist/full.esm.js +1 -1
  58. package/dist/full.esm.js.map +1 -1
  59. package/dist/full.js +1 -1
  60. package/dist/full.js.map +1 -1
  61. package/dist/index.esm.js +1 -1
  62. package/dist/index.esm.js.map +1 -1
  63. package/dist/index.js +1 -1
  64. package/dist/index.js.map +1 -1
  65. package/dist/lits.iife.js +1 -1
  66. package/dist/lits.iife.js.map +1 -1
  67. package/dist/modules/assert.esm.js.map +1 -1
  68. package/dist/modules/assert.js.map +1 -1
  69. package/dist/modules/bitwise.esm.js.map +1 -1
  70. package/dist/modules/bitwise.js.map +1 -1
  71. package/dist/modules/collection.esm.js.map +1 -1
  72. package/dist/modules/collection.js.map +1 -1
  73. package/dist/modules/functional.esm.js.map +1 -1
  74. package/dist/modules/functional.js.map +1 -1
  75. package/dist/modules/grid.esm.js.map +1 -1
  76. package/dist/modules/grid.js.map +1 -1
  77. package/dist/modules/linear-algebra.esm.js.map +1 -1
  78. package/dist/modules/linear-algebra.js.map +1 -1
  79. package/dist/modules/matrix.esm.js.map +1 -1
  80. package/dist/modules/matrix.js.map +1 -1
  81. package/dist/modules/number-theory.esm.js.map +1 -1
  82. package/dist/modules/number-theory.js.map +1 -1
  83. package/dist/modules/random.esm.js.map +1 -1
  84. package/dist/modules/random.js.map +1 -1
  85. package/dist/modules/sequence.esm.js.map +1 -1
  86. package/dist/modules/sequence.js.map +1 -1
  87. package/dist/modules/src/AutoCompleter/AutoCompleter.d.ts +2 -1
  88. package/dist/modules/src/builtin/bindingNode.d.ts +3 -3
  89. package/dist/modules/src/builtin/index.d.ts +0 -1
  90. package/dist/modules/src/builtin/interface.d.ts +3 -4
  91. package/dist/modules/src/builtin/specialExpressionTypes.d.ts +0 -1
  92. package/dist/modules/src/builtin/specialExpressions/and.d.ts +2 -2
  93. package/dist/modules/src/builtin/specialExpressions/array.d.ts +2 -2
  94. package/dist/modules/src/builtin/specialExpressions/block.d.ts +2 -2
  95. package/dist/modules/src/builtin/specialExpressions/cond.d.ts +2 -2
  96. package/dist/modules/src/builtin/specialExpressions/if.d.ts +2 -2
  97. package/dist/modules/src/builtin/specialExpressions/loop.d.ts +2 -2
  98. package/dist/modules/src/builtin/specialExpressions/loops.d.ts +4 -4
  99. package/dist/modules/src/builtin/specialExpressions/object.d.ts +2 -2
  100. package/dist/modules/src/builtin/specialExpressions/or.d.ts +2 -2
  101. package/dist/modules/src/builtin/specialExpressions/qq.d.ts +2 -2
  102. package/dist/modules/src/builtin/specialExpressions/recur.d.ts +2 -2
  103. package/dist/modules/src/builtin/specialExpressions/switch.d.ts +2 -2
  104. package/dist/modules/src/builtin/specialExpressions/throw.d.ts +2 -2
  105. package/dist/modules/src/builtin/specialExpressions/try.d.ts +2 -2
  106. package/dist/modules/src/builtin/specialExpressions/unless.d.ts +2 -2
  107. package/dist/modules/src/builtin/utils.d.ts +2 -2
  108. package/dist/modules/src/evaluator/index.d.ts +2 -2
  109. package/dist/modules/src/evaluator/interface.d.ts +4 -3
  110. package/dist/modules/src/getUndefinedSymbols/index.d.ts +2 -2
  111. package/dist/modules/src/parser/ParserContext.d.ts +20 -0
  112. package/dist/modules/src/parser/helpers.d.ts +19 -0
  113. package/dist/modules/src/parser/index.d.ts +3 -0
  114. package/dist/modules/src/parser/subParsers/getPrecedence.d.ts +3 -0
  115. package/dist/modules/src/parser/subParsers/parseArray.d.ts +3 -0
  116. package/dist/modules/src/parser/subParsers/parseBindingTarget.d.ts +6 -0
  117. package/dist/modules/src/parser/subParsers/parseCond.d.ts +4 -0
  118. package/dist/modules/src/parser/subParsers/parseDo.d.ts +3 -0
  119. package/dist/modules/src/parser/subParsers/parseForOrDoseq.d.ts +4 -0
  120. package/dist/modules/src/parser/subParsers/parseFunction.d.ts +4 -0
  121. package/dist/modules/src/parser/subParsers/parseFunctionCall.d.ts +3 -0
  122. package/dist/modules/src/parser/subParsers/parseIfOrUnless.d.ts +5 -0
  123. package/dist/modules/src/parser/subParsers/parseImplicitBlock.d.ts +5 -0
  124. package/dist/modules/src/parser/subParsers/parseLet.d.ts +4 -0
  125. package/dist/modules/src/parser/subParsers/parseLoop.d.ts +4 -0
  126. package/dist/modules/src/parser/subParsers/parseNumber.d.ts +3 -0
  127. package/dist/modules/src/parser/subParsers/parseObject.d.ts +3 -0
  128. package/dist/modules/src/parser/subParsers/parseOperand.d.ts +3 -0
  129. package/dist/modules/src/parser/subParsers/parseRegexpShorthand.d.ts +3 -0
  130. package/dist/modules/src/parser/subParsers/parseReservedSymbol.d.ts +3 -0
  131. package/dist/modules/src/parser/subParsers/parseString.d.ts +4 -0
  132. package/dist/modules/src/parser/subParsers/parseSwitch.d.ts +4 -0
  133. package/dist/modules/src/parser/subParsers/parseSymbol.d.ts +3 -0
  134. package/dist/modules/src/parser/subParsers/parseTry.d.ts +4 -0
  135. package/dist/modules/src/parser/types.d.ts +19 -26
  136. package/dist/modules/src/testFramework/index.d.ts +3 -2
  137. package/dist/modules/src/tokenizer/token.d.ts +0 -2
  138. package/dist/modules/src/tokenizer/tokenizers.d.ts +2 -2
  139. package/dist/modules/src/typeGuards/astNode.d.ts +18 -19
  140. package/dist/modules/src/typeGuards/index.d.ts +0 -1
  141. package/dist/modules/src/typeGuards/lits.d.ts +0 -1
  142. package/dist/modules/string.esm.js.map +1 -1
  143. package/dist/modules/string.js.map +1 -1
  144. package/dist/modules/vector.esm.js.map +1 -1
  145. package/dist/modules/vector.js.map +1 -1
  146. package/dist/src/AutoCompleter/AutoCompleter.d.ts +2 -1
  147. package/dist/src/builtin/bindingNode.d.ts +3 -3
  148. package/dist/src/builtin/index.d.ts +0 -1
  149. package/dist/src/builtin/interface.d.ts +3 -4
  150. package/dist/src/builtin/specialExpressionTypes.d.ts +0 -1
  151. package/dist/src/builtin/specialExpressions/and.d.ts +2 -2
  152. package/dist/src/builtin/specialExpressions/array.d.ts +2 -2
  153. package/dist/src/builtin/specialExpressions/block.d.ts +2 -2
  154. package/dist/src/builtin/specialExpressions/cond.d.ts +2 -2
  155. package/dist/src/builtin/specialExpressions/if.d.ts +2 -2
  156. package/dist/src/builtin/specialExpressions/loop.d.ts +2 -2
  157. package/dist/src/builtin/specialExpressions/loops.d.ts +4 -4
  158. package/dist/src/builtin/specialExpressions/object.d.ts +2 -2
  159. package/dist/src/builtin/specialExpressions/or.d.ts +2 -2
  160. package/dist/src/builtin/specialExpressions/qq.d.ts +2 -2
  161. package/dist/src/builtin/specialExpressions/recur.d.ts +2 -2
  162. package/dist/src/builtin/specialExpressions/switch.d.ts +2 -2
  163. package/dist/src/builtin/specialExpressions/throw.d.ts +2 -2
  164. package/dist/src/builtin/specialExpressions/try.d.ts +2 -2
  165. package/dist/src/builtin/specialExpressions/unless.d.ts +2 -2
  166. package/dist/src/builtin/utils.d.ts +2 -2
  167. package/dist/src/evaluator/index.d.ts +2 -2
  168. package/dist/src/evaluator/interface.d.ts +4 -3
  169. package/dist/src/getUndefinedSymbols/index.d.ts +2 -2
  170. package/dist/src/parser/ParserContext.d.ts +20 -0
  171. package/dist/src/parser/helpers.d.ts +19 -0
  172. package/dist/src/parser/index.d.ts +3 -0
  173. package/dist/src/parser/subParsers/getPrecedence.d.ts +3 -0
  174. package/dist/src/parser/subParsers/parseArray.d.ts +3 -0
  175. package/dist/src/parser/subParsers/parseBindingTarget.d.ts +6 -0
  176. package/dist/src/parser/subParsers/parseCond.d.ts +4 -0
  177. package/dist/src/parser/subParsers/parseDo.d.ts +3 -0
  178. package/dist/src/parser/subParsers/parseForOrDoseq.d.ts +4 -0
  179. package/dist/src/parser/subParsers/parseFunction.d.ts +4 -0
  180. package/dist/src/parser/subParsers/parseFunctionCall.d.ts +3 -0
  181. package/dist/src/parser/subParsers/parseIfOrUnless.d.ts +5 -0
  182. package/dist/src/parser/subParsers/parseImplicitBlock.d.ts +5 -0
  183. package/dist/src/parser/subParsers/parseLet.d.ts +4 -0
  184. package/dist/src/parser/subParsers/parseLoop.d.ts +4 -0
  185. package/dist/src/parser/subParsers/parseNumber.d.ts +3 -0
  186. package/dist/src/parser/subParsers/parseObject.d.ts +3 -0
  187. package/dist/src/parser/subParsers/parseOperand.d.ts +3 -0
  188. package/dist/src/parser/subParsers/parseRegexpShorthand.d.ts +3 -0
  189. package/dist/src/parser/subParsers/parseReservedSymbol.d.ts +3 -0
  190. package/dist/src/parser/subParsers/parseString.d.ts +4 -0
  191. package/dist/src/parser/subParsers/parseSwitch.d.ts +4 -0
  192. package/dist/src/parser/subParsers/parseSymbol.d.ts +3 -0
  193. package/dist/src/parser/subParsers/parseTry.d.ts +4 -0
  194. package/dist/src/parser/types.d.ts +19 -26
  195. package/dist/src/testFramework/index.d.ts +3 -2
  196. package/dist/src/tokenizer/token.d.ts +0 -2
  197. package/dist/src/tokenizer/tokenizers.d.ts +2 -2
  198. package/dist/src/typeGuards/astNode.d.ts +18 -19
  199. package/dist/src/typeGuards/index.d.ts +0 -1
  200. package/dist/src/typeGuards/lits.d.ts +0 -1
  201. package/dist/testFramework.esm.js +1 -1
  202. package/dist/testFramework.esm.js.map +1 -1
  203. package/dist/testFramework.js +1 -1
  204. package/dist/testFramework.js.map +1 -1
  205. package/package.json +1 -1
  206. package/dist/cli/src/parser/Parser.d.ts +0 -58
  207. package/dist/modules/src/parser/Parser.d.ts +0 -58
  208. package/dist/src/parser/Parser.d.ts +0 -58
@@ -1 +1 @@
1
- {"version":3,"file":"assert.js","sources":["../../src/utils/debug/getCodeMarker.ts","../../src/errors.ts","../../src/constants/constants.ts","../../src/utils/symbols.ts","../../src/utils/debug/debugTools.ts","../../src/utils/getAssertionError.ts","../../src/utils/debug/getSourceCodeInfo.ts","../../src/typeGuards/index.ts","../../src/typeGuards/litsFunction.ts","../../src/typeGuards/lits.ts","../../src/typeGuards/number.ts","../../src/typeGuards/string.ts","../../src/utils/index.ts","../../src/typeGuards/annotatedArrays.ts","../../src/builtin/modules/assert/docs.ts","../../src/builtin/modules/assert/index.ts"],"sourcesContent":["import type { SourceCodeInfo } from '../../tokenizer/token'\n\nexport function getCodeMarker(sourceCodeInfo: SourceCodeInfo): string {\n if (!sourceCodeInfo.position || !sourceCodeInfo.code)\n return ''\n\n const leftPadding = sourceCodeInfo.position.column - 1\n const rightPadding = sourceCodeInfo.code.length - leftPadding - 1\n return `${' '.repeat(Math.max(leftPadding, 0))}^${' '.repeat(Math.max(rightPadding, 0))}`\n}\n","import { getCodeMarker } from '../src/utils/debug/getCodeMarker'\nimport type { Arr } from './interface'\nimport type { SourceCodeInfo } from './tokenizer/token'\n\nfunction getLitsErrorMessage(message: string, sourceCodeInfo?: SourceCodeInfo) {\n if (!sourceCodeInfo) {\n return message\n }\n const location = `${sourceCodeInfo.position.line}:${sourceCodeInfo.position.column}`\n const filePathLine = sourceCodeInfo.filePath\n ? `\\n${sourceCodeInfo.filePath}:${location}`\n : `\\nLocation ${location}`\n const codeLine = `\\n${sourceCodeInfo.code}`\n const codeMarker = `\\n${getCodeMarker(sourceCodeInfo)}`\n return `${message}${filePathLine}${codeLine}${codeMarker}`\n}\n\nexport class RecurSignal extends Error {\n public params: Arr\n constructor(params: Arr) {\n super(`recur, params: ${params}`)\n Object.setPrototypeOf(this, RecurSignal.prototype)\n this.name = 'RecurSignal'\n this.params = params\n }\n}\n\nexport class LitsError extends Error {\n public readonly sourceCodeInfo?: SourceCodeInfo\n public readonly shortMessage: string\n constructor(err: unknown, sourceCodeInfo: SourceCodeInfo | undefined) {\n const message = err instanceof Error\n ? err.message\n : `${err}`\n\n super(getLitsErrorMessage(message, sourceCodeInfo))\n this.shortMessage = message\n this.sourceCodeInfo = sourceCodeInfo\n Object.setPrototypeOf(this, LitsError.prototype)\n this.name = 'LitsError'\n }\n\n public getCodeMarker(): string | undefined {\n return this.sourceCodeInfo && getCodeMarker(this.sourceCodeInfo)\n }\n}\n\nexport class UserDefinedError extends LitsError {\n public userMessage: string\n constructor(message: string, sourceCodeInfo?: SourceCodeInfo) {\n super(message, sourceCodeInfo)\n this.userMessage = message\n Object.setPrototypeOf(this, UserDefinedError.prototype)\n this.name = 'UserDefinedError'\n }\n}\n\nexport class AssertionError extends LitsError {\n constructor(message: string | Error, sourceCodeInfo?: SourceCodeInfo) {\n super(message, sourceCodeInfo)\n Object.setPrototypeOf(this, AssertionError.prototype)\n this.name = 'AssertionError'\n }\n}\n\nexport class UndefinedSymbolError extends LitsError {\n public symbol: string\n constructor(symbolName: string, sourceCodeInfo?: SourceCodeInfo) {\n const message = `Undefined symbol '${symbolName}'.`\n super(message, sourceCodeInfo)\n this.symbol = symbolName\n Object.setPrototypeOf(this, UndefinedSymbolError.prototype)\n this.name = 'UndefinedSymbolError'\n }\n}\n\nexport function isLitsError(error: unknown): error is LitsError {\n return error instanceof LitsError\n}\n","export const NodeTypes = {\n Number: 1,\n String: 2,\n NormalExpression: 3,\n SpecialExpression: 4,\n UserDefinedSymbol: 5,\n NormalBuiltinSymbol: 6,\n SpecialBuiltinSymbol: 7,\n ReservedSymbol: 8,\n Binding: 9,\n Spread: 10,\n} as const\n\nconst NodeTypesSet = new Set(Object.values(NodeTypes))\n\nexport type NodeType = typeof NodeTypes[keyof typeof NodeTypes]\n\nexport function getNodeTypeName(type: NodeType): keyof typeof NodeTypes {\n return Object.keys(NodeTypes).find(key => NodeTypes[key as keyof typeof NodeTypes] === type) as keyof typeof NodeTypes\n}\n\n// TODO, is this needed?\nexport function isNodeType(type: unknown): type is NodeType {\n return typeof type === 'number' && NodeTypesSet.has(type as NodeType)\n}\n\nconst functionTypes = [\n 'UserDefined',\n 'Partial',\n 'Comp',\n 'Constantly',\n 'Juxt',\n 'Complement',\n 'EveryPred',\n 'SomePred',\n 'Fnull',\n 'Builtin',\n 'SpecialBuiltin',\n 'NativeJsFunction',\n 'Module',\n] as const\n\nconst functionTypeSet = new Set(functionTypes)\n\nexport type FunctionType = typeof functionTypes[number]\n\nexport function isFunctionType(type: unknown): type is FunctionType {\n return typeof type === 'string' && functionTypeSet.has(type as FunctionType)\n}\n","export const FUNCTION_SYMBOL = '^^fn^^'\nexport const REGEXP_SYMBOL = '^^re^^'\n","import { getNodeTypeName, isFunctionType, isNodeType } from '../../constants/constants'\nimport type { LitsFunction, Node } from '../../parser/types'\nimport { FUNCTION_SYMBOL } from '../symbols'\n\nfunction isLitsFunction(func: unknown): func is LitsFunction {\n if (func === null || typeof func !== 'object')\n return false\n\n return FUNCTION_SYMBOL in func && 'functionType' in func && isFunctionType(func.functionType)\n}\n\nfunction isNode(value: unknown): value is Node {\n if (!Array.isArray(value) || value.length < 2)\n return false\n return isNodeType(value[0])\n}\n\nexport function valueToString(value: unknown): string {\n if (isLitsFunction(value))\n // eslint-disable-next-line ts/no-unsafe-member-access\n return `<function ${(value as any).name || '\\u03BB'}>`\n\n if (isNode(value))\n return `${getNodeTypeName(value[0])}-node`\n\n if (value === null)\n return 'null'\n\n if (typeof value === 'object' && value instanceof RegExp)\n return `${value}`\n\n if (typeof value === 'object' && value instanceof Error)\n return value.toString()\n\n return JSON.stringify(value)\n}\n","import { LitsError } from '../errors'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { valueToString } from './debug/debugTools'\nimport { getSourceCodeInfo } from './debug/getSourceCodeInfo'\n\nexport function getAssertionError(typeName: string, value: unknown, sourceCodeInfo?: SourceCodeInfo): LitsError {\n return new LitsError(`Expected ${typeName}, got ${valueToString(value)}.`, getSourceCodeInfo(value, sourceCodeInfo))\n}\n","import type { SourceCodeInfo } from '../../tokenizer/token'\n\nexport function getSourceCodeInfo(anyValue: any, sourceCodeInfo: SourceCodeInfo | undefined): SourceCodeInfo | undefined {\n // eslint-disable-next-line ts/no-unsafe-return, ts/no-unsafe-member-access\n return anyValue?.sourceCodeInfo ?? sourceCodeInfo\n}\n","import { LitsError } from '../errors'\nimport type { UnknownRecord } from '../interface'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { valueToString } from '../utils/debug/debugTools'\nimport { getSourceCodeInfo } from '../utils/debug/getSourceCodeInfo'\n\nexport function isNonUndefined<T>(value: T | undefined): value is T {\n return value !== undefined\n}\n\nexport function asNonUndefined<T>(value: T | undefined, sourceCodeInfo?: SourceCodeInfo): T {\n assertNonUndefined(value, sourceCodeInfo)\n return value\n}\n\nexport function assertNonUndefined<T>(value: T | undefined, sourceCodeInfo?: SourceCodeInfo): asserts value is T {\n if (!isNonUndefined(value))\n throw new LitsError('Unexpected undefined', getSourceCodeInfo(value, sourceCodeInfo))\n}\n\nexport function isUnknownRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value)\n}\n\nexport function assertUnknownRecord(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is UnknownRecord {\n if (!isUnknownRecord(value)) {\n throw new LitsError(\n `Expected ${'UnknownRecord'}, got ${valueToString(value)}.`,\n getSourceCodeInfo(value, sourceCodeInfo),\n )\n }\n}\n\nexport function asUnknownRecord(value: unknown, sourceCodeInfo?: SourceCodeInfo): UnknownRecord {\n assertUnknownRecord(value, sourceCodeInfo)\n return value\n}\n","import type { LitsFunction, NativeJsFunction, NormalBuiltinFunction, UserDefinedFunction } from '../parser/types'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { getAssertionError } from '../utils/getAssertionError'\nimport { FUNCTION_SYMBOL } from '../utils/symbols'\nimport { isUnknownRecord } from '.'\n\nexport function isLitsFunction(value: unknown): value is LitsFunction {\n if (value === null || typeof value !== 'object')\n return false\n\n return !!(value as LitsFunction)[FUNCTION_SYMBOL]\n}\nexport function asLitsFunction(value: unknown, sourceCodeInfo?: SourceCodeInfo): LitsFunction {\n assertLitsFunction(value, sourceCodeInfo)\n return value\n}\nexport function assertLitsFunction(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is LitsFunction {\n if (!isLitsFunction(value))\n throw getAssertionError('LitsFunction', value, sourceCodeInfo)\n}\n\nexport function isUserDefinedFunction(value: unknown): value is UserDefinedFunction {\n return isLitsFunction(value) && value.functionType === 'UserDefined'\n}\nexport function asUserDefinedFunction(value: unknown, sourceCodeInfo?: SourceCodeInfo): UserDefinedFunction {\n assertUserDefinedFunction(value, sourceCodeInfo)\n return value\n}\nexport function assertUserDefinedFunction(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is UserDefinedFunction {\n if (!isUserDefinedFunction(value))\n throw getAssertionError('NativeJsFunction', value, sourceCodeInfo)\n}\n\nexport function isNativeJsFunction(value: unknown): value is NativeJsFunction {\n return isLitsFunction(value) && value.functionType === 'NativeJsFunction'\n}\nexport function asNativeJsFunction(value: unknown, sourceCodeInfo?: SourceCodeInfo): NativeJsFunction {\n assertNativeJsFunction(value, sourceCodeInfo)\n return value\n}\nexport function assertNativeJsFunction(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is NativeJsFunction {\n if (!isNativeJsFunction(value))\n throw getAssertionError('NativeJsFunction', value, sourceCodeInfo)\n}\n\nexport function isBuiltinFunction(value: unknown): value is NormalBuiltinFunction {\n return isUnknownRecord(value) && value.functionType === 'Builtin'\n}\n","import type { Any, Coll, Obj, Seq } from '../interface'\nimport type { FunctionLike, RegularExpression } from '../parser/types'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { getAssertionError } from '../utils/getAssertionError'\nimport { REGEXP_SYMBOL } from '../utils/symbols'\nimport { isLitsFunction } from './litsFunction'\n\nexport function isAny(value: unknown): value is Any {\n // TODO weak test\n return value !== undefined\n}\nexport function asAny(value: unknown, sourceCodeInfo?: SourceCodeInfo): Any {\n assertAny(value, sourceCodeInfo)\n return value\n}\nexport function assertAny(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is Any {\n if (!isAny(value))\n throw getAssertionError('not undefined', value, sourceCodeInfo)\n}\n\nexport function isSeq(value: unknown): value is Seq {\n return Array.isArray(value) || typeof value === 'string'\n}\nexport function asSeq(value: unknown, sourceCodeInfo?: SourceCodeInfo): Seq {\n assertSeq(value, sourceCodeInfo)\n return value\n}\nexport function assertSeq(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is Seq {\n if (!isSeq(value))\n throw getAssertionError('string or array', value, sourceCodeInfo)\n}\n\nexport function isObj(value: unknown): value is Obj {\n return !(\n value === null\n || typeof value !== 'object'\n || Array.isArray(value)\n || value instanceof RegExp\n || isLitsFunction(value)\n || isRegularExpression(value)\n )\n}\nexport function asObj(value: unknown, sourceCodeInfo?: SourceCodeInfo): Obj {\n assertObj(value, sourceCodeInfo)\n return value\n}\nexport function assertObj(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is Obj {\n if (!isObj(value))\n throw getAssertionError('object', value, sourceCodeInfo)\n}\n\nexport function isColl(value: unknown): value is Coll {\n return isSeq(value) || isObj(value)\n}\nexport function asColl(value: unknown, sourceCodeInfo?: SourceCodeInfo): Coll {\n assertColl(value, sourceCodeInfo)\n return value\n}\nexport function assertColl(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is Coll {\n if (!isColl(value))\n throw getAssertionError('string, array or object', value, sourceCodeInfo)\n}\n\nexport function isRegularExpression(regexp: unknown): regexp is RegularExpression {\n if (regexp === null || typeof regexp !== 'object')\n return false\n\n return !!(regexp as RegularExpression)[REGEXP_SYMBOL]\n}\nexport function asRegularExpression(value: unknown, sourceCodeInfo?: SourceCodeInfo): RegularExpression {\n assertRegularExpression(value, sourceCodeInfo)\n return value\n}\nexport function assertRegularExpression(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is RegularExpression {\n if (!isRegularExpression(value))\n throw getAssertionError('RegularExpression', value, sourceCodeInfo)\n}\n\nexport function isStringOrRegularExpression(value: unknown): value is string | RegularExpression {\n return isRegularExpression(value) || typeof value === 'string'\n}\nexport function asStringOrRegularExpression(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): string | RegularExpression {\n assertStringOrRegularExpression(value, sourceCodeInfo)\n return value\n}\nexport function assertStringOrRegularExpression(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is string | RegularExpression {\n if (!isStringOrRegularExpression(value))\n throw getAssertionError('string or RegularExpression', value, sourceCodeInfo)\n}\n\nexport function isFunctionLike(value: unknown): value is FunctionLike {\n if (typeof value === 'number')\n return true\n if (isColl(value))\n return true\n if (isLitsFunction(value))\n return true\n\n return false\n}\nexport function asFunctionLike(value: unknown, sourceCodeInfo?: SourceCodeInfo): FunctionLike {\n assertFunctionLike(value, sourceCodeInfo)\n return value\n}\nexport function assertFunctionLike(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is FunctionLike {\n if (!isFunctionLike(value))\n throw getAssertionError('FunctionLike', value, sourceCodeInfo)\n}\n","import { LitsError } from '../errors'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { valueToString } from '../utils/debug/debugTools'\nimport { getSourceCodeInfo } from '../utils/debug/getSourceCodeInfo'\n\ntype SignOptions =\n | {\n positive?: true\n negative?: never\n nonPositive?: never\n nonNegative?: never\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: true\n nonPositive?: never\n nonNegative?: never\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: true\n nonNegative?: never\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: never\n nonNegative?: true\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: never\n nonNegative?: never\n zero?: true\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: never\n nonNegative?: never\n zero?: never\n nonZero?: true\n }\n\ntype GtOptions =\n | {\n gt?: number\n gte?: never\n }\n | {\n gt?: never\n gte?: number\n }\n\ntype LtOptions =\n | {\n lt?: number\n lte?: never\n }\n | {\n lt?: never\n lte?: number\n }\n\ntype NumberOptions = {\n integer?: true\n finite?: true\n} & SignOptions &\nGtOptions &\nLtOptions\n\nfunction getRangeString(options: NumberOptions): string {\n const hasUpperAndLowerBound\n = (typeof options.gt === 'number' || typeof options.gte === 'number')\n && (typeof options.lt === 'number' || typeof options.lte === 'number')\n if (hasUpperAndLowerBound) {\n return `${typeof options.gt === 'number' ? `${options.gt} < n ` : `${options.gte} <= n `}${\n typeof options.lt === 'number' ? `< ${options.lt}` : `<= ${options.lte}`\n }`\n }\n else if (typeof options.gt === 'number' || typeof options.gte === 'number') {\n return `${typeof options.gt === 'number' ? `n > ${options.gt}` : `n >= ${options.gte}`}`\n }\n else if (typeof options.lt === 'number' || typeof options.lte === 'number') {\n return `${typeof options.lt === 'number' ? `n < ${options.lt}` : `n <= ${options.lte}`}`\n }\n else { return '' }\n}\n\nfunction getSignString(options: NumberOptions): string {\n return options.positive\n ? 'positive'\n : options.negative\n ? 'negative'\n : options.nonNegative\n ? 'non negative'\n : options.nonPositive\n ? 'non positive'\n : options.nonZero\n ? 'non zero'\n : ''\n}\n\nfunction getNumberTypeName(options: NumberOptions): string {\n if (options.zero)\n return 'zero'\n\n const sign = getSignString(options)\n const numberType = options.integer ? 'integer' : 'number'\n const finite = options.finite ? 'finite' : ''\n const range = getRangeString(options)\n\n return [sign, finite, numberType, range].filter(x => !!x).join(' ')\n}\n\nexport function isNumber(value: unknown, options: NumberOptions = {}): value is number {\n if (typeof value !== 'number')\n return false\n\n if (Number.isNaN(value))\n return false\n\n if (options.integer && !Number.isInteger(value))\n return false\n\n if (options.finite && !Number.isFinite(value))\n return false\n\n if (options.zero && value !== 0)\n return false\n\n if (options.nonZero && value === 0)\n return false\n\n if (options.positive && value <= 0)\n return false\n\n if (options.negative && value >= 0)\n return false\n\n if (options.nonPositive && value > 0)\n return false\n\n if (options.nonNegative && value < 0)\n return false\n\n if (typeof options.gt === 'number' && value <= options.gt)\n return false\n\n if (typeof options.gte === 'number' && value < options.gte)\n return false\n\n if (typeof options.lt === 'number' && value >= options.lt)\n return false\n\n if (typeof options.lte === 'number' && value > options.lte)\n return false\n\n return true\n}\n\nexport function assertNumber(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n options: NumberOptions = {},\n): asserts value is number {\n if (!isNumber(value, options)) {\n throw new LitsError(\n `Expected ${getNumberTypeName(options)}, got ${valueToString(value)}.`,\n getSourceCodeInfo(value, sourceCodeInfo),\n )\n }\n}\n\nexport function asNumber(\n value: unknown,\n sourceCodeInfo: SourceCodeInfo | undefined,\n options: NumberOptions = {},\n): number {\n assertNumber(value, sourceCodeInfo, options)\n return value\n}\n","import type { SourceCodeInfo } from '../tokenizer/token'\nimport { getAssertionError } from '../utils/getAssertionError'\n\ntype StringAssertionOptions =\n | {\n nonEmpty?: true\n char?: never\n }\n | {\n nonEmpty?: never\n char?: true\n }\n\nexport function isString(value: unknown, options: StringAssertionOptions = {}): value is string {\n if (typeof value !== 'string')\n return false\n\n if (options.nonEmpty && value.length === 0)\n return false\n\n if (options.char && value.length !== 1)\n return false\n\n return true\n}\n\nexport function assertString(\n value: unknown,\n sourceCodeInfo: SourceCodeInfo | undefined,\n options: StringAssertionOptions = {},\n): asserts value is string {\n if (!isString(value, options)) {\n throw getAssertionError(\n `${options.nonEmpty ? 'non empty string' : options.char ? 'character' : 'string'}`,\n value,\n sourceCodeInfo,\n )\n }\n}\n\nexport function asString(\n value: unknown,\n sourceCodeInfo: SourceCodeInfo | undefined,\n options: StringAssertionOptions = {},\n): string {\n assertString(value, sourceCodeInfo, options)\n return value\n}\n\nexport function isStringOrNumber(value: unknown): value is string | number {\n return typeof value === 'string' || typeof value === 'number'\n}\nexport function asStringOrNumber(value: unknown, sourceCodeInfo?: SourceCodeInfo): string | number {\n assertStringOrNumber(value, sourceCodeInfo)\n return value\n}\nexport function assertStringOrNumber(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is string | number {\n if (!isStringOrNumber(value))\n throw getAssertionError('string or number', value, sourceCodeInfo)\n}\n","import type { Any, Coll, Obj } from '../interface'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { asAny, isColl, isObj, isRegularExpression } from '../typeGuards/lits'\nimport { isNumber } from '../typeGuards/number'\nimport { asString, assertStringOrNumber } from '../typeGuards/string'\nimport { isUnknownRecord } from '../typeGuards'\nimport { LitsError } from '../errors'\n\nexport function collHasKey(coll: unknown, key: string | number): boolean {\n if (!isColl(coll))\n return false\n\n if (typeof coll === 'string' || Array.isArray(coll)) {\n if (!isNumber(key, { integer: true }))\n return false\n\n return key >= 0 && key < coll.length\n }\n return !!Object.getOwnPropertyDescriptor(coll, key)\n}\n\nexport function compare<T extends string | number>(a: T, b: T, sourceCodeInfo: SourceCodeInfo | undefined): number {\n assertStringOrNumber(a, sourceCodeInfo)\n assertStringOrNumber(b, sourceCodeInfo)\n\n if (typeof a === 'string' && typeof b === 'string') {\n return a < b ? -1 : a > b ? 1 : 0\n }\n if (typeof a === 'number' && typeof b === 'number') {\n return Math.sign((a) - (b))\n }\n throw new LitsError(`Cannot compare values of different types: ${typeof a} and ${typeof b}`, sourceCodeInfo)\n}\n\nexport function deepEqual(a: unknown, b: unknown, sourceCodeInfo?: SourceCodeInfo): boolean {\n if (a === b)\n return true\n\n if (typeof a === 'number' && typeof b === 'number')\n return approxEqual(a, b)\n\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length)\n return false\n\n for (let i = 0; i < a.length; i += 1) {\n if (!deepEqual(asAny(a[i], sourceCodeInfo), asAny(b[i], sourceCodeInfo), sourceCodeInfo))\n return false\n }\n return true\n }\n if (isRegularExpression(a) && isRegularExpression(b))\n return a.s === b.s && a.f === b.f\n\n if (isUnknownRecord(a) && isUnknownRecord(b)) {\n const aKeys = Object.keys(a)\n const bKeys = Object.keys(b)\n if (aKeys.length !== bKeys.length)\n return false\n\n for (let i = 0; i < aKeys.length; i += 1) {\n const key = asString(aKeys[i], sourceCodeInfo)\n if (!deepEqual(a[key], b[key], sourceCodeInfo))\n return false\n }\n return true\n }\n return false\n}\n\nexport function toNonNegativeInteger(num: number): number {\n return Math.max(0, Math.ceil(num))\n}\n\nexport function toAny(value: unknown): Any {\n return (value ?? null) as Any\n}\n\nfunction clone<T>(value: T): T {\n if (isObj(value)) {\n return Object.entries(value).reduce((result: Obj, entry) => {\n const [key, val] = entry\n result[key] = clone(val)\n return result\n }, {}) as T\n }\n if (Array.isArray(value))\n // eslint-disable-next-line ts/no-unsafe-return\n return value.map(item => clone(item)) as unknown as T\n\n return value\n}\n\nexport function cloneColl<T extends Coll>(value: T): T {\n return clone(value)\n}\n\nexport function joinSets<T>(...results: Set<T>[]): Set<T> {\n const result = new Set<T>()\n for (const symbols of results)\n symbols.forEach(symbol => result.add(symbol))\n\n return result\n}\n\nexport function addToSet<T>(target: Set<T>, source: Set<T>): void {\n source.forEach(symbol => target.add(symbol))\n}\n\nexport const EPSILON = 1e-10\n\nexport function approxEqual(a: number, b: number, epsilon: number = EPSILON): boolean {\n if (a === b) {\n return true\n }\n\n const diff = Math.abs(a - b)\n\n if (a === 0 || b === 0 || diff < epsilon) {\n // Use absolute error for values near zero\n return diff < epsilon\n }\n const absA = Math.abs(a)\n const absB = Math.abs(b)\n\n // Use relative error for larger values\n return diff / (absA + absB) < epsilon\n}\n\nexport function approxZero(value: number): boolean {\n return Math.abs(value) < EPSILON\n}\n\nexport function smartTrim(str: string, minIndent = 0): string {\n const lines = str.split('\\n')\n while (lines[0]?.match(/^\\s*$/)) {\n lines.shift() // Remove leading empty lines\n }\n while (lines[lines.length - 1]?.match(/^\\s*$/)) {\n lines.pop() // Remove trailing empty lines\n }\n const indent = lines.reduce((acc, line) => {\n if (line.match(/^\\s*$/))\n return acc // Skip empty lines\n const lineIndent = line.match(/^\\s*/)![0].length\n return Math.min(acc, lineIndent)\n }, Infinity)\n return lines.map(line => ' '.repeat(minIndent) + line.slice(indent)).join('\\n').trimEnd()\n}\n","import { LitsError } from '../errors'\nimport type { Any } from '../interface'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { isNumber } from './number'\n\nconst annotatedArrays = new WeakSet<unknown[]>()\nconst vectors = new WeakSet<unknown[]>()\nconst notVectors = new WeakSet<unknown[]>()\nconst matrices = new WeakSet<unknown[]>()\nconst notMatrices = new WeakSet<unknown[]>()\nconst grids = new WeakSet<unknown[]>()\nconst notGrids = new WeakSet<unknown[]>()\n\nexport function annotate<T>(value: T): T {\n if (!Array.isArray(value)) {\n return value\n }\n if (annotatedArrays.has(value)) {\n return value\n }\n isVector(value)\n if (!isMatrix(value)) {\n isGrid(value)\n }\n\n return value\n}\nexport function isVector(vector: unknown): vector is number[] {\n if (!Array.isArray(vector)) {\n return false\n }\n\n if (vectors.has(vector)) {\n return true\n }\n if (notVectors.has(vector)) {\n return false\n }\n\n if (vector.every(elem => isNumber(elem))) {\n annotatedArrays.add(vector)\n vectors.add(vector)\n return true\n }\n notVectors.add(vector)\n return false\n}\n\nexport function assertVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is number[] {\n if (!isVector(vector)) {\n throw new LitsError(`Expected a vector, but got ${vector}`, sourceCodeInfo)\n }\n}\n\nexport function is2dVector(vector: unknown): vector is [number, number] {\n if (!isVector(vector)) {\n return false\n }\n return vector.length === 2\n}\nexport function assert2dVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is [number, number] {\n if (!is2dVector(vector)) {\n throw new LitsError(`Expected a 2d vector, but got ${vector}`, sourceCodeInfo)\n }\n}\n\nexport function is3dVector(vector: unknown): vector is [number, number, number] {\n if (!isVector(vector)) {\n return false\n }\n return vector.length === 3\n}\nexport function assert3dVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is [number, number, number] {\n if (!is3dVector(vector)) {\n throw new LitsError(`Expected a 3d vector, but got ${vector}`, sourceCodeInfo)\n }\n}\n\nexport function assertNonEmptyVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is number[] {\n assertVector(vector, sourceCodeInfo)\n if (vector.length === 0) {\n throw new LitsError(`Expected a non empty vector, but got ${vector}`, sourceCodeInfo)\n }\n}\n\nexport function isGrid(grid: unknown): grid is unknown[][] {\n if (!Array.isArray(grid)) {\n return false\n }\n if (grids.has(grid)) {\n return true\n }\n if (notGrids.has(grid)) {\n return false\n }\n if (grid.length === 0) {\n notGrids.add(grid)\n return false\n }\n if (!Array.isArray(grid[0])) {\n notGrids.add(grid)\n return false\n }\n const nbrOfCols = grid[0].length\n for (const row of grid.slice(1)) {\n if (!Array.isArray(row)) {\n notGrids.add(grid)\n return false\n }\n if (row.length !== nbrOfCols) {\n notGrids.add(grid)\n return false\n }\n }\n annotatedArrays.add(grid)\n grids.add(grid)\n return true\n}\n\nexport function assertGrid(grid: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts grid is Any[][] {\n if (!isGrid(grid)) {\n throw new LitsError(`Expected a grid, but got ${grid}`, sourceCodeInfo)\n }\n}\n\nexport function isMatrix(matrix: unknown): matrix is number[][] {\n if (!Array.isArray(matrix)) {\n return false\n }\n if (matrices.has(matrix)) {\n return true\n }\n if (notMatrices.has(matrix)) {\n return false\n }\n if (matrix.length === 0) {\n notMatrices.add(matrix)\n return false\n }\n if (!Array.isArray(matrix[0]) || matrix[0].length === 0) {\n notMatrices.add(matrix)\n return false\n }\n const nbrOfCols = matrix[0].length\n for (const row of matrix) {\n if (!Array.isArray(row) || row.length !== nbrOfCols || row.some(cell => !isNumber(cell))) {\n notMatrices.add(matrix)\n return false\n }\n }\n annotatedArrays.add(matrix)\n grids.add(matrix)\n matrices.add(matrix)\n return true\n}\n\nexport function assertMatrix(matrix: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts matrix is number[][] {\n if (!isMatrix(matrix)) {\n throw new LitsError(`Expected a matrix, but got ${matrix}`, sourceCodeInfo)\n }\n}\n\nexport function assertSquareMatrix(matrix: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts matrix is number[][] {\n if (!isMatrix(matrix)) {\n throw new LitsError(`Expected a matrix, but got ${matrix}`, sourceCodeInfo)\n }\n if (matrix.length !== matrix[0]!.length) {\n throw new LitsError(`Expected square matrix, but got ${matrix.length} and ${matrix[0]!.length}`, sourceCodeInfo)\n }\n}\n\nexport function isSquareMatrix(matrix: unknown): matrix is number[][] {\n if (!isMatrix(matrix)) {\n return false\n }\n if (matrix.length !== matrix[0]!.length) {\n return false\n }\n return true\n}\n","import type { FunctionDocs } from '../../interface'\n\nexport const moduleDocs: Record<string, FunctionDocs> = {\n 'assert': {\n category: 'assert',\n description: 'If $value is falsy it throws `AssertionError` with $message. If no $message is provided, message is set to $value.',\n returns: {\n type: 'any',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert } = import(\"assert\");\\ntry assert(0, \"Expected a positive value\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-truthy', 'assert.assert-true'],\n hideOperatorForm: true,\n },\n 'assert!=': {\n category: 'assert',\n description: 'If $a is the same as $b it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n a: {\n type: 'any',\n },\n b: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'a',\n 'b',\n ],\n },\n {\n argumentNames: [\n 'a',\n 'b',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert!= } = import(\"assert\");\\ntry assert!=(0, 0, \"Expected different values\") catch (e) e.message end',\n 'let { assert!= } = import(\"assert\");\\ntry assert!=(0, 0) catch (e) e.message end',\n 'let { assert!= } = import(\"assert\");\\ntry 0 assert!= 0 catch (e) e.message end',\n 'let { assert!= } = import(\"assert\");\\ntry assert!=(0, 1) catch (e) e.message end',\n ],\n seeAlso: ['assert.assert='],\n hideOperatorForm: true,\n },\n 'assert=': {\n category: 'assert',\n description: 'If $a is not structural equal to $b it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n a: {\n type: 'any',\n },\n b: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'a',\n 'b',\n ],\n },\n {\n argumentNames: [\n 'a',\n 'b',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert= } = import(\"assert\");\\ntry assert=({ \"a\": 1 }, { \"a\": 2 }, \"Expected equal values\") catch (e) e.message end',\n 'let { assert= } = import(\"assert\");\\ntry assert=({ \"a\": 1 }, { \"a\": 2 }) catch (e) e.message end',\n 'let { assert= } = import(\"assert\");\\ntry assert=({ \"a\": 1 }, { \"a\": 1 }) catch (e) e.message end',\n ],\n seeAlso: ['assert.assert!='],\n hideOperatorForm: true,\n },\n 'assert-gt': {\n category: 'assert',\n description: 'If $a is not greater than $b it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n a: {\n type: 'any',\n },\n b: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'a',\n 'b',\n ],\n },\n {\n argumentNames: [\n 'a',\n 'b',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-gt } = import(\"assert\");\\ntry assert-gt(0, 1, \"Expected greater value\") catch (e) e.message end',\n 'let { assert-gt } = import(\"assert\");\\ntry assert-gt(0, 0) catch (e) e.message end',\n 'let { assert-gt } = import(\"assert\");\\ntry assert-gt(1, 0) catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-lt', 'assert.assert-gte', 'assert.assert-lte'],\n hideOperatorForm: true,\n },\n 'assert-lt': {\n category: 'assert',\n description: 'If $a is not less than $b it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n a: {\n type: 'any',\n },\n b: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'a',\n 'b',\n ],\n },\n {\n argumentNames: [\n 'a',\n 'b',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-lt } = import(\"assert\");\\ntry assert-lt(1, 0, \"Expected smaller value value\") catch (e) e.message end',\n 'let { assert-lt } = import(\"assert\");\\ntry assert-lt(1, 1) catch (e) e.message end',\n 'let { assert-lt } = import(\"assert\");\\ntry assert-lt(0, 1) catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-gt', 'assert.assert-lte', 'assert.assert-gte'],\n hideOperatorForm: true,\n },\n 'assert-gte': {\n category: 'assert',\n description: 'If $a is less than $b it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n a: {\n type: 'any',\n },\n b: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'a',\n 'b',\n ],\n },\n {\n argumentNames: [\n 'a',\n 'b',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-gte } = import(\"assert\");\\ntry assert-gte(0, 1, \"Expected greater value\") catch (e) e.message end',\n 'let { assert-gte } = import(\"assert\");\\ntry assert-gte(0, 1) catch (e) e.message end',\n 'let { assert-gte } = import(\"assert\");\\ntry assert-gte(1, 1) catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-lte', 'assert.assert-gt', 'assert.assert-lt'],\n hideOperatorForm: true,\n },\n 'assert-lte': {\n category: 'assert',\n description: 'If $a is grater than $b it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n a: {\n type: 'any',\n },\n b: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'a',\n 'b',\n ],\n },\n {\n argumentNames: [\n 'a',\n 'b',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-lte } = import(\"assert\");\\ntry assert-lte(1, 0, \"Expected smaller value value\") catch (e) e.message end',\n 'let { assert-lte } = import(\"assert\");\\ntry assert-lte(1, 0) catch (e) e.message end',\n 'let { assert-lte } = import(\"assert\");\\ntry assert-lte(1, 1) catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-gte', 'assert.assert-lt', 'assert.assert-gt'],\n hideOperatorForm: true,\n },\n 'assert-true': {\n category: 'assert',\n description: 'If $value is not `true` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-true } = import(\"assert\");\\ntry assert-true(false, \"Expected true\") catch (e) e.message end',\n 'let { assert-true } = import(\"assert\");\\ntry assert-true(false) catch (e) e.message end',\n 'let { assert-true } = import(\"assert\");\\ntry assert-true(true) catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-false', 'assert.assert-truthy', 'assert.assert-falsy', 'assert.assert', 'assert.assert-boolean'],\n hideOperatorForm: true,\n },\n 'assert-false': {\n category: 'assert',\n description: 'If $value is not `false` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-false } = import(\"assert\");\\ntry assert-false(true, \"Expected false\") catch (e) e.message end',\n 'let { assert-false } = import(\"assert\");\\ntry assert-false(true) catch (e) e.message end',\n 'let { assert-false } = import(\"assert\");\\ntry assert-false(false) catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-true', 'assert.assert-falsy', 'assert.assert-truthy', 'assert.assert-boolean'],\n hideOperatorForm: true,\n },\n 'assert-truthy': {\n category: 'assert',\n description: 'If $value is not `truthy` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-truthy } = import(\"assert\");\\ntry assert-truthy(false, \"Expected truthy\") catch (e) e.message end',\n 'let { assert-truthy } = import(\"assert\");\\ntry assert-truthy(false) catch (e) e.message end',\n 'let { assert-truthy } = import(\"assert\");\\ntry assert-truthy(0) catch (e) e.message end',\n 'let { assert-truthy } = import(\"assert\");\\ntry assert-truthy(null) catch (e) e.message end',\n 'let { assert-truthy } = import(\"assert\");\\ntry assert-truthy(\"\") catch (e) e.message end',\n 'let { assert-truthy } = import(\"assert\");\\ntry assert-truthy(true) catch (e) e.message end',\n 'let { assert-truthy } = import(\"assert\");\\ntry assert-truthy(1) catch (e) e.message end',\n 'let { assert-truthy } = import(\"assert\");\\ntry assert-truthy(\"x\") catch (e) e.message end',\n 'let { assert-truthy } = import(\"assert\");\\ntry assert-truthy([]) catch (e) e.message end',\n 'let { assert-truthy } = import(\"assert\");\\ntry assert-truthy(nd) catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-falsy', 'assert.assert-true', 'assert.assert-false', 'assert.assert', 'assert.assert-null'],\n hideOperatorForm: true,\n },\n 'assert-falsy': {\n category: 'assert',\n description: 'If $value is not `falsy` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-falsy } = import(\"assert\");\\ntry assert-falsy(true, \"Expected falsy\") catch (e) e.message end',\n 'let { assert-falsy } = import(\"assert\");\\ntry assert-falsy(\"x\") catch (e) e.message end',\n 'let { assert-falsy } = import(\"assert\");\\ntry assert-falsy([]) catch (e) e.message end',\n 'let { assert-falsy } = import(\"assert\");\\ntry assert-falsy(nd) catch (e) e.message end',\n 'let { assert-falsy } = import(\"assert\");\\ntry assert-falsy(1) catch (e) e.message end',\n 'let { assert-falsy } = import(\"assert\");\\ntry assert-falsy(false) catch (e) e.message end',\n 'let { assert-falsy } = import(\"assert\");\\ntry assert-falsy(0) catch (e) e.message end',\n 'let { assert-falsy } = import(\"assert\");\\ntry assert-falsy(null) catch (e) e.message end',\n 'let { assert-falsy } = import(\"assert\");\\ntry assert-falsy(\"\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-truthy', 'assert.assert-false', 'assert.assert-true', 'assert.assert-null'],\n hideOperatorForm: true,\n },\n 'assert-null': {\n category: 'assert',\n description: 'If $value is not `null` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-null } = import(\"assert\");\\ntry assert-null(null) catch (e) e.message end',\n 'let { assert-null } = import(\"assert\");\\ntry assert-null(true, \"Expected null\") catch (e) e.message end',\n 'let { assert-null } = import(\"assert\");\\ntry assert-null(\"x\") catch (e) e.message end',\n 'let { assert-null } = import(\"assert\");\\ntry assert-null([]) catch (e) e.message end',\n 'let { assert-null } = import(\"assert\");\\ntry assert-null(nd) catch (e) e.message end',\n 'let { assert-null } = import(\"assert\");\\ntry assert-null(1) catch (e) e.message end',\n 'let { assert-null } = import(\"assert\");\\ntry assert-null(false) catch (e) e.message end',\n 'let { assert-null } = import(\"assert\");\\ntry assert-null(0) catch (e) e.message end',\n 'let { assert-null } = import(\"assert\");\\ntry assert-null(\"\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-truthy', 'assert.assert-falsy'],\n hideOperatorForm: true,\n },\n 'assert-throws': {\n category: 'assert',\n description: 'If $fun does not throw, it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n fun: {\n type: 'function',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'fun',\n ],\n },\n {\n argumentNames: [\n 'fun',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-throws } = import(\"assert\");\\nassert-throws(-> throw(\"Error\"))',\n 'let { assert-throws } = import(\"assert\");\\ntry assert-throws(-> identity(\"Error\")) catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-throws-error', 'assert.assert-not-throws'],\n hideOperatorForm: true,\n },\n 'assert-throws-error': {\n category: 'assert',\n description: 'If $fun does not throw $error-message, it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n 'fun': {\n type: 'function',\n },\n 'error-message': {\n type: 'string',\n },\n 'message': {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n 'error-message',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'error-message',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-throws-error } = import(\"assert\");\\ntry assert-throws-error(-> throw(\"Error\"), \"Error\") catch (e) e.message end',\n 'let { assert-throws-error } = import(\"assert\");\\ntry assert-throws-error(-> identity(\"Error\"), \"Error\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-throws', 'assert.assert-not-throws'],\n hideOperatorForm: true,\n },\n 'assert-not-throws': {\n category: 'assert',\n description: 'If $fun throws, it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n fun: {\n type: 'function',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'fun',\n ],\n },\n {\n argumentNames: [\n 'fun',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-not-throws } = import(\"assert\");\\ntry assert-not-throws(-> identity(\"Error\")) catch (e) e.message end',\n 'let { assert-not-throws } = import(\"assert\");\\ntry assert-not-throws(-> throw(\"Error\")) catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-throws', 'assert.assert-throws-error'],\n hideOperatorForm: true,\n },\n 'assert-array': {\n category: 'assert',\n description: 'If $value is not an `array` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-array } = import(\"assert\");\\ntry assert-array([1, 2, 3]) catch (e) e.message end',\n 'let { assert-array } = import(\"assert\");\\ntry assert-array(\"string\") catch (e) e.message end',\n 'let { assert-array } = import(\"assert\");\\ntry assert-array(42, \"Expected an array\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-object', 'assert.assert-collection', 'assert.assert-sequence'],\n hideOperatorForm: true,\n },\n 'assert-boolean': {\n category: 'assert',\n description: 'If $value is not a `boolean` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-boolean } = import(\"assert\");\\ntry assert-boolean(true) catch (e) e.message end',\n 'let { assert-boolean } = import(\"assert\");\\ntry assert-boolean(false) catch (e) e.message end',\n 'let { assert-boolean } = import(\"assert\");\\ntry assert-boolean(1, \"Expected a boolean\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-true', 'assert.assert-false', 'assert.assert-number', 'assert.assert-string'],\n hideOperatorForm: true,\n },\n 'assert-collection': {\n category: 'assert',\n description: 'If $value is not a `collection` (array, object, or string) it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-collection } = import(\"assert\");\\ntry assert-collection([1, 2]) catch (e) e.message end',\n 'let { assert-collection } = import(\"assert\");\\ntry assert-collection({ a: 1 }) catch (e) e.message end',\n 'let { assert-collection } = import(\"assert\");\\ntry assert-collection(\"hello\") catch (e) e.message end',\n 'let { assert-collection } = import(\"assert\");\\ntry assert-collection(42, \"Expected a collection\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-sequence', 'assert.assert-array', 'assert.assert-object'],\n hideOperatorForm: true,\n },\n 'assert-function': {\n category: 'assert',\n description: 'If $value is not a `function` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-function } = import(\"assert\");\\ntry assert-function(-> $ + 1) catch (e) e.message end',\n 'let { assert-function } = import(\"assert\");\\ntry assert-function(42, \"Expected a function\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-number', 'assert.assert-string'],\n hideOperatorForm: true,\n },\n 'assert-grid': {\n category: 'assert',\n description: 'If $value is not a `grid` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-grid } = import(\"assert\");\\ntry assert-grid([[1, 2], [3, 4]]) catch (e) e.message end',\n 'let { assert-grid } = import(\"assert\");\\ntry assert-grid([1, 2], \"Expected a grid\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-matrix', 'assert.assert-vector'],\n hideOperatorForm: true,\n },\n 'assert-integer': {\n category: 'assert',\n description: 'If $value is not an `integer` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-integer } = import(\"assert\");\\ntry assert-integer(42) catch (e) e.message end',\n 'let { assert-integer } = import(\"assert\");\\ntry assert-integer(3.14, \"Expected an integer\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-number'],\n hideOperatorForm: true,\n },\n 'assert-matrix': {\n category: 'assert',\n description: 'If $value is not a `matrix` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-matrix } = import(\"assert\");\\ntry assert-matrix([[1, 2], [3, 4]]) catch (e) e.message end',\n 'let { assert-matrix } = import(\"assert\");\\ntry assert-matrix([1, 2], \"Expected a matrix\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-vector', 'assert.assert-grid'],\n hideOperatorForm: true,\n },\n 'assert-number': {\n category: 'assert',\n description: 'If $value is not a `number` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-number } = import(\"assert\");\\ntry assert-number(42) catch (e) e.message end',\n 'let { assert-number } = import(\"assert\");\\ntry assert-number(\"hello\", \"Expected a number\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-integer', 'assert.assert-boolean', 'assert.assert-string', 'assert.assert-function'],\n hideOperatorForm: true,\n },\n 'assert-object': {\n category: 'assert',\n description: 'If $value is not an `object` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-object } = import(\"assert\");\\ntry assert-object({ a: 1 }) catch (e) e.message end',\n 'let { assert-object } = import(\"assert\");\\ntry assert-object([1, 2], \"Expected an object\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-array', 'assert.assert-collection'],\n hideOperatorForm: true,\n },\n 'assert-regexp': {\n category: 'assert',\n description: 'If $value is not a `regexp` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-regexp } = import(\"assert\");\\ntry assert-regexp(#\"^start\") catch (e) e.message end',\n 'let { assert-regexp } = import(\"assert\");\\ntry assert-regexp(\"hello\", \"Expected a regexp\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-string'],\n hideOperatorForm: true,\n },\n 'assert-sequence': {\n category: 'assert',\n description: 'If $value is not a `sequence` (array or string) it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-sequence } = import(\"assert\");\\ntry assert-sequence([1, 2]) catch (e) e.message end',\n 'let { assert-sequence } = import(\"assert\");\\ntry assert-sequence(\"hello\") catch (e) e.message end',\n 'let { assert-sequence } = import(\"assert\");\\ntry assert-sequence({ a: 1 }, \"Expected a sequence\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-collection', 'assert.assert-array'],\n hideOperatorForm: true,\n },\n 'assert-string': {\n category: 'assert',\n description: 'If $value is not a `string` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-string } = import(\"assert\");\\ntry assert-string(\"hello\") catch (e) e.message end',\n 'let { assert-string } = import(\"assert\");\\ntry assert-string(42, \"Expected a string\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-number', 'assert.assert-boolean', 'assert.assert-regexp', 'assert.assert-function'],\n hideOperatorForm: true,\n },\n 'assert-vector': {\n category: 'assert',\n description: 'If $value is not a `vector` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-vector } = import(\"assert\");\\ntry assert-vector([1, 2, 3]) catch (e) e.message end',\n 'let { assert-vector } = import(\"assert\");\\ntry assert-vector([\"a\", \"b\"], \"Expected a vector\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-matrix', 'assert.assert-grid'],\n hideOperatorForm: true,\n },\n}\n","import type { LitsError } from '../../../errors'\nimport { AssertionError } from '../../../errors'\nimport type { Any } from '../../../interface'\nimport { compare, deepEqual } from '../../../utils'\nimport type { BuiltinNormalExpressions } from '../../../builtin/interface'\nimport { asAny, assertFunctionLike, isColl, isObj, isRegularExpression, isSeq } from '../../../typeGuards/lits'\nimport { isLitsFunction } from '../../../typeGuards/litsFunction'\nimport { isNumber } from '../../../typeGuards/number'\nimport { assertString, assertStringOrNumber } from '../../../typeGuards/string'\nimport { isGrid, isMatrix, isVector } from '../../../typeGuards/annotatedArrays'\nimport type { LitsModule } from '../interface'\nimport { moduleDocs } from './docs'\n\nconst assertNormalExpression: BuiltinNormalExpressions = {\n 'assert': {\n evaluate: (params, sourceCodeInfo): Any => {\n const value = params[0]\n const message = params.length === 2 ? params[1] : `${value}`\n assertString(message, sourceCodeInfo)\n if (!value)\n throw new AssertionError(message, sourceCodeInfo)\n\n return asAny(value, sourceCodeInfo)\n },\n arity: { min: 1, max: 2 },\n },\n 'assert=': {\n evaluate: ([first, second, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (!deepEqual(asAny(first, sourceCodeInfo), asAny(second, sourceCodeInfo), sourceCodeInfo)) {\n throw new AssertionError(\n `Expected ${JSON.stringify(first, null, 2)} to deep equal ${JSON.stringify(second, null, 2)}.${message}`,\n sourceCodeInfo,\n )\n }\n return null\n },\n arity: { min: 2, max: 3 },\n },\n 'assert!=': {\n evaluate: ([first, second, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (deepEqual(asAny(first, sourceCodeInfo), asAny(second, sourceCodeInfo), sourceCodeInfo)) {\n throw new AssertionError(\n `Expected ${JSON.stringify(first)} not to deep equal ${JSON.stringify(second)}.${message}`,\n sourceCodeInfo,\n )\n }\n return null\n },\n arity: { min: 2, max: 3 },\n },\n 'assert-gt': {\n evaluate: ([first, second, message], sourceCodeInfo): null => {\n assertStringOrNumber(first, sourceCodeInfo)\n assertStringOrNumber(second, sourceCodeInfo)\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (compare(first, second, sourceCodeInfo) <= 0)\n throw new AssertionError(`Expected ${first} to be grater than ${second}.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 2, max: 3 },\n },\n 'assert-gte': {\n evaluate: ([first, second, message], sourceCodeInfo): null => {\n assertStringOrNumber(first, sourceCodeInfo)\n assertStringOrNumber(second, sourceCodeInfo)\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (compare(first, second, sourceCodeInfo) < 0)\n throw new AssertionError(`Expected ${first} to be grater than or equal to ${second}.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 2, max: 3 },\n },\n 'assert-lt': {\n evaluate: ([first, second, message], sourceCodeInfo): null => {\n assertStringOrNumber(first, sourceCodeInfo)\n assertStringOrNumber(second, sourceCodeInfo)\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (compare(first, second, sourceCodeInfo) >= 0)\n throw new AssertionError(`Expected ${first} to be less than ${second}.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 2, max: 3 },\n },\n 'assert-lte': {\n evaluate: ([first, second, message], sourceCodeInfo): null => {\n assertStringOrNumber(first, sourceCodeInfo)\n assertStringOrNumber(second, sourceCodeInfo)\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (compare(first, second, sourceCodeInfo) > 0)\n throw new AssertionError(`Expected ${first} to be less than or equal to ${second}.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 2, max: 3 },\n },\n 'assert-true': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (first !== true)\n throw new AssertionError(`Expected ${first} to be true.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-false': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (first !== false)\n throw new AssertionError(`Expected ${first} to be false.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-truthy': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (!first)\n throw new AssertionError(`Expected ${first} to be truthy.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-falsy': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (first)\n throw new AssertionError(`Expected ${first} to be falsy.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-null': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (first !== null)\n throw new AssertionError(`Expected ${first} to be null.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-throws': {\n evaluate: ([func, message], sourceCodeInfo, contextStack, { executeFunction }): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n assertFunctionLike(func, sourceCodeInfo)\n try {\n executeFunction(func, [], contextStack, sourceCodeInfo)\n }\n catch {\n return null\n }\n throw new AssertionError(`Expected function to throw.${message}`, sourceCodeInfo)\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-throws-error': {\n evaluate: ([func, throwMessage, message], sourceCodeInfo, contextStack, { executeFunction }): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n assertString(throwMessage, sourceCodeInfo)\n assertFunctionLike(func, sourceCodeInfo)\n try {\n executeFunction(func, [], contextStack, sourceCodeInfo)\n }\n catch (error) {\n const errorMessage = (error as LitsError).shortMessage\n if (errorMessage !== throwMessage) {\n throw new AssertionError(\n `Expected function to throw \"${throwMessage}\", but thrown \"${errorMessage}\".${message}`,\n sourceCodeInfo,\n )\n }\n return null\n }\n throw new AssertionError(`Expected function to throw \"${throwMessage}\".${message}`, sourceCodeInfo)\n },\n arity: { min: 2, max: 3 },\n },\n 'assert-not-throws': {\n evaluate: ([func, message], sourceCodeInfo, contextStack, { executeFunction }): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n assertFunctionLike(func, sourceCodeInfo)\n try {\n executeFunction(func, [], contextStack, sourceCodeInfo)\n }\n catch {\n throw new AssertionError(`Expected function not to throw.${message}`, sourceCodeInfo)\n }\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-array': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (!Array.isArray(first))\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be an array.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-boolean': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (typeof first !== 'boolean')\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be a boolean.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-collection': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (!isColl(first))\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be a collection.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-function': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (!isLitsFunction(first))\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be a function.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-grid': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (!isGrid(first))\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be a grid.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-integer': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (typeof first !== 'number' || !isNumber(first, { integer: true }))\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be an integer.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-matrix': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (!isMatrix(first))\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be a matrix.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-number': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (typeof first !== 'number')\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be a number.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-object': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (!isObj(first))\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be an object.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-regexp': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (!isRegularExpression(first))\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be a regexp.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-sequence': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (!isSeq(first))\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be a sequence.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-string': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (typeof first !== 'string')\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be a string.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-vector': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (!isVector(first))\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be a vector.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n}\n\nfor (const [key, docs] of Object.entries(moduleDocs)) {\n if (assertNormalExpression[key])\n assertNormalExpression[key].docs = docs\n}\n\nexport const assertModule: LitsModule = {\n name: 'assert',\n functions: assertNormalExpression,\n}\n"],"names":["getCodeMarker","sourceCodeInfo","position","code","leftPadding","column","rightPadding","length","repeat","Math","max","LitsError","Error","shortMessage","constructor","err","message","super","location","line","filePath","getLitsErrorMessage","this","Object","setPrototypeOf","prototype","name","AssertionError","NodeTypes","Number","String","NormalExpression","SpecialExpression","UserDefinedSymbol","NormalBuiltinSymbol","SpecialBuiltinSymbol","ReservedSymbol","Binding","Spread","NodeTypesSet","Set","values","functionTypeSet","FUNCTION_SYMBOL","isLitsFunction","func","type","functionType","has","isNode","value","Array","isArray","valueToString","keys","find","key","RegExp","toString","JSON","stringify","getAssertionError","typeName","anyValue","getSourceCodeInfo","isUnknownRecord","asAny","undefined","isAny","assertAny","isSeq","isObj","isRegularExpression","isColl","regexp","assertFunctionLike","isFunctionLike","isNumber","options","isNaN","integer","isInteger","finite","isFinite","zero","nonZero","positive","negative","nonPositive","nonNegative","gt","gte","lt","lte","assertString","nonEmpty","char","isString","asString","assertStringOrNumber","isStringOrNumber","compare","a","b","sign","deepEqual","epsilon","EPSILON","diff","abs","absA","absB","approxEqual","i","s","f","aKeys","bKeys","annotatedArrays","WeakSet","vectors","notVectors","matrices","notMatrices","grids","notGrids","moduleDocs","assert","category","description","returns","args","variants","argumentNames","examples","seeAlso","hideOperatorForm","fun","assertNormalExpression","evaluate","params","arity","min","first","second","contextStack","executeFunction","throwMessage","error","errorMessage","grid","add","nbrOfCols","row","slice","isGrid","matrix","some","cell","isMatrix","vector","every","elem","docs","entries","assertModule","functions"],"mappings":"aAEM,SAAUA,EAAcC,GAC5B,IAAKA,EAAeC,WAAaD,EAAeE,KAC9C,MAAO,GAET,MAAMC,EAAcH,EAAeC,SAASG,OAAS,EAC/CC,EAAeL,EAAeE,KAAKI,OAASH,EAAc,EAChE,MAAO,GAAG,IAAII,OAAOC,KAAKC,IAAIN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O,CAAEC,IAAK,EAAGpI,IAAK,KAI1B,IAAK,MAAO8C,EAAK2G,KAAS5I,OAAO6I,QAAQtC,GACnCY,EAAuBlF,KACzBkF,EAAuBlF,GAAK2G,KAAOA,GAG1B,MAAAE,EAA2B,CACtC3I,KAAM,SACN4I,UAAW5B"}
1
+ {"version":3,"file":"assert.js","sources":["../../src/utils/debug/getCodeMarker.ts","../../src/errors.ts","../../src/constants/constants.ts","../../src/utils/symbols.ts","../../src/utils/debug/debugTools.ts","../../src/utils/getAssertionError.ts","../../src/utils/debug/getSourceCodeInfo.ts","../../src/typeGuards/index.ts","../../src/typeGuards/litsFunction.ts","../../src/typeGuards/lits.ts","../../src/typeGuards/number.ts","../../src/typeGuards/string.ts","../../src/utils/index.ts","../../src/typeGuards/annotatedArrays.ts","../../src/builtin/modules/assert/docs.ts","../../src/builtin/modules/assert/index.ts"],"sourcesContent":["import type { SourceCodeInfo } from '../../tokenizer/token'\n\nexport function getCodeMarker(sourceCodeInfo: SourceCodeInfo): string {\n if (!sourceCodeInfo.position || !sourceCodeInfo.code)\n return ''\n\n const leftPadding = sourceCodeInfo.position.column - 1\n const rightPadding = sourceCodeInfo.code.length - leftPadding - 1\n return `${' '.repeat(Math.max(leftPadding, 0))}^${' '.repeat(Math.max(rightPadding, 0))}`\n}\n","import { getCodeMarker } from '../src/utils/debug/getCodeMarker'\nimport type { Arr } from './interface'\nimport type { SourceCodeInfo } from './tokenizer/token'\n\nfunction getLitsErrorMessage(message: string, sourceCodeInfo?: SourceCodeInfo) {\n if (!sourceCodeInfo) {\n return message\n }\n const location = `${sourceCodeInfo.position.line}:${sourceCodeInfo.position.column}`\n const filePathLine = sourceCodeInfo.filePath\n ? `\\n${sourceCodeInfo.filePath}:${location}`\n : `\\nLocation ${location}`\n const codeLine = `\\n${sourceCodeInfo.code}`\n const codeMarker = `\\n${getCodeMarker(sourceCodeInfo)}`\n return `${message}${filePathLine}${codeLine}${codeMarker}`\n}\n\nexport class RecurSignal extends Error {\n public params: Arr\n constructor(params: Arr) {\n super(`recur, params: ${params}`)\n Object.setPrototypeOf(this, RecurSignal.prototype)\n this.name = 'RecurSignal'\n this.params = params\n }\n}\n\nexport class LitsError extends Error {\n public readonly sourceCodeInfo?: SourceCodeInfo\n public readonly shortMessage: string\n constructor(err: unknown, sourceCodeInfo: SourceCodeInfo | undefined) {\n const message = err instanceof Error\n ? err.message\n : `${err}`\n\n super(getLitsErrorMessage(message, sourceCodeInfo))\n this.shortMessage = message\n this.sourceCodeInfo = sourceCodeInfo\n Object.setPrototypeOf(this, LitsError.prototype)\n this.name = 'LitsError'\n }\n\n public getCodeMarker(): string | undefined {\n return this.sourceCodeInfo && getCodeMarker(this.sourceCodeInfo)\n }\n}\n\nexport class UserDefinedError extends LitsError {\n public userMessage: string\n constructor(message: string, sourceCodeInfo?: SourceCodeInfo) {\n super(message, sourceCodeInfo)\n this.userMessage = message\n Object.setPrototypeOf(this, UserDefinedError.prototype)\n this.name = 'UserDefinedError'\n }\n}\n\nexport class AssertionError extends LitsError {\n constructor(message: string | Error, sourceCodeInfo?: SourceCodeInfo) {\n super(message, sourceCodeInfo)\n Object.setPrototypeOf(this, AssertionError.prototype)\n this.name = 'AssertionError'\n }\n}\n\nexport class UndefinedSymbolError extends LitsError {\n public symbol: string\n constructor(symbolName: string, sourceCodeInfo?: SourceCodeInfo) {\n const message = `Undefined symbol '${symbolName}'.`\n super(message, sourceCodeInfo)\n this.symbol = symbolName\n Object.setPrototypeOf(this, UndefinedSymbolError.prototype)\n this.name = 'UndefinedSymbolError'\n }\n}\n\nexport function isLitsError(error: unknown): error is LitsError {\n return error instanceof LitsError\n}\n","export const NodeTypes = {\n Number: 1,\n String: 2,\n NormalExpression: 3,\n SpecialExpression: 4,\n UserDefinedSymbol: 5,\n NormalBuiltinSymbol: 6,\n SpecialBuiltinSymbol: 7,\n ReservedSymbol: 8,\n Binding: 9,\n Spread: 10,\n} as const\n\nconst NodeTypesSet = new Set(Object.values(NodeTypes))\n\nexport type NodeType = typeof NodeTypes[keyof typeof NodeTypes]\n\nexport function getNodeTypeName(type: NodeType): keyof typeof NodeTypes {\n return Object.keys(NodeTypes).find(key => NodeTypes[key as keyof typeof NodeTypes] === type) as keyof typeof NodeTypes\n}\n\n// TODO, is this needed?\nexport function isNodeType(type: unknown): type is NodeType {\n return typeof type === 'number' && NodeTypesSet.has(type as NodeType)\n}\n\nconst functionTypes = [\n 'UserDefined',\n 'Partial',\n 'Comp',\n 'Constantly',\n 'Juxt',\n 'Complement',\n 'EveryPred',\n 'SomePred',\n 'Fnull',\n 'Builtin',\n 'SpecialBuiltin',\n 'NativeJsFunction',\n 'Module',\n] as const\n\nconst functionTypeSet = new Set(functionTypes)\n\nexport type FunctionType = typeof functionTypes[number]\n\nexport function isFunctionType(type: unknown): type is FunctionType {\n return typeof type === 'string' && functionTypeSet.has(type as FunctionType)\n}\n","export const FUNCTION_SYMBOL = '^^fn^^'\nexport const REGEXP_SYMBOL = '^^re^^'\n","import { getNodeTypeName, isFunctionType, isNodeType } from '../../constants/constants'\nimport type { AstNode, LitsFunction } from '../../parser/types'\nimport { FUNCTION_SYMBOL } from '../symbols'\n\nfunction isLitsFunction(func: unknown): func is LitsFunction {\n if (func === null || typeof func !== 'object')\n return false\n\n return FUNCTION_SYMBOL in func && 'functionType' in func && isFunctionType(func.functionType)\n}\n\nfunction isNode(value: unknown): value is AstNode {\n if (!Array.isArray(value) || value.length < 2)\n return false\n return isNodeType(value[0])\n}\n\nexport function valueToString(value: unknown): string {\n if (isLitsFunction(value))\n // eslint-disable-next-line ts/no-unsafe-member-access\n return `<function ${(value as any).name || '\\u03BB'}>`\n\n if (isNode(value))\n return `${getNodeTypeName(value[0])}-node`\n\n if (value === null)\n return 'null'\n\n if (typeof value === 'object' && value instanceof RegExp)\n return `${value}`\n\n if (typeof value === 'object' && value instanceof Error)\n return value.toString()\n\n return JSON.stringify(value)\n}\n","import { LitsError } from '../errors'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { valueToString } from './debug/debugTools'\nimport { getSourceCodeInfo } from './debug/getSourceCodeInfo'\n\nexport function getAssertionError(typeName: string, value: unknown, sourceCodeInfo?: SourceCodeInfo): LitsError {\n return new LitsError(`Expected ${typeName}, got ${valueToString(value)}.`, getSourceCodeInfo(value, sourceCodeInfo))\n}\n","import type { SourceCodeInfo } from '../../tokenizer/token'\n\nexport function getSourceCodeInfo(anyValue: any, sourceCodeInfo: SourceCodeInfo | undefined): SourceCodeInfo | undefined {\n // eslint-disable-next-line ts/no-unsafe-return, ts/no-unsafe-member-access\n return anyValue?.sourceCodeInfo ?? sourceCodeInfo\n}\n","import { LitsError } from '../errors'\nimport type { UnknownRecord } from '../interface'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { valueToString } from '../utils/debug/debugTools'\nimport { getSourceCodeInfo } from '../utils/debug/getSourceCodeInfo'\n\nfunction isNonUndefined<T>(value: T | undefined): value is T {\n return value !== undefined\n}\n\nexport function asNonUndefined<T>(value: T | undefined, sourceCodeInfo?: SourceCodeInfo): T {\n assertNonUndefined(value, sourceCodeInfo)\n return value\n}\n\nexport function assertNonUndefined<T>(value: T | undefined, sourceCodeInfo?: SourceCodeInfo): asserts value is T {\n if (!isNonUndefined(value))\n throw new LitsError('Unexpected undefined', getSourceCodeInfo(value, sourceCodeInfo))\n}\n\nexport function isUnknownRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value)\n}\n\nexport function assertUnknownRecord(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is UnknownRecord {\n if (!isUnknownRecord(value)) {\n throw new LitsError(\n `Expected ${'UnknownRecord'}, got ${valueToString(value)}.`,\n getSourceCodeInfo(value, sourceCodeInfo),\n )\n }\n}\n\nexport function asUnknownRecord(value: unknown, sourceCodeInfo?: SourceCodeInfo): UnknownRecord {\n assertUnknownRecord(value, sourceCodeInfo)\n return value\n}\n","import type { LitsFunction, NativeJsFunction, NormalBuiltinFunction, UserDefinedFunction } from '../parser/types'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { getAssertionError } from '../utils/getAssertionError'\nimport { FUNCTION_SYMBOL } from '../utils/symbols'\nimport { isUnknownRecord } from '.'\n\nexport function isLitsFunction(value: unknown): value is LitsFunction {\n if (value === null || typeof value !== 'object')\n return false\n\n return !!(value as LitsFunction)[FUNCTION_SYMBOL]\n}\nexport function asLitsFunction(value: unknown, sourceCodeInfo?: SourceCodeInfo): LitsFunction {\n assertLitsFunction(value, sourceCodeInfo)\n return value\n}\nexport function assertLitsFunction(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is LitsFunction {\n if (!isLitsFunction(value))\n throw getAssertionError('LitsFunction', value, sourceCodeInfo)\n}\n\nexport function isUserDefinedFunction(value: unknown): value is UserDefinedFunction {\n return isLitsFunction(value) && value.functionType === 'UserDefined'\n}\nexport function asUserDefinedFunction(value: unknown, sourceCodeInfo?: SourceCodeInfo): UserDefinedFunction {\n assertUserDefinedFunction(value, sourceCodeInfo)\n return value\n}\nexport function assertUserDefinedFunction(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is UserDefinedFunction {\n if (!isUserDefinedFunction(value))\n throw getAssertionError('NativeJsFunction', value, sourceCodeInfo)\n}\n\nexport function isNativeJsFunction(value: unknown): value is NativeJsFunction {\n return isLitsFunction(value) && value.functionType === 'NativeJsFunction'\n}\nexport function asNativeJsFunction(value: unknown, sourceCodeInfo?: SourceCodeInfo): NativeJsFunction {\n assertNativeJsFunction(value, sourceCodeInfo)\n return value\n}\nexport function assertNativeJsFunction(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is NativeJsFunction {\n if (!isNativeJsFunction(value))\n throw getAssertionError('NativeJsFunction', value, sourceCodeInfo)\n}\n\nexport function isBuiltinFunction(value: unknown): value is NormalBuiltinFunction {\n return isUnknownRecord(value) && value.functionType === 'Builtin'\n}\n","import type { Any, Coll, Obj, Seq } from '../interface'\nimport type { FunctionLike, RegularExpression } from '../parser/types'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { getAssertionError } from '../utils/getAssertionError'\nimport { REGEXP_SYMBOL } from '../utils/symbols'\nimport { isLitsFunction } from './litsFunction'\n\nexport function isAny(value: unknown): value is Any {\n // TODO weak test\n return value !== undefined\n}\nexport function asAny(value: unknown, sourceCodeInfo?: SourceCodeInfo): Any {\n assertAny(value, sourceCodeInfo)\n return value\n}\nexport function assertAny(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is Any {\n if (!isAny(value))\n throw getAssertionError('not undefined', value, sourceCodeInfo)\n}\n\nexport function isSeq(value: unknown): value is Seq {\n return Array.isArray(value) || typeof value === 'string'\n}\nexport function asSeq(value: unknown, sourceCodeInfo?: SourceCodeInfo): Seq {\n assertSeq(value, sourceCodeInfo)\n return value\n}\nexport function assertSeq(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is Seq {\n if (!isSeq(value))\n throw getAssertionError('string or array', value, sourceCodeInfo)\n}\n\nexport function isObj(value: unknown): value is Obj {\n return !(\n value === null\n || typeof value !== 'object'\n || Array.isArray(value)\n || value instanceof RegExp\n || isLitsFunction(value)\n || isRegularExpression(value)\n )\n}\nexport function asObj(value: unknown, sourceCodeInfo?: SourceCodeInfo): Obj {\n assertObj(value, sourceCodeInfo)\n return value\n}\nexport function assertObj(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is Obj {\n if (!isObj(value))\n throw getAssertionError('object', value, sourceCodeInfo)\n}\n\nexport function isColl(value: unknown): value is Coll {\n return isSeq(value) || isObj(value)\n}\nexport function asColl(value: unknown, sourceCodeInfo?: SourceCodeInfo): Coll {\n assertColl(value, sourceCodeInfo)\n return value\n}\nexport function assertColl(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is Coll {\n if (!isColl(value))\n throw getAssertionError('string, array or object', value, sourceCodeInfo)\n}\n\nexport function isRegularExpression(regexp: unknown): regexp is RegularExpression {\n if (regexp === null || typeof regexp !== 'object')\n return false\n\n return !!(regexp as RegularExpression)[REGEXP_SYMBOL]\n}\nexport function asRegularExpression(value: unknown, sourceCodeInfo?: SourceCodeInfo): RegularExpression {\n assertRegularExpression(value, sourceCodeInfo)\n return value\n}\nexport function assertRegularExpression(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is RegularExpression {\n if (!isRegularExpression(value))\n throw getAssertionError('RegularExpression', value, sourceCodeInfo)\n}\n\nexport function isStringOrRegularExpression(value: unknown): value is string | RegularExpression {\n return isRegularExpression(value) || typeof value === 'string'\n}\nexport function asStringOrRegularExpression(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): string | RegularExpression {\n assertStringOrRegularExpression(value, sourceCodeInfo)\n return value\n}\nexport function assertStringOrRegularExpression(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is string | RegularExpression {\n if (!isStringOrRegularExpression(value))\n throw getAssertionError('string or RegularExpression', value, sourceCodeInfo)\n}\n\nfunction isFunctionLike(value: unknown): value is FunctionLike {\n if (typeof value === 'number')\n return true\n if (isColl(value))\n return true\n if (isLitsFunction(value))\n return true\n\n return false\n}\nexport function asFunctionLike(value: unknown, sourceCodeInfo?: SourceCodeInfo): FunctionLike {\n assertFunctionLike(value, sourceCodeInfo)\n return value\n}\nexport function assertFunctionLike(value: unknown, sourceCodeInfo?: SourceCodeInfo): asserts value is FunctionLike {\n if (!isFunctionLike(value))\n throw getAssertionError('FunctionLike', value, sourceCodeInfo)\n}\n","import { LitsError } from '../errors'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { valueToString } from '../utils/debug/debugTools'\nimport { getSourceCodeInfo } from '../utils/debug/getSourceCodeInfo'\n\ntype SignOptions =\n | {\n positive?: true\n negative?: never\n nonPositive?: never\n nonNegative?: never\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: true\n nonPositive?: never\n nonNegative?: never\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: true\n nonNegative?: never\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: never\n nonNegative?: true\n zero?: never\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: never\n nonNegative?: never\n zero?: true\n nonZero?: never\n }\n | {\n positive?: never\n negative?: never\n nonPositive?: never\n nonNegative?: never\n zero?: never\n nonZero?: true\n }\n\ntype GtOptions =\n | {\n gt?: number\n gte?: never\n }\n | {\n gt?: never\n gte?: number\n }\n\ntype LtOptions =\n | {\n lt?: number\n lte?: never\n }\n | {\n lt?: never\n lte?: number\n }\n\ntype NumberOptions = {\n integer?: true\n finite?: true\n} & SignOptions &\nGtOptions &\nLtOptions\n\nfunction getRangeString(options: NumberOptions): string {\n const hasUpperAndLowerBound\n = (typeof options.gt === 'number' || typeof options.gte === 'number')\n && (typeof options.lt === 'number' || typeof options.lte === 'number')\n if (hasUpperAndLowerBound) {\n return `${typeof options.gt === 'number' ? `${options.gt} < n ` : `${options.gte} <= n `}${\n typeof options.lt === 'number' ? `< ${options.lt}` : `<= ${options.lte}`\n }`\n }\n else if (typeof options.gt === 'number' || typeof options.gte === 'number') {\n return `${typeof options.gt === 'number' ? `n > ${options.gt}` : `n >= ${options.gte}`}`\n }\n else if (typeof options.lt === 'number' || typeof options.lte === 'number') {\n return `${typeof options.lt === 'number' ? `n < ${options.lt}` : `n <= ${options.lte}`}`\n }\n else { return '' }\n}\n\nfunction getSignString(options: NumberOptions): string {\n return options.positive\n ? 'positive'\n : options.negative\n ? 'negative'\n : options.nonNegative\n ? 'non negative'\n : options.nonPositive\n ? 'non positive'\n : options.nonZero\n ? 'non zero'\n : ''\n}\n\nfunction getNumberTypeName(options: NumberOptions): string {\n if (options.zero)\n return 'zero'\n\n const sign = getSignString(options)\n const numberType = options.integer ? 'integer' : 'number'\n const finite = options.finite ? 'finite' : ''\n const range = getRangeString(options)\n\n return [sign, finite, numberType, range].filter(x => !!x).join(' ')\n}\n\nexport function isNumber(value: unknown, options: NumberOptions = {}): value is number {\n if (typeof value !== 'number')\n return false\n\n if (Number.isNaN(value))\n return false\n\n if (options.integer && !Number.isInteger(value))\n return false\n\n if (options.finite && !Number.isFinite(value))\n return false\n\n if (options.zero && value !== 0)\n return false\n\n if (options.nonZero && value === 0)\n return false\n\n if (options.positive && value <= 0)\n return false\n\n if (options.negative && value >= 0)\n return false\n\n if (options.nonPositive && value > 0)\n return false\n\n if (options.nonNegative && value < 0)\n return false\n\n if (typeof options.gt === 'number' && value <= options.gt)\n return false\n\n if (typeof options.gte === 'number' && value < options.gte)\n return false\n\n if (typeof options.lt === 'number' && value >= options.lt)\n return false\n\n if (typeof options.lte === 'number' && value > options.lte)\n return false\n\n return true\n}\n\nexport function assertNumber(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n options: NumberOptions = {},\n): asserts value is number {\n if (!isNumber(value, options)) {\n throw new LitsError(\n `Expected ${getNumberTypeName(options)}, got ${valueToString(value)}.`,\n getSourceCodeInfo(value, sourceCodeInfo),\n )\n }\n}\n\nexport function asNumber(\n value: unknown,\n sourceCodeInfo: SourceCodeInfo | undefined,\n options: NumberOptions = {},\n): number {\n assertNumber(value, sourceCodeInfo, options)\n return value\n}\n","import type { SourceCodeInfo } from '../tokenizer/token'\nimport { getAssertionError } from '../utils/getAssertionError'\n\ntype StringAssertionOptions =\n | {\n nonEmpty?: true\n char?: never\n }\n | {\n nonEmpty?: never\n char?: true\n }\n\nexport function isString(value: unknown, options: StringAssertionOptions = {}): value is string {\n if (typeof value !== 'string')\n return false\n\n if (options.nonEmpty && value.length === 0)\n return false\n\n if (options.char && value.length !== 1)\n return false\n\n return true\n}\n\nexport function assertString(\n value: unknown,\n sourceCodeInfo: SourceCodeInfo | undefined,\n options: StringAssertionOptions = {},\n): asserts value is string {\n if (!isString(value, options)) {\n throw getAssertionError(\n `${options.nonEmpty ? 'non empty string' : options.char ? 'character' : 'string'}`,\n value,\n sourceCodeInfo,\n )\n }\n}\n\nexport function asString(\n value: unknown,\n sourceCodeInfo: SourceCodeInfo | undefined,\n options: StringAssertionOptions = {},\n): string {\n assertString(value, sourceCodeInfo, options)\n return value\n}\n\nexport function isStringOrNumber(value: unknown): value is string | number {\n return typeof value === 'string' || typeof value === 'number'\n}\nexport function asStringOrNumber(value: unknown, sourceCodeInfo?: SourceCodeInfo): string | number {\n assertStringOrNumber(value, sourceCodeInfo)\n return value\n}\nexport function assertStringOrNumber(\n value: unknown,\n sourceCodeInfo?: SourceCodeInfo,\n): asserts value is string | number {\n if (!isStringOrNumber(value))\n throw getAssertionError('string or number', value, sourceCodeInfo)\n}\n","import type { Any, Coll, Obj } from '../interface'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { asAny, isColl, isObj, isRegularExpression } from '../typeGuards/lits'\nimport { isNumber } from '../typeGuards/number'\nimport { asString, assertStringOrNumber } from '../typeGuards/string'\nimport { isUnknownRecord } from '../typeGuards'\nimport { LitsError } from '../errors'\n\nexport function collHasKey(coll: unknown, key: string | number): boolean {\n if (!isColl(coll))\n return false\n\n if (typeof coll === 'string' || Array.isArray(coll)) {\n if (!isNumber(key, { integer: true }))\n return false\n\n return key >= 0 && key < coll.length\n }\n return !!Object.getOwnPropertyDescriptor(coll, key)\n}\n\nexport function compare<T extends string | number>(a: T, b: T, sourceCodeInfo: SourceCodeInfo | undefined): number {\n assertStringOrNumber(a, sourceCodeInfo)\n assertStringOrNumber(b, sourceCodeInfo)\n\n if (typeof a === 'string' && typeof b === 'string') {\n return a < b ? -1 : a > b ? 1 : 0\n }\n if (typeof a === 'number' && typeof b === 'number') {\n return Math.sign((a) - (b))\n }\n throw new LitsError(`Cannot compare values of different types: ${typeof a} and ${typeof b}`, sourceCodeInfo)\n}\n\nexport function deepEqual(a: unknown, b: unknown, sourceCodeInfo?: SourceCodeInfo): boolean {\n if (a === b)\n return true\n\n if (typeof a === 'number' && typeof b === 'number')\n return approxEqual(a, b)\n\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length)\n return false\n\n for (let i = 0; i < a.length; i += 1) {\n if (!deepEqual(asAny(a[i], sourceCodeInfo), asAny(b[i], sourceCodeInfo), sourceCodeInfo))\n return false\n }\n return true\n }\n if (isRegularExpression(a) && isRegularExpression(b))\n return a.s === b.s && a.f === b.f\n\n if (isUnknownRecord(a) && isUnknownRecord(b)) {\n const aKeys = Object.keys(a)\n const bKeys = Object.keys(b)\n if (aKeys.length !== bKeys.length)\n return false\n\n for (let i = 0; i < aKeys.length; i += 1) {\n const key = asString(aKeys[i], sourceCodeInfo)\n if (!deepEqual(a[key], b[key], sourceCodeInfo))\n return false\n }\n return true\n }\n return false\n}\n\nexport function toNonNegativeInteger(num: number): number {\n return Math.max(0, Math.ceil(num))\n}\n\nexport function toAny(value: unknown): Any {\n return (value ?? null) as Any\n}\n\nfunction clone<T>(value: T): T {\n if (isObj(value)) {\n return Object.entries(value).reduce((result: Obj, entry) => {\n const [key, val] = entry\n result[key] = clone(val)\n return result\n }, {}) as T\n }\n if (Array.isArray(value))\n // eslint-disable-next-line ts/no-unsafe-return\n return value.map(item => clone(item)) as unknown as T\n\n return value\n}\n\nexport function cloneColl<T extends Coll>(value: T): T {\n return clone(value)\n}\n\nexport function joinSets<T>(...results: Set<T>[]): Set<T> {\n const result = new Set<T>()\n for (const symbols of results)\n symbols.forEach(symbol => result.add(symbol))\n\n return result\n}\n\nexport function addToSet<T>(target: Set<T>, source: Set<T>): void {\n source.forEach(symbol => target.add(symbol))\n}\n\nexport const EPSILON = 1e-10\n\nexport function approxEqual(a: number, b: number, epsilon: number = EPSILON): boolean {\n if (a === b) {\n return true\n }\n\n const diff = Math.abs(a - b)\n\n if (a === 0 || b === 0 || diff < epsilon) {\n // Use absolute error for values near zero\n return diff < epsilon\n }\n const absA = Math.abs(a)\n const absB = Math.abs(b)\n\n // Use relative error for larger values\n return diff / (absA + absB) < epsilon\n}\n\nexport function approxZero(value: number): boolean {\n return Math.abs(value) < EPSILON\n}\n\nexport function smartTrim(str: string, minIndent = 0): string {\n const lines = str.split('\\n')\n while (lines[0]?.match(/^\\s*$/)) {\n lines.shift() // Remove leading empty lines\n }\n while (lines[lines.length - 1]?.match(/^\\s*$/)) {\n lines.pop() // Remove trailing empty lines\n }\n const indent = lines.reduce((acc, line) => {\n if (line.match(/^\\s*$/))\n return acc // Skip empty lines\n const lineIndent = line.match(/^\\s*/)![0].length\n return Math.min(acc, lineIndent)\n }, Infinity)\n return lines.map(line => ' '.repeat(minIndent) + line.slice(indent)).join('\\n').trimEnd()\n}\n","import { LitsError } from '../errors'\nimport type { Any } from '../interface'\nimport type { SourceCodeInfo } from '../tokenizer/token'\nimport { isNumber } from './number'\n\nconst annotatedArrays = new WeakSet<unknown[]>()\nconst vectors = new WeakSet<unknown[]>()\nconst notVectors = new WeakSet<unknown[]>()\nconst matrices = new WeakSet<unknown[]>()\nconst notMatrices = new WeakSet<unknown[]>()\nconst grids = new WeakSet<unknown[]>()\nconst notGrids = new WeakSet<unknown[]>()\n\nexport function annotate<T>(value: T): T {\n if (!Array.isArray(value)) {\n return value\n }\n if (annotatedArrays.has(value)) {\n return value\n }\n isVector(value)\n if (!isMatrix(value)) {\n isGrid(value)\n }\n\n return value\n}\nexport function isVector(vector: unknown): vector is number[] {\n if (!Array.isArray(vector)) {\n return false\n }\n\n if (vectors.has(vector)) {\n return true\n }\n if (notVectors.has(vector)) {\n return false\n }\n\n if (vector.every(elem => isNumber(elem))) {\n annotatedArrays.add(vector)\n vectors.add(vector)\n return true\n }\n notVectors.add(vector)\n return false\n}\n\nexport function assertVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is number[] {\n if (!isVector(vector)) {\n throw new LitsError(`Expected a vector, but got ${vector}`, sourceCodeInfo)\n }\n}\n\nexport function is2dVector(vector: unknown): vector is [number, number] {\n if (!isVector(vector)) {\n return false\n }\n return vector.length === 2\n}\nexport function assert2dVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is [number, number] {\n if (!is2dVector(vector)) {\n throw new LitsError(`Expected a 2d vector, but got ${vector}`, sourceCodeInfo)\n }\n}\n\nexport function is3dVector(vector: unknown): vector is [number, number, number] {\n if (!isVector(vector)) {\n return false\n }\n return vector.length === 3\n}\nexport function assert3dVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is [number, number, number] {\n if (!is3dVector(vector)) {\n throw new LitsError(`Expected a 3d vector, but got ${vector}`, sourceCodeInfo)\n }\n}\n\nexport function assertNonEmptyVector(vector: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts vector is number[] {\n assertVector(vector, sourceCodeInfo)\n if (vector.length === 0) {\n throw new LitsError(`Expected a non empty vector, but got ${vector}`, sourceCodeInfo)\n }\n}\n\nexport function isGrid(grid: unknown): grid is unknown[][] {\n if (!Array.isArray(grid)) {\n return false\n }\n if (grids.has(grid)) {\n return true\n }\n if (notGrids.has(grid)) {\n return false\n }\n if (grid.length === 0) {\n notGrids.add(grid)\n return false\n }\n if (!Array.isArray(grid[0])) {\n notGrids.add(grid)\n return false\n }\n const nbrOfCols = grid[0].length\n for (const row of grid.slice(1)) {\n if (!Array.isArray(row)) {\n notGrids.add(grid)\n return false\n }\n if (row.length !== nbrOfCols) {\n notGrids.add(grid)\n return false\n }\n }\n annotatedArrays.add(grid)\n grids.add(grid)\n return true\n}\n\nexport function assertGrid(grid: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts grid is Any[][] {\n if (!isGrid(grid)) {\n throw new LitsError(`Expected a grid, but got ${grid}`, sourceCodeInfo)\n }\n}\n\nexport function isMatrix(matrix: unknown): matrix is number[][] {\n if (!Array.isArray(matrix)) {\n return false\n }\n if (matrices.has(matrix)) {\n return true\n }\n if (notMatrices.has(matrix)) {\n return false\n }\n if (matrix.length === 0) {\n notMatrices.add(matrix)\n return false\n }\n if (!Array.isArray(matrix[0]) || matrix[0].length === 0) {\n notMatrices.add(matrix)\n return false\n }\n const nbrOfCols = matrix[0].length\n for (const row of matrix) {\n if (!Array.isArray(row) || row.length !== nbrOfCols || row.some(cell => !isNumber(cell))) {\n notMatrices.add(matrix)\n return false\n }\n }\n annotatedArrays.add(matrix)\n grids.add(matrix)\n matrices.add(matrix)\n return true\n}\n\nexport function assertMatrix(matrix: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts matrix is number[][] {\n if (!isMatrix(matrix)) {\n throw new LitsError(`Expected a matrix, but got ${matrix}`, sourceCodeInfo)\n }\n}\n\nexport function assertSquareMatrix(matrix: unknown, sourceCodeInfo: SourceCodeInfo | undefined): asserts matrix is number[][] {\n if (!isMatrix(matrix)) {\n throw new LitsError(`Expected a matrix, but got ${matrix}`, sourceCodeInfo)\n }\n if (matrix.length !== matrix[0]!.length) {\n throw new LitsError(`Expected square matrix, but got ${matrix.length} and ${matrix[0]!.length}`, sourceCodeInfo)\n }\n}\n\nexport function isSquareMatrix(matrix: unknown): matrix is number[][] {\n if (!isMatrix(matrix)) {\n return false\n }\n if (matrix.length !== matrix[0]!.length) {\n return false\n }\n return true\n}\n","import type { FunctionDocs } from '../../interface'\n\nexport const moduleDocs: Record<string, FunctionDocs> = {\n 'assert': {\n category: 'assert',\n description: 'If $value is falsy it throws `AssertionError` with $message. If no $message is provided, message is set to $value.',\n returns: {\n type: 'any',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert } = import(\"assert\");\\ntry assert(0, \"Expected a positive value\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-truthy', 'assert.assert-true'],\n hideOperatorForm: true,\n },\n 'assert!=': {\n category: 'assert',\n description: 'If $a is the same as $b it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n a: {\n type: 'any',\n },\n b: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'a',\n 'b',\n ],\n },\n {\n argumentNames: [\n 'a',\n 'b',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert!= } = import(\"assert\");\\ntry assert!=(0, 0, \"Expected different values\") catch (e) e.message end',\n 'let { assert!= } = import(\"assert\");\\ntry assert!=(0, 0) catch (e) e.message end',\n 'let { assert!= } = import(\"assert\");\\ntry 0 assert!= 0 catch (e) e.message end',\n 'let { assert!= } = import(\"assert\");\\ntry assert!=(0, 1) catch (e) e.message end',\n ],\n seeAlso: ['assert.assert='],\n hideOperatorForm: true,\n },\n 'assert=': {\n category: 'assert',\n description: 'If $a is not structural equal to $b it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n a: {\n type: 'any',\n },\n b: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'a',\n 'b',\n ],\n },\n {\n argumentNames: [\n 'a',\n 'b',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert= } = import(\"assert\");\\ntry assert=({ \"a\": 1 }, { \"a\": 2 }, \"Expected equal values\") catch (e) e.message end',\n 'let { assert= } = import(\"assert\");\\ntry assert=({ \"a\": 1 }, { \"a\": 2 }) catch (e) e.message end',\n 'let { assert= } = import(\"assert\");\\ntry assert=({ \"a\": 1 }, { \"a\": 1 }) catch (e) e.message end',\n ],\n seeAlso: ['assert.assert!='],\n hideOperatorForm: true,\n },\n 'assert-gt': {\n category: 'assert',\n description: 'If $a is not greater than $b it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n a: {\n type: 'any',\n },\n b: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'a',\n 'b',\n ],\n },\n {\n argumentNames: [\n 'a',\n 'b',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-gt } = import(\"assert\");\\ntry assert-gt(0, 1, \"Expected greater value\") catch (e) e.message end',\n 'let { assert-gt } = import(\"assert\");\\ntry assert-gt(0, 0) catch (e) e.message end',\n 'let { assert-gt } = import(\"assert\");\\ntry assert-gt(1, 0) catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-lt', 'assert.assert-gte', 'assert.assert-lte'],\n hideOperatorForm: true,\n },\n 'assert-lt': {\n category: 'assert',\n description: 'If $a is not less than $b it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n a: {\n type: 'any',\n },\n b: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'a',\n 'b',\n ],\n },\n {\n argumentNames: [\n 'a',\n 'b',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-lt } = import(\"assert\");\\ntry assert-lt(1, 0, \"Expected smaller value value\") catch (e) e.message end',\n 'let { assert-lt } = import(\"assert\");\\ntry assert-lt(1, 1) catch (e) e.message end',\n 'let { assert-lt } = import(\"assert\");\\ntry assert-lt(0, 1) catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-gt', 'assert.assert-lte', 'assert.assert-gte'],\n hideOperatorForm: true,\n },\n 'assert-gte': {\n category: 'assert',\n description: 'If $a is less than $b it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n a: {\n type: 'any',\n },\n b: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'a',\n 'b',\n ],\n },\n {\n argumentNames: [\n 'a',\n 'b',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-gte } = import(\"assert\");\\ntry assert-gte(0, 1, \"Expected greater value\") catch (e) e.message end',\n 'let { assert-gte } = import(\"assert\");\\ntry assert-gte(0, 1) catch (e) e.message end',\n 'let { assert-gte } = import(\"assert\");\\ntry assert-gte(1, 1) catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-lte', 'assert.assert-gt', 'assert.assert-lt'],\n hideOperatorForm: true,\n },\n 'assert-lte': {\n category: 'assert',\n description: 'If $a is grater than $b it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n a: {\n type: 'any',\n },\n b: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'a',\n 'b',\n ],\n },\n {\n argumentNames: [\n 'a',\n 'b',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-lte } = import(\"assert\");\\ntry assert-lte(1, 0, \"Expected smaller value value\") catch (e) e.message end',\n 'let { assert-lte } = import(\"assert\");\\ntry assert-lte(1, 0) catch (e) e.message end',\n 'let { assert-lte } = import(\"assert\");\\ntry assert-lte(1, 1) catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-gte', 'assert.assert-lt', 'assert.assert-gt'],\n hideOperatorForm: true,\n },\n 'assert-true': {\n category: 'assert',\n description: 'If $value is not `true` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-true } = import(\"assert\");\\ntry assert-true(false, \"Expected true\") catch (e) e.message end',\n 'let { assert-true } = import(\"assert\");\\ntry assert-true(false) catch (e) e.message end',\n 'let { assert-true } = import(\"assert\");\\ntry assert-true(true) catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-false', 'assert.assert-truthy', 'assert.assert-falsy', 'assert.assert', 'assert.assert-boolean'],\n hideOperatorForm: true,\n },\n 'assert-false': {\n category: 'assert',\n description: 'If $value is not `false` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-false } = import(\"assert\");\\ntry assert-false(true, \"Expected false\") catch (e) e.message end',\n 'let { assert-false } = import(\"assert\");\\ntry assert-false(true) catch (e) e.message end',\n 'let { assert-false } = import(\"assert\");\\ntry assert-false(false) catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-true', 'assert.assert-falsy', 'assert.assert-truthy', 'assert.assert-boolean'],\n hideOperatorForm: true,\n },\n 'assert-truthy': {\n category: 'assert',\n description: 'If $value is not `truthy` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-truthy } = import(\"assert\");\\ntry assert-truthy(false, \"Expected truthy\") catch (e) e.message end',\n 'let { assert-truthy } = import(\"assert\");\\ntry assert-truthy(false) catch (e) e.message end',\n 'let { assert-truthy } = import(\"assert\");\\ntry assert-truthy(0) catch (e) e.message end',\n 'let { assert-truthy } = import(\"assert\");\\ntry assert-truthy(null) catch (e) e.message end',\n 'let { assert-truthy } = import(\"assert\");\\ntry assert-truthy(\"\") catch (e) e.message end',\n 'let { assert-truthy } = import(\"assert\");\\ntry assert-truthy(true) catch (e) e.message end',\n 'let { assert-truthy } = import(\"assert\");\\ntry assert-truthy(1) catch (e) e.message end',\n 'let { assert-truthy } = import(\"assert\");\\ntry assert-truthy(\"x\") catch (e) e.message end',\n 'let { assert-truthy } = import(\"assert\");\\ntry assert-truthy([]) catch (e) e.message end',\n 'let { assert-truthy } = import(\"assert\");\\ntry assert-truthy(nd) catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-falsy', 'assert.assert-true', 'assert.assert-false', 'assert.assert', 'assert.assert-null'],\n hideOperatorForm: true,\n },\n 'assert-falsy': {\n category: 'assert',\n description: 'If $value is not `falsy` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-falsy } = import(\"assert\");\\ntry assert-falsy(true, \"Expected falsy\") catch (e) e.message end',\n 'let { assert-falsy } = import(\"assert\");\\ntry assert-falsy(\"x\") catch (e) e.message end',\n 'let { assert-falsy } = import(\"assert\");\\ntry assert-falsy([]) catch (e) e.message end',\n 'let { assert-falsy } = import(\"assert\");\\ntry assert-falsy(nd) catch (e) e.message end',\n 'let { assert-falsy } = import(\"assert\");\\ntry assert-falsy(1) catch (e) e.message end',\n 'let { assert-falsy } = import(\"assert\");\\ntry assert-falsy(false) catch (e) e.message end',\n 'let { assert-falsy } = import(\"assert\");\\ntry assert-falsy(0) catch (e) e.message end',\n 'let { assert-falsy } = import(\"assert\");\\ntry assert-falsy(null) catch (e) e.message end',\n 'let { assert-falsy } = import(\"assert\");\\ntry assert-falsy(\"\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-truthy', 'assert.assert-false', 'assert.assert-true', 'assert.assert-null'],\n hideOperatorForm: true,\n },\n 'assert-null': {\n category: 'assert',\n description: 'If $value is not `null` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-null } = import(\"assert\");\\ntry assert-null(null) catch (e) e.message end',\n 'let { assert-null } = import(\"assert\");\\ntry assert-null(true, \"Expected null\") catch (e) e.message end',\n 'let { assert-null } = import(\"assert\");\\ntry assert-null(\"x\") catch (e) e.message end',\n 'let { assert-null } = import(\"assert\");\\ntry assert-null([]) catch (e) e.message end',\n 'let { assert-null } = import(\"assert\");\\ntry assert-null(nd) catch (e) e.message end',\n 'let { assert-null } = import(\"assert\");\\ntry assert-null(1) catch (e) e.message end',\n 'let { assert-null } = import(\"assert\");\\ntry assert-null(false) catch (e) e.message end',\n 'let { assert-null } = import(\"assert\");\\ntry assert-null(0) catch (e) e.message end',\n 'let { assert-null } = import(\"assert\");\\ntry assert-null(\"\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-truthy', 'assert.assert-falsy'],\n hideOperatorForm: true,\n },\n 'assert-throws': {\n category: 'assert',\n description: 'If $fun does not throw, it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n fun: {\n type: 'function',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'fun',\n ],\n },\n {\n argumentNames: [\n 'fun',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-throws } = import(\"assert\");\\nassert-throws(-> throw(\"Error\"))',\n 'let { assert-throws } = import(\"assert\");\\ntry assert-throws(-> identity(\"Error\")) catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-throws-error', 'assert.assert-not-throws'],\n hideOperatorForm: true,\n },\n 'assert-throws-error': {\n category: 'assert',\n description: 'If $fun does not throw $error-message, it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n 'fun': {\n type: 'function',\n },\n 'error-message': {\n type: 'string',\n },\n 'message': {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n 'error-message',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'error-message',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-throws-error } = import(\"assert\");\\ntry assert-throws-error(-> throw(\"Error\"), \"Error\") catch (e) e.message end',\n 'let { assert-throws-error } = import(\"assert\");\\ntry assert-throws-error(-> identity(\"Error\"), \"Error\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-throws', 'assert.assert-not-throws'],\n hideOperatorForm: true,\n },\n 'assert-not-throws': {\n category: 'assert',\n description: 'If $fun throws, it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n fun: {\n type: 'function',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'fun',\n ],\n },\n {\n argumentNames: [\n 'fun',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-not-throws } = import(\"assert\");\\ntry assert-not-throws(-> identity(\"Error\")) catch (e) e.message end',\n 'let { assert-not-throws } = import(\"assert\");\\ntry assert-not-throws(-> throw(\"Error\")) catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-throws', 'assert.assert-throws-error'],\n hideOperatorForm: true,\n },\n 'assert-array': {\n category: 'assert',\n description: 'If $value is not an `array` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-array } = import(\"assert\");\\ntry assert-array([1, 2, 3]) catch (e) e.message end',\n 'let { assert-array } = import(\"assert\");\\ntry assert-array(\"string\") catch (e) e.message end',\n 'let { assert-array } = import(\"assert\");\\ntry assert-array(42, \"Expected an array\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-object', 'assert.assert-collection', 'assert.assert-sequence'],\n hideOperatorForm: true,\n },\n 'assert-boolean': {\n category: 'assert',\n description: 'If $value is not a `boolean` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-boolean } = import(\"assert\");\\ntry assert-boolean(true) catch (e) e.message end',\n 'let { assert-boolean } = import(\"assert\");\\ntry assert-boolean(false) catch (e) e.message end',\n 'let { assert-boolean } = import(\"assert\");\\ntry assert-boolean(1, \"Expected a boolean\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-true', 'assert.assert-false', 'assert.assert-number', 'assert.assert-string'],\n hideOperatorForm: true,\n },\n 'assert-collection': {\n category: 'assert',\n description: 'If $value is not a `collection` (array, object, or string) it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-collection } = import(\"assert\");\\ntry assert-collection([1, 2]) catch (e) e.message end',\n 'let { assert-collection } = import(\"assert\");\\ntry assert-collection({ a: 1 }) catch (e) e.message end',\n 'let { assert-collection } = import(\"assert\");\\ntry assert-collection(\"hello\") catch (e) e.message end',\n 'let { assert-collection } = import(\"assert\");\\ntry assert-collection(42, \"Expected a collection\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-sequence', 'assert.assert-array', 'assert.assert-object'],\n hideOperatorForm: true,\n },\n 'assert-function': {\n category: 'assert',\n description: 'If $value is not a `function` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-function } = import(\"assert\");\\ntry assert-function(-> $ + 1) catch (e) e.message end',\n 'let { assert-function } = import(\"assert\");\\ntry assert-function(42, \"Expected a function\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-number', 'assert.assert-string'],\n hideOperatorForm: true,\n },\n 'assert-grid': {\n category: 'assert',\n description: 'If $value is not a `grid` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-grid } = import(\"assert\");\\ntry assert-grid([[1, 2], [3, 4]]) catch (e) e.message end',\n 'let { assert-grid } = import(\"assert\");\\ntry assert-grid([1, 2], \"Expected a grid\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-matrix', 'assert.assert-vector'],\n hideOperatorForm: true,\n },\n 'assert-integer': {\n category: 'assert',\n description: 'If $value is not an `integer` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-integer } = import(\"assert\");\\ntry assert-integer(42) catch (e) e.message end',\n 'let { assert-integer } = import(\"assert\");\\ntry assert-integer(3.14, \"Expected an integer\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-number'],\n hideOperatorForm: true,\n },\n 'assert-matrix': {\n category: 'assert',\n description: 'If $value is not a `matrix` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-matrix } = import(\"assert\");\\ntry assert-matrix([[1, 2], [3, 4]]) catch (e) e.message end',\n 'let { assert-matrix } = import(\"assert\");\\ntry assert-matrix([1, 2], \"Expected a matrix\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-vector', 'assert.assert-grid'],\n hideOperatorForm: true,\n },\n 'assert-number': {\n category: 'assert',\n description: 'If $value is not a `number` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-number } = import(\"assert\");\\ntry assert-number(42) catch (e) e.message end',\n 'let { assert-number } = import(\"assert\");\\ntry assert-number(\"hello\", \"Expected a number\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-integer', 'assert.assert-boolean', 'assert.assert-string', 'assert.assert-function'],\n hideOperatorForm: true,\n },\n 'assert-object': {\n category: 'assert',\n description: 'If $value is not an `object` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-object } = import(\"assert\");\\ntry assert-object({ a: 1 }) catch (e) e.message end',\n 'let { assert-object } = import(\"assert\");\\ntry assert-object([1, 2], \"Expected an object\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-array', 'assert.assert-collection'],\n hideOperatorForm: true,\n },\n 'assert-regexp': {\n category: 'assert',\n description: 'If $value is not a `regexp` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-regexp } = import(\"assert\");\\ntry assert-regexp(#\"^start\") catch (e) e.message end',\n 'let { assert-regexp } = import(\"assert\");\\ntry assert-regexp(\"hello\", \"Expected a regexp\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-string'],\n hideOperatorForm: true,\n },\n 'assert-sequence': {\n category: 'assert',\n description: 'If $value is not a `sequence` (array or string) it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-sequence } = import(\"assert\");\\ntry assert-sequence([1, 2]) catch (e) e.message end',\n 'let { assert-sequence } = import(\"assert\");\\ntry assert-sequence(\"hello\") catch (e) e.message end',\n 'let { assert-sequence } = import(\"assert\");\\ntry assert-sequence({ a: 1 }, \"Expected a sequence\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-collection', 'assert.assert-array'],\n hideOperatorForm: true,\n },\n 'assert-string': {\n category: 'assert',\n description: 'If $value is not a `string` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-string } = import(\"assert\");\\ntry assert-string(\"hello\") catch (e) e.message end',\n 'let { assert-string } = import(\"assert\");\\ntry assert-string(42, \"Expected a string\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-number', 'assert.assert-boolean', 'assert.assert-regexp', 'assert.assert-function'],\n hideOperatorForm: true,\n },\n 'assert-vector': {\n category: 'assert',\n description: 'If $value is not a `vector` it throws `AssertionError`.',\n returns: {\n type: 'null',\n },\n args: {\n value: {\n type: 'any',\n },\n message: {\n type: 'string',\n },\n },\n variants: [\n {\n argumentNames: [\n 'value',\n ],\n },\n {\n argumentNames: [\n 'value',\n 'message',\n ],\n },\n ],\n examples: [\n 'let { assert-vector } = import(\"assert\");\\ntry assert-vector([1, 2, 3]) catch (e) e.message end',\n 'let { assert-vector } = import(\"assert\");\\ntry assert-vector([\"a\", \"b\"], \"Expected a vector\") catch (e) e.message end',\n ],\n seeAlso: ['assert.assert-matrix', 'assert.assert-grid'],\n hideOperatorForm: true,\n },\n}\n","import type { LitsError } from '../../../errors'\nimport { AssertionError } from '../../../errors'\nimport type { Any } from '../../../interface'\nimport { compare, deepEqual } from '../../../utils'\nimport type { BuiltinNormalExpressions } from '../../../builtin/interface'\nimport { asAny, assertFunctionLike, isColl, isObj, isRegularExpression, isSeq } from '../../../typeGuards/lits'\nimport { isLitsFunction } from '../../../typeGuards/litsFunction'\nimport { isNumber } from '../../../typeGuards/number'\nimport { assertString, assertStringOrNumber } from '../../../typeGuards/string'\nimport { isGrid, isMatrix, isVector } from '../../../typeGuards/annotatedArrays'\nimport type { LitsModule } from '../interface'\nimport { moduleDocs } from './docs'\n\nconst assertNormalExpression: BuiltinNormalExpressions = {\n 'assert': {\n evaluate: (params, sourceCodeInfo): Any => {\n const value = params[0]\n const message = params.length === 2 ? params[1] : `${value}`\n assertString(message, sourceCodeInfo)\n if (!value)\n throw new AssertionError(message, sourceCodeInfo)\n\n return asAny(value, sourceCodeInfo)\n },\n arity: { min: 1, max: 2 },\n },\n 'assert=': {\n evaluate: ([first, second, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (!deepEqual(asAny(first, sourceCodeInfo), asAny(second, sourceCodeInfo), sourceCodeInfo)) {\n throw new AssertionError(\n `Expected ${JSON.stringify(first, null, 2)} to deep equal ${JSON.stringify(second, null, 2)}.${message}`,\n sourceCodeInfo,\n )\n }\n return null\n },\n arity: { min: 2, max: 3 },\n },\n 'assert!=': {\n evaluate: ([first, second, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (deepEqual(asAny(first, sourceCodeInfo), asAny(second, sourceCodeInfo), sourceCodeInfo)) {\n throw new AssertionError(\n `Expected ${JSON.stringify(first)} not to deep equal ${JSON.stringify(second)}.${message}`,\n sourceCodeInfo,\n )\n }\n return null\n },\n arity: { min: 2, max: 3 },\n },\n 'assert-gt': {\n evaluate: ([first, second, message], sourceCodeInfo): null => {\n assertStringOrNumber(first, sourceCodeInfo)\n assertStringOrNumber(second, sourceCodeInfo)\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (compare(first, second, sourceCodeInfo) <= 0)\n throw new AssertionError(`Expected ${first} to be grater than ${second}.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 2, max: 3 },\n },\n 'assert-gte': {\n evaluate: ([first, second, message], sourceCodeInfo): null => {\n assertStringOrNumber(first, sourceCodeInfo)\n assertStringOrNumber(second, sourceCodeInfo)\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (compare(first, second, sourceCodeInfo) < 0)\n throw new AssertionError(`Expected ${first} to be grater than or equal to ${second}.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 2, max: 3 },\n },\n 'assert-lt': {\n evaluate: ([first, second, message], sourceCodeInfo): null => {\n assertStringOrNumber(first, sourceCodeInfo)\n assertStringOrNumber(second, sourceCodeInfo)\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (compare(first, second, sourceCodeInfo) >= 0)\n throw new AssertionError(`Expected ${first} to be less than ${second}.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 2, max: 3 },\n },\n 'assert-lte': {\n evaluate: ([first, second, message], sourceCodeInfo): null => {\n assertStringOrNumber(first, sourceCodeInfo)\n assertStringOrNumber(second, sourceCodeInfo)\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (compare(first, second, sourceCodeInfo) > 0)\n throw new AssertionError(`Expected ${first} to be less than or equal to ${second}.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 2, max: 3 },\n },\n 'assert-true': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (first !== true)\n throw new AssertionError(`Expected ${first} to be true.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-false': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (first !== false)\n throw new AssertionError(`Expected ${first} to be false.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-truthy': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (!first)\n throw new AssertionError(`Expected ${first} to be truthy.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-falsy': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (first)\n throw new AssertionError(`Expected ${first} to be falsy.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-null': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (first !== null)\n throw new AssertionError(`Expected ${first} to be null.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-throws': {\n evaluate: ([func, message], sourceCodeInfo, contextStack, { executeFunction }): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n assertFunctionLike(func, sourceCodeInfo)\n try {\n executeFunction(func, [], contextStack, sourceCodeInfo)\n }\n catch {\n return null\n }\n throw new AssertionError(`Expected function to throw.${message}`, sourceCodeInfo)\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-throws-error': {\n evaluate: ([func, throwMessage, message], sourceCodeInfo, contextStack, { executeFunction }): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n assertString(throwMessage, sourceCodeInfo)\n assertFunctionLike(func, sourceCodeInfo)\n try {\n executeFunction(func, [], contextStack, sourceCodeInfo)\n }\n catch (error) {\n const errorMessage = (error as LitsError).shortMessage\n if (errorMessage !== throwMessage) {\n throw new AssertionError(\n `Expected function to throw \"${throwMessage}\", but thrown \"${errorMessage}\".${message}`,\n sourceCodeInfo,\n )\n }\n return null\n }\n throw new AssertionError(`Expected function to throw \"${throwMessage}\".${message}`, sourceCodeInfo)\n },\n arity: { min: 2, max: 3 },\n },\n 'assert-not-throws': {\n evaluate: ([func, message], sourceCodeInfo, contextStack, { executeFunction }): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n assertFunctionLike(func, sourceCodeInfo)\n try {\n executeFunction(func, [], contextStack, sourceCodeInfo)\n }\n catch {\n throw new AssertionError(`Expected function not to throw.${message}`, sourceCodeInfo)\n }\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-array': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (!Array.isArray(first))\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be an array.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-boolean': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (typeof first !== 'boolean')\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be a boolean.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-collection': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (!isColl(first))\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be a collection.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-function': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (!isLitsFunction(first))\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be a function.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-grid': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (!isGrid(first))\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be a grid.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-integer': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (typeof first !== 'number' || !isNumber(first, { integer: true }))\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be an integer.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-matrix': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (!isMatrix(first))\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be a matrix.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-number': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (typeof first !== 'number')\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be a number.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-object': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (!isObj(first))\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be an object.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-regexp': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (!isRegularExpression(first))\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be a regexp.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-sequence': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (!isSeq(first))\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be a sequence.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-string': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (typeof first !== 'string')\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be a string.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n 'assert-vector': {\n evaluate: ([first, message], sourceCodeInfo): null => {\n if (message !== undefined) {\n assertString(message, sourceCodeInfo)\n message = ` ${message}`\n }\n message ??= ''\n if (!isVector(first))\n throw new AssertionError(`Expected ${JSON.stringify(first)} to be a vector.${message}`, sourceCodeInfo)\n\n return null\n },\n arity: { min: 1, max: 2 },\n },\n}\n\nfor (const [key, docs] of Object.entries(moduleDocs)) {\n if (assertNormalExpression[key])\n assertNormalExpression[key].docs = docs\n}\n\nexport const assertModule: LitsModule = {\n name: 'assert',\n functions: assertNormalExpression,\n}\n"],"names":["getCodeMarker","sourceCodeInfo","position","code","leftPadding","column","rightPadding","length","repeat","Math","max","LitsError","Error","shortMessage","constructor","err","message","super","location","line","filePath","getLitsErrorMessage","this","Object","setPrototypeOf","prototype","name","AssertionError","NodeTypes","Number","String","NormalExpression","SpecialExpression","UserDefinedSymbol","NormalBuiltinSymbol","SpecialBuiltinSymbol","ReservedSymbol","Binding","Spread","NodeTypesSet","Set","values","functionTypeSet","FUNCTION_SYMBOL","isLitsFunction","func","type","functionType","has","isNode","value","Array","isArray","valueToString","keys","find","key","RegExp","toString","JSON","stringify","getAssertionError","typeName","anyValue","getSourceCodeInfo","isUnknownRecord","asAny","undefined","isAny","assertAny","isSeq","isObj","isRegularExpression","isColl","regexp","assertFunctionLike","isFunctionLike","isNumber","options","isNaN","integer","isInteger","finite","isFinite","zero","nonZero","positive","negative","nonPositive","nonNegative","gt","gte","lt","lte","assertString","nonEmpty","char","isString","asString","assertStringOrNumber","isStringOrNumber","compare","a","b","sign","deepEqual","epsilon","EPSILON","diff","abs","absA","absB","approxEqual","i","s","f","aKeys","bKeys","annotatedArrays","WeakSet","vectors","notVectors","matrices","notMatrices","grids","notGrids","moduleDocs","assert","category","description","returns","args","variants","argumentNames","examples","seeAlso","hideOperatorForm","fun","assertNormalExpression","evaluate","params","arity","min","first","second","contextStack","executeFunction","throwMessage","error","errorMessage","grid","add","nbrOfCols","row","slice","isGrid","matrix","some","cell","isMatrix","vector","every","elem","docs","entries","assertModule","functions"],"mappings":"aAEM,SAAUA,EAAcC,GAC5B,IAAKA,EAAeC,WAAaD,EAAeE,KAC9C,MAAO,GAET,MAAMC,EAAcH,EAAeC,SAASG,OAAS,EAC/CC,EAAeL,EAAeE,KAAKI,OAASH,EAAc,EAChE,MAAO,GAAG,IAAII,OAAOC,KAAKC,IAAIN,EAAa,OAAO,IAAII,OAAOC,KAAKC,IAAIJ,EAAc,KACtF,CCkBM,MAAOK,UAAkBC,MACbX,eACAY,aAChB,WAAAC,CAAYC,EAAcd,GACxB,MAAMe,EAAUD,aAAeH,MAC3BG,EAAIC,QACJ,GAAGD,IAEPE,MA/BJ,SAA6BD,EAAiBf,GAC5C,IAAKA,EACH,OAAOe,EAET,MAAME,EAAW,GAAGjB,EAAeC,SAASiB,QAAQlB,EAAeC,SAASG,SAM5E,MAAO,GAAGW,IALWf,EAAemB,SAChC,KAAKnB,EAAemB,YAAYF,IAChC,cAAcA,QACIjB,EAAeE,SACbH,EAAcC,IAExC,CAoBUoB,CAAoBL,EAASf,IACnCqB,KAAKT,aAAeG,EACpBM,KAAKrB,eAAiBA,EACtBsB,OAAOC,eAAeF,KAAMX,EAAUc,WACtCH,KAAKI,KAAO,WACb,CAEM,aAAA1B,GACL,OAAOsB,KAAKrB,gBAAkBD,EAAcsB,KAAKrB,eAClD,EAaG,MAAO0B,U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